/* Cadence — sentence flow analyzer.
   Palette roles follow the reference data-viz palette; light is the base,
   dark overrides via media query and an explicit data-theme toggle. */

:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --hairline: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;          /* series blue */
  --accent-soft: #cde2fb;     /* blue 100 */
  --accent-mid: #86b6ef;      /* blue 250 */
  --orange: #eb6834;          /* series 2 */
  --aqua: #1baf7a;            /* series 3 */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-text: #006300;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --hairline: #2c2c2a;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --accent-soft: #10345c;
    --accent-mid: #1c5cab;
    --orange: #d95926;
    --aqua: #199e70;
    --good-text: #0ca30c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --hairline: #2c2c2a;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #3987e5;
  --accent-soft: #10345c;
  --accent-mid: #1c5cab;
  --orange: #d95926;
  --aqua: #199e70;
  --good-text: #0ca30c;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}
main { max-width: 880px; margin: 0 auto; padding: 0 1rem 4rem; }
a { color: var(--accent); }
h2 { font-size: 1.05rem; margin: 0 0 0.35rem; }
h3 { font-size: 0.95rem; margin: 1.2rem 0 0.4rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---------- header ---------- */
.site-header {
  max-width: 880px; margin: 0 auto; padding: 0.9rem 1rem 0;
  display: flex; justify-content: flex-end;
}
#theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--ink-2); font-size: 1rem; padding: 0.25rem 0.55rem; cursor: pointer;
}

