/* Paper into Structures, no-AI website.
   Same design as web/index.html: a lab bench. The source page sits on the left with every found
   structure outlined on it; specimen cards (paper crop beside the redrawn structure) stack on the
   right; the export tray stays pinned to the bottom edge. Structure tiles stay paper-white in both
   themes, like a printout. Colours are tokens; dark mode follows the system unless data-theme is set. */
/* IBM Plex (SIL Open Font License 1.1, fonts/OFL.txt), served by this site: a font service would
   learn about every visit. Browsers download only the faces a page uses. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexSans-Italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexSansCondensed-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/IBMPlexSansCondensed-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/IBMPlexSansCondensed-Bold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2"); }
:root {
  --bg: #eef1f2;
  --surface: #ffffff;
  --surface-2: #f5f7f8;
  --paper: #ffffff;
  --paper-ink: #4b5961;
  --paper-line: #dfe4e6;
  --ink: #142028;
  --muted: #56656e;
  --line: #d5dcdf;
  --line-strong: #aab6bc;
  --accent: #0a6660;
  --accent-hover: #075550;
  --accent-ink: #ffffff;
  --accent-soft: #dcefec;
  --mark: #cf2f6b;
  --mark-fill: rgba(207, 47, 107, 0.10);
  --mark-focus: #0a6660;
  --ok: #1b6e36;
  --ok-soft: #e0f1e5;
  --warn: #8a5100;
  --warn-soft: #faeed7;
  --bad: #b0241d;
  --bad-soft: #fae4e2;
  --info: #2a559b;
  --info-soft: #e3ebf8;
  --shadow: 0 1px 2px rgba(20, 32, 40, 0.06), 0 6px 18px rgba(20, 32, 40, 0.06);
  --f-display: "IBM Plex Sans Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1316;
    --surface: #141c20;
    --surface-2: #1a2428;
    --ink: #e2e9ec;
    --muted: #96a5ad;
    --line: #263238;
    --line-strong: #3c4a52;
    --accent: #3dbdb0;
    --accent-hover: #63d2c6;
    --accent-ink: #04201d;
    --accent-soft: #11312e;
    --mark-focus: #0a6660;
    --ok: #63c985;
    --ok-soft: #10301b;
    --warn: #e2a64a;
    --warn-soft: #33260e;
    --bad: #f07d74;
    --bad-soft: #3a1613;
    --info: #86abee;
    --info-soft: #15253e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1316;
  --surface: #141c20;
  --surface-2: #1a2428;
  --ink: #e2e9ec;
  --muted: #96a5ad;
  --line: #263238;
  --line-strong: #3c4a52;
  --accent: #3dbdb0;
  --accent-hover: #63d2c6;
  --accent-ink: #04201d;
  --accent-soft: #11312e;
  --mark-focus: #0a6660;
  --ok: #63c985;
  --ok-soft: #10301b;
  --warn: #e2a64a;
  --warn-soft: #33260e;
  --bad: #f07d74;
  --bad-soft: #3a1613;
  --info: #86abee;
  --info-soft: #15253e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--f-body);
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--surface);
}
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
code { font-family: var(--f-mono); font-size: 0.92em; overflow-wrap: anywhere; }
.wrap {
  max-width: 1480px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
header.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 25;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; gap: 12px 20px; padding-block: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand svg { flex: none; }
.brand h1 { font-size: 21px; font-weight: 600; letter-spacing: 0.005em; line-height: 1.1; }
.brand p { margin: 0; font-size: 12.5px; color: var(--muted); }
.status { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
/* The site's shared GP icon and Tools menu (/assets/js/gp-bar.js, /assets/css/gp-tools.css),
   coloured with this page's theme. */
.gp-slot {
  display: flex; align-items: center; gap: 8px; flex: none;
  --gp-tools-text: var(--ink); --gp-tools-line: var(--line); --gp-tools-hover: var(--surface-2); --gp-tools-bg: var(--surface);
  --gp-menu-bg: var(--surface); --gp-menu-text: var(--ink); --gp-menu-muted: var(--muted);
  --gp-menu-line: var(--line); --gp-menu-hover: var(--surface-2); --gp-menu-accent: var(--accent);
}
.gp-slot .gp-home { display: inline-flex; border-radius: 7px; }
.gp-slot .gp-home img { display: block; width: 28px; height: 28px; border-radius: 6px; }
.gp-slot .gp-tools-btn { font-family: var(--f-body); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; line-height: 1; padding: 6px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: none; }
.pill.ok i { background: var(--ok); }
.pill.warn i { background: var(--warn); }
.pill.bad i { background: var(--bad); }

