/* ════════════════════════════════════════════════════════════════════════
   Lex Document Editor — Shell v2 (Phase 1)
   ────────────────────────────────────────────────────────────────────────
   Three primitives:
     1. .lex-doc-topbar    — one-row strip at top: breadcrumb / title /
                             saved-status / mode toggle / count / matter /
                             Ask Lex ⌘K / icon group / Sign / Save.
     2. .lex-doc-leftrail  — vertical icon column on the left holding the
                             workflow actions that used to live in Row 2.
     3. .lex-doc-bottom-bar — bottom strip with zoom / word count / find,
                              plus the existing Ask Lex pill.

   Mode toggle:
     body.lex-mode-workbench  (default) → left + right rails visible.
     body.lex-mode-focus                → both rails hidden; floating
                                          quick-action pill appears.

   Rulers:
     Default off. body.lex-rulers-on shows them. Toggle from the View
     popover anchored on the left rail.

   When the editor view is open, body.lex-editor-open hides the appnav
   and modulebar so the doc topbar IS the chrome.
   ──────────────────────────────────────────────────────────────────────── */


/* ── App chrome suppression when editor is open ────────────────────────── */
/* .appnav is a class with two instances (home + work contexts). Both hide
   when the editor view is up so the doc topbar IS the chrome.           */
body.lex-editor-open .appnav,
body.lex-editor-open #modulebar { display: none !important; }
/* The app's outer wrapper uses flex/grid; #document-editor-view should
   eat the full viewport when chrome is suppressed. */
body.lex-editor-open #module-documents { flex: 1; display: flex; flex-direction: column; }
body.lex-editor-open #document-editor-view { flex: 1; min-height: 0; }


/* ── New top bar ───────────────────────────────────────────────────────── */
.lex-doc-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: var(--white, #fff);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 20;
  font-family: var(--font-sans, system-ui, sans-serif);
}
.lex-doc-topbar-left   { display: flex; align-items: center; gap: 0.45rem; min-width: 0; flex: 1; }
.lex-doc-topbar-center { display: flex; align-items: center; gap: 0.45rem; flex-shrink: 0; }
.lex-doc-topbar-right  { display: flex; align-items: center; gap: 0.25rem; flex: 1; justify-content: flex-end; }

.ldt-back {
  background: none; border: none; padding: 0.25rem; cursor: pointer;
  color: var(--mid); border-radius: var(--r-sm); display: inline-flex;
}
.ldt-back:hover { background: var(--border-2); color: var(--ink); }

.ldt-breadcrumb {
  background: none; border: none; padding: 0.15rem 0.25rem; cursor: pointer;
  color: var(--muted); font-size: 0.78rem; font-family: inherit;
  border-radius: var(--r-sm);
}
.ldt-breadcrumb:hover { color: var(--ink); background: var(--border-2); }

.ldt-sep-slash { color: var(--muted); font-size: 0.78rem; user-select: none; }