/* ---------- input ---------- */
.input-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.9rem; margin-top: 1rem;
}
textarea {
  width: 100%; resize: vertical; border: 1px solid var(--hairline);
  border-radius: 8px; padding: 0.7rem 0.8rem; font: inherit;
  font-size: 1.05rem; background: var(--page); color: var(--ink);
  min-height: 5.5rem;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.speech-row {
  display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
  margin-top: 0.55rem;
}
.speech-row button, .speech-row select {
  background: none; border: 1px solid var(--hairline); border-radius: 8px;
  color: var(--ink-2); font-size: 0.85rem; padding: 0.22rem 0.6rem; cursor: pointer;
  font-family: inherit;
}
.speech-row select { background: var(--surface); color: var(--ink); max-width: 15rem; }
.speech-row button:hover { border-color: var(--accent); color: var(--accent); }
.speech-row button:disabled { opacity: 0.45; cursor: default; }
#neural-load.hidden { display: none; }
.tok.speaking {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 4px;
}
.input-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-top: 0.55rem; flex-wrap: wrap;
}
.examples { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.examples-label { color: var(--muted); font-size: 0.85rem; }
.examples button {
  background: none; border: 1px solid var(--hairline); border-radius: 999px;
  color: var(--ink-2); font-size: 0.85rem; padding: 0.15rem 0.7rem; cursor: pointer;
}
.examples button:hover { border-color: var(--accent); color: var(--accent); }
.status { color: var(--muted); font-size: 0.85rem; }

/* ---------- score row ---------- */
.results { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.score-row { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; }
@media (max-width: 640px) { .score-row { grid-template-columns: 1fr; } }
.hero-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem 1.1rem;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-label { font-size: 0.8rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.hero-value { font-size: 2.6rem; font-weight: 650; line-height: 1.1; }
.hero-max { font-size: 1rem; color: var(--muted); font-weight: 400; margin-left: 2px; }
.hero-desc { color: var(--ink-2); font-size: 0.95rem; }
.meters {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.9rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.45rem; justify-content: center;
}
.meter { display: grid; grid-template-columns: 7.5em 1fr 2.5em; align-items: center; gap: 0.7rem; }
.meter-label { font-size: 0.88rem; color: var(--ink-2); }
.meter-track {
  height: 8px; background: var(--hairline); border-radius: 4px; overflow: hidden;
}
.meter-fill {
  height: 100%; border-radius: 4px; background: var(--accent);
  transition: width 0.35s ease;
}
.meter-value { font-size: 0.88rem; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- panels ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem 1.1rem;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.panel-hint { color: var(--muted); font-size: 0.85rem; margin: 0.1rem 0 0.6rem; }
.count-badge { color: var(--muted); font-weight: 400; font-size: 0.9rem; }

/* ---------- rhythm strip ---------- */
.rhythm-sentence { margin: 0.6rem 0 0.9rem; overflow-x: auto; padding-bottom: 0.2rem; }
.rhythm-line { display: flex; align-items: flex-end; gap: 2px; min-height: 46px; width: max-content; }
.syll {
  width: 9px; border-radius: 3px 3px 0 0; background: var(--accent-mid);
  height: 12px; flex: none; cursor: pointer;
}
.syll.s1 { height: 34px; background: var(--accent); }
.syll.s2 { height: 24px; background: var(--accent); }
.syll.clash { background: var(--critical); }
.syll.ovr { box-shadow: 0 0 0 1.5px var(--ink-2); }
.syll.skip {
  height: 6px; background: transparent;
  border: 1px dashed var(--muted); border-radius: 3px;
}
.rhythm-controls { display: flex; align-items: center; gap: 0.5rem; margin: 0.2rem 0 0.6rem; }
.rhythm-controls button, .rhythm-controls select {
  border: 1px solid var(--hairline); border-radius: 8px; background: var(--page);
  color: var(--ink); font: inherit; font-size: 0.85rem;
  padding: 0.25rem 0.7rem; cursor: pointer;
}
.rhythm-controls button:hover { border-color: var(--accent); color: var(--accent); }
.lens-toggles { display: inline-flex; gap: 0.3rem; margin-left: 0.4rem; flex-wrap: wrap; }
.lens-btn {
  border: 1px dashed var(--hairline) !important; border-radius: 999px !important;
  background: none !important; color: var(--muted) !important;
  font-size: 0.75rem !important; padding: 0.12rem 0.55rem !important;
}
.lens-btn.on {
  border-style: solid !important; color: var(--accent) !important;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--hairline)) !important;
}
.rhythm-inner { position: relative; width: max-content; }
.rhythm-line.with-pitch { padding-top: 30px; }
.rhythm-inner.with-arcs { padding-bottom: 18px; }
.prosody-overlay { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.pitch-line {
  fill: none; stroke: color-mix(in srgb, var(--accent) 75%, var(--ink-2));
  stroke-width: 1.6; stroke-linejoin: round; opacity: 0.85; pointer-events: stroke;
}
.echo-arc { fill: none; stroke-width: 1.5; opacity: 0.75; pointer-events: stroke; }
.echo-arc.echo-vowel { stroke-dasharray: 4 3; }
.syll.patter {
  background: repeating-linear-gradient(135deg, var(--accent-mid) 0 3px,
    color-mix(in srgb, var(--accent-mid) 35%, var(--page)) 3px 6px);
}
.prosody-verdict {
  margin-top: 0.25rem; font-size: 0.78rem; color: var(--muted);
}

/* ---------- structure gallery ---------- */
.gallery-panel { margin-top: 1rem; }
.structure-gallery details {
  border-top: 1px solid var(--hairline); padding: 0.35rem 0;
}
.structure-gallery summary {
  cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: 0.9rem;
  padding: 0.2rem 0;
}
.gal-row { padding: 0.4rem 0 0.4rem 0.9rem; }
.gal-head { display: flex; align-items: center; gap: 0.5rem; }
.shape-tag {
  font-family: ui-monospace, monospace; font-size: 0.74rem; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--page));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--hairline));
  border-radius: 5px; padding: 0.05rem 0.35rem; white-space: nowrap;
}
.gal-badge {
  font-size: 0.72rem; color: var(--page); background: var(--accent);
  border-radius: 999px; padding: 0.06rem 0.5rem;
}
.gal-row.gal-used .shape-tag { border-color: var(--accent); }
.gal-ex { font-size: 0.88rem; color: var(--ink); margin-top: 0.15rem; }
.gal-note { font-size: 0.78rem; color: var(--muted); font-style: italic; margin-top: 0.1rem; }
.variety-tags { margin-top: 0.15rem; display: flex; flex-wrap: wrap; gap: 0.25rem; }

