:root {
  color-scheme: light;
  --board: #f3efe6;
  --card: #fffdf8;
  --sunk: #ebe5d8;
  --ink: #22303c;
  --ink-2: #536170;
  --muted: #7d8794;
  --line: #e2dbcc;
  --navy: #2f4b66;
  --navy-2: #3b5b7a;
  --navy-soft: #e3eaf1;
  --tan: #c7ae88;
  --tan-2: #8a6f48;
  --tan-soft: #f2e8d6;
  --red: #b23b2a;
  --red-soft: #f7e3df;
  --green: #3b7a57;
  --green-soft: #e1efe6;
  --blue: #3f6fa0;
  --blue-soft: #e2ebf5;
  --draft: #b8956a;
  --serif: "Spectral", Georgia, serif;
  --sans: "Work Sans", system-ui, sans-serif;
  --type: "Courier Prime", "Courier New", monospace;
  --shadow: 0 1px 2px rgba(34, 48, 60, 0.06), 0 10px 26px rgba(34, 48, 60, 0.08);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --board: #13171b; --card: #1a2026; --sunk: #222a31; --ink: #ece7dc; --ink-2: #c3c9cf; --muted: #8d969f; --line: #2b343c;
  --navy: #8fb1d4; --navy-2: #a9c4e0; --navy-soft: #1d2b39; --tan: #a88e69; --tan-2: #d7bf98; --tan-soft: #2c2519;
  --red: #ff8f7c; --red-soft: #3a1f1b; --green: #7fcda1; --green-soft: #15291e; --blue: #8fb6e3; --blue-soft: #18263a; --draft: #c9a77b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 26px rgba(0, 0, 0, 0.35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --board: #13171b; --card: #1a2026; --sunk: #222a31; --ink: #ece7dc; --ink-2: #c3c9cf; --muted: #8d969f; --line: #2b343c;
    --navy: #8fb1d4; --navy-2: #a9c4e0; --navy-soft: #1d2b39; --tan: #a88e69; --tan-2: #d7bf98; --tan-soft: #2c2519;
    --red: #ff8f7c; --red-soft: #3a1f1b; --green: #7fcda1; --green-soft: #15291e; --blue: #8fb6e3; --blue-soft: #18263a; --draft: #c9a77b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 26px rgba(0, 0, 0, 0.35);
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--board); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { padding: 0; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.typed { font-family: var(--type); }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #f3efe6; }
:root[data-theme="dark"] .top { background: #1c2833; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .top { background: #1c2833; } }
.top-in { display: flex; align-items: center; gap: 18px; max-width: 1320px; min-height: 60px; margin: 0 auto; padding: 0 22px; }
.logo { display: inline-flex; align-items: center; gap: 10px; margin-right: 8px; font: 600 20px/1 var(--serif); text-decoration: none; white-space: nowrap; }
.logo svg { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2); }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav a { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 60px; padding: 0 12px; color: rgba(243, 239, 230, 0.75); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav a svg { width: 17px; height: 17px; }
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 #e7c48f; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; background: rgba(255, 255, 255, 0.16); border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.nav a[aria-current="page"] .count { background: #e7c48f; color: #2f4b66; }
.spacer { flex: 1; }
.acting { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.acting > span { color: rgba(243, 239, 230, 0.7); }
.who { display: inline-flex; padding: 3px; background: rgba(0, 0, 0, 0.18); border-radius: 99px; }
.who button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; color: rgba(243, 239, 230, 0.8); font-weight: 600; }
.who button[aria-pressed="true"] { background: #f3efe6; color: #2f4b66; }
.av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; }
.av.maya { background: #8a6f48; } .av.sam { background: #3b7a57; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: inherit; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.icon-btn svg { width: 18px; height: 18px; }
.main { max-width: 1320px; margin: 0 auto; padding: 26px 22px 64px; }

/* ---------- headings, buttons ---------- */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 20px; }
.eyebrow { color: var(--tan-2); font: 700 12px/1.3 var(--type); letter-spacing: 0.08em; text-transform: uppercase; }
.head h1 { margin-top: 4px; font: 600 32px/1.12 var(--serif); letter-spacing: -0.01em; }
.head p { margin-top: 4px; max-width: 70ch; color: var(--ink-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: border-color 0.15s, transform 0.15s; }
.btn svg { width: 17px; height: 17px; }
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #13171b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .btn.primary { color: #13171b; } }
.btn.primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn.good { background: var(--green); border-color: var(--green); color: #fff; }
.btn.warn { border-color: var(--red); color: var(--red); }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--sunk); border-color: transparent; }
.card { padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h2 { font: 600 20px/1.2 var(--serif); }
.card-h a { color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.in, .sel, .ta { width: 100%; min-height: 40px; padding: 8px 11px; background: var(--card); border: 1px solid var(--line); border-radius: 9px; }
.ta { min-height: 140px; resize: vertical; font-family: var(--type); font-size: 13.5px; line-height: 1.55; }
.in:focus, .sel:focus, .ta:focus { outline: 0; border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 22%, transparent); }
.field { display: grid; gap: 5px; margin-bottom: 13px; }
.field > span { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.field small { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.field small.good { color: var(--green); }
.field small.bad { color: var(--red); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.status.draft { background: var(--tan-soft); color: var(--tan-2); }
.status.catalogued { background: var(--blue-soft); color: var(--blue); }
.status.verified { background: var(--green-soft); color: var(--green); }
.status.flagged { background: var(--red-soft); color: var(--red); }
.call { font: 700 14px var(--type); letter-spacing: 0.02em; white-space: nowrap; }

/* ---------- shelf ---------- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat small { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat strong { display: block; margin-top: 4px; font: 600 30px/1.1 var(--serif); }
.stat p { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.shelf { display: grid; gap: 26px; padding: 8px 4px 0; }
.shelf-row { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; padding: 0 10px 10px; }
.shelf-row::after { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: linear-gradient(var(--tan-2), color-mix(in srgb, var(--tan-2) 70%, #000)); border-radius: 3px; box-shadow: 0 6px 10px rgba(0, 0, 0, 0.12); content: ""; }
.box { position: relative; display: grid; align-content: space-between; gap: 6px; min-height: 118px; padding: 10px 9px 9px; background: linear-gradient(180deg, color-mix(in srgb, var(--tan) 92%, #fff) 0%, var(--tan) 100%); border: 1px solid color-mix(in srgb, var(--tan-2) 50%, transparent); border-radius: 4px 4px 2px 2px; color: #2b2116; text-align: left; transition: transform 0.15s; }
.box:hover { transform: translateY(-3px); }
.box::before { position: absolute; top: 9px; left: 50%; width: 26px; height: 7px; margin-left: -13px; background: rgba(43, 33, 22, 0.35); border-radius: 99px; content: ""; }
.box .label { margin-top: 14px; padding: 6px 7px; background: #fbf8f1; border: 1px solid rgba(43, 33, 22, 0.15); border-radius: 3px; font: 700 13px/1.2 var(--type); }
.box .label small { display: block; color: #6b5a44; font: 600 10.5px var(--sans); }
.box .fill { display: flex; height: 7px; overflow: hidden; background: rgba(255, 255, 255, 0.5); border-radius: 99px; }
.box .fill i { display: block; height: 100%; }
.box.empty { background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--tan) 18%, transparent) 8px 16px); border: 1.5px dashed color-mix(in srgb, var(--tan-2) 60%, transparent); color: var(--muted); }
.box.empty::before { display: none; }
.box.empty .label { background: transparent; border: 0; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; color: var(--ink-2); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.queue-cta { display: grid; gap: 10px; }
.queue-cta a { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--board); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.queue-cta a:hover { border-color: var(--navy); }
.queue-cta b { display: block; font: 600 18px var(--serif); }
.queue-cta small { color: var(--ink-2); font-size: 13px; }
.queue-cta .n { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; font: 700 18px var(--type); }
.activity li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.activity li:last-child { border-bottom: 0; }
.activity p { flex: 1; color: var(--ink-2); }
.activity b { color: var(--ink); }
.activity time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- workbench (catalogue / verify) ---------- */
.bench { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.queue { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; padding: 0; }
.queue h2 { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--line); font: 600 17px var(--serif); }
.queue li button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; width: 100%; padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.queue li button:hover { background: var(--board); }
.queue li button[aria-current="true"] { background: var(--navy-soft); box-shadow: inset 3px 0 0 var(--navy); }
.queue li button:disabled { opacity: 0.55; }
.queue .t { grid-column: 1 / -1; overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.queue .m { color: var(--muted); font-size: 12px; }
.queue .empty-q { padding: 26px 16px; color: var(--muted); text-align: center; }
.source { padding: 14px 16px; background: #fbf7ec; border: 1px solid #e3d7bd; border-radius: 10px; color: #3b3022; }
:root[data-theme="dark"] .source { background: #241f17; border-color: #3b3223; color: #e9dcc4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .source { background: #241f17; border-color: #3b3223; color: #e9dcc4; } }
.source small { display: block; margin-bottom: 4px; color: var(--tan-2); font: 700 11.5px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; }
.source code { display: block; overflow-x: auto; font: 15px/1.5 var(--type); white-space: pre-wrap; word-break: break-word; }
.editor { display: grid; gap: 16px; }
.editor-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.editor-h .call { font-size: 20px; }
.interp { margin-top: 4px; color: var(--green); font-size: 13px; font-weight: 600; }
.interp.bad { color: var(--red); }
.clean { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 600; }
.clean svg { width: 18px; height: 18px; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.checks li:first-child { border-top: 0; }
.checks .ic { width: 20px; height: 20px; margin-top: 1px; }
.checks .open .ic { color: var(--red); }
.checks .done .ic { color: var(--green); }
.checks p { color: var(--ink-2); }
.checks .ack { display: block; margin-top: 4px; color: var(--green); font-size: 13px; font-style: italic; }
.ack-form { display: flex; gap: 6px; margin-top: 8px; }
.ack-form .in { min-height: 34px; padding: 5px 9px; font-size: 13.5px; }
.bench-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.bench-foot .note { margin-right: auto; color: var(--muted); font-size: 13.5px; }
.returned { padding: 12px 14px; background: var(--red-soft); border-radius: 10px; color: var(--red); font-size: 14px; }
.returned b { color: inherit; }
.compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.facts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 14px; font-size: 14px; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { min-width: 0; overflow-wrap: anywhere; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; background: var(--tan-soft); border: 1px solid color-mix(in srgb, var(--tan-2) 30%, transparent); border-radius: 12px; }
.banner p { flex: 1; min-width: 220px; }
.done-card { padding: 34px 20px; text-align: center; }
.done-card b { display: block; margin-bottom: 4px; font: 600 22px var(--serif); }
.done-card p { color: var(--ink-2); }
.done-card .btn { margin-top: 14px; }

/* ---------- records ---------- */
.records { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.facets { display: grid; gap: 16px; }
.facets h3 { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.facets button { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 5px 8px; border-radius: 7px; font-size: 14px; text-align: left; }
.facets button:hover { background: var(--sunk); }
.facets button[aria-pressed="true"] { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .facets button[aria-pressed="true"] { color: #13171b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .facets button[aria-pressed="true"] { color: #13171b; } }
.facets button span:last-child { opacity: 0.65; font-size: 12.5px; }
.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; top: 50%; left: 12px; width: 18px; height: 18px; color: var(--muted); transform: translateY(-50%); }
.search .in { padding-left: 38px; min-height: 44px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 10px 12px; background: var(--sunk); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: color-mix(in srgb, var(--sunk) 60%, transparent); }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table .muted { color: var(--muted); }
.table-wrap { overflow-x: auto; padding: 0; }
mark { padding: 0 2px; background: #f3dfa6; border-radius: 3px; color: inherit; }
:root[data-theme="dark"] mark { background: #5b4a1d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) mark { background: #5b4a1d; } }
.empty { padding: 34px 16px; color: var(--muted); text-align: center; }

/* ---------- record ---------- */
.record { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.record-title { font: 600 28px/1.15 var(--serif); }
.timeline li { position: relative; padding: 0 0 16px 24px; font-size: 14px; }
.timeline li::before { position: absolute; left: 5px; top: 6px; width: 9px; height: 9px; background: var(--card); border: 2px solid var(--navy); border-radius: 50%; content: ""; }
.timeline li::after { position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--line); content: ""; }
.timeline li:last-child::after { display: none; }
.timeline li.ok::before { border-color: var(--green); background: var(--green); }
.timeline li.bad::before { border-color: var(--red); }
.timeline time { display: block; color: var(--muted); font-size: 12px; }
.timeline .chg { display: block; margin-top: 2px; color: var(--ink-2); font-size: 13px; }
.timeline del { color: var(--red); }
.timeline ins { color: var(--green); text-decoration: none; }

/* ---------- intake ---------- */
.intake { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 18px; align-items: start; }
.sources li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.sources li:first-child { border-top: 0; }
.sources .doc { display: grid; place-items: center; width: 38px; height: 46px; flex: none; background: #fbf7ec; border: 1px solid #e3d7bd; border-radius: 3px; color: #8a6f48; font: 700 11px var(--type); }
.sources b { display: block; }
.sources small { color: var(--muted); font-size: 12.5px; }
.sources div { flex: 1; min-width: 0; }
.preview-sum { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--sunk); border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.chip.bad { background: var(--red-soft); color: var(--red); }
.chip.good { background: var(--green-soft); color: var(--green); }
.raw { color: var(--muted); font: 12.5px var(--type); }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- finding aid ---------- */
.aid { max-width: 920px; margin: 0 auto; padding: 44px 48px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.aid .eyebrow { color: var(--muted); }
.aid h1 { margin-top: 8px; font: 600 38px/1.1 var(--serif); }
.aid h2 { margin: 30px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); font: 600 22px var(--serif); }
.aid h3 { margin: 22px 0 8px; font: 600 18px var(--serif); }
.aid p { color: var(--ink-2); }
.aid .facts { margin-top: 18px; }
.aid .series-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dotted var(--line); }
.aid-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; max-width: 920px; margin: 0 auto 14px; }
.aid-tools label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.aid-tools input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--navy); }
.aid .table td:first-child, .aid .table th:first-child { white-space: nowrap; }
.inqa { color: var(--blue); font-size: 12px; font-weight: 700; }

/* ---------- data ---------- */
.data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.export li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.export li:first-child { border-top: 0; }
.export b { display: block; }
.export small { color: var(--muted); font-size: 13px; }
pre.schema { max-height: 320px; overflow: auto; margin: 0; padding: 14px; background: #1b232b; border-radius: 10px; color: #dfe6ec; font: 12.5px/1.55 var(--type); }

/* ---------- dialog, toast, welcome ---------- */
.dlg { width: min(500px, calc(100vw - 24px)); padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); color: var(--ink); }
.dlg::backdrop { background: rgba(19, 23, 27, 0.55); }
.dlg form { padding: 22px; }
.dlg h2 { margin-bottom: 12px; font: 600 22px var(--serif); }
.dlg p { margin-bottom: 12px; color: var(--ink-2); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 60; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); padding: 11px 12px 11px 16px; background: var(--ink); border-radius: 12px; box-shadow: var(--shadow); color: var(--board); font-size: 14px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity 0.2s, transform 0.2s; }
.toast.is-on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.toast button { padding: 6px 10px; background: #e7c48f; border-radius: 8px; color: #2f4b66; font-size: 13px; font-weight: 700; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols, .intake, .record, .data-grid { grid-template-columns: minmax(0, 1fr); }
  .acting > span { display: none; }
}
@media (max-width: 900px) {
  .top-in { flex-wrap: wrap; gap: 0 10px; padding: 0 12px; }
  .logo { min-height: 54px; }
  .nav { order: 3; width: calc(100% + 24px); margin: 0 -12px; padding: 0 6px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
  .nav a { min-height: 46px; padding: 0 10px; font-size: 13.5px; }
  .main { padding: 18px 14px 48px; }
  .bench, .records { grid-template-columns: minmax(0, 1fr); }
  .queue { position: static; max-height: 260px; }
  .compare { grid-template-columns: minmax(0, 1fr); }
  .shelf-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 10px; }
  .facets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aid { padding: 26px 18px; }
  .aid h1 { font-size: 28px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat strong { font-size: 24px; }
  .head h1 { font-size: 26px; }
  .row2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .who button { padding-right: 8px; }
  .who .nm { display: none; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .table .hide-sm { display: none; }
}
@media print {
  .top, .aid-tools, .toast { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; }
  .aid { border: 0; box-shadow: none; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* Touch screens: the small "All records" style links get a thumb-sized target. */
@media (pointer: coarse) { .card-h a { display: inline-flex; align-items: center; min-height: 44px; } }
