/* ReviewLens-for-TESL — "Lens Console" modern reskin.
   Pure CSS reskin over an unchanged DOM. Near-monochrome neutrals + one
   electric-indigo accent. Light + dark via prefers-color-scheme. */

:root {
  /* neutrals (near-monochrome) */
  --bg:        #fafafa;
  --card:      #ffffff;          /* kept name (== surface) */
  --surface-2: #f4f4f5;
  --border:    #e8e8ec;
  --border-strong: #d4d4d8;
  --line:      #e8e8ec;          /* kept name, == --border */
  --ink:       #18181b;
  --muted:     #6b6b76;
  --faint:     #71717a;   /* AA on --card (4.8:1): copyright text must read clearly */

  /* one electric accent */
  --accent:      #5b5bd6;
  --accent-hover:#4f4fc7;
  --accent-ink:  #ffffff;        /* kept name (text on accent) */
  --accent-weak: #eeeefb;
  --accent-line: #dcdcf7;
  --focus:       #5b5bd6;

  /* semantic data trios */
  --pos: #1f9d57;  --pos-soft:#e9f7ef;  --pos-line:#c2e9d2;  --pos-ink:#11633a;
  --neg: #dc4040;  --neg-soft:#fcecec;  --neg-line:#f4cccc;  --neg-ink:#9c2626;
  --mix: #d68a1c;  --mix-soft:#fdf4e3;  --mix-line:#f0dcae;  --mix-ink:#8a5a12;
  --nul: #8a8a94;  --nul-soft:#f1f1f3;
  --oth: #6b6b76;

  /* data viz / misc */
  --skel:    var(--surface-2);   /* kept name */
  --bar-fill:#c9c9f0;
  --plot-bg: #fcfdfe;
  --tooltip-bg: rgba(24,24,27,0.94);

  --shadow-sm:  0 1px 2px rgba(24,24,27,0.04);
  --shadow-md:  0 1px 2px rgba(24,24,27,0.04), 0 4px 12px rgba(24,24,27,0.05);
  --shadow-pop: 0 8px 28px rgba(24,24,27,0.12);

  --radius:    12px;             /* kept name */
  --radius-sm: 8px;
  --maxw:      1040px;           /* kept name */
  font-size: 16px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0a0a0b;
    --card:      #131316;
    --surface-2: #1c1c20;
    --border:    #262629;
    --border-strong: #34343a;
    --line:      #262629;
    --ink:       #f4f4f5;
    --muted:     #a1a1ac;
    --faint:     #7e7e88;   /* AA on dark --card (4.6:1) */

    --accent:      #7c7cf0;
    --accent-hover:#8d8df5;
    --accent-ink:  #0a0a0b;
    --accent-weak: #1b1b2e;
    --accent-line: #33335a;
    --focus:       #7c7cf0;

    --pos:#37c47f; --pos-soft:#0f2419; --pos-line:#1f4a33; --pos-ink:#7fe3ad;
    --neg:#f06a6a; --neg-soft:#2a1416; --neg-line:#5a2628; --neg-ink:#f4a9a9;
    --mix:#e7a945; --mix-soft:#271f10; --mix-line:#4f3d1c; --mix-ink:#f0cd84;
    --nul:#7a7a84; --nul-soft:#1c1c20;
    --oth:#a1a1ac;

    --skel: var(--surface-2);
    --bar-fill:#36365e;
    --plot-bg:#10141d;
    --tooltip-bg: rgba(8,8,10,0.96);

    --shadow-sm:  0 1px 2px rgba(0,0,0,0.4);
    --shadow-md:  0 1px 2px rgba(0,0,0,0.4), 0 4px 14px rgba(0,0,0,0.45);
    --shadow-pop: 0 10px 34px rgba(0,0,0,0.6);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "ss01" 1;
  line-height: 1.55;
  letter-spacing: -0.006em;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }

/* tabular figures where numbers compare */
.cand-sim, .macro-count, .char-counter, #batch-count,
.gap-value strong, .verdict-model strong, .bar-text, .batch-table td {
  font-variant-numeric: tabular-nums;
}

/* plain-language placement lead sentence (Where it fits hero) */
.placed-caption {
  margin: 0 0 0.75rem; font-size: 1.05rem; line-height: 1.5; color: var(--ink);
}
.placed-caption strong { font-weight: 650; }