/* Source bar */
.source { padding-block: 16px 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.source-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.docname { font-family: var(--f-display); font-size: 17px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.docmeta { color: var(--muted); font-size: 13px; }
.grow { flex: 1 1 auto; }
.docinfo { min-width: 0; }
.field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); max-width: 100%; min-width: 0; }
.input {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 5px; padding: 7px 9px; font-size: 13.5px;
}
.progress { margin: 0; font-size: 13.5px; color: var(--muted); min-height: 1.5em; }
.progress b { color: var(--ink); font-weight: 600; }
.notice {
  border-radius: var(--r); padding: 10px 12px; font-size: 13.5px; border: 1px solid transparent;
  background: var(--info-soft); color: var(--info); display: flex; gap: 10px; align-items: flex-start;
}
.notice + .notice { margin-top: 8px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice .x { margin-left: auto; }

/* One-time loading of the reader */
.loader {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  display: grid; gap: 8px; box-shadow: var(--shadow);
}
.loader-head { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; }
.loader-head h2 { font-size: 15px; font-weight: 600; }
.loader-head .sizes { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.loader p { margin: 0; font-size: 13px; color: var(--muted); max-width: 80ch; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s linear; }
@media (prefers-reduced-motion: reduce) { .bar > span { transition: none; } }
ul.parts {
  margin: 0; padding: 0; list-style: none; display: grid; gap: 2px 18px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); font-size: 12.5px;
}
ul.parts li { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; }
ul.parts li span:first-child { min-width: 0; overflow-wrap: anywhere; }
ul.parts li.done { color: var(--ok); }
ul.parts li.busy { color: var(--ink); }
ul.parts li span:last-child { white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13.5px; font-weight: 500; line-height: 1; padding: 9px 13px; border-radius: 5px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line); }
.btn.small { font-size: 12.5px; padding: 7px 10px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, .input:focus-visible, textarea:focus-visible, input:focus-visible, .idx:focus-visible, .t-img:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--accent-soft); color: var(--ink); font-weight: 500; }

/* Bench */
.bench { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: start; padding-bottom: 20px; }
.pane { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.pane-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pane-head h2 { font-size: 16px; font-weight: 600; }
.pane-head .count { color: var(--muted); font-size: 13px; font-family: var(--f-body); font-weight: 400; }
.pane-head .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pages-pane { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 64px); }

.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.thumbs:empty { display: none; }
.thumb { flex: none; width: 78px; display: grid; gap: 4px; font-size: 11.5px; color: var(--muted); }
.thumb .t-img {
  position: relative; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: var(--paper);
  height: 100px; overflow: hidden; cursor: pointer; display: flex; align-items: flex-start; justify-content: center;
}
.thumb .t-img img { width: 100%; height: auto; display: block; }
.thumb .t-img .t-wait { margin: auto; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--paper-line); border-top-color: var(--mark-focus); animation: spin 0.9s linear infinite; }
.thumb.cur .t-img { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.thumb .t-row { display: flex; align-items: center; gap: 4px; justify-content: space-between; }
.thumb label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.thumb input { margin: 0; accent-color: var(--accent); }
.t-state { font-family: var(--f-mono); font-size: 10.5px; padding: 2px 5px; border-radius: 3px; background: var(--surface-2); }
.t-state.done { background: var(--ok-soft); color: var(--ok); }
.t-state.busy { background: var(--info-soft); color: var(--info); }
.t-state.err { background: var(--bad-soft); color: var(--bad); }
.t-fig { position: absolute; right: 3px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--mark); box-shadow: 0 0 0 2px var(--paper); }