/* ---------- sentence variety ---------- */
.variety-notes { margin: 0.3rem 0 0.7rem; font-size: 0.85rem; }
.variety-mix { color: var(--ink-2); margin-bottom: 0.25rem; }
.variety-tip { margin-top: 0.5rem; }
.note-line { display: flex; gap: 0.45rem; align-items: baseline; margin-top: 0.1rem; }
.note-tag {
  flex: none; font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; border-radius: 999px; padding: 0.05rem 0.5rem;
  border: 1px solid var(--hairline);
}
.note-obs { color: var(--ink-2); }
.note-sug { color: var(--accent); border-color: var(--accent); }
.note-line .note-obs + span { color: var(--ink); }
.note-line .note-sug + span { color: var(--accent); }
.variety-table { display: flex; flex-direction: column; }
.variety-row {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem;
  padding: 0.5rem 0; border-top: 1px solid var(--hairline);
}
.variety-row:first-child { border-top: none; }
.variety-sentence { font-size: 0.92rem; color: var(--ink); }
.variety-note { font-size: 0.88rem; color: var(--ink-2); }
.variety-meta { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
@media (max-width: 560px) {
  .variety-row { grid-template-columns: 1fr; gap: 0.25rem; }
}
.tap-speed-label {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.8rem; color: var(--ink-2);
}
.tap-speed-label input[type="range"] { width: 130px; accent-color: var(--accent); cursor: pointer; }
.word-gap { width: 7px; flex: none; }
.pause-gap {
  width: 18px; flex: none; align-self: flex-end;
  border-bottom: 2px dotted var(--muted); margin: 0 2px 2px;
}
.wordgroup { display: flex; flex-direction: column; align-items: center; flex: none; }
.blocks { display: flex; align-items: flex-end; gap: 2px; min-height: 36px; }
.rhythm-words { display: flex; gap: 2px; width: max-content; margin-top: 3px; }
.rhythm-word-label {
  font-size: 0.68rem; color: var(--muted); text-align: center;
  white-space: nowrap; padding: 0 2px;
}
.clash-mark { color: var(--critical); font-weight: 700; }

/* ---------- annotated text ---------- */
.lens-tabs { display: flex; gap: 0.3rem; }
.lens-tabs button {
  background: none; border: 1px solid var(--hairline); border-radius: 999px;
  color: var(--ink-2); font-size: 0.82rem; padding: 0.12rem 0.65rem; cursor: pointer;
}
.lens-tabs button[aria-selected="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.annotated {
  font-size: 1.12rem; line-height: 2.05; margin: 0.4rem 0;
  overflow-wrap: break-word;
}
.annotated .tok { border-radius: 4px; padding: 0.05em 0.08em; margin: 0 -0.02em; }
.annotated .tok.word { cursor: pointer; }
.annotated .tok.word:hover { outline: 1px solid var(--accent); }

/* problems lens */
.lens-problems .tok.f-minor    { border-bottom: 2px dotted var(--warning); }
.lens-problems .tok.f-moderate { border-bottom: 2px solid var(--serious); }
.lens-problems .tok.f-major    { border-bottom: 3px solid var(--critical); }
.lens-problems .tok.f-info     { border-bottom: 2px dotted var(--muted); }

/* stress lens */
.lens-stress .tok.stress-1 { font-weight: 700; }
.lens-stress .tok.stress-mixed { font-weight: 600; }
.lens-stress .tok.stress-0 { color: var(--ink-2); }

/* sound lens: three categorical slots max, then shape fallback */
.lens-sound .tok.snd-0 { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.lens-sound .tok.snd-1 { background: color-mix(in srgb, var(--orange) 22%, transparent); }
.lens-sound .tok.snd-2 { background: color-mix(in srgb, var(--aqua) 24%, transparent); }
.lens-sound .tok.snd-more { text-decoration: underline dotted var(--muted); }

/* etymology lens */
.lens-origin .tok.ety-latinate { background: color-mix(in srgb, var(--orange) 22%, transparent); }
.lens-origin .tok.ety-germanic { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.tok.flash {
  outline: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

/* ---------- word inspector ---------- */
.word-inspector[hidden] { display: none; }
.word-inspector {
  margin-top: 0.6rem; border: 1px solid var(--hairline); border-radius: 10px;
  padding: 0.6rem 0.8rem; font-size: 0.9rem; background: var(--page);
  display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem;
}
.word-inspector .wi-head { font-weight: 650; font-size: 1rem; width: 100%; }
.word-inspector .wi-item { color: var(--ink-2); }
.word-inspector .wi-item b { color: var(--ink); font-weight: 600; }

/* ---------- findings ---------- */
.findings { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.finding {
  border: 1px solid var(--hairline); border-left-width: 4px;
  border-radius: 8px; padding: 0.55rem 0.8rem; cursor: pointer;
}
.finding:hover { border-color: var(--accent); }
.finding.sev-major    { border-left-color: var(--critical); }
.finding.sev-moderate { border-left-color: var(--serious); }
.finding.sev-minor    { border-left-color: var(--warning); }
.finding.sev-info     { border-left-color: var(--muted); }
.finding-title { font-weight: 650; font-size: 0.95rem; }
.finding-sev {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); margin-left: 0.5rem;
}
.finding-msg { color: var(--ink-2); font-size: 0.92rem; margin-top: 0.1rem; }
.finding-fix { font-size: 0.92rem; margin-top: 0.15rem; }
.finding-fix::before { content: "→ "; color: var(--good-text); }
.no-findings { color: var(--good-text); font-size: 0.95rem; }

/* ---------- details tables ---------- */
.details-panel summary { cursor: pointer; }
.details-panel summary h2 { display: inline; }
.metric-table-wrap { overflow-x: auto; margin-top: 0.6rem; }
table { border-collapse: collapse; font-size: 0.88rem; min-width: 480px; }
th, td { text-align: left; padding: 0.3rem 0.9rem 0.3rem 0; border-bottom: 1px solid var(--hairline); }
th { color: var(--muted); font-weight: 500; }
td.num { font-variant-numeric: tabular-nums; }
.score-chip {
  display: inline-block; min-width: 2.4em; text-align: center;
  border-radius: 999px; padding: 0 0.45em; font-variant-numeric: tabular-nums;
  background: var(--hairline); color: var(--ink);
}
.about p { color: var(--ink-2); margin: 0.3rem 0 0; font-size: 0.93rem; }

/* ---------- sounds-like control ---------- */
.seed-def {
  margin: 0.35rem 0 0; font-size: 0.88rem; color: var(--ink-2);
  border-left: 3px solid var(--accent-mid); padding-left: 0.6rem;
}
.seed-def i { color: var(--muted); }
.def-of { color: var(--muted); }
.soundslike-row {
  display: flex; align-items: flex-end; gap: 0.8rem; flex-wrap: wrap;
  margin-top: 0.7rem;
}
.sl-word-label, .sl-pos-label {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.82rem; color: var(--ink-2);
}
.sl-word-label input, .sl-pos-label select {
  border: 1px solid var(--hairline); border-radius: 8px; font: inherit;
  font-size: 0.92rem; padding: 0.35rem 0.55rem; background: var(--page);
  color: var(--ink); min-width: 13rem;
}
.sl-pos-label select { min-width: auto; }
.sl-phones {
  display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap;
  padding-bottom: 0.15rem;
}
.sl-hint { font-size: 0.78rem; color: var(--muted); margin-right: 0.2rem; }
.sl-chip {
  border: 1px solid var(--hairline); border-radius: 8px; background: var(--page);
  color: var(--ink); font-size: 0.9rem; font-family: ui-monospace, monospace;
  padding: 0.18rem 0.5rem; cursor: pointer;
}
.sl-chip.sl-vowel { border-bottom: 3px solid var(--orange); }
.sl-chip.sl-conson { border-bottom: 3px solid var(--accent-mid); }
.sl-chip.on {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.sl-chip:hover { border-color: var(--accent); }
.sl-block {
  display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap;
  padding: 0.2rem 0.45rem; border: 1px dashed var(--hairline); border-radius: 10px;
}
.sl-wordlbl { font-size: 0.82rem; color: var(--ink-2); font-weight: 600; margin-right: 0.15rem; }
.sl-group {
  border: 1px solid var(--hairline); border-radius: 999px; background: none;
  color: var(--ink-2); font-size: 0.75rem; padding: 0.12rem 0.55rem; cursor: pointer;
}
.sl-group.on { background: var(--aqua); border-color: var(--aqua); color: #fff; }
.sl-group[hidden] { display: none; }

/* ---------- stress-pattern builder ---------- */
.stress-cell {
  display: flex; flex-direction: column; gap: 0.18rem;
  font-size: 0.8rem; color: var(--ink-2);
}
.stress-builder {
  display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap;
  border: 1px solid var(--hairline); border-radius: 7px;
  padding: 0.22rem 0.4rem; background: var(--page); min-height: 2.05rem;
}
.stress-chip {
  border: 1px solid var(--hairline); border-radius: 6px; cursor: pointer;
  font-size: 0.78rem; font-family: ui-monospace, monospace; color: var(--ink);
  padding: 0.1rem 0.4rem; background: var(--surface);
}
.stress-chip.st-1 { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.stress-chip.st-0 { color: var(--ink-2); }
.stress-chip.st-x { border-style: dashed; color: var(--muted); font-style: italic; }
.stress-builder button#stress-add, .stress-builder button#stress-clear {
  border: 1px dashed var(--hairline); border-radius: 6px; background: none;
  color: var(--muted); font-size: 0.78rem; padding: 0.1rem 0.45rem; cursor: pointer;
}
.stress-builder button#stress-mode {
  border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface);
  color: var(--ink-2); font-size: 0.72rem; padding: 0.1rem 0.4rem; cursor: pointer;
}
.stress-builder button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- definition popup ---------- */
.def-popup {
  position: absolute; z-index: 30;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  padding: 0.55rem 0.75rem; font-size: 0.88rem; color: var(--ink-2);
  line-height: 1.45;
}
.def-popup b { color: var(--ink); }
.def-popup i { color: var(--muted); }
.def-popup[hidden] { display: none; }

/* ---------- word finder ---------- */
.finder-panel input[type="text"], .finder-panel input:not([type]) {
  width: 100%; border: 1px solid var(--hairline); border-radius: 8px;
  padding: 0.55rem 0.7rem; font: inherit; background: var(--page); color: var(--ink);
}
.finder-panel input:focus, .finder-panel select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
#seed-input { font-size: 1.05rem; margin-top: 0.2rem; }
.constraint-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.55rem 0.8rem; margin-top: 0.7rem;
}
.constraint-grid label {
  display: flex; flex-direction: column; gap: 0.18rem;
  font-size: 0.8rem; color: var(--ink-2);
}
.constraint-grid input, .constraint-grid select {
  border: 1px solid var(--hairline); border-radius: 7px;
  padding: 0.35rem 0.5rem; font: inherit; font-size: 0.9rem;
  background: var(--page); color: var(--ink); width: 100%;
}
.finder-clear {
  background: none; border: 1px solid var(--hairline); border-radius: 999px;
  color: var(--ink-2); font-size: 0.82rem; padding: 0.12rem 0.65rem; cursor: pointer;
}
.finder-clear:hover { border-color: var(--accent); color: var(--accent); }
.finder-results { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem; }
.word-chip {
  display: inline-flex; align-items: baseline; gap: 0.4rem;
  background: var(--page); border: 1px solid var(--hairline); border-radius: 999px;
  padding: 0.22rem 0.75rem; cursor: pointer; font: inherit;
  color: var(--ink);
}
.word-chip:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--page)); }
.chip-word { font-size: 0.98rem; }
.chip-meta { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.08em; }
.spell-note { color: var(--muted); }
.reach-row {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.35rem; font-size: 0.82rem; color: var(--ink-2);
}
.reach-row input[type="range"] { width: 110px; accent-color: var(--accent); cursor: pointer; }
#reach-label { color: var(--muted); }
.clear-models {
  border: 1px dashed var(--hairline); border-radius: 999px; background: none;
  color: var(--muted); font: inherit; font-size: 0.78rem;
  padding: 0.15rem 0.6rem; cursor: pointer;
}
.clear-models:hover { border-color: var(--critical); color: var(--critical); }
.def-meta { color: var(--muted); font-size: 0.85em; letter-spacing: 0.06em; }
.spell-sug {
  border: 1px solid var(--hairline); border-radius: 999px; background: none;
  color: var(--accent); font: inherit; font-size: 0.85rem;
  padding: 0.05rem 0.55rem; margin: 0 0.1rem; cursor: pointer;
}
.spell-sug:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--page)); }
.chip-legend {
  margin: 0.45rem 0 0; font-size: 0.76rem; color: var(--muted);
}
.chip-legend b { font-weight: 600; color: var(--ink-2); }
.show-more {
  display: inline-flex; align-items: center;
  background: none; border: 1px dashed var(--hairline); border-radius: 999px;
  padding: 0.22rem 0.85rem; cursor: pointer; font: inherit;
  font-size: 0.88rem; color: var(--accent);
}
.show-more:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--page)); }
.wi-find, .wi-speak {
  margin-left: 0.7rem; background: none; border: 1px solid var(--hairline);
  border-radius: 999px; color: var(--accent); font-size: 0.78rem;
  padding: 0.08rem 0.6rem; cursor: pointer; vertical-align: middle;
}
.wi-find:hover, .wi-speak:hover { border-color: var(--accent); }

/* ---------- compare mode ---------- */
.revision-label {
  display: block; margin: 0.6rem 0 0.3rem; font-size: 0.85rem; color: var(--ink-2);
}
#revision-wrap[hidden] { display: none; }
.revision-toggle { border-style: dashed !important; }
.compare-panel[hidden] { display: none; }
.delta.up { color: var(--good-text); }
.delta.down { color: var(--critical); }
.delta.same { color: var(--muted); }
.cmp-group {
  margin-top: 0.55rem; font-size: 0.9rem; color: var(--ink-2);
  padding-left: 0.7rem; border-left: 3px solid var(--hairline);
}
.cmp-group .cmp-head { font-weight: 650; color: var(--ink); margin-right: 0.3rem; }
.cmp-fixed { border-left-color: var(--good); }
.cmp-fixed .cmp-head { color: var(--good-text); }
.cmp-remain { border-left-color: var(--warning); }
.cmp-added { border-left-color: var(--critical); }