/* similarity as a soft word-badge instead of a bare cosine */
.nn-sim {
  font-size: 0.72rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.nn-sim.sim-high  { background: var(--pos-soft); color: var(--pos-ink); border-color: var(--pos-line); }
.nn-sim.sim-mid   { background: var(--accent-weak); color: var(--accent); border-color: var(--accent-line); }
.nn-sim.sim-low   { background: var(--surface-2, transparent); }
.nn-sim.sim-faint { opacity: 0.8; }

/* ===== Header ============================================================= */
.site-header { position: relative; background: var(--card); border-bottom: 1px solid var(--border); }
.site-header::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--accent);
}
.header-inner { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1.5rem 0; }
.site-header h1 { margin: 0; font-size: 1.5rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.subtitle { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.975rem; font-weight: 450; line-height: 1.45; max-width: 62ch; }
.copyright { margin: 0.5rem 0 0; color: var(--faint); font-size: 0.75rem; font-weight: 450; }

/* ===== Tab bar (underline; .tab/.tab.active LOAD-BEARING) ================= */
.tabs {
  display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-top: 1rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap;
}
.tab {
  appearance: none; border: none; background: transparent; cursor: pointer;
  padding: 0.6rem 0.9rem; font-size: 0.875rem; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0;
  transition: color .15s, background .15s, border-color .15s; white-space: nowrap;
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); background: transparent; }
.tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Batch is a secondary tab: lighter weight, de-emphasized until active. */
.tab-secondary { font-weight: 450; }
.tab-secondary.active { font-weight: 600; }

/* ===== Views ============================================================== */
.view[hidden] { display: none; }

/* ===== Input card ========================================================= */
.input-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.25rem 1.35rem;
}
.input-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.picker-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

#sample-picker, #model-picker, #batch-model-picker, #abstract-input, #batch-input {
  background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem; color: var(--ink); font: inherit;
}
#sample-picker, #model-picker, #batch-model-picker { min-width: 260px; }
#abstract-input, #batch-input { width: 100%; resize: vertical; line-height: 1.6; padding: 0.85rem; }

#sample-picker:focus, #model-picker:focus, #batch-model-picker:focus,
#abstract-input:focus, #batch-input:focus,
#sample-picker:focus-visible, #model-picker:focus-visible, #batch-model-picker:focus-visible,
#abstract-input:focus-visible, #batch-input:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak);
}
#abstract-input::placeholder, #batch-input::placeholder { color: var(--faint); }

.model-caption { font-size: 0.78rem; color: var(--muted); margin: 0 0 0.7rem; }

.input-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.7rem; flex-wrap: wrap; gap: 0.5rem; }
.input-footer span button { margin-left: 0.4rem; }
.char-counter { font-size: 0.82rem; color: var(--muted); }
.char-counter.warn { color: var(--neg); font-weight: 700; }

/* ===== Buttons ============================================================ */
.btn-primary {
  background: var(--accent); color: var(--accent-ink); border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 0.55rem 1.15rem; font: 600 0.9rem/1 inherit;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .12s, background .15s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-primary:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }

.btn-secondary {
  background: var(--card); color: var(--ink); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 0.45rem 0.9rem; font: 550 0.85rem/1 inherit; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.btn-secondary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-secondary:disabled { opacity: .5; cursor: not-allowed; }

#batch-file { font-size: 0.85rem; color: var(--ink); }
#batch-file:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
#batch-file::file-selector-button {
  background: var(--card); color: var(--ink); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 0.35rem 0.8rem; font: 550 0.82rem/1 inherit;
  cursor: pointer; margin-right: 0.6rem; transition: border-color .15s, color .15s, background .15s;
}
#batch-file::file-selector-button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }

