/* MSI Forklift — shop-floor instrument panel.
 *
 * Direction: industrial/utilitarian. This is a diagnostic console for people who
 * work around machines, not a SaaS dashboard. Dark graphite chassis, hairline rules,
 * monospace readouts, and hazard yellow used the way it is used on a forklift —
 * to mark the thing you must not walk past.
 *
 * Typography: IBM Plex. Chosen for its technical-documentation heritage rather than
 * as a default; Condensed does signage and labels, Sans does prose, Mono carries
 * every number so columns of money and hour-meters align on the digit.
 *
 * Colour discipline (see the dataviz method):
 *  - Magnitude uses ONE hue as an ordinal ramp (--seq-1..5), validated for lightness
 *    monotonicity, adjacent step separation and contrast against --panel.
 *  - Status colours are reserved for Matt's Red/Yellow/Blue/Green severity taxonomy
 *    and always ship with the code as text — colour is never the only signal.
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans+Condensed:wght@500;600;700&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --ink: #0d0f12;
  --panel: #16191e;
  --panel-2: #1b1f26;
  --panel-3: #232830;
  --line: #2a2f38;
  --line-2: #3a4250;

  --text: #e7e9ec;
  --text-2: #a7b0bb;
  --text-3: #767f8b;

  --accent: #f2b705;
  --accent-dim: #8a6d14;
  --accent-ink: #14100a;

  /* Matt's severity taxonomy (rulebook Part B) — reserved, never reused for series */
  --red: #ff6b6b;
  --yellow: #f2b705;
  --blue: #58a6ff;
  --green: #56d364;

  /* Sequential ramp for magnitude. Validated: monotone L, ΔL ≥ 0.06, light end
     2.43:1 vs --panel, single hue (3° spread). */
  --seq-1: #6b5410;
  --seq-2: #8f7013;
  --seq-3: #b48c16;
  --seq-4: #d6a91a;
  --seq-5: #f2c94c;

  --rail: 216px;
  --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --cond: 'IBM Plex Sans Condensed', 'IBM Plex Sans', ui-sans-serif, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  /* A faint machined grain so the flat panels read as surfaces, not voids. */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(242, 183, 5, .05), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px);
  color: var(--text);
  font: 400 14px/1.55 var(--sans);
  font-feature-settings: 'kern' 1;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3, h4 { font-family: var(--cond); font-weight: 600; letter-spacing: .01em; margin: 0; }
h1 { font-size: 25px; letter-spacing: .02em; }
h2 { font-size: 17px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-2); }
h3 { font-size: 15px; }

code, .mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { text-align: right; white-space: nowrap; }

/* ---------------------------------------------------------------- hazard rule
   The one high-voltage element. Reserved for states that genuinely block work —
   no active rulebook, no benchmarks, a failed run. If it is everywhere it means
   nothing. */
.hazard {
  height: 5px;
  background: repeating-linear-gradient(45deg,
    var(--accent) 0 9px, var(--ink) 9px 18px);
  opacity: .9;
}

/* ---------------------------------------------------------------- layout */
.shell { display: flex; min-height: 100vh; }

.rail {
  width: var(--rail);
  flex: 0 0 var(--rail);
  background: linear-gradient(180deg, var(--panel) 0%, #131519 100%);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.plate {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.plate .mark {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text);
  display: block;
  line-height: 1.1;
}
.plate .mark em {
  font-style: normal;
  color: var(--accent);
}
.plate .sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-top: 5px;
  display: block;
}

.nav { padding: 10px 0; flex: 1; }
.nav .group {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 18px 6px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px;
  color: var(--text-2);
  font-family: var(--cond);
  font-size: 14.5px;
  letter-spacing: .03em;
  border-left: 2px solid transparent;
}
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.on {
  color: var(--text);
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(242,183,5,.10), transparent 70%);
}
.nav .tick {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 9px;
  background: var(--panel-3);
  color: var(--text-2);
  border: 1px solid var(--line-2);
}
.nav .tick.hot { background: rgba(255,107,107,.14); color: var(--red); border-color: rgba(255,107,107,.35); }

