/* catalog-eval — layered over Pico. Restrained, clear hierarchy, one green accent. */
:root {
  --accent: #16794f;
  --accent-weak: #e7f2ec;   /* light tints — overridden for dark theme below */
  --flag: #9a5b00;
  --flag-weak: #fbeed9;
  --flag-border: #e6c894;
  --btn-fill: #e9ecec;      /* unselected pill fill */
  --danger: #b4453a;        /* weak / exclude in charts */
  --pico-primary: var(--accent);
  --pico-primary-background: var(--accent);
  --pico-primary-hover-background: #12633f;
  --pico-primary-focus: rgba(22, 121, 79, 0.28);
  --pico-primary-hover: #12633f;
}
/* dark theme: swap the light tints for dark equivalents so nothing glares / goes white-on-white */
@media (prefers-color-scheme: dark) {
  :root {
    --accent-weak: #173a2d;
    --flag: #d8a24e;
    --flag-weak: #3a2c14;
    --flag-border: #6b552c;
    --btn-fill: #2b302f;
    --danger: #d9776c;
  }
}
:root[data-theme="dark"] {
  --accent-weak: #173a2d;
  --flag: #d8a24e;
  --flag-weak: #3a2c14;
  --flag-border: #6b552c;
  --btn-fill: #2b302f;
  --danger: #d9776c;
}
:root[data-theme="light"] {
  --accent-weak: #e7f2ec;
  --flag: #9a5b00;
  --flag-weak: #fbeed9;
  --flag-border: #e6c894;
  --btn-fill: #e9ecec;
  --danger: #b4453a;
}
body { --pico-font-size: 100%; }
.muted { color: var(--pico-muted-color); }
.small { font-size: 13px; }
[hidden] { display: none !important; }   /* JS filter relies on the hidden attribute */

/* ── admin (read-only monitor + export) ──────────────────────────────── */
.topbar .admin-tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--pico-muted-color); border: 1px solid var(--pico-muted-border-color);
  border-radius: 5px; padding: 2px 7px;
}
main.admin { max-width: 1180px; margin: 0 auto; padding: 26px 22px 90px; }
.admin-block { margin-bottom: 34px; }
.admin-block h2 { font-size: 17px; margin: 0 0 12px; }
.table-scroll { overflow-x: auto; }        /* wide tables scroll here, never the page body */
.admin table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin table.dense { min-width: 720px; }
.admin th, .admin td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--pico-muted-border-color);
  vertical-align: top;
}
.admin th { font-weight: 600; color: var(--pico-muted-color); white-space: nowrap; }
.admin td { text-transform: capitalize; }
.admin td.cell-wide { min-width: 240px; max-width: 420px; text-transform: none; }
.admin td.nowrap { white-space: nowrap; }
.admin tbody tr:hover { background: var(--accent-weak); }