/* ===== Banners ============================================================ */
.banner {
  border-radius: var(--radius-sm); padding: 0.8rem 1rem; margin-top: 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.banner-error { background: var(--neg-soft); color: var(--neg-ink); border: 1px solid var(--neg-line); }

/* ===== Progress =========================================================== */
.progress {
  margin-top: 1rem; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1rem 1.2rem;
}
.progress-line { font-size: 0.92rem; color: var(--muted); padding: 0.15rem 0 0.15rem 1.5rem; position: relative; }
.progress-line.active { color: var(--ink); font-weight: 600; }
.progress-line.done { color: var(--pos); }
.progress-line::before { content: "○"; position: absolute; left: 0; }
.progress-line.done::before { content: "●"; }
.progress-line.active::before {
  content: ""; width: 0.8em; height: 0.8em; top: 0.3em;
  border: 2px solid var(--accent-weak); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
.progress-note { font-size: 0.8rem; color: var(--muted); margin: 0.5rem 0 0; }

/* ===== Results (single-column guided report) ============================== */
.results { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; }
.results > * { min-width: 0; }

/* sr-only utility */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===== Onboarding / empty state =========================================== */
.onboarding-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 2rem 1.75rem; margin-top: 1.5rem;
  max-width: 760px; margin-left: auto; margin-right: auto; text-align: center;
}
.onboarding-card[hidden] { display: none; }
.onboarding-title { margin: 0 0 0.6rem; font-size: 1.45rem; font-weight: 750; letter-spacing: -0.02em; }
.onboarding-prop { margin: 0 auto 1.4rem; color: var(--muted); font-size: 0.97rem; max-width: 60ch; line-height: 1.55; }
.onboarding-preview-label, .onboarding-samples-label {
  font-size: 0.74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  margin: 1.1rem 0 0.55rem;
}
.onboarding-preview {
  list-style: none; margin: 0 0 0.4rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
}
.onboarding-preview li {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.3rem 0.75rem 0.3rem 0.35rem; font-size: 0.82rem;
}
.onboarding-preview .op-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--accent);
  color: var(--accent-ink); font-size: 0.72rem; font-weight: 700;
}
.sample-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.sample-chip {
  appearance: none; cursor: pointer; font: 550 0.84rem/1.2 inherit;
  background: var(--accent-weak); border: 1px solid var(--accent-line); color: var(--accent);
  border-radius: 999px; padding: 0.45rem 0.85rem; min-height: 38px;
  transition: background .15s, border-color .15s;
}
.sample-chip:hover { background: var(--card); border-color: var(--accent); }
.sample-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.onboarding-trust { margin: 1.4rem auto 0; font-size: 0.78rem; max-width: 64ch; }

/* ===== Verdict card ======================================================= */
.verdict-card {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 1.35rem 1.5rem 1.25rem;
}
.verdict-kicker {
  margin: 0 0 0.3rem; font-size: 0.7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); line-height: 1.2;
}
#verdict-heading:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.verdict-sentence {
  margin: 0 0 0.9rem; font-size: 1.15rem; font-weight: 550; line-height: 1.45;
  letter-spacing: -0.01em; max-width: 70ch; padding-right: 6.5rem;
}
.verdict-copy { position: absolute; top: 1.1rem; right: 1.2rem; }
.verdict-micro { margin: 0.9rem 0 0; font-size: 0.78rem; }
.verdict-model { font-variant-numeric: tabular-nums; }
.verdict-model strong { color: var(--accent); }

.btn-ghost {
  appearance: none; cursor: pointer; background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.35rem 0.7rem; font: 550 0.8rem/1 inherit; min-height: 36px;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-weak); }
