/* Literature Atlas · one stylesheet, no build step. Colour tokens are defined once and re-mapped for dark mode. */
:root {
  --bg: #f7f7f4; --surface: #ffffff; --surface-2: #f0f0eb; --ink: #1d2327; --ink-2: #4a545c; --muted: #6b757d; --line: #dcdcd4;
  --accent: #1f5f8b; --accent-ink: #ffffff; --accent-soft: #e3eef6; --focus: #f0a202;
  --good: #2f7a4a; --good-soft: #e3f2e8; --warn: #9a6400; --warn-soft: #fbf0d8; --bad: #a33a2b; --bad-soft: #f8e3df;
  --info: #5a4a9a; --info-soft: #ece8f8; --neutral-soft: #ecece6;
  --mark: #fff1a8; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
  --radius: 8px; --rail: 300px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181b; --surface: #1b2024; --surface-2: #232a2f; --ink: #e6e9eb; --ink-2: #b9c0c5; --muted: #8d969c; --line: #323a40;
    --accent: #6fb3e0; --accent-ink: #0d1114; --accent-soft: #1f3343; --focus: #f0b429;
    --good: #6cc38c; --good-soft: #1d3326; --warn: #e2b04a; --warn-soft: #3a3020; --bad: #ec8a7a; --bad-soft: #3d2622;
    --info: #b3a6f0; --info-soft: #2b2742; --neutral-soft: #2a3035; --mark: #5a5020; --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1 { font-size: 1.45rem; line-height: 1.3; margin: .2rem 0 .4rem; } h2 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; } h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
code, .mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .tiny { font-size: .78rem; }
.skip-link { position: absolute; left: -999px; } .skip-link:focus { left: 8px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 50; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, .button { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; padding: 5px 11px; cursor: pointer; }
button:hover, .button:hover { border-color: var(--accent); text-decoration: none; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button[disabled] { opacity: .5; cursor: default; }
input[type=text], input[type=search], input[type=number], input[type=password], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
textarea { width: 100%; min-height: 4.5rem; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 8px 18px; background: var(--surface);
  border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--ink); letter-spacing: .01em; }
.topbar nav { display: flex; gap: 4px; } .topbar nav a { padding: 5px 10px; border-radius: 6px; color: var(--ink-2); }
.topbar nav a[aria-current=page] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.topsearch { flex: 1; max-width: 520px; } .topsearch input { width: 100%; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar form.inline { display: inline; }
main { padding: 16px 18px 120px; }
footer.caveat { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface-2); border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: .78rem; padding: 5px 18px; }

/* pills and badges */
.pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: .78rem; background: var(--neutral-soft); color: var(--ink-2);
  white-space: nowrap; border: 1px solid transparent; }
.pill.snapshot { font-family: var(--mono); }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0; }
.t-PHYSICIAN_REVIEWED { background: var(--good-soft); color: var(--good); border-color: var(--good); font-weight: 600; }
.t-MACHINE_VALIDATED { background: var(--accent-soft); color: var(--accent); }
.t-AI_REVIEWED_PROVISIONAL { background: var(--good-soft); color: var(--good); border: 1px dashed currentColor; }
.t-MACHINE_VALIDATED_WITH_FLAGS { background: var(--warn-soft); color: var(--warn); }
.t-MACHINE_UNVERIFIED { background: var(--bad-soft); color: var(--bad); }
.t-NO_BRIEF { background: var(--neutral-soft); color: var(--muted); }
.s-QUARANTINED, .s-INVALID_DRAFT_ONLY { background: var(--bad-soft); color: var(--bad); }
.s-ACTIVE, .s-RESERVED_UNTOUCHED, .s-EXPOSED_OR_PROTECTED { background: var(--info-soft); color: var(--info); }
.s-PARTIAL, .s-ABSTAINED { background: var(--warn-soft); color: var(--warn); }
.pill.flag { background: var(--warn-soft); color: var(--warn); }
.pill.family { background: var(--info-soft); color: var(--info); }
.pill.elig { background: transparent; border-color: var(--line); }
.chip { display: inline-block; margin: 2px 4px 2px 0; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; color: var(--ink-2); background: var(--surface); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.machine-label::after { content: " ·m"; color: var(--muted); font-size: .7em; }

/* layout with rail */
.with-rail { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: 18px; align-items: start; }
.rail { position: sticky; top: 60px; max-height: calc(100vh - 100px); overflow: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; }
.rail h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 4px; }
.rail details { border-top: 1px solid var(--line); padding: 4px 0; } .rail details:first-of-type { border-top: 0; }
.rail summary { cursor: pointer; font-weight: 600; font-size: .9rem; padding: 3px 0; }
.rail summary .count { font-weight: 400; color: var(--accent); }
.rail label.opt { display: flex; gap: 6px; align-items: baseline; font-size: .84rem; padding: 1px 0; }
.rail label.opt span.n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail .opts { max-height: 260px; overflow: auto; }
.rail .years { display: flex; gap: 6px; align-items: center; } .rail .years input { width: 5.5em; }
.rail .actions { position: sticky; bottom: -10px; background: var(--surface); padding: 8px 0 2px; display: flex; gap: 8px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 10px; }