/* summary charts (pure CSS bars, no chart lib) */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.stat-card {
  border: 1px solid var(--pico-muted-border-color); border-radius: 12px; padding: 16px 18px;
}
.stat-card h3 { margin: 0 0 12px; font-size: 14px; }
.stat-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: 12.5px; }
.srow-label {
  flex: 0 0 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--pico-color);
}
.srow-val { flex: 0 0 30px; text-align: right; font-variant-numeric: tabular-nums; color: var(--pico-muted-color); }
.sbar {
  flex: 1; display: flex; height: 14px; border-radius: 4px; overflow: hidden;
  background: var(--pico-muted-border-color);
}
.sbar.big { height: 20px; border-radius: 6px; }
.sbar i { display: block; height: 100%; background: var(--accent); }  /* single bars = accent */
.sbar i.lv-strong, .sbar i.lv-include { background: var(--accent); }
.sbar i.lv-adequate, .sbar i.lv-unsure { background: var(--flag); }
.sbar i.lv-weak, .sbar i.lv-exclude { background: var(--danger); }
.legend { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.legend.inline { flex-direction: row; gap: 16px; margin: 0 0 12px; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.dot.lv-strong, .dot.lv-include { background: var(--accent); }
.dot.lv-adequate, .dot.lv-unsure { background: var(--flag); }
.dot.lv-weak, .dot.lv-exclude { background: var(--danger); }

/* primary buttons -> our green accent (scoped to beat Pico's own selector) */
button, [type="submit"], [role="button"] {
  --pico-primary-background: var(--accent);
  --pico-primary-hover-background: #12633f;
  --pico-primary-border-color: var(--accent);
  --pico-primary-hover-border-color: #12633f;
}

/* ── single top bar: brand · numbered tabs · identity ────────────────── */
.topbar {
  display: flex; align-items: center; gap: 18px; flex: 0 0 auto;
  padding: 0 22px; border-bottom: 1px solid var(--pico-muted-border-color);
}
.topbar .brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-logo { height: 20px; width: auto; display: block; }
.topbar .spacer { flex: 1; }
.topbar .who { font-weight: 600; font-size: 13.5px; }
.topbar .switch { color: var(--pico-muted-color); font-size: 13px; text-decoration: none; }
.topbar .switch:hover { color: var(--pico-color); }

.tabs { display: flex; justify-content: flex-start; gap: 2px; margin: 0; padding: 0; }
.tabs a {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 14px 14px; font-size: 14px; text-decoration: none;
  color: var(--pico-muted-color); border-bottom: 2px solid transparent;
}
.tabs a b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--pico-muted-border-color); color: var(--pico-muted-color);
}
.tabs a:hover { color: var(--pico-color); }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a.on b { background: var(--accent); color: #fff; }

/* ── app shell: fixed bar, independently-scrolling panes (no page scroll) ─ */
html { height: 100%; }
body.shell { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
body.shell .work {
  flex: 1 1 auto; min-height: 0; display: grid;
  grid-template-columns: 280px minmax(0, 1fr); overflow: hidden;
}
body.shell .sidebar {
  height: 100%; overflow-y: auto; padding: 18px 12px 40px;
  border-right: 1px solid var(--pico-muted-border-color);
}
body.shell main {
  height: 100%; overflow-y: auto; max-width: none; margin: 0; padding: 26px 30px 70px;
}
body.shell main .page-head,
body.shell #item { max-width: 760px; margin-left: auto; margin-right: auto; }
.side-toggle { display: none; }
.side-head { margin: 0 6px 10px; }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; padding: 0 14px; }
  .tabs { order: 10; flex-basis: 100%; overflow-x: auto; border-top: 1px solid var(--pico-muted-border-color); }
  .tabs a { padding: 12px 10px; }
  /* mobile: normal document scroll; sidebar becomes a drawer */
  body.shell { height: auto; display: block; overflow: visible; }
  body.shell .work { display: block; overflow: visible; }
  body.shell .sidebar {
    display: none; height: auto; border-right: none;
    border-bottom: 1px solid var(--pico-muted-border-color); padding: 8px 6px;
  }
  body.shell .sidebar.open { display: block; max-height: 60vh; overflow-y: auto; }
  body.shell main { height: auto; overflow: visible; padding: 12px 16px 70px; }
  body.shell main .page-head, body.shell #item { max-width: none; }
  .side-toggle {
    display: inline-block; width: auto; margin: 12px 16px 0;
    background: none; color: var(--accent); font-weight: 600; font-size: 14px;
    border: 1px solid var(--pico-muted-border-color); border-radius: 8px; padding: 9px 14px;
  }
}
.grp { border: none; margin: 0; }
.grp > summary {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; padding: 8px 6px; border-radius: 7px;
  font-size: 13px; color: var(--pico-color);
}
.grp > summary:hover { background: var(--pico-muted-border-color); }
.grp .gname { font-weight: 600; flex: 1; min-width: 0; }
.grp .cnt { font-variant-numeric: tabular-nums; color: var(--pico-muted-color); font-size: 12px; }
.sidebar .rows { list-style: none; padding: 2px 0 8px; margin: 0; border: none; }
.sidebar .rows li { border: none; }
.sidebar .rows li a {
  display: flex; gap: 8px; align-items: baseline; padding: 6px 8px 6px 14px;
  text-decoration: none; color: var(--pico-color); font-size: 12.5px; line-height: 1.35;
  border-radius: 6px;
}
.sidebar .rows li a:hover { background: var(--accent-weak); }
.sidebar .rows li a.active { background: var(--accent-weak); color: var(--accent); }
.sidebar .rl {
  flex: 1; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.sidebar .rd { flex: 0 0 12px; color: var(--accent); font-size: 12px; text-align: right; }

/* ── page: title + progress ──────────────────────────────────────────── */
main { max-width: 760px; margin: 0 auto; padding: 30px 22px 90px; }
.page-head {
  position: relative;
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 30px; flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.prog { display: flex; align-items: center; gap: 10px; }
.prog #progress-text {
  font-variant-numeric: tabular-nums; font-size: 13px; color: var(--pico-muted-color);
  min-width: 62px; text-align: right;   /* fixed width so the count never shifts the bar */
}
.prog .bar {
  width: 120px; height: 5px; border-radius: 999px;
  background: var(--pico-muted-border-color); overflow: hidden;
}
.prog .bar i { display: block; height: 100%; background: var(--accent); transition: width .2s ease; }

/* ── the annotation card ─────────────────────────────────────────────── */
.card {
  border: 1px solid var(--pico-muted-border-color); border-radius: 14px;
  padding: 22px 26px 24px; background: var(--pico-card-background-color);
}
.card .back {
  display: inline-block; font-size: 13px; text-decoration: none;
  color: var(--pico-muted-color); margin-bottom: 14px;
}
.card .back:hover { color: var(--accent); }
.kicker {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--pico-muted-color); margin: 0 0 10px;
}
.kicker .counter { font-variant-numeric: tabular-nums; }
.question { font-size: 20px; line-height: 1.42; font-weight: 650; margin: 0 0 10px; }
.rationale { color: var(--pico-muted-color); font-size: 14.5px; line-height: 1.5; margin: 0 0 20px; }