.btn-ghost:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* verdict chips */
.verdict-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.verdict-chip {
  appearance: none; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 0.1rem; min-height: 44px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.4rem 0.7rem; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
button.verdict-chip:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
button.verdict-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.verdict-chip .vc-caption { font-size: 0.68rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.verdict-chip .vc-value { font-size: 0.92rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict-chip.gap-dense    { border-color: var(--neg-line); background: var(--neg-soft); }
.verdict-chip.gap-dense .vc-value    { color: var(--neg-ink); }
.verdict-chip.gap-moderate { border-color: var(--mix-line); background: var(--mix-soft); }
.verdict-chip.gap-moderate .vc-value { color: var(--mix-ink); }
.verdict-chip.gap-sparse   { border-color: var(--pos-line); background: var(--pos-soft); }
.verdict-chip.gap-sparse .vc-value   { color: var(--pos-ink); }
/* theme chip left swatch keyed to the macro legend palette */
.verdict-chip[class*="theme-macro-"] { border-left-width: 3px; }
.verdict-chip.theme-macro-0 { border-left-color: #b8c0c9; }
.verdict-chip.theme-macro-1 { border-left-color: #E69F00; }
.verdict-chip.theme-macro-2 { border-left-color: #56B4E9; }
.verdict-chip.theme-macro-3 { border-left-color: #009E73; }
.verdict-chip.theme-macro-4 { border-left-color: #CC79A7; }
.verdict-chip.theme-macro-5 { border-left-color: #0072B2; }
.verdict-chip.theme-macro-6 { border-left-color: #D55E00; }
.verdict-chip.theme-macro-7 { border-left-color: #9467BD; }
.skel-inline { display: inline-block; width: 7ch; height: 0.9rem; vertical-align: middle; margin: 0; }
.verdict-sentence .skel-inline { width: 60%; }

/* ===== Report sections (Q1-Q5) ============================================ */
.report-section {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.25rem 1.35rem;
  transition: box-shadow .18s, border-color .18s;
}
.report-section:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.report-section h2 {
  margin: 0 0 0.2rem; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em;
}
.report-section h2:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.report-section .dek { margin: 0 0 0.9rem; font-size: 0.84rem; color: var(--muted); }
.hero-body { margin-bottom: 0.4rem; }
.placed-caption { margin: 0 0 0.7rem; font-size: 0.9rem; }
.panel-note { margin: 0.7rem 0 0; font-size: 0.78rem; color: var(--muted); font-style: italic; }
/* Long unbreakable tokens (journal names, snippets, URLs) must not force overflow. */
.hero-body, .details-body, .nn-snippet, .nn-journal, .batch-snip, table.kv td, .evidence { overflow-wrap: anywhere; }

/* Field-map hero accent rail on the "where" section */
#sec-where::before {
  content: ""; position: absolute; left: 0; top: 1.1rem; bottom: 1.1rem;
  width: 3px; border-radius: 3px; background: var(--accent);
}

/* ===== Collapsible details rows =========================================== */
.report-section details { margin-top: 0.9rem; }
.report-section details + details { margin-top: 0.5rem; }
summary.summary-row {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  gap: 0.5rem; padding: 0.6rem 0.7rem; min-height: 44px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 0.86rem; font-weight: 600; color: var(--ink);
  transition: border-color .15s, color .15s, background .15s;
}
summary.summary-row::-webkit-details-marker { display: none; }
summary.summary-row::after {
  content: ""; margin-left: auto; width: 0.55rem; height: 0.55rem;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .18s ease;
}
details[open] > summary.summary-row::after { transform: rotate(225deg); }
summary.summary-row:hover { border-color: var(--accent); color: var(--accent); }
summary.summary-row:hover::after { border-color: var(--accent); }
summary.summary-row:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.details-body { padding: 0.85rem 0.7rem 0.2rem; }
.details-caption { margin: 0 0 0.6rem; font-size: 0.8rem; }
/* nested details read as a deeper disclosure */
details details > summary.summary-row { background: var(--card); border-style: dashed; }

/* ===== Q1 hero: 5-fact line + constructs ================================== */
.fact-line { display: flex; flex-wrap: wrap; gap: 0.5rem 0.7rem; margin-bottom: 0.85rem; }
.fact {
  display: flex; flex-direction: column; gap: 0.1rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.4rem 0.7rem; min-width: 0; flex: 1 1 auto;
}
.fact-label { font-size: 0.68rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.fact-value { font-size: 0.9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.constructs-label { font-size: 0.72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 0.4rem; }

/* ===== Extraction table =================================================== */
table.kv { width: 100%; border-collapse: collapse; }
table.kv th, table.kv td {
  text-align: left; padding: 0.4rem 0.55rem; vertical-align: top;
  border-bottom: 1px solid var(--border); font-size: 0.875rem;
}
table.kv th { width: 32%; color: var(--muted); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chip, .nn-macro {
  background: var(--accent-weak); border: 1px solid var(--accent-line); color: var(--accent);
  border-radius: 999px; padding: 0.12rem 0.6rem; font-size: 0.78rem; font-weight: 500;
}
.nn-macro { font-size: 0.74rem; padding: 0.05rem 0.5rem; }

.muted { color: var(--muted); }
.none { color: var(--muted); font-style: italic; }
.pending { color: var(--mix); font-style: italic; font-weight: 600; }

/* ===== Claims subtable ==================================================== */
.claims-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.claims-table th, .claims-table td {
  padding: 0.4rem 0.55rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; text-align: left; vertical-align: top;
}
.claims-table th { color: var(--muted); font-weight: 600; }

.dir-badge, .status-badge {
  display: inline-block; border-radius: 999px; padding: 0.1rem 0.55rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: .02em;
}
.dir-positive, .status-ok      { background: var(--pos-soft); color: var(--pos-ink); }
.dir-negative, .status-error   { background: var(--neg-soft); color: var(--neg-ink); }
.dir-null                      { background: var(--nul-soft); color: var(--muted); }
.dir-mixed, .status-partial    { background: var(--mix-soft); color: var(--mix-ink); }
.dir-other                     { background: var(--surface-2); color: var(--oth); }
.hedged-tag { font-style: italic; color: var(--mix); font-size: 0.78rem; margin-left: 0.35rem; }

/* ===== Evidence / constructs ============================================= */
.construct-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.construct-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; }
.evidence {
  display: inline-block; font-size: 0.8rem; color: var(--muted); font-style: italic;
  border-left: 3px solid var(--accent); padding: 0.05rem 0.5rem; background: var(--surface-2); border-radius: 4px;
}
.claim-evidence-row td { border-bottom: 1px solid var(--border); padding-top: 0; }

/* ===== Placement ========================================================== */
.placed-topic {
  padding: 0.6rem 0.8rem; background: var(--accent-weak); border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm); margin-bottom: 0.7rem;
}
.placed-topic .macro-label { font-weight: 700; color: var(--accent); }
.cand-list { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.cand-list li {
  display: flex; justify-content: space-between; padding: 0.3rem 0.2rem;
  border-bottom: 1px solid var(--border); font-size: 0.88rem;
}
.cand-sim { color: var(--muted); }

/* ===== NN list ============================================================ */
.nn-list { list-style: none; margin: 0; padding: 0; }
.nn-item { padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
.nn-item:last-child { border-bottom: none; }
.nn-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; font-size: 0.85rem; }
.nn-journal { font-weight: 700; }
.nn-sim { margin-left: auto; color: var(--accent); font-weight: 700; }
.nn-snippet { margin: 0.3rem 0 0.25rem; font-size: 0.88rem; color: var(--ink); }
.nn-fields { font-size: 0.78rem; color: var(--muted); }

/* ===== Benchmark / bars / gauges ========================================= */
.bench-row { margin-bottom: 0.85rem; }
.bench-label { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.25rem; }
.bench-detail { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.3rem; }

.bar-wrap, .macro-bar-track, .batch-bar-wrap, .gap-gauge, .journalfit-bar {
  background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden;
}
.bar-wrap { position: relative; height: 22px; }
.macro-bar-track { height: 18px; }
.batch-bar-wrap { height: 12px; margin-top: 0.6rem; }

.bar-fill, .macro-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar-fill);
  transition: width .3s cubic-bezier(.4,0,.2,1);
}
.macro-bar-fill { position: static; height: 100%; }
.bar-marker { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--accent); }
.bar-text { position: absolute; left: 0.5rem; top: 0; line-height: 22px; font-size: 0.76rem; color: var(--ink); }

/* ===== Macro map ========================================================== */
.macro-bar-row { display: grid; grid-template-columns: 1fr 4fr auto; gap: 0.6rem; align-items: center; margin-bottom: 0.4rem; }
.macro-bar-row .name { font-size: 0.82rem; }
.macro-bar-row.placed .name { font-weight: 700; color: var(--accent); }
.macro-bar-row.placed .macro-bar-fill, .batch-bar { background: var(--accent); }
.macro-count { font-size: 0.78rem; color: var(--muted); }

/* ===== Best-fit journals ================================================== */
.journalfit-list { display: flex; flex-direction: column; gap: 0.55rem; }
.journalfit-row { display: grid; grid-template-columns: 1fr; gap: 0.2rem; }
.journalfit-name { font-size: 0.85rem; font-weight: 600; }
.journalfit-bar { height: 22px; }

/* ===== Novelty / gap signal =============================================== */
.gap-value { font-size: 0.95rem; margin-bottom: 0.35rem; }
.gap-value strong { color: var(--accent); }
.gap-band { font-size: 0.85rem; font-weight: 600; padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); margin-bottom: 0.55rem; }
.gap-dense    { background: var(--neg-soft); color: var(--neg-ink); border: 1px solid var(--neg-line); }
.gap-moderate { background: var(--mix-soft); color: var(--mix-ink); border: 1px solid var(--mix-line); }
.gap-sparse   { background: var(--pos-soft); color: var(--pos-ink); border: 1px solid var(--pos-line); }
.gap-gauge { height: 22px; }

/* ===== Skeletons ========================================================== */
.skel-line {
  height: 0.9rem; border-radius: 5px; margin: 0.45rem 0;
  background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 60%, var(--card)) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
}
.skel-line.short { width: 45%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ===== Field map (Panel 6) ================================================ */
.fieldmap-wrap {
  position: relative; width: 100%; max-width: 100%; overflow-x: auto;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 22px 22px;
}
#fieldmap-canvas { display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--plot-bg); }
#fieldmap-unavailable {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 0.8rem 1rem; background: var(--surface-2);
}
.fieldmap-tooltip {
  position: absolute; pointer-events: none; z-index: 5; max-width: 240px;
  background: var(--tooltip-bg); color: #fff; border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem; font-size: 0.78rem; line-height: 1.35; box-shadow: var(--shadow-pop);
}
.fieldmap-tooltip .fm-tt-journal, .fm-tt-journal { font-weight: 700; }
.fieldmap-tooltip .fm-tt-topic, .fm-tt-topic { color: #cdd9e6; margin: 0.1rem 0; }
.fieldmap-tooltip .fm-tt-snip, .fm-tt-snip { color: #e6edf4; }
.fieldmap-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 0.85rem; margin-top: 0.8rem; }
.fm-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.76rem; color: var(--ink); }
.fm-swatch { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; border: 1px solid var(--border); }

/* ===== Batch ============================================================== */
.batch-intro { margin: 0 0 1rem; font-size: 0.86rem; }
.batch-help { font-size: 0.8rem; color: var(--muted); margin: 0.25rem 0 0.5rem; }
.batch-cap-note {
  margin-top: 0.6rem; font-size: 0.82rem; background: var(--neg-soft); color: var(--neg-ink);
  border: 1px solid var(--neg-line); border-radius: var(--radius-sm); padding: 0.4rem 0.6rem;
}
.batch-bar { height: 100%; width: 0; transition: width .2s ease; }
.batch-export { margin-top: 1rem; display: flex; gap: 0.5rem; }
.batch-table-wrap {
  margin-top: 1rem; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.batch-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; background: var(--card); }
.batch-table caption { caption-side: top; text-align: left; font-size: 0.8rem; color: var(--muted); padding: 0.3rem 0.55rem; }
.batch-table th, .batch-table td { text-align: left; padding: 0.4rem 0.55rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.batch-table th { color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
.batch-table tr:hover td { background: var(--surface-2); }
.batch-snip { max-width: 260px; color: var(--ink); }

/* ===== Validation / About ================================================= */
.validation-body {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.6rem 1.75rem;
}
.validation-body h2 { margin-top: 0; font-size: 1.2rem; font-weight: 700; }
.validation-body h3 { font-size: 0.95rem; font-weight: 650; margin: 1.3rem 0 0.4rem; }
.validation-body p { font-size: 0.92rem; max-width: 72ch; }
.proto-list { margin: 0.3rem 0; padding-left: 1.2rem; font-size: 0.92rem; }
.proto-list li { margin: 0.3rem 0; }
.rel-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.rel-table th, .rel-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.88rem; }
.rel-table th { color: var(--muted); font-weight: 600; }
.status-note {
  margin-top: 1rem; padding: 0.7rem 0.9rem; background: var(--mix-soft); color: var(--mix-ink);
  border: 1px solid var(--mix-line); border-radius: var(--radius-sm); font-size: 0.85rem;
}
.about-body h3 { font-size: 0.95rem; margin: 1.2rem 0 0.4rem; }
.about-body p { font-size: 0.92rem; }

/* ===== Footer ============================================================= */
.site-footer { border-top: 1px solid var(--border); background: var(--card); }
.site-footer .muted { max-width: var(--maxw); margin: 0 auto; padding: 1.25rem 1.5rem; font-size: 0.8rem; }

/* ===== Responsive ========================================================= */
@media (max-width: 640px) {
  .container { padding: 1.25rem 1rem 3rem; }
  .site-header h1 { font-size: 1.3rem; }
  #sample-picker, #model-picker, #batch-model-picker { min-width: 100%; }
  .input-footer { flex-wrap: wrap; }
  .onboarding-card { padding: 1.5rem 1.15rem; }
  .verdict-sentence { padding-right: 0; font-size: 1.05rem; }
  .verdict-copy { position: static; margin-bottom: 0.7rem; }
  .verdict-card { padding: 1.15rem 1.15rem; }
  .verdict-chip { flex: 1 1 100%; }
  .fact { flex: 1 1 100%; }
}

/* ===== Motion budget ====================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skel-line, .bar-fill, .macro-bar-fill, .batch-bar {
    animation: none !important; transition: none !important; background: var(--surface-2);
  }
  .macro-bar-row.placed .macro-bar-fill, .batch-bar { background: var(--accent); }
  .bar-fill { background: var(--bar-fill); }
  .progress-line.active::before { animation: none; }
  .btn-primary:active { transform: none; }
  summary.summary-row::after { transition: none; }
}