.ldt-title {
  border: none; background: transparent; outline: none;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 0.95rem; font-weight: 500; color: var(--ink);
  padding: 0.15rem 0.35rem;
  min-width: 6rem; max-width: 26rem;
  flex-shrink: 1;
  border-radius: var(--r-sm);
}
.ldt-title:hover  { background: var(--border-2); }
.ldt-title:focus  { background: var(--gold-bg, #fdf6e3); box-shadow: 0 0 0 1px var(--gold, #c9a84c) inset; }
.ldt-title::placeholder { color: var(--muted); font-style: italic; }

.ldt-saved-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--gold, #c9a84c);
  flex-shrink: 0;
}
.ldt-saved {
  font-size: 0.7rem; color: var(--muted); white-space: nowrap;
}
.ldt-offline {
  font-size: 0.65rem; color: var(--gold);
  background: var(--gold-bg); border: 1px solid var(--gold-dim);
  border-radius: var(--r-sm); padding: 0.1rem 0.35rem;
}


/* ── Focus / Workbench mode toggle ─────────────────────────────────────── */
.ldt-mode-toggle {
  display: inline-flex;
  background: var(--surface, #f1efe9);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.ldt-mode {
  background: transparent; border: none; cursor: pointer;
  padding: 0.25rem 0.65rem; border-radius: 999px;
  font-family: inherit; font-size: 0.72rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: 0.35rem;
  transition: background var(--t), color var(--t);
}
.ldt-mode svg { opacity: 0.7; }
.ldt-mode:hover { color: var(--ink); }
.ldt-mode.is-active {
  background: var(--white, #fff);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.ldt-mode.is-active svg { opacity: 1; }


/* ── Topbar pills (word count, matter, ask lex) ────────────────────────── */
.ldt-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  background: var(--white, #fff);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: inherit; font-size: 0.72rem; color: var(--mid);
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.ldt-pill:hover { border-color: var(--mid); color: var(--ink); }
.ldt-pill svg { flex-shrink: 0; opacity: 0.7; }
.ldt-pill:hover svg { opacity: 1; }

.ldt-count #tb-word-count { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink); }

.ldt-matter-type {
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.04em;
  background: var(--gold-bg, #fdf6e3); color: var(--gold, #c9a84c);
  padding: 0.1rem 0.35rem; border-radius: var(--r-sm);
  text-transform: uppercase;
}
.ldt-matter-name { color: var(--ink); font-weight: 500; max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ldt-caret { opacity: 0.55; }

.ldt-ask-lex {
  background: var(--ink, #0f0f0d);
  color: var(--white, #fff);
  border-color: var(--ink, #0f0f0d);
  font-weight: 500;
}
.ldt-ask-lex:hover {
  background: var(--gold, #c9a84c);
  color: var(--ink, #0f0f0d);
  border-color: var(--gold, #c9a84c);
}
.ldt-ask-lex svg path { stroke: currentColor; }
.ldt-ask-lex kbd {
  font-family: inherit; font-size: 0.65rem; opacity: 0.7;
  border: 1px solid currentColor; padding: 0 0.25rem;
  border-radius: 3px; background: transparent;
}


/* ── Topbar right icon group ──────────────────────────────────────────── */
.ldt-icon-wrap { position: relative; display: inline-flex; }
.ldt-icon {
  background: none; border: none; cursor: pointer;
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  color: var(--mid);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.ldt-icon:hover { background: var(--border-2); color: var(--ink); }
.ldt-icon[disabled] { opacity: 0.4; cursor: not-allowed; }

.ldt-icon-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--gold, #c9a84c); color: var(--white);
  font-size: 0.55rem; font-weight: 600;
  min-width: 12px; height: 12px; padding: 0 3px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}

.ldt-sign {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  background: var(--white, #fff);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--ink); font-family: inherit; font-size: 0.72rem; font-weight: 500;
  cursor: pointer;
}
.ldt-sign:hover { border-color: var(--ink); background: var(--surface); }

.ldt-save {
  background: var(--ink, #0f0f0d);
  color: var(--white, #fff);
  border: 1px solid var(--ink);
  border-radius: var(--r-md);
  padding: 0.3rem 0.85rem;
  font-family: inherit; font-size: 0.72rem; font-weight: 500;
  cursor: pointer;
}
.ldt-save:hover { background: var(--gold, #c9a84c); color: var(--ink); border-color: var(--gold); }


/* ── Body grid: leftrail + editor-layout ──────────────────────────────── */
.lex-doc-body {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}
.lex-doc-body > .editor-layout { flex: 1; min-width: 0; }


/* ── Left workflow rail (vertical) ────────────────────────────────────── */
.lex-doc-leftrail {
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 0.5rem 0.25rem;
  width: 40px; flex-shrink: 0;
  background: var(--surface, #f7f5ef);
  border-right: 1px solid var(--border);
}
.ldr-btn {
  background: none; border: none; cursor: pointer;
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  color: var(--mid);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  transition: background var(--t), color var(--t);
}
.ldr-btn:hover { background: var(--border-2); color: var(--ink); }
.ldr-btn.is-active { background: var(--gold-bg); color: var(--gold); }
.ldr-btn svg { flex-shrink: 0; }

/* Tooltip on hover (CSS-only, right-anchored). */
.ldr-btn::after {
  content: attr(data-tooltip);
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: var(--ink, #0f0f0d); color: var(--white, #fff);
  font-family: var(--font-sans); font-size: 0.7rem; font-weight: 500;
  padding: 0.25rem 0.5rem; border-radius: var(--r-sm);
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease 0.4s;
  z-index: 100;
}
.ldr-btn:hover::after { opacity: 1; }
.ldr-spacer { flex: 1; }
.ldr-sep { height: 1px; width: 60%; background: var(--border); margin: 0.25rem 0; }


/* ── Bottom bar (zoom / count / find + center pill) ───────────────────── */
.lex-doc-bottom-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.85rem;
  background: var(--white);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 18;
  pointer-events: none;
}
.lex-doc-bottom-bar > * { pointer-events: auto; }

.lex-doc-bottom-left {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--surface);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.ldb-zoom-step {
  background: none; border: none; cursor: pointer;
  width: 18px; height: 18px;
  color: var(--mid); font-size: 0.85rem; line-height: 1;
  border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
}
.ldb-zoom-step:hover { background: var(--white); color: var(--ink); }
.ldb-zoom-label {
  font-size: 0.68rem; color: var(--ink); font-variant-numeric: tabular-nums;
  min-width: 2.5rem; text-align: center; cursor: pointer;
}
.ldb-zoom-label:hover { color: var(--gold, #c9a84c); }
.ldb-sep { width: 1px; height: 12px; background: var(--border); }
.ldb-wc { font-size: 0.68rem; color: var(--muted); white-space: nowrap; }
.ldb-find {
  background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.25rem;
  color: var(--mid); font-family: inherit; font-size: 0.68rem;
  padding: 0.1rem 0.3rem; border-radius: var(--r-sm);
}
.ldb-find:hover { color: var(--ink); background: var(--white); }


/* ── Popovers (matter picker, view, properties, stats) ────────────────── */
.lex-doc-popover {
  position: absolute;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 80;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  min-width: 14rem;
  padding: 0.4rem;
}
.lex-doc-popover.hidden { display: none; }

/* Matter picker */
.ldm-search {
  width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 0.35rem 0.5rem; font-family: inherit; font-size: 0.72rem;
  margin-bottom: 0.35rem;
}
.ldm-list { max-height: 18rem; overflow-y: auto; }
.ldm-item {
  display: block; width: 100%;
  background: none; border: none; cursor: pointer;
  padding: 0.4rem 0.5rem; border-radius: var(--r-sm);
  text-align: left; font-family: inherit; font-size: 0.75rem;
  color: var(--ink);
}
.ldm-item:hover { background: var(--gold-bg); }
.ldm-item.is-active { background: var(--gold-bg); font-weight: 500; }
.ldm-item small { color: var(--muted); font-size: 0.66rem; display: block; margin-top: 1px; }
.ldm-divider { height: 1px; background: var(--border); margin: 0.35rem 0; }
.ldm-unlink {
  display: block; width: 100%;
  background: none; border: none; cursor: pointer;
  color: #b34141; padding: 0.4rem 0.5rem; border-radius: var(--r-sm);
  text-align: left; font-family: inherit; font-size: 0.72rem;
}
.ldm-unlink:hover { background: #fff0f0; }
.ldm-empty {
  padding: 0.6rem 0.5rem; color: var(--muted); font-size: 0.72rem; text-align: center;
}

/* View popover */
.ldv-row { padding: 0.35rem 0.4rem; }
.ldv-check {
  display: flex; align-items: center; gap: 0.4rem; cursor: pointer;
  color: var(--ink); font-size: 0.75rem;
}

/* Properties popover */
.ldp-row {
  display: grid; grid-template-columns: 5rem 1fr;
  align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.4rem;
}
.ldp-row label { color: var(--muted); font-size: 0.7rem; }
.ldp-row select,
.ldp-row .ldp-toggle-wrap {
  font-size: 0.72rem; padding: 0.3rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--white);
}

/* Stats popover */
.lds-grid {
  display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 0.85rem;
  padding: 0.25rem 0.4rem; font-size: 0.72rem;
}
.lds-grid dt { color: var(--muted); }
.lds-grid dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }


/* ── Focus-mode floating quick-action pill ────────────────────────────── */
body:not(.lex-mode-focus) .lex-doc-focus-quick { display: none; }
.lex-doc-focus-quick {
  position: fixed;
  bottom: 4.5rem; right: 1.5rem;
  z-index: 60;
}
.ldfq-trigger {
  width: 40px; height: 40px;
  border-radius: 999px;
  background: var(--ink); color: var(--white);
  border: none; cursor: pointer;
  font-size: 1.1rem; font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  display: inline-flex; align-items: center; justify-content: center;
}
.ldfq-trigger:hover { background: var(--gold, #c9a84c); color: var(--ink); }
.ldfq-menu {
  position: absolute; bottom: calc(100% + 0.5rem); right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  padding: 0.35rem;
  min-width: 13rem;
}
.ldfq-menu.hidden { display: none; }
.ldfq-item {
  display: flex; align-items: center; gap: 0.55rem;
  width: 100%;
  background: none; border: none; cursor: pointer;
  padding: 0.4rem 0.5rem;
  border-radius: var(--r-sm);
  font-family: inherit; font-size: 0.75rem;
  color: var(--ink); text-align: left;
}
.ldfq-item:hover { background: var(--gold-bg); }
.ldfq-item svg { color: var(--mid); flex-shrink: 0; }


/* ── Mode-driven visibility ───────────────────────────────────────────── */
body.lex-mode-focus .lex-doc-leftrail,
body.lex-mode-focus .editor-panel {
  display: none;
}
/* When the right panel is hidden, collapse the editor-layout grid to a
   single column so the page area uses the full width. */
body.lex-mode-focus .editor-layout {
  grid-template-columns: 1fr;
}


/* ── Rulers: default OFF; body.lex-rulers-on shows them ──────────────── */
.editor-rulers-h-bar,
.ruler-v { display: none; }
body.lex-rulers-on .editor-rulers-h-bar { display: flex; }
body.lex-rulers-on .ruler-v { display: block; }
/* Also drop the left padding compensation that was added in documents.css
   when rulers are off — so the page sits flush against the leftrail edge. */
body:not(.lex-rulers-on) .editor-shell:has(.editor-rulers-h-bar) .editor-content {
  padding-left: 0.75rem;
}


/* ── Mobile: collapse rails, keep topbar simple ───────────────────────── */
@media (max-width: 700px) {
  .lex-doc-leftrail { width: 36px; }
  .ldr-btn { width: 28px; height: 28px; }
  .ldt-mode-toggle, .ldt-pill.ldt-count { display: none; }
  .lex-doc-topbar { gap: 0.3rem; padding: 0.35rem 0.5rem; }
  .ldt-title { max-width: 11rem; }
  .lex-doc-bottom-bar { padding: 0.25rem 0.4rem; }
}


/* ════════════════════════════════════════════════════════════════════════
   Phase 2: Ask Lex bottom pill + modal
   ──────────────────────────────────────────────────────────────────────── */

/* ── Bottom Ask Lex pill ──────────────────────────────────────────────── */
/* Restyled from doc-lex-pill — now wider, friendlier copy, ⌘K hint. */
#doc-lex-pill.doc-lex-pill {
  position: fixed;
  bottom: 3.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.1rem;
  background: var(--white, #fff);
  border: 1px solid var(--border, #E8E2D0);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.04);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
#doc-lex-pill.doc-lex-pill:hover {
  transform: translateX(-50%) translateY(-1px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.14), 0 3px 8px rgba(0,0,0,0.06);
  border-color: var(--gold, #C9A84C);
}
.doc-lex-pill-icon {
  color: var(--gold, #C9A84C);
  display: inline-flex;
}
.doc-lex-pill-label {
  font-size: 0.78rem;
  color: var(--mid, #5A5648);
  font-style: italic;
}
.doc-lex-pill-kbd {
  font-family: inherit;
  font-size: 0.62rem;
  color: var(--muted, #8E8B7C);
  background: var(--surface, #F4F2EB);
  border: 1px solid var(--border, #E8E2D0);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  margin-left: 0.2rem;
}
/* Hide the pill while the modal is open so they don't stack. */
body.lex-ask-open #doc-lex-pill { display: none !important; }


/* ── Modal ────────────────────────────────────────────────────────────── */
.lex-ask-modal {
  position: fixed;
  bottom: 2.8rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(560px, calc(100vw - 2rem));
  font-family: var(--font-sans);
  animation: lex-ask-rise 0.22s cubic-bezier(.16,1,.3,1);
}
.lex-ask-modal.hidden { display: none; }
@keyframes lex-ask-rise {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.lex-ask-modal-card {
  background: var(--white, #fff);
  border: 1px solid var(--border, #E8E2D0);
  border-radius: var(--r-lg, 14px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.18), 0 6px 14px rgba(0,0,0,0.06);
  padding: 1rem 1.1rem 0.9rem;
}

/* Header */
.lex-ask-modal-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.lex-ask-modal-icon {
  color: var(--gold, #C9A84C);
  display: inline-flex;
}
.lex-ask-modal-title {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink, #0F0F0D);
  font-family: var(--font-serif, Georgia, serif);
}
.lex-ask-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted, #8E8B7C);
  width: 22px; height: 22px;
  border-radius: var(--r-sm, 4px);
  display: inline-flex; align-items: center; justify-content: center;
}
.lex-ask-modal-close:hover { background: var(--border-2, #ECE9DD); color: var(--ink); }

/* Chips */
.lex-ask-modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
.lex-ask-chip {
  background: var(--surface, #F4F2EB);
  border: 1px solid var(--border, #E8E2D0);
  border-radius: 999px;
  padding: 0.35rem 0.7rem 0.35rem 0.6rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: inherit;
  font-size: 0.72rem;
  color: var(--ink, #0F0F0D);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lex-ask-chip:hover {
  background: var(--white, #fff);
  border-color: var(--gold, #C9A84C);
}
.lex-ask-chip:disabled { opacity: 0.5; cursor: wait; }
.lex-ask-chip svg { color: var(--gold, #C9A84C); flex-shrink: 0; }
/* Stale-while-revalidating: dimmed but still clickable. */
.lex-ask-modal-chips.is-stale .lex-ask-chip { opacity: 0.75; }

/* Skeleton placeholder for chips while first generation runs. */
.lex-ask-chip-skeleton {
  background: var(--surface, #F4F2EB);
  border: 1px solid var(--border, #E8E2D0);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  height: 1.6rem;
  width: var(--w, 9rem);
  position: relative;
  overflow: hidden;
}
.lex-ask-chip-skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
  animation: lex-ask-shimmer 1.4s linear infinite;
}
@keyframes lex-ask-shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* Input + send */
.lex-ask-modal-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  background: var(--surface, #F4F2EB);
  border: 1px solid var(--border, #E8E2D0);
  border-radius: var(--r-md, 8px);
  padding: 0.5rem 0.55rem;
}
.lex-ask-modal-input-wrap:focus-within {
  border-color: var(--gold, #C9A84C);
  background: var(--white, #fff);
}
.lex-ask-modal-input-wrap .voice-mic-btn {
  background: none;
  border: none;
  color: var(--muted, #8E8B7C);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  display: inline-flex;
  align-self: center;
}
.lex-ask-modal-input-wrap .voice-mic-btn:hover { color: var(--ink); }

.lex-ask-modal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--ink, #0F0F0D);
  padding: 0.25rem 0;
  max-height: 8rem;
  min-height: 1.4rem;
}
.lex-ask-modal-input::placeholder {
  color: var(--muted, #8E8B7C);
  font-style: italic;
}
.lex-ask-modal-input:not(:placeholder-shown) { font-style: normal; }

.lex-ask-modal-send {
  background: var(--gold, #C9A84C);
  color: var(--white, #fff);
  border: none;
  cursor: pointer;
  width: 34px; height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lex-ask-modal-send:hover { background: var(--ink, #0F0F0D); transform: scale(1.05); }
.lex-ask-modal-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Footer */
.lex-ask-modal-footer {
  margin-top: 0.6rem;
  font-size: 0.65rem;
  color: var(--muted, #8E8B7C);
  text-align: center;
  letter-spacing: 0.01em;
}

/* Mobile shrink */
@media (max-width: 700px) {
  .lex-ask-modal { width: calc(100vw - 1rem); bottom: 1rem; }
  #doc-lex-pill.doc-lex-pill { bottom: 1rem; }
}