.flag-intro { font-size: 13.5px; color: var(--pico-muted-color); margin: 0 0 10px; }
.flag-intro em { color: var(--flag); font-style: normal; font-weight: 600; }
.flags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; cursor: pointer; user-select: none; margin: 0;
  border: 1px solid var(--pico-muted-border-color); border-radius: 999px;
  padding: 6px 14px; font-size: 13.5px; line-height: 1.2;
  color: var(--pico-color); background: var(--pico-card-background-color);
  transition: background .12s, border-color .12s, color .12s;
}
.chip input { display: none; }
.chip:hover { border-color: var(--flag-border); }
.chip:has(input:checked) {
  background: var(--flag-weak); border-color: var(--flag-border); color: var(--flag);
}
textarea { margin-bottom: 0; font-size: 14px; }

.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--pico-muted-border-color);
}
.nav button { margin: 0; width: auto; }
/* autosave confirmation, now up beside the progress counter */
/* out of flow: pinned just under the progress bar so it never reserves space or shifts anything */
.saved-flag {
  position: absolute; right: 0; bottom: -20px;
  font-size: 12px; color: var(--accent); white-space: nowrap;
}
.saved::before { content: "✓ "; }

/* ── identify ────────────────────────────────────────────────────────── */
.identify { max-width: 440px; margin: 14vh auto; padding: 0 22px; text-align: center; }
.identify h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.identify form { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.identify input { text-align: center; }

/* ── sources: decision + why-exclude reasons ─────────────────────────── */
.decision-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.decision-row { margin: 4px 0 16px; }
.rate-label { flex: 0 0 150px; font-size: 14px; }
/* the why-exclude flags reveal only when "exclude" is chosen. Fail OPEN: browsers without :has()
   support show the chips (unreachable-if-hidden would be worse than always-visible). */
@supports selector(:has(*)) {
  .exclude-reasons { display: none; }
  form:has(input[name="decision"][value="exclude"]:checked) .exclude-reasons { display: block; }
}
/* separate pill options; selected uses the single green accent (click again to deselect) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 7px; }
.seg-opt { margin: 0; }
.seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg-opt span {
  display: inline-block; min-width: 92px; text-align: center; padding: 8px 16px;
  border: 1.5px solid var(--pico-muted-border-color); border-radius: 9px;
  font-size: 13px; cursor: pointer; text-transform: capitalize;
  color: var(--pico-color); background: var(--btn-fill);   /* theme-aware fill so it reads as a button in both themes */
  transition: border-color .12s, background .12s, color .12s;
}
.seg-opt span:hover { border-color: var(--accent); background: var(--accent-weak); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--pico-primary-focus); outline-offset: 2px; }
.seg-opt:has(input:checked) span { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── splits: original vs proposed-split comparison ───────────────────── */
.split-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 4px;
}
@media (max-width: 640px) { .split-compare { grid-template-columns: 1fr; } }
.split-side {
  border: 1px solid var(--pico-muted-border-color); border-radius: 10px; padding: 12px 14px;
}
.split-side.proposed { background: var(--accent-weak); border-color: transparent; }
.side-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--pico-muted-color); margin: 0 0 8px;
}
.split-q { font-size: 14.5px; line-height: 1.5; margin: 0; color: var(--pico-color); }
.split-parts { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.split-parts li { font-size: 14px; line-height: 1.45; }
.verdict-row {
  margin: 18px 0 4px; padding-top: 16px; border-top: 1px solid var(--pico-muted-border-color);
}
.verdict-label { display: block; font-size: 14px; margin-bottom: 10px; }
.seg.split-verdict .seg-opt span { text-transform: none; }  /* labels are sentences, not words */

/* ── completeness: search + browse + gaps ────────────────────────────── */
main.completeness { max-width: 1000px; }
.completeness .intro { margin-bottom: 18px; line-height: 1.55; }
.completeness .intro em { font-style: normal; color: var(--flag); font-weight: 600; }
.comp-grid { display: grid; grid-template-columns: 1fr 320px; gap: 26px; align-items: start; }
.comp-grid > * { min-width: 0; }   /* let grid items shrink to their column instead of overflowing */
@media (max-width: 820px) {
  .comp-grid { grid-template-columns: 1fr; gap: 16px; }
  /* mobile: put the gap-logging form on top so it's not buried under 37 categories */
  .comp-gaps { order: -1; }
}
/* sticky only on the desktop two-column layout (never on mobile, where it would float over content) */
@media (min-width: 821px) { .comp-gaps { position: sticky; top: 16px; } }
/* completeness: filter bar (category dropdown + count) over a flat result list */
.filter-bar { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; }
.filter-bar select { margin: 0; width: auto; min-width: 200px; font-size: 13.5px; }
.result-list { list-style: none; padding: 0; margin: 6px 0 0; border-top: 1px solid var(--pico-muted-border-color); }
.result-list li {
  display: block; padding: 12px 4px; border-bottom: 1px solid var(--pico-muted-border-color);
}
.result-list .r-cat {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--pico-muted-color); margin-bottom: 4px;
}
.result-list .r-q { display: block; font-size: 14px; line-height: 1.5; color: var(--pico-color); }
.comp-gaps {
  border: 1px solid var(--pico-muted-border-color); border-radius: 14px;
  padding: 16px 18px;
}
.comp-gaps h3 { margin: 0 0 10px; font-size: 15px; }
.comp-gaps form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.comp-gaps textarea, .comp-gaps select, .comp-gaps button { margin: 0; font-size: 13.5px; }
.gaps-count { margin: 0 0 8px; }
.gap-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.gap-list li {
  display: flex; gap: 8px; justify-content: space-between; align-items: start;
  font-size: 13px; line-height: 1.4;
}
.gap-del {
  background: none; border: none; color: var(--pico-muted-color); cursor: pointer;
  padding: 0 4px; width: auto; font-size: 14px;
}
.gap-del:hover { color: #b4453a; }

/* ── retrieval: a search engine — search bar, then one list below ──────── */
/* The #panel below the bar holds EITHER the question list or a result. Clicking a question drops it
   into the bar and swaps the panel to that question's checks (in place). The search bar sits above
   the panel and never moves — no reflow, no scroll. */
main.retrieval { max-width: 760px; }
.retrieval .page-head { margin-bottom: 16px; }

.ask { position: relative; display: flex; gap: 10px; align-items: flex-start; width: 100%; margin: 0 0 6px; }
/* A FIXED-height multiline search box: shows a full multi-line question, but NEVER changes size on
   input, so content below it never shifts. Longer text scrolls inside the box. */
.ask textarea {
  margin: 0; flex: 1 1 auto; min-width: 0; width: auto;
  font-family: inherit; font-size: 15px; line-height: 1.5; padding: 8px 14px;
  height: 64px; resize: none; overflow-y: auto;
}
.ask button { margin: 0; width: auto; white-space: nowrap; padding: 9px 18px; font-size: 15px; }
/* out of flow so it never steals width from the input (opacity:0 still reserves flex space) */
.ask .htmx-indicator {
  position: absolute; left: 2px; top: calc(100% + 4px);
  opacity: 0; transition: opacity .15s; white-space: nowrap;
}
.ask.htmx-request .htmx-indicator { opacity: 1; }
.ask-hint { margin: 0 0 6px; }
.ask-hint code { font-size: 12px; }

#panel { margin-top: 14px; }

/* the question list (search "suggestions") — full text, nothing truncated */
.qlist { list-style: none; padding: 0; margin: 0; }
.qlist li { list-style: none; border: none; padding: 0; }
.qrow {
  display: flex; gap: 14px; align-items: baseline; justify-content: space-between;
  padding: 11px 6px; border-bottom: 1px solid var(--pico-muted-border-color);
  text-decoration: none; color: var(--pico-color); border-radius: 6px;
}
.qrow:hover { background: var(--accent-weak); }
.qrow-text { flex: 1; font-size: 15px; line-height: 1.5; }
.qrow-count {
  flex: 0 0 auto; font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600;
  color: var(--pico-muted-color); background: var(--btn-fill); border-radius: 999px; padding: 2px 9px;
}

/* a result (checks that answer the question), category-grouped, catalogue order */
.ret-back {
  display: inline-block; font-size: 13px; text-decoration: none; margin: 0 0 14px;
  color: var(--pico-muted-color);
}
.ret-back:hover { color: var(--accent); }
.ret-note { margin: 6px 0; }
.ret-head { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--pico-muted-border-color); }
.ret-q { font-size: 18px; font-weight: 650; line-height: 1.45; margin: 0 0 6px; }
.ret-funnel { margin: 0; }
.ret-funnel strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.ret-cat { margin-bottom: 22px; }
.ret-cat-name {
  margin: 0 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--pico-muted-color);
}
.ret-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.ret-checks li { list-style: none; border: none; padding: 0; }
.ret-checks .rc-q { display: block; font-size: 15px; line-height: 1.5; color: inherit; }
.ret-checks .rc-plain { display: block; padding-left: 18px; }   /* a check with no captured reason */
/* pill on its own line below the question (same stacked layout as the completeness rows) */
.ret-checks .node-badge { display: block; width: fit-content; margin: 4px 0 0; }