/* results */
.results-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.results-toolbar .count { font-size: 1.05rem; font-weight: 600; }
ol.results { list-style: none; padding: 0; margin: 0; }
ol.results li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px; }
ol.results li.focused { outline: 2px solid var(--accent); }
ol.results li.selected { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
ol.results .title { font-weight: 600; color: var(--ink); } ol.results .meta { color: var(--muted); font-size: .84rem; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 14px 0; }

/* selection bar */
.selection-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 34px; z-index: 40; background: var(--ink); color: var(--bg);
  border-radius: 10px; padding: 8px 12px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); max-width: calc(100vw - 40px); flex-wrap: wrap; }
.selection-bar button { background: transparent; color: var(--bg); border-color: rgba(255,255,255,.35); }
@media (prefers-color-scheme: dark) { .selection-bar button { border-color: rgba(0,0,0,.35); } }
.selection-bar .sum { font-size: .84rem; opacity: .85; }
.toast { position: fixed; right: 18px; bottom: 90px; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; box-shadow: var(--shadow); }

/* article */
.article-page { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .9fr); gap: 22px; align-items: start; }
.article-page .crumbs { color: var(--muted); font-size: .84rem; margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.card.warn { border-color: var(--warn); } .card.good { border-color: var(--good); }
.brief-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
dl.pico { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 12px; margin: 8px 0; }
dl.pico dt { color: var(--muted); font-size: .86rem; } dl.pico dd { margin: 0; }
.finding { border-left: 3px solid var(--accent); background: var(--surface); padding: 8px 12px; margin: 10px 0; border-radius: 0 6px 6px 0; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.finding .fid { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin-right: 6px; }
.finding .stmt { font-weight: 600; }
.finding table.kv { border-collapse: collapse; margin: 6px 0; font-size: .88rem; width: 100%; }
.finding table.kv th { text-align: left; color: var(--muted); font-weight: 500; width: 165px; vertical-align: top; padding: 2px 8px 2px 0; }
.finding table.kv td { padding: 2px 0; vertical-align: top; }
.basis { font-size: .75rem; } .basis.not_established { background: var(--warn-soft); color: var(--warn); }
.prov { font-family: var(--mono); font-size: .74rem; color: var(--muted); margin-top: 6px; word-break: break-all; }
a.ref { font-family: var(--mono); font-size: .76rem; background: var(--accent-soft); border-radius: 4px; padding: 0 5px; margin-right: 3px; white-space: nowrap; }
.source-col { position: sticky; top: 60px; max-height: calc(100vh - 100px); overflow: auto; }
.source-col h2 { margin-top: 0; }
.unit { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; margin: 6px 0; scroll-margin-top: 70px; }
.unit:target, .unit.hl { background: var(--mark); border-color: var(--warn); }
.unit .loc { font-family: var(--mono); font-size: .74rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.unit p { margin: 4px 0 0; white-space: pre-wrap; font-size: .9rem; }
.unit table.row { border-collapse: collapse; font-size: .82rem; margin-top: 4px; } .unit table.row td { border: 1px solid var(--line); padding: 2px 5px; }
.notice { background: var(--warn-soft); color: var(--ink); border: 1px solid var(--warn); border-radius: 8px; padding: 8px 12px; margin: 8px 0 12px; font-size: .9rem; }
.notice.info { background: var(--accent-soft); border-color: var(--accent); }
table.data { border-collapse: collapse; width: 100%; font-size: .88rem; background: var(--surface); }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.review-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.review-grid div { background: var(--good-soft); border-radius: 6px; padding: 5px 7px; font-size: .82rem; }
.review-grid div b { display: block; color: var(--muted); font-weight: 500; font-size: .72rem; text-transform: uppercase; }

/* compare */
.compare { overflow-x: auto; } .compare table { min-width: 900px; table-layout: fixed; }
.compare td { font-size: .86rem; } .compare th.rowh { width: 150px; }
.compare .f { border-top: 1px dashed var(--line); padding-top: 4px; margin-top: 4px; }

/* matrix */
.matrix-wrap { overflow: auto; max-height: calc(100vh - 210px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.matrix { border-collapse: separate; border-spacing: 0; font-size: .8rem; }
table.matrix th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; padding: 4px; vertical-align: bottom; border-bottom: 1px solid var(--line); }
table.matrix th.col { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 170px; white-space: nowrap; font-weight: 500; }
table.matrix th.rowh { position: sticky; left: 0; z-index: 1; background: var(--surface-2); text-align: left; white-space: nowrap; font-weight: 500; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.matrix th.corner { left: 0; z-index: 3; }
table.matrix td { padding: 2px; border-bottom: 1px solid var(--surface-2); }
.cell { display: block; width: 58px; min-height: 38px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); padding: 2px 3px; text-align: left; color: var(--ink); cursor: pointer; }
.cell:hover { border-color: var(--accent); text-decoration: none; }
.cell .n { font-weight: 700; font-size: .86rem; } .cell .cov { font-size: .66rem; color: var(--muted); }
.cell.s1 { background: var(--surface-2); } .cell.s2 { background: var(--neutral-soft); }
.cell.empty { border-style: dashed; color: var(--muted); background: transparent; cursor: default; text-align: center; }
.mix { display: flex; height: 4px; border-radius: 2px; overflow: hidden; margin-top: 2px; background: var(--line); }
.mix i { display: block; height: 100%; }
.g-rct { background: #1f5f8b; } .g-prospective { background: #3f8f6b; } .g-retrospective { background: #8fb36b; } .g-diagnostic_accuracy { background: #c49a2c; }
.g-case { background: #b26a4a; } .g-review_sr_guideline { background: #7d6bb0; } .g-other { background: #9aa3a8; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .78rem; color: var(--ink-2); align-items: center; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 3px; vertical-align: -1px; }

/* map */
body.map-page main { padding: 0; }
.map-layout { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); height: calc(100vh - 49px - 28px); }
.map-layout .rail { position: relative; top: 0; max-height: none; height: 100%; border-radius: 0; border-width: 0 1px 0 0; }
.map-stage { position: relative; overflow: hidden; background: var(--surface); }
.map-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.map-toolbar { position: absolute; top: 10px; left: 10px; z-index: 5; display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; box-shadow: var(--shadow); }
.map-toolbar .seg button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.map-toolbar .map-which .button { text-decoration: none; white-space: nowrap; }
.map-toolbar .map-which .button.is-current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.map-toolbar .map-which .button.is-off { color: var(--muted); cursor: not-allowed; }
.map-legend { position: absolute; right: 10px; bottom: 10px; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 9px; max-width: 280px; max-height: 45%; overflow: auto; font-size: .78rem; box-shadow: var(--shadow); }
.map-legend .row { display: flex; align-items: center; gap: 6px; } .map-legend .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.map-tooltip { position: absolute; z-index: 6; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 8px; max-width: 360px; font-size: .82rem; box-shadow: var(--shadow); }
.map-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 46vw); z-index: 7; background: var(--bg); border-left: 1px solid var(--line);
  overflow: auto; padding: 10px 14px; box-shadow: -4px 0 14px rgba(0,0,0,.08); }
.map-drawer .close { position: sticky; top: 0; float: right; z-index: 2; }
.map-drawer .article-page { display: block; } .map-drawer .source-col { position: static; max-height: none; }
.map-status { position: absolute; left: 10px; bottom: 10px; z-index: 5; font-size: .78rem; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.cluster-list { max-height: 220px; overflow: auto; } .cluster-list li { cursor: pointer; } .cluster-list li[aria-selected=true] { background: var(--accent-soft); }
.empty-state { max-width: 640px; margin: 40px auto; }

@media (max-width: 1000px) {
  .with-rail, .article-page, .map-layout { grid-template-columns: 1fr; }
  .rail, .source-col { position: static; max-height: none; }
  .map-layout { height: auto; } .map-stage { height: 70vh; }
}
@media print { .topbar, .rail, .selection-bar, footer.caveat, .no-print { display: none !important; } .article-page { display: block; } }

/* question workbench */
.block { display: block; }
.summary-chip { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: baseline; background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: 999px; padding: 4px 14px; font-size: .9rem; margin: 6px 0 10px; }
details.card > summary { cursor: pointer; }
.pico { display: grid; gap: 8px; margin: 10px 0; }
.pico-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: start; border-top: 1px solid var(--line); padding-top: 8px; }
.pico-label { font-weight: 600; font-size: .9rem; padding-top: 3px; }
ul.chips { list-style: none; display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 6px 4px 0; vertical-align: middle; }
.chip.pico-chip { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); font-size: .86rem; }
.pico-chip .x { border: 0; background: transparent; padding: 0 2px; color: var(--muted); line-height: 1; }
input[data-chip-input] { min-width: 280px; }
ul.resolves { list-style: none; padding: 0; margin: 4px 0 0; color: var(--ink-2); }
fieldset.filters { border: 1px solid var(--line); border-radius: 6px; margin: 8px 0; padding: 4px 10px 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
fieldset.filters legend { font-size: .8rem; color: var(--muted); }
fieldset.filters label.opt { font-size: .86rem; }
button.danger { color: var(--bad); border-color: var(--bad); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.tabs a[aria-current=page] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
ol.results.cands li { grid-template-columns: 22px minmax(0, 1fr) 280px; }
ol.results.cands li.empty { display: block; }
ol.results.cands li.previewing { outline: 2px solid var(--accent); }
button.linkish { border: 0; background: none; padding: 0; color: var(--accent); font-size: inherit; }
button.linkish:hover { text-decoration: underline; }
.suggest { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; margin: 10px 0; }
.suggest-row { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-top: 6px; }
.suggest-row b { min-width: 100px; font-size: .86rem; }
.suggest-row label.opt { font-size: .88rem; }
.bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 2px; }
.bulk .reason-form { flex-basis: 100%; max-width: 520px; }
.wb-drawer { position: fixed; top: 49px; right: 0; bottom: 28px; width: min(680px, 52vw); z-index: 35; background: var(--bg);
  border-left: 1px solid var(--line); overflow: auto; padding: 0 14px 14px; box-shadow: -4px 0 14px rgba(0,0,0,.12); }
.wb-drawer-head { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px 0; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wb-drawer-head .close { margin-left: auto; }
.wb-drawer-head [data-drawer-reason] { flex-basis: 100%; }
.wb-drawer .article-page { display: block; } .wb-drawer .source-col { position: static; max-height: none; }
ol.results.cands li.d-included { box-shadow: inset 4px 0 0 var(--good); }
ol.results.cands li.d-excluded { box-shadow: inset 4px 0 0 var(--bad); }
ol.results.cands li.d-excluded .title { color: var(--ink-2); }
.why { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.why .score { font-family: var(--mono); font-size: .78rem; color: var(--ink-2); }
.why-field b { font-weight: 600; font-size: .78rem; color: var(--muted); margin-right: 2px; }
.decision .state { margin-bottom: 6px; }
.decision .buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.pill.d-pill.included { background: var(--good-soft); color: var(--good); border-color: var(--good); font-weight: 600; }
.pill.d-pill.excluded { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); font-weight: 600; }
.reason { color: var(--ink-2); margin-top: 3px; }
.reason-form { display: grid; gap: 6px; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.reason-form select, .reason-form input { width: 100%; }
@media (max-width: 1000px) { ol.results.cands li, .pico-row { grid-template-columns: 1fr; } .wb-drawer { width: 100vw; } }

.full { width: 100%; } .m0 { margin: 0; } .mt0 { margin-top: 0; } .mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; }
.selection-bar[hidden], .map-tooltip[hidden], .map-drawer[hidden], .wb-drawer[hidden], .suggest[hidden] { display: none; }

/* evidence table, comparison records and descriptive visuals (Phase 2c); marks use tokens so dark mode follows */
.ev-nav { margin: 8px 0 4px; }
.glance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px 28px; }
figure.mini { margin: 0; } figure.mini.wide { grid-column: 1 / -1; }
figure.mini figcaption { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
table.bars { border-collapse: collapse; font-size: .84rem; }
table.bars th { text-align: left; font-weight: 400; color: var(--ink-2); padding: 2px 10px 2px 0; white-space: nowrap; }
table.bars td { padding: 2px 0; } table.bars td.num { padding-left: 8px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
svg.bar { display: block; }
.bar-fill { fill: var(--accent); }
svg.years { width: 100%; max-width: 640px; height: auto; display: block; }
svg.years .axis { stroke: var(--line); stroke-width: 1; }
svg.years text { fill: var(--muted); font-size: 11px; text-anchor: middle; } svg.years text.cap { fill: var(--ink-2); }
.forest-panel { margin-top: 12px; }
table.forest { border-collapse: collapse; width: 100%; font-size: .86rem; }
table.forest th, table.forest td { padding: 3px 8px; border-bottom: 1px solid var(--surface-2); text-align: left; vertical-align: middle; }
table.forest thead th { color: var(--muted); font-weight: 600; font-size: .8rem; }
table.forest .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.forest th.plot, table.forest td.plot { width: 336px; padding: 0 8px; }
table.forest tr.arm-head th { color: var(--ink); background: var(--surface-2); font-size: .84rem; }
.fp-axis text { fill: var(--muted); font-size: 10px; text-anchor: middle; }
.fp-axis line, .fp-grid { stroke: var(--line); stroke-width: 1; }
.fp-ci { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.fp-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.pill.rec-proposed { background: var(--warn-soft); color: var(--warn); }
.pill.rec-confirmed { background: var(--good-soft); color: var(--good); border-color: var(--good); font-weight: 600; }
.pill.rec-rejected { background: var(--neutral-soft); color: var(--muted); text-decoration: line-through; }
a.pill:hover { text-decoration: none; border-color: var(--accent); }
table.records td.actions-cell { white-space: nowrap; }
table.ev-findings td { font-size: .86rem; } table.ev-findings th { white-space: nowrap; }
table.ev-findings td:first-child { min-width: 240px; }
details.quoted .unit { margin: 4px 0; } details.quoted .unit p { font-size: .82rem; }
.ev-pico { grid-template-columns: 190px minmax(0, 1fr); }
.record-form { margin: 6px 0; padding: 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); }
.record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 12px; margin-top: 6px; }
.record-grid label { display: grid; gap: 2px; font-size: .84rem; color: var(--ink-2); }
.record-grid .span2 { grid-column: 1 / -1; }
.record-grid input, .record-grid select { width: 100%; }
table.defs td:first-child { width: 45%; }
ul.plain { list-style: none; margin: 0; padding: 0; } ul.plain li { margin: 2px 0; }
table.data.compact { width: auto; }
.form-slot[hidden] { display: none; }

/* network view (Phase 3, gated and exploratory); marks use tokens so dark mode follows */
ul.gates { display: grid; gap: 6px; }
.gate { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; }
.gate.pass { border-color: var(--good); background: var(--good-soft); }
.gate.fail { border-color: var(--bad); background: var(--bad-soft); }
.gate.pending { border-color: var(--warn); background: var(--warn-soft); }
.gate-mark { font-weight: 700; text-align: center; }
.gate.pass .gate-mark { color: var(--good); } .gate.fail .gate-mark { color: var(--bad); } .gate.pending .gate-mark { color: var(--warn); }
.gate-items { margin-top: 3px; }
.pill.gate-ok { background: var(--good-soft); color: var(--good); border-color: var(--good); font-weight: 600; }
.pill.gate-no { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); font-weight: 600; }
.net-grid { display: grid; grid-template-columns: minmax(0, 560px) minmax(260px, 1fr); gap: 16px; align-items: start; }
figure.netfig { margin: 0; }
svg.netgraph { width: 100%; height: auto; display: block; background: var(--surface-2); border-radius: 8px; }
.netgraph .edge line { stroke: var(--accent); stroke-opacity: .55; stroke-linecap: round; }
.netgraph .edge-label { fill: var(--ink-2); font-size: 11px; text-anchor: middle; paint-order: stroke; stroke: var(--surface-2); stroke-width: 3px; }
.netgraph .node circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.netgraph .node.isolated circle { fill: var(--surface); stroke: var(--muted); stroke-dasharray: 3 3; }
.netgraph .node-label { fill: var(--ink); font-size: 13px; font-weight: 600; }
.netgraph .node-sub { fill: var(--muted); font-size: 11px; }
table.map-table input[type=text] { width: 100%; max-width: 280px; }
.unused-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 18px; }
.unused-grid > div { border-top: 1px solid var(--line); padding-top: 4px; }
.edge-table h3 { margin-bottom: 4px; }
.decision-box { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.decision-box.current { border-color: var(--good); } .decision-box.stale { border-color: var(--warn); background: var(--warn-soft); }
.decision-form { margin-top: 8px; padding: 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); }
.decision-form fieldset.filters { margin: 0; }
.result-label { font-weight: 700; padding: 8px 12px; border-radius: 8px; border: 2px solid var(--info); background: var(--info-soft); color: var(--ink); margin-bottom: 8px; }
table.nma-forest th.plot, table.nma-forest td.plot { width: 376px; }
.fp-one { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 2; }
.fp-est { fill: var(--accent); }
.league-wrap { overflow-x: auto; }
table.league { border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
table.league td, table.league th { border: 1px solid var(--line); padding: 4px 8px; text-align: center; min-width: 96px; }
table.league th.diag { background: var(--accent-soft); color: var(--accent); }
table.league td.ev-dir, .pill.ev-dir { background: var(--good-soft); }
table.league td.ev-mix, .pill.ev-mix { background: var(--surface); }
table.league td.ev-ind, .pill.ev-ind { background: var(--warn-soft); }
.pill.ev-dir { color: var(--good); } .pill.ev-ind { color: var(--warn); } .pill.ev-mix { border-color: var(--line); }
@media (max-width: 1000px) { .net-grid { grid-template-columns: 1fr; } }

/* map legend: categories are toggle buttons (highlight one category and zoom to it) */
.map-legend button.row { width: 100%; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font: inherit; text-align: left;
  padding: 1px 4px; margin: 0 -4px; cursor: pointer; }
.map-legend button.row:hover { background: var(--surface-2); }
.map-legend button.row[aria-pressed=true] { background: var(--accent-soft); font-weight: 600; }
.map-legend button.row.off { opacity: .5; }
.map-legend .row .n { margin-left: auto; padding-left: 8px; font-variant-numeric: tabular-nums; }
.map-legend .legend-actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.map-legend .legend-actions button { font-size: .76rem; padding: 2px 7px; }

/* filter rail: include (checkbox) or exclude ("not") per value */
.rail div.opt { display: flex; gap: 6px; align-items: baseline; font-size: .84rem; padding: 1px 0; }
.rail div.opt label.inc { display: flex; gap: 6px; align-items: baseline; flex: 1; min-width: 0; }
.rail div.opt span.n { color: var(--muted); font-variant-numeric: tabular-nums; }
.rail div.opt label.ex { display: inline-flex; align-items: center; gap: 2px; font-size: .7rem; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 6px; cursor: pointer; white-space: nowrap; }
.rail div.opt label.ex input { width: 11px; height: 11px; margin: 0; }
.rail div.opt label.ex:hover { border-color: var(--bad); color: var(--bad); }
.rail div.opt.is-excluded label.ex { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); font-weight: 600; }
.rail div.opt.is-excluded label.inc span { text-decoration: line-through; color: var(--ink-2); }
.chip.active.not { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
/* Public tester preview (templates/public/): banner, preview pill, single-column article (no source column). */
.preview-banner { margin: 0; padding: 6px 16px; background: var(--info-soft); color: var(--ink); border-bottom: 1px solid var(--line); font-size: .84rem; }
.pill.preview { background: var(--info-soft); color: var(--info); font-size: .7rem; vertical-align: middle; }
.article-page.single { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
.withheld { color: var(--muted); font-style: italic; font-size: .86rem; }
/* Question tree and summary pages (build step F1): evidence-tier labels, direction chips, gaps; marks use tokens so dark mode follows. */
.pill.lab-ai_draft { background: var(--neutral-soft); color: var(--ink-2); border-color: var(--line); }
.pill.lab-ai_reviewed { background: var(--info-soft); color: var(--info); border-color: var(--info); }
.pill.lab-physician_confirmed { background: var(--good-soft); color: var(--good); border-color: var(--good); font-weight: 600; }
.pill.muted-pill { background: transparent; border-color: var(--line); color: var(--muted); }
.pill.tiny-pill { font-size: .7rem; padding: 0 7px; }
.pill.gap { background: var(--bad-soft); color: var(--bad); }
.pill.gap-not_started, .pill.gap-not_screened { background: var(--surface-2); color: var(--muted); }
.pill.dir { font-weight: 600; }
.pill.dir-favours_intervention, .pill.dir-favours_comparator { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.pill.dir-similar { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.pill.dir-mixed { background: var(--warn-soft); color: var(--warn); }
.pill.dir-single_arm_only, .pill.dir-not_enough_data, .pill.dir-not_assessed { background: transparent; color: var(--muted); border-color: var(--line); }
ul.tq-list { list-style: none; margin: 0; padding: 0 0 0 18px; } ul.tq-list.tq-root { padding-left: 0; }
.tq-node { margin: 2px 0; } .tq-node > details > summary { cursor: pointer; list-style-position: outside; }
.tq-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 3px 0; }
.tq-domain > details > summary .tq-title { font-weight: 700; } .tq-group > details > summary .tq-title { font-weight: 600; }
.tq-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.tq-badge { font-size: .76rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; background: var(--surface); }
.tq-note { margin: 2px 0 4px 18px; }
.status-line { font-size: .9rem; margin: 6px 0 10px; }
.table-scroll { overflow-x: auto; }
table.glance-table { width: 100%; border-collapse: collapse; }
table.glance-table th, table.glance-table td { padding: 6px 8px; border-bottom: 1px solid var(--surface-2); text-align: left; vertical-align: top; }
table.glance-table thead th { color: var(--muted); font-size: .8rem; font-weight: 600; }
table.glance-table td:nth-child(3) { min-width: 260px; } table.glance-table td:nth-child(4) { min-width: 170px; }
.gl-row-evidence { margin-top: 14px; } .gl-row-evidence h3 { margin-bottom: 4px; }
.fp-dot.gl-arm1 { fill: var(--info); }
.fp-dot.derived { fill: var(--surface); stroke: var(--accent); stroke-width: 2; } .fp-dot.gl-arm1.derived { stroke: var(--info); }
dl.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }
ul.versions { margin: 0; padding-left: 18px; }
ol.open-questions li { margin-bottom: 8px; }
.flag-text { color: var(--warn); }
@media (max-width: 760px) { dl.kv { grid-template-columns: minmax(0, 1fr); } table.glance-table td:nth-child(3), table.glance-table td:nth-child(4) { min-width: 0; } }
/* Citation reminder before downloads and coarse locators (build step F3). */
dialog.cite-dialog { max-width: 560px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); padding: 16px 18px; box-shadow: var(--shadow); }
dialog.cite-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.cite-text { font-size: .92rem; background: var(--surface-2); border-radius: 6px; padding: 8px 10px; user-select: all; }
dialog.cite-dialog .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
p.locators { margin: 2px 0 4px; }
/* Two design attributes (owner 2026-10-27): Randomized pills. */
.pill.rz-yes { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.pill.rz-probable { background: var(--warn-soft); color: var(--warn); }
.pill.rz-no { background: var(--neutral-soft); color: var(--ink-2); }
p.design-attrs { margin: 4px 0 8px; }

/* Map modes and dot sizes (owner 2026-10-28) */
.map-legend .size-legend { margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.map-legend .size-ticks, .map-legend .share-scale { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin: 4px 0; }
.map-legend .tick { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.map-legend .rel-list { margin: 6px 0 0; padding-left: 18px; max-height: 38vh; overflow: auto; }
.map-legend .rel-list li { margin-bottom: 5px; }
.map-legend .warn { color: var(--warn); }
.map-toolbar select:disabled { opacity: .5; }
.map-focus { position: absolute; left: 10px; z-index: 5; max-width: min(560px, 60%); background: var(--surface); border: 1px solid var(--accent);
  border-radius: 8px; padding: 7px 10px; box-shadow: var(--shadow); font-size: .82rem; }
.map-focus .focus-head { display: flex; flex-direction: column; gap: 1px; }
.map-focus .focus-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.map-focus .focus-actions button { font-size: .78rem; padding: 3px 8px; }
.map-focus .focus-actions button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.map-legend .min-score { display: block; margin: 4px 0; } .map-legend .min-score select { font-size: .74rem; padding: 0 2px; margin: 0 3px; }

/* WS1 physician review (atlas_ui/review.py) */
.pill.rv-verified { background: var(--good-soft); color: var(--good); border-color: var(--good); font-weight: 600; }
.pill.rv-disagree { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.pill.rv-pending { background: var(--warn-soft); color: var(--warn); }
.rv-unit mark { background: var(--mark); color: inherit; outline: 1px solid var(--warn); border-radius: 3px; padding: 0 2px; }
.rv-form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 0 0 8px; }
.rv-form label.block { display: block; margin: 3px 0; }
.rv-values { font-size: 1.05rem; }
details.rv-promote { margin-top: 6px; }
details.rv-promote form { margin-top: 6px; }
.rv-coding { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px 8px; margin: 8px 0 0; min-width: 0; }
.rv-code { display: grid; gap: 2px; align-content: start; }
/* R2.6a source pane: extraction and decision on the left, the PDF on the right; stacked below 1100px (no horizontal scroll) */
.rv-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
.rv-main, .rv-side { min-width: 0; }
.rv-side { position: sticky; top: 60px; }
.rv-side .rv-pdf { margin-top: 12px; max-height: calc(100vh - 84px); display: flex; flex-direction: column; }
.rv-pdf .rv-pages { position: relative; overflow: auto; flex: 1 1 auto; min-height: 0; }
.rv-pdf blockquote { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--surface-2); }
.rv-drop { border: 2px dashed var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: var(--surface-2); }
.rv-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.rv-drop .m0, .rv-pdf .m0 { margin: 0; }
.rv-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; padding: 0; list-style: none; }
.rv-chips button.chip { cursor: pointer; text-align: left; }
.chip.rv-found { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.chip.rv-machine { border-style: dashed; color: var(--ink-2); background: transparent; cursor: help; }
.chip.rv-partial { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.chip.rv-missing { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.rv-page { position: relative; width: 100%; margin: 0 0 10px; background: #fff; box-shadow: var(--shadow); }
.rv-page canvas { display: block; width: 100%; height: 100%; }
.rv-page .rv-num { position: absolute; right: 6px; top: 4px; font-size: .72rem; color: #555; background: rgba(255,255,255,.85); padding: 0 5px; border-radius: 4px; }
.rv-hl { position: absolute; background: rgba(255, 214, 0, .32); outline: 1px solid rgba(154, 100, 0, .55); pointer-events: none; mix-blend-mode: multiply; }
.rv-hl.rv-hl-value { background: rgba(255, 140, 0, .45); outline: 2px solid #b35900; }
.rv-hl.rv-hl-off { display: none; }
/* full-text reader of the source pane (atlas-review-reader/1) */
.rv-tabs { display: flex; gap: 4px; margin: 4px 0 8px; }
.rv-tabs button[aria-selected="true"] { background: var(--accent-soft, #e8f0fe); border-color: var(--accent, #1a56db); font-weight: 600; }
.rv-pdf [data-pdf-view], .rv-pdf .rv-reader-view { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.rv-pdf [data-pdf-view][hidden], .rv-pdf .rv-reader-view[hidden] { display: none; }
.rv-reader { overflow: auto; flex: 1 1 auto; min-height: 0; font-size: .92rem; line-height: 1.5; padding-right: 4px; }
.rv-rd-title { font-weight: 600; margin: 0 0 2px; }
.rv-rd-section h3 { font-size: .95rem; margin: 14px 0 4px; }
.rv-rd-unit { margin: 0 0 8px; }
.rv-rd-table { margin: 12px 0; }
.rv-rd-scroll { overflow-x: auto; }
.rv-rd-grid { border-collapse: collapse; font-size: .85rem; }
.rv-rd-grid th, .rv-rd-grid td { border: 1px solid var(--line, #d0d7de); padding: 2px 6px; vertical-align: top; text-align: left; }
.rv-rd-grid thead th { background: var(--surface-2); }
.rv-rd-anchor { background: rgba(255, 214, 0, .22); outline: 1px solid rgba(154, 100, 0, .45); }
.rv-rd-cell { background: rgba(255, 140, 0, .30); outline: 2px solid #b35900; }
mark.rv-rd-value { background: rgba(255, 140, 0, .45); outline: 1px solid #b35900; }
.rv-rd-anchor.rv-rd-off, .rv-rd-cell.rv-rd-off { background: none; outline: none; }
mark.rv-rd-value.rv-rd-off { background: none; outline: none; }
/* One paper on one page (review_paper.html): one card per value; the focused row's cells are the ones marked in the PDF pane. */
.rv-row { border-left: 4px solid var(--line); scroll-margin-top: 70px; }
.rv-row.rv-row-todo { border-left-color: var(--warn); }
.rv-row.rv-row-submitted { border-left-color: var(--good); }
.rv-row.rv-focus { box-shadow: 0 0 0 2px var(--accent); }
.rv-row-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 1.02rem; }
.rv-row-n { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; }
.rv-row-h .rv-state { margin-left: auto; }
.rv-check { margin: 4px 0 8px; }
.rv-check .rv-values { font-size: 1.12rem; }
.rv-decide { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 8px 0 0; }
.rv-decide legend { font-weight: 600; }
.rv-more { margin-top: 8px; }
.notice.rv-error { background: var(--bad-soft); border-color: var(--bad); }
.rv-paper-actions { position: sticky; bottom: 30px; z-index: 21; background: var(--surface); padding: 8px 0; display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); }
@media (max-width: 1100px) {
  .rv-split { grid-template-columns: minmax(0, 1fr); }
  .rv-side { position: static; }
  .rv-side .rv-pdf { max-height: none; display: block; }
}

/* WS3 protocol and screening (atlas_ui/screening.py) */
.prisma-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.prisma-box { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); }
.prisma-box h3 { margin: 0 0 4px; font-size: .95rem; }
.prisma-box.included { border-color: var(--good); }

/* WS4 synthesis (atlas_ui/synthesis.py) */
table.forest svg line.ci { stroke: var(--ink-2); stroke-width: 1.5; }
table.forest svg line.ref { stroke: var(--line); stroke-dasharray: 3 3; }
table.forest svg rect.pt { fill: var(--accent); }
table.forest svg path.diamond { fill: var(--good); }
ul.gates li.gate { margin: 2px 0; }


/* "Understood as" panel (R1.1): how a search was read; every chip can be removed or edited, an ambiguous term is a choice. */
.understood { margin: 8px 0 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: .84rem; }
.understood.card { margin: 10px 0; padding: 8px 12px; }
.u-head { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.u-terms { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 4px; }
.u-field { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: start; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 4px; }
.u-term { line-height: 1.7; }
.u-ask { color: var(--ink-2); }
.u-choices { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.u-choice { font-size: .8rem; padding: 1px 8px; }
.u-choice.u-chosen { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.u-chip { border-radius: 10px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.u-chip.u-typed { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); font-weight: 600; }
.u-chip.u-off { opacity: .62; }
.u-chip.u-off .u-text { text-decoration: line-through; }
.u-chip.u-filter.not { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.u-act { border: 0; background: transparent; padding: 0 2px; margin-left: 2px; color: var(--muted); text-decoration: none; font-size: .9em; line-height: 1; cursor: pointer; }
.u-act:hover, .u-act:focus { color: var(--accent); }
.u-input { font-size: .8rem; padding: 0 4px; width: 16em; max-width: 100%; }
.u-group { margin-top: 4px; }
.u-add { display: block; }
.u-fts { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.u-matched { list-style: none; padding: 0; margin: 2px 0 0; }
/* Restrict versus rank (R1.2): what each restriction removes, and the per-chip "must" toggle that makes a ranking chip a restriction too. */
.restrictions { margin: 6px 0 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.r-list { margin: 4px 0; display: grid; gap: 2px; }
.r-row { padding: 2px 6px; border-left: 3px solid var(--line); overflow-wrap: anywhere; }
.r-row.r-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.pico-chip .req { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 0 5px; margin-left: 2px; font-size: .72rem; color: var(--muted); line-height: 1.3; cursor: pointer; }
.pico-chip .req[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 600; }
.chip.pico-chip.required { border-width: 2px; border-color: var(--ink); }
.req-mark { font-size: .72rem; font-weight: 600; color: var(--ink); border: 1px solid var(--ink); border-radius: 8px; padding: 0 5px; }
/* Public brief fact table (templates/public/_article_body.html). Stacks by its own width, so a phone, a narrow iframe and the map drawer behave alike. */
.brief-fit { container-type: inline-size; margin-top: 8px; }
table.brief-table { border-collapse: collapse; width: 100%; font-size: .9rem; overflow-wrap: anywhere; }
table.brief-table > tbody > tr > th, table.brief-table > tbody > tr > td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
table.brief-table > tbody > tr > th[scope="row"] { width: 170px; color: var(--muted); font-weight: 500; }
table.brief-table > tbody > tr.bt-head > th { background: var(--surface-2); color: var(--ink); font-weight: 600; }
table.brief-table > tbody > tr > td.bt-wide { padding: 6px 0 10px; }
.bt-wide > p { margin: 2px 8px; } p.bt-note { margin: 0 8px 6px; }
ul.bt-list { margin: 0; padding-left: 18px; }
table.finding-grid { border-collapse: collapse; width: 100%; font-size: .82rem; table-layout: fixed; }
table.finding-grid th:nth-child(1) { width: 21%; } table.finding-grid th:nth-child(2) { width: 25%; }
table.finding-grid th:nth-child(3), table.finding-grid th:nth-child(4) { width: 14%; }
table.finding-grid th:nth-child(5), table.finding-grid th:nth-child(6) { width: 9%; } table.finding-grid th:nth-child(7) { width: 8%; }
table.finding-grid th, table.finding-grid td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
table.finding-grid th { color: var(--muted); font-weight: 600; font-size: .76rem; }
table.finding-grid .fid { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
table.finding-grid .pill { white-space: normal; }
table.finding-grid p.locators { margin: 0; }
@container (max-width: 720px) {
  table.brief-table, table.brief-table > tbody, table.brief-table > tbody > tr, table.brief-table > tbody > tr > th, table.brief-table > tbody > tr > td { display: block; width: auto; }
  table.brief-table > tbody > tr > th[scope="row"] { width: auto; border-bottom: 0; padding-bottom: 0; }
  table.finding-grid, table.finding-grid tbody, table.finding-grid tr, table.finding-grid td { display: block; }
  table.finding-grid thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.finding-grid tr { border-bottom: 2px solid var(--line); padding: 4px 0; }
  table.finding-grid td { border-bottom: 0; padding: 2px 8px; }
  table.finding-grid td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 600; }
}
/* The public tier labels are long: they wrap instead of forcing the page wide. The snapshot pill does the same in the topbar at phone width. */
body.public .pill.t-MACHINE_VALIDATED, body.public .pill.t-MACHINE_VALIDATED_WITH_FLAGS, body.public .pill.t-MACHINE_UNVERIFIED, body.public .pill.t-AI_REVIEWED_PROVISIONAL { white-space: normal; }
@media (max-width: 760px) {
  body.public .topbar { flex-wrap: wrap; gap: 6px 12px; }
  body.public .topbar .right { margin-left: 0; min-width: 0; }
  body.public .pill.snapshot { white-space: normal; overflow-wrap: anywhere; }
}
/* Ask in your own words (templates/ask.html, static/js/ask.js) */
.qt-text { width: 100%; box-sizing: border-box; font: inherit; }
.qt-grid { display: grid; grid-template-columns: minmax(220px, 1fr) 2.4fr; gap: 12px; align-items: start; }
@media (max-width: 860px) { .qt-grid { grid-template-columns: 1fr; } }
.qt-original { font-size: 1.05rem; white-space: pre-wrap; }
.qt-terms input[type="text"] { width: 100%; min-width: 12em; box-sizing: border-box; }
.qt-choice { display: block; white-space: nowrap; }
.qt-part + .qt-part { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }

/* evidence spaces (atlas_spaces): Primary / Emerging / Synthesis & Guidance / All Literature */
.spacebar { display: flex; align-items: center; gap: 10px 16px; height: 40px; padding: 0 18px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: none; }
.spacebar::-webkit-scrollbar { display: none; }
.space-switch, .space-tabs { display: flex; gap: 4px; }
.space-link, .space-tab { padding: 3px 9px; border-radius: 6px; color: var(--ink-2); border: 1px solid transparent; }
.space-link.is-current { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.space-tab { font-size: .86rem; } .space-tab.sub { font-size: .8rem; }
.space-tab.is-current { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); font-weight: 600; }
.space-link .n, .space-tab .n, .space-layer .n { opacity: .75; font-size: .8em; }
.space-layer { font-size: .86rem; padding: 3px 9px; border: 1px dashed var(--line); border-radius: 6px; color: var(--ink-2); }
.space-layer.is-on { border-style: solid; background: var(--warn-soft); color: var(--warn); }
.space-coverage { margin-left: auto; }
body.has-spacebar .map-layout { height: calc(100vh - 49px - 40px - 28px); }
.space-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 14px 0; }
.space-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.space-card.is-default { border-color: var(--accent); }
.space-card .question { font-style: italic; color: var(--ink-2); margin: .2rem 0 .4rem; }
.space-card .actions { margin-bottom: 0; }
.pill.pubcat { background: var(--info-soft); color: var(--info); }
.classification .pill.machine { font-weight: 400; font-size: .78rem; vertical-align: middle; }