.whoami {
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  font-size: 12px;
  color: var(--text-3);
}
.whoami b { color: var(--text-2); font-weight: 600; }
.whoami form { display: inline; }
.whoami button {
  background: none; border: 0; color: var(--text-3); cursor: pointer;
  font: inherit; padding: 0; text-decoration: underline; text-underline-offset: 2px;
}
.whoami button:hover { color: var(--accent); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- telemetry strip
   The persistent machine readout. Same numbers on every page so nobody has to
   remember where the review queue lives. */
.telemetry {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.telemetry .cell {
  padding: 9px 16px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.telemetry .k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-3);
}
.telemetry .v {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.telemetry .v.warn { color: var(--accent); }
.telemetry .v.bad { color: var(--red); }
.telemetry .v.good { color: var(--green); }
.telemetry .spacer { flex: 1; border-right: 0; }

.content { padding: 22px 26px 60px; max-width: 1500px; }

.head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.head .lede { color: var(--text-2); font-size: 13.5px; max-width: 76ch; margin: 6px 0 18px; }
.head .spacer { flex: 1; }

/* ---------------------------------------------------------------- panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  margin-bottom: 18px;
}
.panel > header {
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel > header h2 { font-size: 12.5px; }
.panel > header .spacer { flex: 1; }
.panel .body { padding: 15px; }
.panel .body.tight { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* ---------------------------------------------------------------- stat tiles
   A hero number with no plot: per the form heuristic this is the right mark for a
   single headline value, and it is the one form that needs no hover layer. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 12px 14px 13px;
  position: relative;
  overflow: hidden;
}
.tile .k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-3);
  display: block;
}
.tile .v {
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.15;
  margin-top: 5px;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.tile .s { font-size: 11.5px; color: var(--text-3); margin-top: 3px; display: block; }
.tile.attention { border-color: rgba(242,183,5,.4); }
.tile.attention .v { color: var(--accent); }
.tile.alarm { border-color: rgba(255,107,107,.4); }
.tile.alarm .v { color: var(--red); }
.tile.calm .v { color: var(--green); }
.tile a { color: inherit; }

/* ---------------------------------------------------------------- tables */
.tablewrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 400;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}
table.data th.num { text-align: right; }
table.data td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data tbody tr:hover td { background: var(--panel-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
/* An ISO date broken across two lines reads as two numbers. Monospace cells hold dates,
   FL numbers and codes — none of them may wrap. */
table.data td.mono { white-space: nowrap; }
table.data .dim { color: var(--text-3); }
table.data caption {
  caption-side: bottom;
  text-align: left;
  padding: 10px 12px;
  color: var(--text-3);
  font-size: 12px;
}

/* in-table magnitude meter: ordinal ramp, 4px rounded data-end on the baseline,
   2px surface gap so adjacent fills never touch */
.meter { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.meter .track {
  width: 86px;
  height: 8px;
  /* Ink, not panel-3: the ramp's dark end was validated against a dark surface, and on
     a lighter track the low steps stop reading. Inset shadow makes it a recessed gauge. */
  background: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
  border-radius: 2px;
  overflow: hidden;
  flex: 0 0 auto;
}
.meter .fill {
  /* block, not the default inline: an inline span ignores width/height and the bar
     renders as an empty track. */
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--seq-3);
  min-width: 2px;
}
.meter .fill.s1 { background: var(--seq-1); }
.meter .fill.s2 { background: var(--seq-2); }
.meter .fill.s3 { background: var(--seq-3); }
.meter .fill.s4 { background: var(--seq-4); }
.meter .fill.s5 { background: var(--seq-5); }

/* ---------------------------------------------------------------- chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  padding: 2px 7px 2px 6px;
  border-radius: 2px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text-2);
  white-space: nowrap;
  margin: 1px 2px 1px 0;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; background: var(--text-3); }
.chip.red { border-color: rgba(255,107,107,.4); color: #ffb3b3; }
.chip.red .dot { background: var(--red); }
.chip.yellow { border-color: rgba(242,183,5,.4); color: #f6d67a; }
.chip.yellow .dot { background: var(--yellow); }
.chip.blue { border-color: rgba(88,166,255,.4); color: #a9cdff; }
.chip.blue .dot { background: var(--blue); }
.chip.green { border-color: rgba(86,211,100,.4); color: #a2e8ac; }
.chip.green .dot { background: var(--green); }
.chip.plain { font-family: var(--sans); font-size: 11.5px; }

.tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); border: 1px solid var(--line); padding: 1px 6px; border-radius: 2px;
}
.tag.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }

/* the FL number, stamped like the plate on the machine */
.fl {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text);
  border-bottom: 1px dotted var(--line-2);
}
a.fl:hover { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------- forms */
label { display: block; }
.field { margin-bottom: 14px; }
.field > .lab {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 5px;
  display: block;
}
.hint { font-size: 12px; color: var(--text-3); line-height: 1.55; }
.field .hint { margin-top: 5px; }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=search], select, textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  color: var(--text);
  font: 400 14px/1.5 var(--sans);
  padding: 8px 10px;
}
input.mono, textarea.mono, input[type=text].fl-input { font-family: var(--mono); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
input[type=file] {
  width: 100%; color: var(--text-2); font-size: 13px;
  background: var(--ink); border: 1px dashed var(--line-2); border-radius: 2px; padding: 14px;
}
input[type=file]::file-selector-button {
  font: 600 12px var(--cond); letter-spacing: .06em; text-transform: uppercase;
  background: var(--panel-3); color: var(--text); border: 1px solid var(--line-2);
  border-radius: 2px; padding: 6px 12px; margin-right: 12px; cursor: pointer;
}

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 12.5px var(--cond); letter-spacing: .07em; text-transform: uppercase;
  background: var(--panel-3); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 2px;
  padding: 8px 15px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #2b3138; text-decoration: none; border-color: var(--text-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #ffc71f; }
.btn.danger { color: #ffb3b3; border-color: rgba(255,107,107,.4); }
.btn.danger:hover { background: rgba(255,107,107,.12); }
.btn.small { padding: 4px 9px; font-size: 11px; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; }

.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > * { margin-bottom: 0; }
.filters {
  display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap;
  padding: 12px 15px; border-bottom: 1px solid var(--line); background: var(--panel-2);
}
.filters .field { margin-bottom: 0; min-width: 130px; }

/* ---------------------------------------------------------------- notices */
.notice {
  border: 1px solid var(--line-2);
  border-left-width: 3px;
  background: var(--panel-2);
  border-radius: 2px;
  padding: 11px 14px;
  margin-bottom: 14px;
  font-size: 13.5px;
  color: var(--text-2);
}
.notice b, .notice strong { color: var(--text); font-weight: 600; }
.notice.ok { border-left-color: var(--green); }
.notice.warn { border-left-color: var(--accent); }
.notice.error { border-left-color: var(--red); }
.notice.info { border-left-color: var(--blue); }

.blocker { border: 1px solid rgba(242,183,5,.45); border-radius: 3px; margin-bottom: 18px; overflow: hidden; }
.blocker .inner { padding: 13px 15px; background: rgba(242,183,5,.07); font-size: 13.5px; color: var(--text-2); }
.blocker .inner b { color: var(--text); }

.empty { padding: 34px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.empty .big { font-family: var(--cond); font-size: 16px; color: var(--text-2); display: block; margin-bottom: 5px; }

/* ---------------------------------------------------------------- verdict card */
.verdict {
  border: 1px solid var(--line-2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 18px;
  position: relative;
  background: var(--panel);
}
.verdict .banner {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.verdict .call {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1;
}
.verdict .meta { font-family: var(--mono); font-size: 11px; color: var(--text-3); letter-spacing: .06em; }
.verdict.repair { border-color: rgba(86,211,100,.45); }
.verdict.repair .call { color: var(--green); }
.verdict.replace { border-color: rgba(255,107,107,.45); }
.verdict.replace .call { color: var(--red); }
.verdict.request_more_info { border-color: rgba(242,183,5,.45); }
.verdict.request_more_info .call { color: var(--accent); font-size: 26px; }
.verdict.manual_review { border-color: rgba(88,166,255,.45); }
.verdict.manual_review .call { color: var(--blue); font-size: 26px; }
.verdict .prose { padding: 18px 22px; font-size: 14.5px; line-height: 1.65; color: var(--text); max-width: 78ch; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding-top: 2px; }
.kv dd { margin: 0; color: var(--text); }

.list-plain { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.list-plain li { margin-bottom: 3px; }

pre.rules, pre.diff {
  background: var(--ink); border: 1px solid var(--line); border-radius: 2px;
  padding: 14px; overflow-x: auto; font: 400 12.5px/1.65 var(--mono);
  color: var(--text-2); white-space: pre-wrap; word-break: break-word; margin: 0;
}
pre.diff .add { color: var(--green); }
pre.diff .del { color: var(--red); }

/* ---------------------------------------------------------------- progress */
.progress { height: 6px; background: var(--panel-3); border-radius: 3px; overflow: hidden; }
.progress .bar {
  height: 100%; background: var(--accent); border-radius: 0 3px 3px 0;
  transition: width .4s ease;
}
.runlog {
  max-height: 320px; overflow-y: auto; font: 400 12px/1.6 var(--mono);
  background: var(--ink); border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px;
}
.runlog .ln { display: flex; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.03); padding: 2px 0; }
.runlog .ln .f { color: var(--text-2); min-width: 90px; }
.runlog .ln.imported .s { color: var(--green); }
.runlog .ln.failed .s { color: var(--red); }
.runlog .ln.duplicate .s { color: var(--accent); }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a {
  padding: 9px 15px; color: var(--text-3);
  font: 600 12.5px var(--cond); letter-spacing: .07em; text-transform: uppercase;
  border: 1px solid transparent; border-bottom: 0; border-radius: 2px 2px 0 0;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--text-2); text-decoration: none; }
.tabs a.on {
  color: var(--text); background: var(--panel);
  border-color: var(--line); border-bottom: 1px solid var(--panel);
}
.tabs a .n { font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-left: 5px; }

.pager { display: flex; gap: 10px; align-items: center; padding: 12px 15px; color: var(--text-3); font-size: 12.5px; }
.pager .spacer { flex: 1; }

/* ---------------------------------------------------------------- login */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.gate .card .inner { padding: 26px; }
.gate .mark { font-family: var(--cond); font-weight: 700; font-size: 26px; letter-spacing: .13em; text-transform: uppercase; }
.gate .mark em { font-style: normal; color: var(--accent); }
.gate .sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: 6px 0 22px; }

/* ---------------------------------------------------------------- motion
   One orchestrated reveal on load; nothing that moves while you read. */
@media (prefers-reduced-motion: no-preference) {
  .content > * { animation: rise .34s cubic-bezier(.2,.7,.3,1) both; }
  .content > *:nth-child(1) { animation-delay: .02s; }
  .content > *:nth-child(2) { animation-delay: .06s; }
  .content > *:nth-child(3) { animation-delay: .10s; }
  .content > *:nth-child(4) { animation-delay: .14s; }
  .content > *:nth-child(n+5) { animation-delay: .18s; }

  .verdict .banner::after {
    content: ''; position: absolute; inset: 0 auto 0 0; width: 100%;
    background: linear-gradient(90deg, transparent, rgba(242,183,5,.10), transparent);
    animation: sweep 1.1s ease-out 1 both; pointer-events: none;
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .rail { width: 100%; flex: none; height: auto; position: static; }
  .nav { display: flex; flex-wrap: wrap; padding: 6px; }
  .nav .group { display: none; }
  .nav a { border-left: 0; border-bottom: 2px solid transparent; padding: 8px 12px; }
  .nav a.on { border-left: 0; border-bottom-color: var(--accent); }
  .content { padding: 16px 14px 50px; }
}

@media print {
  .rail, .telemetry, .filters, .btn, .tabs { display: none !important; }
  body { background: #fff; color: #000; }
  .panel, table.data td, table.data th { border-color: #ccc; }
}

/* --- invoice verification: source PDF beside the row it produced ----------- */
/* Two panes that fill the viewport: the whole point is reading the document and the
     row it produced without scrolling between them. Falls back to stacked below 1100px,
     where side-by-side stops being legible rather than merely cramped. */
  .verify        { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(430px,.85fr);
                   gap:14px; height:calc(100vh - 176px); min-height:520px }
  .verify > *    { min-height:0 }
  .doc           { position:relative; background:var(--panel); border:1px solid var(--line);
                   border-radius:10px; overflow:hidden; display:flex; flex-direction:column }
  .doc iframe    { flex:1; width:100%; border:0; background:#3a3a3a }
  .doc .missing  { flex:1; display:grid; place-content:center; text-align:center; padding:32px;
                   color:var(--text-3); font-size:13px; line-height:1.7 }
  .fields        { overflow-y:auto; padding-right:4px; display:flex; flex-direction:column; gap:12px }

  /* An edited input should be obvious at a glance — a reviewer needs to see what they
     have touched before committing the row. */
  .fieldrow      { display:grid; grid-template-columns:132px 1fr; gap:10px; align-items:center;
                   padding:5px 0 }
  .fieldrow .lab { font-size:12px; color:var(--text-2); font-family:var(--cond);
                   text-transform:uppercase; letter-spacing:.04em }
  .fieldrow input{ width:100%; background:var(--panel-3); border:1px solid var(--line-2);
                   color:var(--text); border-radius:6px; padding:6px 9px;
                   font-family:var(--mono); font-size:13px }
  .fieldrow input:focus       { outline:none; border-color:var(--accent); }
  .fieldrow input.dirty       { border-color:var(--accent); background:#241f0d }
  .fieldrow input.dirty + .was{ display:block }
  .was           { display:none; grid-column:2; font-size:11px; color:var(--text-3);
                   font-family:var(--mono); margin-top:2px }

  .verifybar     { display:flex; align-items:center; gap:10px; margin:0 0 12px }
  .verifybar .progress { font-family:var(--mono); font-size:12px; color:var(--text-3) }
  .kbd           { font-family:var(--mono); font-size:10.5px; border:1px solid var(--line-2);
                   border-radius:4px; padding:1px 5px; color:var(--text-3) }
  .footcheck     { font-family:var(--mono); font-size:12px }
  .footcheck.bad { color:var(--red) }
  .footcheck.ok  { color:var(--green) }

  /* The right pane scrolls, and the field list plus line items runs well past a
     screen. Pinning the actions keeps "save & next" reachable without scrolling to
     the bottom of every invoice — the difference between 718 reviews and 718 chores. */
  .fields .panel.actions { position:sticky; bottom:0; z-index:2;
                           box-shadow:0 -10px 24px -12px rgba(0,0,0,.85) }

  @media (max-width:1100px) {
    .verify { grid-template-columns:1fr; height:auto }
    .doc    { height:70vh }
    .fields .panel.actions { position:static; box-shadow:none }
  }

/* --- verify: why this needs you --------------------------------------------- */
.panel.why        { border-color: var(--accent-dim) }
.panel.why .headline { font-family:var(--cond); font-size:16px; font-weight:600; margin:0 0 6px;
                       color:var(--text) }
.panel.why .reason   { margin:0 0 12px; font-size:13px; line-height:1.65; color:var(--text-2) }
.panel.why .evidence { margin:0 0 12px; table-layout:fixed; width:100% }
.panel.why .evidence th:first-child, .panel.why .evidence td.lab { width:72px }
.panel.why .evidence th:last-child,  .panel.why .evidence td:last-child { width:92px; text-align:right }
.panel.why .evidence td.mono { font-size:12px; word-break:break-all; white-space:normal }
.panel.why .evidence .chip { white-space:nowrap }
.panel.why .evidence td.lab { color:var(--text-3); font-family:var(--cond); text-transform:uppercase;
                              letter-spacing:.04em; font-size:11px }
.panel.why .evidence tr.v-conflict td { background:rgba(255,107,107,.06) }
.chip.green       { border-color: rgba(86,211,100,.4); color:#a8e6b0 }
.chip.green .dot  { background: var(--green) }
.checks           { margin:0; padding:0 0 0 22px; display:flex; flex-direction:column; gap:8px }
.checks li        { font-size:12.5px; line-height:1.55; color:var(--text-2) }
.checks li b      { display:block; color:var(--text); font-weight:600 }
.checks li.key b  { color:var(--accent) }
.checks li .jump  { margin-left:6px; font-size:11px; color:var(--text-3); text-decoration:none }
.checks li .jump:hover { color:var(--accent) }
.panel.why .decision { margin:12px 0 0; font-size:12.5px; color:var(--text-2); border-top:1px solid var(--line);
                       padding-top:10px }
.rawnotes         { margin-top:10px; font-size:12px; color:var(--text-3) }
.rawnotes summary { cursor:pointer }
.rawnotes p       { margin:6px 0 0; line-height:1.6 }
.fieldrow select  { width:100%; background:var(--panel-3); border:1px solid var(--line-2); color:var(--text);
                    border-radius:6px; padding:6px 9px; font-family:var(--mono); font-size:13px }
.fieldrow select.dirty { border-color:var(--accent); background:#241f0d }
.fieldrow select.dirty + .was { display:block }
.inline-unit      { display:flex; gap:6px; align-items:center }
.inline-unit input{ background:var(--panel-3); border:1px solid var(--line-2); color:var(--text);
                    border-radius:6px; padding:5px 8px; font-size:12.5px }
.fieldrow:target  { animation: flash-row 1.2s ease-out }
@keyframes flash-row { from { background: rgba(242,183,5,.18) } to { background: transparent } }

/* flags the policy marks informational: visible, weightless */
.chip.info { opacity:.55 }

/* --- verify: the decision card (question · proposal · accept / decline) ------- */
.panel.decide            { border-color: rgba(242,183,5,.45) }
.panel.decide > header   { background: rgba(242,183,5,.07) }
.panel.decide.closed     { border-color: var(--line-2) }
.panel.decide.closed > header { background: transparent }
.panel.decide .ask       { font-family: var(--cond); font-size: 21px; font-weight: 600; line-height: 1.3;
                           margin: 0 0 12px; color: var(--text) }
.panel.decide .ask.closed{ font-size: 15px; font-weight: 500; color: var(--text-2); margin-bottom: 8px }
.panel.decide .proposal  { border: 1px solid var(--line-2); border-radius: 6px; padding: 12px 14px;
                           background: var(--panel-2) }
.panel.decide .eyebrow   { font-family: var(--cond); font-size: 11px; letter-spacing: .09em;
                           text-transform: uppercase; color: var(--text-3); margin-right: 8px }
.panel.decide .answer    { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px }
.panel.decide .answer .val { font-size: 15px; font-weight: 600; color: var(--text) }
.panel.decide .strength  { display: inline-flex; align-items: center; gap: 6px; margin-left: auto }
.panel.decide .basis     { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.6;
                           color: var(--text-2) }
.panel.decide .basis.small { font-size: 12px; margin-top: 4px }
.panel.decide .caution   { display: block; margin: 8px 0 0; font-size: 12.5px; color: #ffb3b3 }
.panel.decide .choose    { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap }
.btn.big                 { padding: 9px 16px; font-size: 13.5px }
.alts                    { margin-top: 12px; font-size: 12.5px }
.alts summary            { cursor: pointer; color: var(--text-2); font-family: var(--cond);
                           text-transform: uppercase; letter-spacing: .07em; font-size: 11.5px }
.alts ol                 { margin: 8px 0 0; padding: 0; list-style: none; display: flex;
                           flex-direction: column; gap: 8px }
.alts > ol > li          { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px;
                           background: var(--panel-2) }
.alts .basis li          { border: 0; padding: 0; background: none; border-radius: 0 }
.alts .altrow            { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between }
.alts .alttext           { min-width: 0 }
.alts .alttext b         { display: block; color: var(--text); font-weight: 600 }
.alts .alttext > span    { color: var(--text-2) }
.alts .altinputs         { display: flex; gap: 6px; align-items: center; flex: 0 0 auto;
                           flex-wrap: wrap; justify-content: flex-end }
.alts .altinputs input, .alts .altinputs select {
                           background: var(--panel-3); border: 1px solid var(--line-2); color: var(--text);
                           border-radius: 6px; padding: 5px 8px; font-size: 12.5px; max-width: 220px }
.alts .altinputs input:focus, .alts .altinputs select:focus { outline: none; border-color: var(--accent) }
.remember, .siblings     { display: block; margin-top: 10px; font-size: 12.5px; color: var(--text-2); line-height: 1.6 }
.remember label          { display: block }
.remember input, .siblings input { margin-right: 6px }
.panel.decide .choose .key { display: inline-flex; align-items: center; gap: 6px }
/* .progress is also the name of the thin bar in the meter macro; inside the verify
   bar it is a text label and must not inherit the bar's 6px height */
.verifybar .progress     { height: auto; background: none; border: 0; border-radius: 0; overflow: visible;
                           line-height: 1.4; width: auto }

/* ---------------------------------------------------------------- decision run
   The stage list a request watches while the engine works. Done stages are quiet;
   the running one carries the only motion on the page. */
.panel.run .progress { height: 3px; background: var(--panel-3); }
.panel.run.busy .progress .bar { position: relative; overflow: hidden; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step .dot {
  flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; margin-top: 5px;
  background: var(--panel-3); border: 1px solid var(--line-2);
}
.step.done .dot { background: var(--green); border-color: var(--green); }
.step.failed .dot { background: var(--red); border-color: var(--red); }
.step.running .dot { background: var(--accent); border-color: var(--accent); }
.step > div { flex: 1; min-width: 0; }
.step .lab { font-family: var(--cond); font-weight: 600; font-size: 14px; color: var(--text); }
.step.running .lab { color: var(--accent); }
.step .det { font-size: 12.5px; color: var(--text-2); margin-top: 2px; line-height: 1.55; overflow-wrap: anywhere; }
.step .took { flex: 0 0 auto; font-size: 11px; color: var(--text-3); margin-top: 3px; min-width: 36px; text-align: right; }
@media (prefers-reduced-motion: no-preference) {
  .step.running .dot { animation: pulse 1.1s ease-in-out infinite; }
  .panel.run.busy .progress .bar::after {
    content: ''; position: absolute; inset: 0; width: 40%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    animation: slide 1.3s ease-in-out infinite;
  }
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(350%); } }

/* ---------------------------------------------------------------- typeahead
   Custom suggestions under the FL box: a <datalist> hides options that do not contain
   the typed text, which is every serial-number match. */
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 3px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 3px;
  box-shadow: 0 10px 28px rgba(0,0,0,.45); max-height: 300px; overflow-y: auto;
}
.suggest .opt {
  display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 0 12px;
  padding: 7px 11px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.suggest .opt:last-child { border-bottom: 0; }
.suggest .opt.on, .suggest .opt:hover { background: var(--panel-3); }
.suggest .opt .fl { color: var(--accent); }
.suggest .opt .sn { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .opt .md { grid-column: 1 / -1; color: var(--text-3); font-size: 11.5px; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .opt.dim .fl { color: var(--text-3); }