/* every disclosure summary in the results (matched rows + the 'not selected' wrapper): strip the
   UA marker AND Pico's accordion chevron so only our own left caret shows. Block, not flex —
   flex pushes Chrome's disclosure triangle to the right. */
#panel details > summary { list-style: none; cursor: pointer; }
#panel details > summary::-webkit-details-marker { display: none; }
#panel details > summary::marker { content: ""; }
#panel details > summary::after { display: none; }
.rc-caret {
  position: absolute; left: 0; top: 0; color: var(--pico-muted-color);
  transition: transform .12s; transform-origin: 45% 60%;
}

/* a matched/rejected check row: the question is the summary; expands to the NATIVE model reason */
.ret-checks details.rc > summary {
  position: relative; padding-left: 18px; font-size: 15px; line-height: 1.5; color: var(--pico-color);
}
.ret-checks details.rc[open] .rc-caret { transform: rotate(90deg); }
.ret-checks details.rc > summary:hover { color: var(--accent); }
.rc-why {
  margin: 8px 0 2px 18px; padding-left: 12px; line-height: 1.5; font-size: 13.5px;
  color: var(--pico-muted-color); border-left: 2px solid var(--pico-muted-border-color);
}
/* pipeline-metadata tag: makes clear the reason is the MODEL's own verdict, not editorial text */
.rc-tag {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; margin-right: 8px;
}
.rc-tag.ok { color: var(--accent); background: var(--accent-weak); }
.rc-tag.no { color: var(--flag); background: var(--flag-weak); }

