/* Spell-check overlay for messaging composer textareas (mirror + transparent text). */

.flmvr-spellcheck-wrap {
  position: relative;
  display: block;
  /* Replace the textarea’s flex:1 slot in .flmvr-msg-composer-main — must absorb remaining row width */
  flex: 1 1 0%;
  min-width: 0;
  align-self: stretch;
  /* Mirror div inherits alignment; match composer textarea left-to-right typing on centered pages */
  text-align: left;
}

.flmvr-msg-composer-main .flmvr-spellcheck-wrap {
  flex: 1 1 0%;
  min-width: 0;
}

.flmvr-msg-prelude .flmvr-spellcheck-wrap {
  width: 100%;
}

/* Composer/prelude textareas grew the row via flex — keep full width inside the wrapper */
.flmvr-spellcheck-wrap textarea.flmvr-msg-composer-input,
.flmvr-spellcheck-wrap textarea.flmvr-msg-prelude-message {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
}

.flmvr-spellcheck-mirror {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  box-sizing: border-box;
  background: #fff;
  color: #1a1a1a;
  border-radius: inherit;
  text-align: left;
}

.flmvr-spellcheck-wrap textarea.flmvr-spellcheck-ta {
  position: relative;
  z-index: 1;
  color: transparent;
  caret-color: #1a1a1a;
  background: transparent;
}

.flmvr-spellcheck-wrap textarea.flmvr-spellcheck-ta::selection {
  background: rgba(102, 153, 204, 0.35);
}

.flmvr-spellcheck-mark {
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: #c62828;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.flmvr-spellcheck-popover {
  min-width: 160px;
  max-width: min(320px, 90vw);
  padding: 6px 0;
  border-radius: 8px;
  border: 1px solid #d6d8de;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  font-size: 14px;
  line-height: 1.35;
}

.flmvr-spellcheck-popover-title {
  padding: 4px 10px 6px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #eee;
}

.flmvr-spellcheck-popover-empty {
  padding: 6px 10px;
  color: #666;
  font-style: italic;
}

button.flmvr-spellcheck-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #1a4b8c;
  font: inherit;
}

button.flmvr-spellcheck-suggestion:hover,
button.flmvr-spellcheck-suggestion:focus {
  background: #f0f4fa;
  outline: none;
}

button.flmvr-spellcheck-addword {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 6px 10px;
  border: 0;
  border-top: 1px solid #eee;
  background: #fafafa;
  cursor: pointer;
  color: #555;
  font-size: 12px;
}

button.flmvr-spellcheck-addword:hover {
  background: #f0f0f0;
}
