/* Beacon review app — IMA brand palette (memory: ima-branding).
   cyan #00B2E3, marine #004D71, mid #0090B8, grey #A5BAC9, pale-cyan #EAF7FC */
:root {
  --cyan: #00B2E3;
  --marine: #004D71;
  --mid: #0090B8;
  --grey: #A5BAC9;
  --pale: #EAF7FC;
  --ink: #1b2733;
  --line: #d7e3ec;
  --bg: #f4f8fb;
  --warn: #b5651d;
  --ok: #1d7a4d;
  --radius: 8px;
}
/* --- environment identity (three-tier plan): non-prod must be unmistakable ---------------- */
.tier-banner {
  flex: 0 0 auto;
  text-align: center; font-weight: 700; font-size: 12px; letter-spacing: .1em;
  padding: 4px 10px; color: #fff; text-transform: none;
}
html[data-tier="dev"] .tier-banner { background: #1d5fbf; }   /* blue = development */
html[data-tier="uat"] .tier-banner { background: #b57a1d; }   /* amber = UAT */
/* Accent recolour so the whole chrome reads as the tier, not just the band. */
html[data-tier="dev"] .topbar { border-bottom-color: #1d5fbf; }
html[data-tier="uat"] .topbar { border-bottom-color: #b57a1d; }
html[data-tier="dev"] .brand-sub { color: #1d5fbf; }
html[data-tier="uat"] .brand-sub { color: #b57a1d; }

/* --- tier run-state (maintenance / stopped) ------------------------------------------------ */
.maint-overlay {
  position: fixed; inset: 0; z-index: 60; /* above every overlay incl. help (50) */
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.maint-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,77,113,.12);
  padding: 40px 48px; max-width: 520px; text-align: center;
}
.maint-card h1 { margin: 6px 0 10px; color: var(--marine); font-size: 24px; }
.maint-card p { font-size: 15px; color: var(--ink); margin: 8px 0; }
.maint-card p.muted { font-size: 13px; }
.maint-adminbar {
  flex: 0 0 auto; text-align: center; font-size: 12.5px; font-weight: 600;
  padding: 5px 10px; background: #7a1d1d; color: #fff;
}

/* --- "What's new" release notes ------------------------------------------------------------ */
.wn-badge {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn); margin-left: 5px; vertical-align: super;
}
.wn-body { max-height: 60vh; overflow-y: auto; }
.wn-release { padding: 10px 0; border-bottom: 1px solid var(--line); }
.wn-release:last-child { border-bottom: 0; }
.wn-release ul { margin: 6px 0 0; padding-left: 20px; }
.wn-release li { font-size: 13.5px; margin: 4px 0; }
.wn-fixes { font-size: 12px; margin-top: 6px; }

* { box-sizing: border-box; }
/* Author display rules (e.g. .who{display:flex}) outrank the UA [hidden] rule, so make
   the `hidden` attribute authoritative — without this, hidden flex/grid elements still show. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  /* App shell = exactly the viewport height. The topbar takes its natural height and the
     main area fills the rest; the detail view then fits the window so only its inner panes
     scroll — no page-level scrollbar (the queue still scrolls inside `main` when long). */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: #fff; border-bottom: 3px solid var(--cyan);
  box-shadow: 0 1px 4px rgba(0,77,113,.08);
  flex: 0 0 auto; /* fixed-height header within the viewport-height shell */
}
/* Login screen: blank page but for the centered card — drop the top header bar entirely. */
body.signedout .topbar { display: none; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo { height: 42px; width: auto; display: block; }
.brand-divider { width: 1px; height: 26px; background: var(--line); flex: none; }
.brand-sub { color: var(--mid); font-weight: 600; font-size: 15px; letter-spacing: .01em; }
/* sign-in card: the full Beacon wordmark sits above the heading on the white card */
.signin-logo { display: block; width: 300px; max-width: 78%; height: auto; margin: 0 auto 20px; }
.who { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--marine); }

/* Full-bleed so the review view uses the whole window (the queue stays capped + centered below).
   Fills the remaining viewport height and is the scroll container: the queue scrolls here when
   long, while the detail view fits exactly (so its only scroll is the inner spine/OCR). */
main { margin: 0; padding: 14px 20px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; }
#view-list { max-width: 1080px; margin: 0 auto; }
h1 { font-size: 22px; color: var(--marine); margin: 0 0 4px; }
h2 { font-size: 16px; color: var(--marine); margin: 0 0 6px; }
.muted { color: #5d6f7e; font-size: 13px; }
.small { font-size: 12px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.center { max-width: 420px; margin: 60px auto; text-align: center; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.list-tools { display: flex; align-items: center; gap: 14px; }
.facts { display: flex; gap: 16px; }
.fact { font-size: 13px; color: #5d6f7e; }
.fact b { color: var(--marine); }

/* buttons */
button { font: inherit; cursor: pointer; border-radius: 6px; }
.btn-primary { background: var(--cyan); color: #fff; border: none; padding: 10px 20px; font-weight: 600; }
.btn-primary:hover { background: var(--mid); }
.btn-primary:disabled { background: var(--grey); cursor: default; }
.btn-secondary { background: #fff; color: var(--marine); border: 1px solid var(--mid); padding: 7px 14px; }
.btn-secondary:hover { background: var(--pale); }
.btn-secondary.active { background: var(--cyan); color: #fff; border-color: var(--cyan); }
.btn-link { background: none; border: none; color: var(--mid); text-decoration: underline; padding: 4px 0; }
kbd {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; background: #eef3f7;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; color: var(--marine);
}

/* live pipeline flow (queue view) */
.pipeline { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px 14px; margin-top: 14px; }
.pl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pl-title { font-weight: 600; color: var(--marine); }
.pl-live { font-size: 12px; color: var(--ok); font-weight: 600; }
.pl-live.stale { color: var(--grey); }
/* The strip ALWAYS fits its card — never a scrollbar: stages + connectors shrink to fit (flex-shrink
   1, no min floor) and any residual overflow is clipped, not scrolled. */
.pl-track { display: flex; align-items: flex-start; gap: 0; overflow-x: hidden; padding-bottom: 4px; }
.pl-stage { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; }
.pl-node { position: relative; width: 46px; height: 46px; border-radius: 50%; background: var(--pale);
  border: 2px solid var(--line); display: flex; align-items: center; justify-content: center;
  color: var(--mid); font-size: 18px; transition: all .35s ease; }
.pl-node.active { background: var(--cyan); border-color: var(--cyan); color: #fff;
  box-shadow: 0 0 0 0 rgba(0,178,227,.5); animation: pl-pulse 1.8s infinite; }
.pl-node.err { background: #b3261e; border-color: #b3261e; color: #fff; animation: none; }
@keyframes pl-pulse { 0% { box-shadow: 0 0 0 0 rgba(0,178,227,.45); }
  70% { box-shadow: 0 0 0 9px rgba(0,178,227,0); } 100% { box-shadow: 0 0 0 0 rgba(0,178,227,0); } }
.pl-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--marine); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.pl-count.err { background: #b3261e; }
.pl-label { font-size: 12px; color: var(--marine); font-weight: 500; text-align: center; }
.pl-chips { display: flex; flex-direction: column; gap: 3px; align-items: center; max-width: 110px; }
.pl-chip { font-size: 10.5px; color: var(--marine); background: var(--pale); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px; max-width: 104px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; animation: pl-fade .4s ease; }
.pl-chip.err { color: #b3261e; border-color: #e3b3ae; background: #fdecea; }
@keyframes pl-fade { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
/* progress fill behind the chip label (slow stages only): solid = exact (extract), striped = estimate (OCR) */
.pl-chip { position: relative; }
.pl-chip-label { position: relative; z-index: 1; }
.pl-bar { position: absolute; left: 0; top: 0; bottom: 0; z-index: 0; border-radius: 3px 0 0 3px;
  background: rgba(0,178,227,.30); transition: width .6s ease; }
.pl-bar.est { background-image: repeating-linear-gradient(45deg,
  rgba(0,178,227,.32) 0 5px, rgba(0,178,227,.14) 5px 10px); background-color: transparent; }
.pl-chip.err .pl-bar { background: rgba(179,38,30,.18); }

/* admin right-click menu on a pipeline chip (delete a bundle from the pipeline) */
.ctx-menu { position: fixed; z-index: 1000; background: #fff; border: 1px solid var(--line);
  border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 4px; min-width: 200px; }
.ctx-item { display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 4px; color: var(--marine); }
.ctx-item:hover { background: var(--pale); }
.ctx-danger { color: #b3261e; }
.ctx-danger:hover { background: #fdecea; }
/* animated connector between stages — a flowing dash conveys motion even between polls */
.pl-conn { flex: 1 1 18px; height: 3px; margin-top: 22px; border-radius: 2px; align-self: flex-start;
  background-image: linear-gradient(90deg, var(--cyan) 0 50%, transparent 0 100%);
  background-size: 14px 3px; background-repeat: repeat-x; opacity: .35; }
.pl-conn.flowing { opacity: 1; animation: pl-flow .7s linear infinite; }
@keyframes pl-flow { from { background-position: 0 0; } to { background-position: 14px 0; } }

/* compact pipeline in the top header bar (review screen only) — no card; blends into the white topbar */
.pipeline-mini { display: flex; align-items: center; gap: 10px; margin: 0 16px;
  flex: 1 1 auto; min-width: 0; max-width: 700px; }
.pl-title-mini { font-size: 12px; font-weight: 600; color: var(--marine); white-space: nowrap; }
.pl-track-mini { flex: 1; gap: 0; padding: 0; overflow: hidden; }
.pl-track-mini .pl-stage { min-width: 0; gap: 1px; flex: 1 1 0; }
.pl-track-mini .pl-node { width: 26px; height: 26px; font-size: 11px; }
.pl-track-mini .pl-label { font-size: 9.5px; }
.pl-track-mini .pl-conn { margin-top: 13px; flex-basis: 8px; }

/* Review-header mini strip: concentric, clockwise-filling progress rings — one lane per case at a node
   (up to 3). The most-advanced case is the outer ring; a ring vanishes when its case moves on. Rings
   sit on the pale node (not the solid cyan active fill) so they read clearly. */
.pl-node.has-rings { background: var(--pale); border-color: var(--cyan); color: var(--marine); animation: none; }
.pl-rings { position: absolute; inset: 0; width: 100%; height: 100%; }
.pl-ring-track { fill: none; stroke: rgba(0,178,227,.14); stroke-width: 2.5; }
.pl-ring { fill: none; stroke: var(--cyan); stroke-width: 2.5; stroke-linecap: round;
  transition: stroke-dashoffset .6s ease; }
.pl-ring.est { stroke: rgba(0,178,227,.5); } /* OCR = time-estimate: lighter than the exact stages */
.pl-node.has-rings.err { border-color: #b3261e; }

/* "Start" drop-zone node — dashed, distinct from the live stages; lights up on hover/drag */
.pl-start { cursor: pointer; }
.pl-start-node { background: #fff; border: 2px dashed var(--mid); color: var(--mid); font-weight: 700; }
.pl-start .pl-label { color: var(--mid); font-weight: 600; }
.pl-start:hover .pl-start-node,
.pipeline.drop-active .pl-start-node,
.pipeline-mini.drop-active .pl-start-node {
  background: var(--pale); border-color: var(--cyan); color: var(--cyan); border-style: solid; }

/* review-routing threshold control (queue view) */
.routing { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--mid);
  border-radius: var(--radius); padding: 12px 16px; margin-top: 14px; }
.routing-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.routing-label { font-weight: 600; color: var(--marine); }
.routing-ctl { color: var(--ink); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.thr-input { width: 56px; border: 1px solid var(--line); border-radius: 4px; padding: 5px 6px;
  font: inherit; font-size: 14px; text-align: right; }
.thr-input:focus { outline: 2px solid var(--cyan); border-color: var(--cyan); }
#thr-save { margin-left: auto; }
#routing-state { margin-top: 7px; }
.routing-on { color: var(--ok); }

/* queue list */
#list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.task {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--cyan);
  border-radius: var(--radius); padding: 14px 18px; cursor: pointer;
}
.task:hover { background: var(--pale); }
.task .tid { font-weight: 600; color: var(--marine); }
.task .meta { font-size: 13px; color: #5d6f7e; display: flex; gap: 16px; align-items: baseline; }
.task .meta .cost { color: var(--marine); font-weight: 600; }
.empty { color: #5d6f7e; padding: 24px; text-align: center; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ===== detail view: spine + viewer ===== */
/* The detail view fills `main`: header + footer take their natural height, the grid flexes into
   whatever is left, so the screen fits the window at any size (no page-level scrollbar). */
#view-detail { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.detail-top { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; flex: 0 0 auto; }
.detail-top h1 { margin: 0; }
.detail-top .facts { gap: 16px; }
.attn-count { background: var(--warn); color: #fff; font-size: 12px; font-weight: 600; border-radius: 12px; padding: 3px 11px; }
#help-btn { margin-left: auto; }

.review-grid {
  display: grid; grid-template-columns: var(--spine-w, 360px) 6px 1fr; gap: 8px; align-items: stretch;
  /* Flex into the space left between the header and footer instead of a hardcoded viewport
     subtraction — fits at every window size; min-height:0 lets the inner panes own the scroll. */
  flex: 1 1 auto; min-height: 0;
}
.pane-splitter { cursor: col-resize; background: var(--line); border-radius: 3px; align-self: stretch; }
.pane-splitter:hover, .pane-splitter.dragging { background: var(--cyan); }

/* spine */
.spine { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.spine-head { padding: 9px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--marine); }
.spine-body { overflow-y: auto; flex: 1; }
.srow { padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; border-left: 4px solid transparent; }
.srow:hover { background: var(--pale); }
.srow.active { background: #e3f4fb; border-left-color: var(--cyan); }
.srow.edited { background: #fff6e6; }
.srow.active.edited { background: #fdeecf; }
/* leading Index/TOC item — reads as the deliverable's front-matter section header */
.srow-index { background: var(--pale); }
.srow-index .type { font-weight: 700; color: var(--marine); }
.srow-index .pg { background: var(--mid); }
.srow-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.srow-head .pg { font-size: 11px; font-weight: 700; color: #fff; background: var(--marine); border-radius: 4px; padding: 1px 6px; }
.srow-head .type { font-size: 12px; color: var(--ink); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #fff; background: var(--warn); border-radius: 4px; padding: 1px 6px; letter-spacing: .03em; }
/* Confidence dot carries a non-colour cue (letter) for colour-blind reviewers; per-class text
   colour keeps the letter high-contrast on each background. */
.conf-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; display: inline-flex;
  align-items: center; justify-content: center; font: 700 10px/1 ui-monospace, Menlo, monospace; color: #fff; }
.conf-dot.high { background: var(--ok); }
.conf-dot.mid { background: #e0a528; color: #3d2e00; }
.conf-dot.low { background: #c0392b; }
.conf-dot.unknown { background: var(--grey); color: #243240; }
.srow-fields { display: flex; gap: 6px; margin-bottom: 5px; }
.srow-fields input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; font: inherit; font-size: 12px; background: #fff; }
.srow-fields input:focus { outline: 2px solid var(--cyan); border-color: var(--cyan); }
.srow-fields select { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; font: inherit; font-size: 12px; background: #fff; color: var(--ink); }
.srow-fields select:focus { outline: 2px solid var(--cyan); border-color: var(--cyan); }
.srow-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: #5d6f7e; }
.srow-foot .flag { display: flex; align-items: center; gap: 4px; cursor: pointer; }

/* reviewer keep/weed override controls (capture-only) */
.srow-acts { display: flex; align-items: center; gap: 10px; flex: none; }
.ovr { display: inline-flex; align-items: center; gap: 4px; }
.ovr-sec { display: flex; align-items: center; gap: 4px; cursor: pointer; font-weight: 600; }
.ovr-weed .ovr-sec { color: #c0392b; }
.ovr-keep .ovr-sec { color: var(--ok); }
.ovr-pp { font: inherit; font-size: 10px; line-height: 1.4; padding: 1px 5px; border: 1px solid var(--line);
  background: #fff; color: var(--mid); border-radius: 4px; cursor: pointer; }
.ovr-pp:hover { border-color: var(--mid); }
/* per-page chips: a full-width in-flow block under the row (never clipped by the scrolling spine) */
.ovr-pages { display: flex; flex-wrap: wrap; gap: 4px; padding: 7px 12px 9px; border-top: 1px dashed var(--line); }
.pg-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--marine);
  background: var(--pale); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; cursor: pointer; }
/* marked-row states */
.srow.row-weeding { background: #fdecea; border-left-color: #c0392b; }
.srow.row-weeding .srow-head .type { text-decoration: line-through; opacity: .85; }
.srow.row-keeping { background: #e8f6ee; border-left-color: var(--ok); }
.spine-weeded .srow { cursor: default; }
.spine-weeded .srow:hover { background: #fff; }
/* the weeded spine's leading Index/TOC item IS clickable (jumps to the rejected front page) */
.spine-weeded .srow-index { cursor: pointer; }
.spine-weeded .srow-index:hover { background: var(--pale); }
.spine-weeded .srow.row-keeping, .spine-weeded .srow.row-keeping:hover { background: #e8f6ee; }

/* viewer */
.viewer-col { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.viewer-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.view-switch { display: flex; gap: 4px; }
.vbtn { background: #fff; border: 1px solid var(--mid); color: var(--marine); border-radius: 6px; padding: 5px 10px; font-size: 13px; }
.vbtn.active { background: var(--marine); color: #fff; border-color: var(--marine); }
.vbtn kbd { margin-left: 4px; }
.coord { flex: 1; font-size: 12.5px; color: #5d6f7e; min-width: 180px; }
.coord b { color: var(--marine); }
.viewer-tools { display: flex; align-items: center; gap: 8px; }
.viewer-tools a.disabled { opacity: .4; pointer-events: none; }
#compare-btn.active { background: var(--cyan); color: #fff; border-color: var(--cyan); }

.panes { flex: 1; display: grid; gap: 6px; padding: 6px; background: #5a6b78; overflow: hidden; }
.panes.single { grid-template-columns: 1fr; }
.panes.two-up { grid-template-columns: 1fr 1fr; }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pane-bar { display: flex; justify-content: space-between; font-size: 11px; color: #eaf2f7; padding: 1px 4px 3px; }
/* viewer.js fits the WHOLE page to this frame in both views — page is centered, never scrolls. */
.canvas-wrap { background: #3f4d59; flex: 1; overflow: hidden; display: flex; justify-content: center; align-items: center; padding: 4px; border-radius: 4px; }
.page-holder { position: relative; line-height: 0; }
.canvas-wrap canvas { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); display: block; }
/* clickable hit-areas for the PDF's internal links (sized/placed by viewer.js over the canvas) */
.link-layer { position: absolute; top: 0; left: 0; pointer-events: none; }
.pdf-link { position: absolute; pointer-events: auto; cursor: pointer; border-radius: 2px; }
.pdf-link:hover { background: rgba(0,178,227,.18); outline: 1px solid var(--cyan); }

/* verdict / notes / submit footer */
.review-foot { display: flex; align-items: center; gap: 18px; margin: 12px 0 0; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; flex: 0 0 auto; }
.verdict { display: flex; gap: 20px; }
.radio { font-size: 14px; }
.notes { font-size: 13px; flex: 1; min-width: 220px; }
.notes summary { cursor: pointer; color: var(--mid); }
.field { display: block; margin: 8px 0; }
.field span { display: block; font-size: 13px; color: var(--marine); margin-bottom: 4px; font-weight: 500; }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: inherit; font-size: 13px; resize: vertical; }
#edit-count { font-size: 13px; }
#submit { margin-left: auto; }

/* help overlay */
.help-overlay { position: fixed; inset: 0; background: rgba(13,30,43,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.help-card { background: #fff; border-radius: 10px; padding: 20px 26px 24px; max-width: 460px; width: 90%; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.help-card h2 { margin: 0; }
.help-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 9px; font-size: 14px; color: var(--ink); }
.help-list kbd { margin-right: 2px; }
.ocr-card { max-width: 680px; }
.ocr-text { margin: 12px 0 0; max-height: 60vh; overflow: auto; white-space: pre-wrap; word-break: break-word;
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--pale); border: 1px solid var(--line);
  border-radius: 6px; padding: 12px; color: var(--ink); }

/* banner */
.banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: 28px;
  padding: 12px 22px; border-radius: 8px; color: #fff; font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,.2); z-index: 60; }
.banner.ok { background: var(--ok); }
.banner.err { background: #b3261e; }

/* per-upload toast stack (multi-upload UX) — one toast per active ingestFile(), bottom-centered,
   stacking upward; uses the same visual language as the single .banner above. */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 80px; z-index: 60;
  display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 8px; color: #fff; font-weight: 600; font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2); min-width: 280px; max-width: 520px; pointer-events: auto;
  animation: toast-in .22s ease; }
.toast.ok { background: var(--ok); }
.toast.err { background: #b3261e; }
.toast.done { opacity: .92; transition: opacity .4s ease, transform .4s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