/* the collapsible 'screened and not selected' section */
.rejected-wrap { margin-top: 24px; border-top: 1px solid var(--pico-muted-border-color); padding-top: 16px; }
.rejected-wrap > summary {
  position: relative; padding-left: 18px; font-size: 13px; font-weight: 600; color: var(--pico-muted-color);
}
.rejected-wrap > summary:hover { color: var(--accent); }
.rejected-wrap[open] > summary .rc-caret { transform: rotate(90deg); }
.rejected-body { margin-top: 16px; }
.rejected-body .rc-q { color: var(--pico-muted-color); }   /* rejected read as secondary */

/* Sources page: a fixed controls rail on the left, the document filling the rest as the hero. The
   PDF is set to fit-to-width (#view=FitH in the template) so it fills its pane with no gutters. */
.source-layout { display: flex; gap: 28px; align-items: flex-start; }
.source-main { flex: 0 0 360px; }
.source-doc { flex: 1 1 auto; min-width: 0; }
.source-view {
  display: block; width: 100%; height: calc(100vh - 120px); min-height: 520px; background: #fff;
  border: 1px solid var(--pico-muted-border-color); border-radius: 8px;
}
/* The inline iframe works in desktop browsers, but iOS/iPadOS Safari renders an embedded PDF as
   page 1 only (a WebKit limitation). So a prominent button sits ABOVE the viewer to open the full
   PDF in a new tab — a full-tab PDF scrolls all pages everywhere, iPad included. */