.viewer-bar { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 10px 14px; font-size: 13px; color: var(--muted); }
.viewer-bar .ptitle { font-family: var(--f-display); font-weight: 600; font-size: 15px; color: var(--ink); }
.viewer-scroll { max-height: calc(100dvh - 300px); min-height: 280px; overflow: auto; padding: 0 14px 14px; }
.viewer { position: relative; background: var(--paper); border: 1px solid var(--paper-line); border-radius: 3px; }
.viewer img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.viewer svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.viewer.drawing svg { cursor: crosshair; touch-action: none; }
.viewer .empty { padding: 60px 20px; text-align: center; color: var(--paper-ink); font-size: 14px; display: grid; gap: 10px; justify-items: center; }
.viewer .empty strong { font-family: var(--f-display); font-size: 16px; color: #142028; }
.ov-box { fill: var(--mark-fill); stroke: var(--mark); stroke-width: 2; vector-effect: non-scaling-stroke; cursor: pointer; }
.ov-box.focus { stroke: var(--mark-focus); stroke-width: 3; fill: rgba(10, 102, 96, 0.12); }
.ov-box.done { fill: transparent; }
.ov-tag { fill: var(--mark); }
.ov-tag.focus { fill: var(--mark-focus); }
.ov-num { fill: #ffffff; font-family: var(--f-body); font-weight: 600; pointer-events: none; }
.ov-draft { fill: rgba(10, 102, 96, 0.10); stroke: var(--mark-focus); stroke-width: 2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.ov-busy { fill: rgba(10, 102, 96, 0.06); stroke: var(--mark-focus); stroke-width: 2; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }

/* Dropping a file anywhere on the page */
body.dropping::after {
  content: "Drop the PDF or image to open it"; position: fixed; inset: 10px; z-index: 40;
  display: flex; align-items: center; justify-content: center; border: 3px dashed var(--accent); border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink);
  font: 600 20px var(--f-display); pointer-events: none;
}

/* Cards */
.cards { display: grid; gap: 12px; padding: 14px; }
.empty-cards { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; display: grid; gap: 6px; justify-items: center; }
.empty-cards strong { color: var(--ink); font-family: var(--f-display); font-size: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 10px; background: var(--surface); scroll-margin: 90px; min-width: 0; }
.card.focus { border-color: var(--mark-focus); box-shadow: 0 0 0 2px var(--mark-focus); }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.idx { font-family: var(--f-mono); font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; cursor: pointer; }
.label-in { width: 9.5em; max-width: 40%; font-weight: 600; font-family: var(--f-display); font-size: 15px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.badges { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.badge { font-size: 11.5px; line-height: 1; padding: 5px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--ink); border-color: transparent; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { position: relative; background: var(--paper); border: 1px solid var(--paper-line); border-radius: 4px; aspect-ratio: 3 / 2; max-width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; min-width: 0; }
.tile img { max-width: 92%; max-height: 84%; object-fit: contain; display: block; }
.tile .cap { position: absolute; left: 7px; top: 5px; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper-ink); }
.tile .msg { color: var(--paper-ink); font-size: 13px; padding: 10px; text-align: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--paper-line); border-top-color: var(--mark-focus); animation: spin 0.9s linear infinite; margin: 0 auto 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner, .thumb .t-img .t-wait { animation: none; } }
.smiles {
  width: 100%; min-width: 0; resize: vertical; font-family: var(--f-mono); font-size: 13px; line-height: 1.45;
  padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-2); overflow-wrap: anywhere;
}
.smiles.bad { border-color: var(--bad); }
.smiles-wrap { display: grid; gap: 4px; }
.smiles-wrap .lbl { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.smiles-wrap .lbl .bad { color: var(--bad); }
.smiles-wrap .lbl .ok { color: var(--ok); }
.meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; font-variant-numeric: tabular-nums; }
.meta:empty { display: none; }
.meta b { color: var(--ink); font-weight: 500; }
.meta .key { font-family: var(--f-mono); font-size: 11.5px; overflow-wrap: anywhere; }
.notes { display: grid; gap: 6px; }
.notes:empty { display: none; }
.note { font-size: 13px; padding: 7px 9px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); overflow-wrap: anywhere; }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.info { background: var(--info-soft); color: var(--info); }
.note .btn { margin-top: 6px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.actions .inc { margin-left: auto; display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; color: var(--muted); }
.actions input[type="checkbox"] { accent-color: var(--accent); }

/* About and reviews */
.about { padding-block: 8px 28px; }
.about > h2 { font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.about > p.lead { margin: 0 0 14px; color: var(--muted); max-width: 72ch; font-size: 14px; }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.lcard h3 { font-size: 15px; font-weight: 600; }
.lcard p { margin: 0; font-size: 13.5px; color: var(--muted); }
.lcard ol, .lcard ul.plain { margin: 0; padding-left: 1.2em; font-size: 13.5px; color: var(--muted); display: grid; gap: 4px; }
.lcard b { color: var(--ink); font-weight: 600; }
.imp textarea { width: 100%; min-height: 5.5em; resize: vertical; font-family: var(--f-mono); font-size: 12px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-2); }
.imp { display: grid; gap: 8px; }
ul.revs { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13.5px; }
ul.revs li { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; background: var(--surface-2); border-radius: 4px; padding: 5px 8px; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.versions { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }

/* Export tray */
footer.tray {
  position: sticky; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -4px 16px rgba(20, 32, 40, 0.06);
}
footer.tray .wrap { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding-block: 10px; }
.tray-sum { font-size: 13.5px; }
.tray-sum b { font-variant-numeric: tabular-nums; }
.tray-opts { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.tray-opts label { display: inline-flex; gap: 5px; align-items: center; }
.tray-opts input { accent-color: var(--accent); }
.tray-btns { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tray-msg { width: 100%; margin: 0; font-size: 12.5px; color: var(--muted); }
.tray-msg:empty { display: none; }

@media (max-width: 1040px) {
  .bench { grid-template-columns: minmax(0, 1fr); }
  .pages-pane { position: static; }
  .viewer-scroll { max-height: none; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  header.top { position: static; }
  .brand p { display: none; }
  .gp-slot { margin-left: auto; }
  .status { margin-left: 0; }
  .pair { grid-template-columns: 1fr 1fr; gap: 6px; }
  .label-in { max-width: 50%; }
  footer.tray .wrap { gap: 6px 10px; padding-block: 8px; }
  .tray-sum, .tray-opts { font-size: 12px; }
  .tray-btns { margin-left: 0; width: 100%; }
  .tray-btns .btn { flex: 1 1 0; padding: 9px 8px; min-width: 0; }
  .hide-sm { display: none; }
}
