/* MobileHealth review. One visual system for every page.
   Cool grey desk, white paper, ink text. Status colours mean status only.
   The one bold element is the highlighter: the selected answer, on the scan and in the list. */
:root {
  --desk: #eef1f3;      /* app background, under the paper */
  --paper: #ffffff;     /* reading surfaces */
  --ink: #1d2733;       /* text, primary buttons */
  --ink-2: #5a6675;     /* secondary text */
  --ink-3: #8a94a1;     /* hints, empty values */
  --rule: #dde2e7;      /* hairlines */
  --mark: #ffe36e;      /* highlighter */
  --need: #b3261e;      /* needs review */
  --look: #a15c07;      /* worth a look */
  --ok: #2e7d4f;        /* looks right */
  --edit: #3355c4;      /* edited by you */
  --need-bg: #fbeceb; --look-bg: #fdf3e3; --ok-bg: #e8f3ec; --edit-bg: #ebeffb;
  --radius: 8px;
  --bar-h: 52px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--desk); }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 20px; line-height: 1.25; }
h2 { font-size: 15px; }
h3 { font-size: 13px; color: var(--ink-2); }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.note { color: var(--ink-2); font-size: 13px; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- top bar */
.bar { position: sticky; top: 0; z-index: 10; height: var(--bar-h); display: flex; align-items: center; gap: 14px; padding: 0 20px; background: var(--paper); border-bottom: 1px solid var(--rule); }
.bar .home { font-weight: 600; text-decoration: none; }
.bar .file { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .meta { color: var(--ink-2); font-size: 13px; }
#when { white-space: nowrap; }
#when span + span { margin-left: 12px; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2c3949; }
.btn.small { height: 26px; padding: 0 9px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------------------------------------------------------------- status language */
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.sicon { flex: none; display: inline-flex; width: 16px; height: 16px; }
.sicon svg { display: block; }
.sicon.ok { color: var(--ok); } .sicon.look { color: #c27a12; } .sicon.need { color: var(--need); }
.sicon.edited { color: var(--edit); } .sicon.resolved { color: var(--ok); }
.status .sicon { width: 14px; height: 14px; } .status .sicon svg { width: 14px; height: 14px; }
.s-need .dot, .dot.need { background: var(--need); }
.s-look .dot, .dot.look { background: var(--look); }
.s-ok .dot, .dot.ok { background: var(--ok); }
.s-edited .dot, .dot.edited { background: var(--edit); }
.s-resolved .dot { background: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.status.resolved { color: var(--ink-2); } .status.need { color: var(--need); } .status.look { color: var(--look); } .status.ok { color: var(--ok); } .status.edited { color: var(--edit); } .status.muted { color: var(--ink-2); }
.meter { flex: none; width: 26px; height: 4px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.meter i { display: block; height: 100%; background: #a3adb8; }
.meter.mid i { background: var(--look); } .meter.low i { background: var(--need); } .meter.none i { background: transparent; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--desk); }

/* ---------------------------------------------------------------- home */
.home-main { max-width: 1040px; margin: 0 auto; padding: 32px 20px 64px; }
.home-main h1 { font-size: 26px; margin-bottom: 6px; }
.home-main .lede { color: var(--ink-2); max-width: 68ch; margin-bottom: 20px; }
.drop { display: flex; align-items: center; gap: 16px; padding: 22px 24px; border: 1.5px dashed #b9c1ca; border-radius: var(--radius); background: var(--paper); }
.drop.over { border-color: var(--ink); background: #fbfcfd; }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop .drop-text { flex: 1; }
.drop .drop-text strong { display: block; font-size: 15px; }
.drop .drop-text span { color: var(--ink-2); font-size: 13px; }
.upload-msg { margin-top: 8px; font-size: 13px; color: var(--ink-2); min-height: 1.4em; }
.upload-msg.err { color: var(--need); }
.batch { margin-top: 8px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); }
.batch h2 { margin: 0 0 10px; font-size: 16px; }
.batch-files { list-style: none; margin: 0; padding: 0; }
.batch-files li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.batch-files li:last-child { border-bottom: 0; }
.batch-files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-files .pages { color: var(--ink-2); white-space: nowrap; }
.batch-files .tag { padding: 0 7px; border-radius: 999px; font-size: 12px; color: var(--ink-2); background: var(--desk); white-space: nowrap; }
.batch-files .skip { color: var(--ink-3); }
.batch .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.jobs { margin-top: 36px; }
.jobs h2 { margin-bottom: 10px; }
.jobs-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.jobs-h h2 { margin: 0; }
.jobs-h .count { color: var(--ink-2); font-size: 13px; }
.jobs-h .search { margin-left: auto; }
.search input { width: min(280px, 70vw); height: 32px; padding: 0 10px; border: 1px solid #c9d0d7; border-radius: 6px; font: inherit; background: #fff; }
.table th a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
.table th a.sort:hover { color: var(--ink); }
.table th a.sort.on { color: var(--ink); font-weight: 600; }
.table th .arrow { margin-left: 4px; font-size: 10px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.pager [aria-disabled="true"] { opacity: .45; cursor: default; }
.table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table th { font-size: 12px; font-weight: 500; color: var(--ink-2); background: #f7f8fa; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfc; }
.table td.when { color: var(--ink-2); white-space: nowrap; }
.table a.file { font-weight: 500; text-decoration: none; }
.table a.file:hover { text-decoration: underline; }
.table .forms { color: var(--ink-2); }
.altered-tag { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 500; color: #8a4b00; background: #fff1d6; }
.jobs-empty { padding: 28px; text-align: center; color: var(--ink-2); background: var(--paper); border-radius: var(--radius); }

/* ---------------------------------------------------------------- progress, error, nothing found */
.status-page { max-width: 620px; margin: 48px auto; padding: 28px 32px; background: var(--paper); border-radius: var(--radius); }
.status-page h1 { margin-bottom: 18px; }
.status-page .progress-form { margin: -10px 0 14px; color: var(--ink-2); }
.status-page .note { margin-top: 18px; }
.stepper { list-style: none; margin: 0; padding: 0; }
.stepper li { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink-3); border-bottom: 1px solid var(--rule); }
.stepper li:last-child { border-bottom: 0; }
.stepper li .ic { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1.5px solid var(--rule); display: grid; place-items: center; font-size: 12px; }
.stepper li.done { color: var(--ink-2); }
.stepper li.done .ic { border-color: var(--ok); background: var(--ok); color: #fff; }
.stepper li.now { color: var(--ink); font-weight: 600; }
.stepper li.now .ic { border-color: var(--ink); }
.stepper li.now .ic::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .stepper li.now .ic::after { animation: none; } }
.status-page .table { margin-top: 16px; border: 1px solid var(--rule); }
.status-page .issues { list-style: none; padding: 0; margin: 12px 0 0; }
.status-page .issues li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; }

/* ---------------------------------------------------------------- altered copy */
.rerun { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(29, 39, 51, .16); }
.menu { width: min(240px, calc(100vw - 32px)); padding: 4px; }
.menu .mi { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.menu .mi:hover, .menu .mi:focus-visible { background: var(--desk); }
.menu .mi span { font-size: 12.5px; color: var(--ink-2); }
.menu .mi[aria-disabled="true"] { cursor: not-allowed; }
.menu .mi[aria-disabled="true"] b { color: var(--ink-3); }
.confirm { width: min(340px, calc(100vw - 32px)); padding: 16px 18px; }
.confirm h2 { margin: 0 0 6px; font-size: 16px; }
.confirm p { margin: 0 0 10px; }
.confirm .actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 14px; }
.confirm .err { color: var(--need); }
.rerun-note { display: flex; align-items: center; gap: 12px; margin: 12px 20px 0; padding: 10px 14px; border-radius: var(--radius); background: var(--look-bg); color: #6e3f05; border: 1px solid #f0c27a; }
.rerun-note .btn { margin-left: auto; }
.altered { margin: 12px 20px 0; padding: 10px 14px; border-radius: var(--radius); background: #fff1d6; color: #6b3a00; border: 1px solid #f0b44c; }

/* ---------------------------------------------------------------- review layout */
.review { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(400px, 1fr); grid-template-areas: "tabs tabs" "viewer panel"; gap: 0 20px; padding: 14px 20px 40px; align-items: start; }
.forms-switch { grid-area: tabs; display: flex; gap: 4px; margin-bottom: 12px; padding: 3px; background: #e2e6ea; border-radius: 8px; width: max-content; max-width: 100%; overflow-x: auto; }
.forms-switch button { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.forms-switch button.on { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(29,39,51,.12); }
.forms-switch .n { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; font-size: 12px; font-weight: 600; line-height: 18px; text-align: center; color: #fff; background: var(--need); }
.forms-switch .n.zero { background: var(--ok); }
.forms-switch .n.muted { background: var(--ink-3); }

.viewer-col { grid-area: viewer; min-width: 0; position: sticky; top: calc(var(--bar-h) + 12px); }
.viewer-tools { display: flex; align-items: center; gap: 10px; min-height: 34px; margin-bottom: 8px; color: var(--ink); font-size: 13px; }
.zoom { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); overflow: hidden; }
.zoom button { height: 28px; min-width: 34px; padding: 0 8px; border: 0; border-right: 1px solid var(--rule); background: transparent; cursor: pointer; }
.zoom button:last-child { border-right: 0; }
.zoom button:hover { background: var(--desk); }
.viewer { position: relative; height: calc(100vh - var(--bar-h) - 200px); min-height: 380px; overflow: auto; padding: 10px; background: #dfe4e8; border-radius: var(--radius); }
.page-wrap { position: relative; margin: 0 auto; }
.page-wrap img { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 1px 3px rgba(29,39,51,.25); }
.thumbs { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; padding: 2px 2px 10px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }
.thumb { flex: none; width: 76px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.thumb img { display: block; width: 100%; aspect-ratio: 17 / 22; object-fit: cover; object-position: top; background: #fff; border-radius: 3px; outline: 2px solid transparent; outline-offset: 1px; }
.thumb.on img { outline-color: var(--ink); }
.thumb span { display: block; margin-top: 3px; font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb.on span { color: var(--ink); font-weight: 600; }

/* boxes on the scan: quiet by default, the selected one gets the highlighter */
.ov { position: absolute; border: 1.5px solid rgba(46,125,79,.4); border-radius: 3px; cursor: pointer; }
.ov.need { border: 2px solid var(--need); background: rgba(179,38,30,.05); }
.ov.look { border: 2px solid var(--look); background: rgba(161,92,7,.05); }
.ov.edited { border: 2px solid var(--edit); }
.ov.paper { border: 1.5px dashed var(--ink-2); cursor: pointer; }
.ov span { display: none; position: absolute; left: -2px; bottom: calc(100% + 3px); max-width: 260px; padding: 2px 7px; border-radius: 4px; font-size: 12px; font-weight: 500; line-height: 1.35; color: #fff; background: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.ov.hover { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 3; }
.ov.hover span, .ov.focus span { display: block; }
.ov.focus { z-index: 4; border: 2px solid var(--ink); background: rgba(255,227,110,.45); }

/* ---------------------------------------------------------------- panel */
.panel { grid-area: panel; min-width: 0; background: var(--paper); border-radius: var(--radius); }
.panel section, .panel-head { padding: 18px 20px; border-top: 1px solid var(--rule); }
.panel-head { border-top: 0; }
.panel-head .sub { margin-top: 2px; color: var(--ink-2); font-size: 13px; }
.panel-head .summary { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.sec-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.sec-h .hint { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.sec-h .count { color: var(--ink-2); font-weight: 400; }
.page-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 2px; }
.page-h + .note { margin-bottom: 6px; }
.group-h { margin: 14px 0 2px; }

/* rows: one line per answer; the queue adds the reason underneath */
.rows { list-style: none; margin: 0; padding: 0; }
.row { border-bottom: 1px solid #eef0f3; scroll-margin: 72px 0 24px; }
.row:last-child { border-bottom: 0; }
.row-main { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; width: 100%; min-height: 38px; padding: 7px 8px 7px 6px; border: 0; border-left: 3px solid transparent; background: none; text-align: left; cursor: pointer; }
.row-main:hover { background: #f7f8fa; }
.row-main:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 4px; }
.row-main .q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main .a { justify-self: end; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row-main .a.empty { font-weight: 400; color: var(--ink-3); }
.row.focus > .row-main, .row.open > .row-main { border-left-color: var(--mark); background: #fffbe6; }
.queue .row-main { grid-template-columns: 16px minmax(0, 1fr) auto; align-items: start; padding-top: 10px; padding-bottom: 10px; }
.queue .row-main .dot { margin-top: 6px; }
.queue .row-main .sicon { margin-top: 2px; }
.queue .row-main .q { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.queue .row-main .why { grid-column: 2 / 4; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.queue .row-main .a { max-width: 170px; }
.queue-empty { padding: 10px 0; color: var(--ok); font-weight: 500; }
.blank-group { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 34px; padding: 6px 8px 6px 9px; border: 0; background: none; color: var(--ink-3); text-align: left; cursor: pointer; }
.blank-group:hover { background: #f7f8fa; color: var(--ink-2); }
.resolved { margin-top: 10px; }
.resolved summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
.resolved .row-main { cursor: default; }
.resolved .why { color: var(--ink-3); }

/* the details drawer under the selected row */
.detail { padding: 4px 12px 16px 27px; background: #fffdf3; border-left: 3px solid var(--mark); }
.detail .means { margin-bottom: 12px; padding: 8px 10px; border-radius: 6px; font-size: 13px; }
.detail .means.need { background: var(--need-bg); color: #7d1a14; }
.detail .means.look { background: var(--look-bg); color: #6e3f05; }
.detail .label-full { margin-bottom: 8px; color: var(--ink-2); font-size: 13px; }
.field-h { margin: 14px 0 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.opts { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.opt { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.opt.none { color: var(--ink-2); }
.tx { width: 100%; padding: 6px 8px; border: 1px solid #c9d0d7; border-radius: 6px; font: inherit; background: #fff; }
.tx.num { width: 120px; }
.save-state { min-height: 18px; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.save-state.error { color: var(--need); }
.link { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.paper-rows .detail .note { margin-top: 6px; }
textarea.tx { resize: vertical; }
.empty-hint { margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.detail .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* how it was read: a short vertical story */
.story { list-style: none; margin: 0; padding: 0; }
.story li { position: relative; padding: 0 0 12px 20px; }
.story li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.story li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 1px; background: var(--rule); }
.story li:last-child { padding-bottom: 0; }
.story li:last-child::after { display: none; }
.story li.result::before { background: var(--ink); }
.story .step { font-weight: 600; margin-right: 6px; }
.story .txt { color: var(--ink); }
.story .pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--desk); color: var(--ink-2); }
.pill.ok { background: var(--ok-bg); color: #1f5c39; }
.pill.look { background: var(--look-bg); color: #6e3f05; }
.pill.need { background: var(--need-bg); color: #7d1a14; }
.pill .meter { width: 20px; background: rgba(29,39,51,.12); }
.tech { margin-top: 12px; }
.tech summary { cursor: pointer; font-size: 12px; color: var(--ink-2); }
.tech .raw { margin-top: 6px; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.tech .field-h { margin-top: 10px; }
.tech .story + .raw { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--rule); }
.tech .raw code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }

/* paper-only rows (sign-off, older RA clinician questions) */
.paper-rows .row-main { grid-template-columns: 12px minmax(0, 1fr) auto; }
.paper-rows .dot { background: transparent; border: 1.5px dashed var(--ink-3); width: 9px; height: 9px; }

/* export */

/* Export preview: a side drawer with a small JSON code viewer (line numbers, colours, fold, wrap). */
.drawer { position: fixed; inset: 0 0 0 auto; width: min(820px, 100vw); height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--rule); background: var(--paper); color: var(--ink); flex-direction: column; }
.drawer[open] { display: flex; }
.drawer::backdrop { background: rgba(29, 39, 51, .32); }
.drawer-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-head .note { margin: 2px 0 0; }
.drawer-head .btn[aria-pressed="true"] { background: var(--desk); border-color: var(--ink-3); }
.drawer-tabs { flex: none; display: flex; gap: 4px; margin: 10px 18px; padding: 3px; width: max-content; background: #e2e6ea; border-radius: 8px; }
.drawer-tabs button { height: 30px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font: inherit; cursor: pointer; white-space: nowrap; }
.drawer-tabs button[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(29,39,51,.12); }
.code { flex: 1; min-height: 0; overflow: auto; padding: 10px 0 24px; background: #fbfcfd; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: #24313f; counter-reset: none; }
.code:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.code .ln { position: relative; min-height: 1.6em; padding-left: calc(7ch + var(--d, 0) * 2ch); padding-right: 18px; white-space: pre; }
.code .ln::before { content: attr(data-n); position: absolute; left: 0; width: 5ch; text-align: right; color: #9aa4ae; user-select: none; }
.code.wrap .ln { white-space: pre-wrap; overflow-wrap: anywhere; }
.code .jt { position: absolute; left: calc(5.6ch + var(--d, 0) * 2ch); top: 0; width: 1.4ch; height: 1.6em; padding: 0; border: 0; background: none; color: #6b7682; cursor: pointer; font: inherit; line-height: inherit; }
.code .jt:hover { color: var(--ink); }
.code .jt:focus-visible { outline: 2px solid var(--ink); border-radius: 2px; }
.code .jb.folded > .jc, .code .jb.folded > .ln.close { display: none; }
.code .jb:not(.folded) > .ln .fold, .code .jb:not(.folded) > .ln .fold-end { display: none; }
.code .fold { color: #6b7682; background: #eef1f4; border-radius: 3px; padding: 0 4px; margin: 0 2px; }
.code .k { color: #0b5cad; }
.code .s { color: #1a7f37; }
.code .n { color: #b35900; }
.code .b { color: #8250df; }
.code .p { color: #6b7682; }

/* Unknown tab: pages no form reads. Only its own section shows in the panel. */
#unknown-card { display: none; }
.panel.unknown > section:not(#unknown-card), .panel.unknown #inputs { display: none; }
.panel.unknown #unknown-card { display: block; }
#unknown .row-main .a { font-weight: 500; }
.panel.unknown.empty #unknown-card { display: none; }
.viewer-col.empty .thumbs, .viewer-col.empty .viewer, .viewer-col.empty .zoom { display: none; }
#unknown-issues { list-style: none; margin: 14px 0 0; padding: 0; }
#unknown-issues li { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; font-size: 13px; }

/* Desktop review: one full-viewport screen. The page never scrolls; only the scan preview (left, below the
   thumbnails) and the questions panel (right) do. Narrower screens keep the stacked, normally scrolling layout. */
@media (min-width: 1001px) {
  body:has(#review:not([hidden])) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
  body:has(#review:not([hidden])) > .bar, body:has(#review:not([hidden])) > .altered { flex: none; position: static; }
  .review:not([hidden]) { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); align-items: stretch; padding-bottom: 16px; }
  .review .viewer-col { position: static; display: flex; flex-direction: column; min-height: 0; }
  .review .viewer-tools, .review .thumbs { flex: none; }
  .review .viewer { flex: 1; height: auto; min-height: 0; }
  .review .panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 1000px) {
  .review { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tabs" "viewer" "panel"; }
  .viewer-col { position: static; margin-bottom: 16px; }
  .viewer { height: 60vh; }
  .drop { flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .bar { gap: 10px; padding: 0 16px; }
  .bar .meta { display: none; }
  .bar .file { display: none; }
  .bar .status { display: none; }
  .bar .btn { height: 30px; padding: 0 10px; }
  .home-main { padding: 22px 16px 48px; }
  .drop { flex-direction: column; align-items: stretch; text-align: left; }
  .table .forms { display: none; }
  .table th, .table td { padding: 10px; }
  .table td { word-break: break-word; }
  .review { padding: 12px 16px 32px; }
  .panel section, .panel-head { padding: 16px; }
  .row-main .a { max-width: 120px; }
  .sec-h .hint { display: none; }
  .status-page { margin: 24px 16px; padding: 22px 20px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Sign-in */
.login-main { display: grid; place-items: start center; padding: 12vh 16px 40px; }
.login { width: min(340px, 100%); display: grid; gap: 8px; padding: 28px; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; }
.login h1 { margin: 0 0 8px; font-size: 22px; }
.login label { font-size: 13px; color: var(--ink-2); }
.login input { height: 36px; padding: 0 10px; border: 1px solid #c9d0d7; border-radius: 6px; font: inherit; background: #fff; }
.login input:focus-visible { outline: 2px solid var(--edit); outline-offset: 1px; }
.login .btn { justify-content: center; height: 36px; margin-top: 4px; }
.login .upload-msg { min-height: 1.2em; margin: 0; }