/* Header bar and content share one left-justified block, capped so the document doesn't get absurd
   on an ultrawide screen; Copy-link then lines up with the document's right edge. */
body.shell main:has(.source-layout) .page-head,
body.shell #item:has(.source-layout) { max-width: 1340px; margin-left: 0; margin-right: auto; }
@media (max-width: 900px) {
  .source-layout { flex-wrap: wrap; }
  .source-doc { flex-basis: 100%; }
  .source-view { height: 82vh; }
}

/* Node-type overlay badges — our taxonomy classification, a sidecar to the checks. */
.node-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; vertical-align: middle;
  background: var(--btn-fill); color: var(--pico-muted-color);
}
.node-badge.agg { background: var(--accent-weak); color: var(--accent); }   /* the aggregation moat */

.login-error { color: var(--danger); font-size: 14px; margin: 0 0 4px; }

/* Lumilogic logo on the login / identify cards */
.identify-logo { height: 44px; width: auto; display: block; margin: 0 auto 14px; }

/* Identify: pick your name to resume (exact DB key), with a "someone else" fallback */
.pick { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 6px 0 14px; }
.pick-name {
  width: auto; margin: 0; padding: 11px 22px; font-size: 15px; font-weight: 600;
  background: var(--btn-fill); color: var(--pico-color);
  border: 1px solid var(--pico-muted-border-color); border-radius: 10px;
}
.pick-name:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.pick-other { margin-top: 4px; }
.pick-other summary { cursor: pointer; color: var(--pico-muted-color); font-size: 14px; list-style: none; }
.pick-other summary:hover { color: var(--pico-color); }
.pick-other form { margin-top: 12px; }
