@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk-var.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("fonts/courier-prime-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("fonts/courier-prime-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("fonts/kalam-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("fonts/kalam-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Design tokens: "Docket and ballpoint" (see DESIGN.md). No values outside these. */
:root {
  /* neutral ramp, tinted toward the ink hue */
  --n0: #ffffff; --n50: #f7f8f9; --n100: #f1f2f4; --n150: #e9ebee; --n200: #dfe2e7; --n300: #c8cdd5; --n400: #8b919c; --n500: #5f6675; --n600: #434a57; --n900: #181c24;
  --bg: var(--n100);
  --surface: var(--n0);
  --surface-2: var(--n50);
  --border: var(--n200);
  --border-strong: var(--n300);
  --ink: var(--n900);
  --ink-2: var(--n600);
  --ink-3: var(--n500);
  /* the one accent: ballpoint blue from the handwritten proforma */
  --accent: #2340a0;
  --accent-2: #2340a0;
  --accent-hover: #1a3080;
  --accent-soft: #e8ecf8;
  --accent-line: #b9c5ea;
  /* semantic */
  --good: #1e6b3a; --good-bg: #e6f2ea;
  --warn: #8a5300; --warn-bg: #fbf0dc; --warn-line: #e3c48a;
  --bad: #b42318;  --bad-bg: #fbe9e7; --bad-line: #efc2bc;
  --info: var(--accent); --info-bg: var(--accent-soft);
  --stamp: #b42318;
  /* radius by role */
  --r-chip: 4px; --r-ctl: 6px; --r-panel: 8px; --r-sheet: 10px;
  --radius: var(--r-panel);
  /* shadows: one light source above */
  --shadow: none;
  --shadow-card: 0 1px 0 rgba(24, 28, 36, .04), 0 1px 3px rgba(24, 28, 36, .08);
  --shadow-lg: 0 2px 6px rgba(24, 28, 36, .08), 0 16px 40px rgba(24, 28, 36, .18);
  /* type */
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Courier Prime", "Courier New", monospace;
  --hand: "Kalam", "Bradley Hand", cursive;
  --fs-12: 12px; --fs-14: 14px; --fs-16: 16px; --fs-18: 17.5px; --fs-22: 22px; --fs-27: 27px; --fs-34: 34px;
  /* motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 160ms; --t-med: 220ms;
  /* stage ramp: sequential in the accent hue */
  --st-proforma: var(--n150); --st-proforma-ink: var(--n600);
  --st-paid: #e8ecf8; --st-w1: #d3dbf2; --st-w2: #b9c5ea; --st-w3: #97a8df; --st-completed: #2340a0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: var(--fs-14); line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11px; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Layout */
.app { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.sidebar { background: #13201e; color: #dfe7e4; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; }
.logo { color: #2a9d92; display: flex; }
.brand-name { font-weight: 700; font-size: 16px; color: #fff; letter-spacing: -.01em; }
.brand-sub { font-size: 11.5px; color: #8fa39e; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid #2c3b38; color: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; color: #c4d1cd; padding: 9px 10px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: #1c2d2a; text-decoration: none; color: #fff; }
.nav a.active { background: #234441; color: #fff; }
.nav .ico { width: 18px; text-align: center; opacity: .85; }
.nav .count { margin-left: auto; font-size: 11px; background: #2c3b38; color: #dfe7e4; border-radius: 999px; padding: 1px 7px; font-weight: 600; }
.nav .count:empty { display: none; }
.nav .count.warn { background: #b45309; color: #fff; }
.sidebar-foot { padding: 14px 18px 18px; border-top: 1px solid #22312e; display: grid; gap: 10px; }
.sidebar-foot .btn.ghost { color: #c4d1cd; border-color: #2c3b38; background: transparent; }
.sidebar-foot .btn.ghost:hover { background: #1c2d2a; }
.user { display: flex; gap: 10px; align-items: center; font-size: 13px; color: #fff; }
.user .muted { color: #8fa39e; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2a9d92; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.main { padding: 22px 26px 40px; min-width: 0; }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); border-color: #f1c0bb; }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.link { border: none; background: none; color: var(--accent-2); padding: 2px 4px; }
.input, select.input, textarea.input { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.input:focus { outline: 2px solid var(--accent-line); outline-offset: 0; border-color: var(--accent); }
.input.search { padding-left: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237a8380' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat 10px center; width: 220px; }
label.field { display: grid; gap: 4px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
label.field .input { font-size: 14px; color: var(--ink); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); white-space: nowrap; line-height: 1.5; }
.chip.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.chip.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.code { font-family: var(--mono); font-weight: 600; background: #fff; }
.sr { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; color: #fff; }
.sr.SYD { background: #2f5f8a; } .sr.MEL { background: #6b4c8a; } .sr.BNE { background: #9a5b1f; }
.stage { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.stage.proforma { background: var(--st-proforma); color: var(--st-proforma-ink); }
.stage.paid { background: var(--st-paid); color: var(--accent); }
.stage.w1 { background: var(--st-w1); color: var(--accent-hover); }
.stage.w2 { background: var(--st-w2); color: #0b4541; }
.stage.w3 { background: var(--st-w3); color: #083a36; }
.stage.completed { background: var(--st-completed); color: #fff; }

/* Cards / panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 14.5px; }
.panel-body { padding: 14px 16px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 26px; margin-bottom: 6px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 12px; box-shadow: var(--shadow); display: block; color: inherit; }
.kpi:hover { text-decoration: none; border-color: var(--border-strong); }
.kpi .label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.kpi .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi.alert .value { color: var(--bad); }
.kpi.hero { background: var(--accent); color: #fff; border-color: var(--accent); }
.kpi.hero .label, .kpi.hero .sub { color: #dfe5f6; }

/* Bars (dashboard) */
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 86px 1fr 92px; align-items: center; gap: 10px; font-size: 13px; border-radius: 6px; padding: 2px 4px; }
.bar-row:hover { background: var(--surface-2); }
.bar-track { height: 18px; position: relative; }
.bar-fill { height: 100%; background: var(--accent-2); border-radius: 0 4px 4px 0; min-width: 3px; }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* Tables */
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: none; }
.t td.mono, .t td .mono { white-space: nowrap; }
.t tr.row-bad td { background: #fff6f5; }
.t tr.row-warn td { background: #fffaf0; }
.t tr.row-muted td { color: var(--ink-3); }
.t tr.clickable { cursor: pointer; }
.t tr.clickable:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }

/* Board */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.board { display: grid; grid-template-columns: repeat(6, minmax(172px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: #eceeea; border-radius: 12px; display: flex; flex-direction: column; min-height: 300px; border: 1px solid transparent; transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.col.drop-ok { background: var(--accent-soft); border-color: var(--accent-line); border-style: dashed; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 8px; position: sticky; top: 0; }
.col-head .title { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.col-head .dot { width: 9px; height: 9px; border-radius: 3px; }
.col-head .meta { font-size: 11.5px; color: var(--ink-3); text-align: right; }
.col-body { padding: 0 8px 10px; display: grid; gap: 8px; align-content: start; flex: 1; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 10px 10px 8px; box-shadow: var(--shadow); cursor: grab; display: grid; gap: 6px; }
.card:hover { border-color: var(--border-strong); }
.card.dragging { opacity: .45; }
.card .row1 { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.card .so { font-weight: 700; font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.card .row1 > span:last-child { white-space: nowrap; }
.card .client { font-weight: 600; font-size: 13px; line-height: 1.3; }
.card .sidemark { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.card .row3 { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.card .total { font-weight: 700; font-variant-numeric: tabular-nums; }
.card .age { font-size: 11.5px; color: var(--ink-3); }
.card .age.stale { color: var(--bad); font-weight: 600; }
.card .flags { display: flex; gap: 4px; flex-wrap: wrap; }
.card .actions { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--border); padding-top: 6px; margin-top: 2px; }
.col-empty { border: 1.5px dashed var(--border-strong); border-radius: 9px; color: var(--ink-3); text-align: center; padding: 18px 8px; font-size: 12.5px; }

/* Drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 25, 23, .35); opacity: 0; pointer-events: none; transition: opacity var(--t-med) var(--ease); z-index: 40; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform var(--t-med) var(--ease); z-index: 41; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px 20px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.drawer-head h2 { margin: 0; font-size: 19px; font-family: var(--mono); letter-spacing: -.01em; }
.drawer-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 3px; }
.drawer-body { overflow-y: auto; padding: 16px 20px 40px; display: grid; gap: 14px; align-content: start; }
.section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }
.lines .input { padding: 5px 7px; font-size: 13px; width: 100%; }
.lines td { padding: 6px 6px; }
.lines th { padding: 7px 6px; }
.kv { display: grid; grid-template-columns: 180px 1fr 32px; gap: 6px; margin-bottom: 6px; }
.icon-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 7px; cursor: pointer; color: var(--ink-3); width: 32px; }
.icon-btn:hover { color: var(--bad); border-color: #f1c0bb; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding-bottom: 10px; position: relative; }
.timeline li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2); margin-top: 5px; }
.timeline li::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: 0; width: 1px; background: var(--border-strong); }
.timeline li:last-child::after { display: none; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; font-size: 13px; max-width: 300px; margin-left: auto; }
.totals .grand { font-weight: 700; font-size: 15px; border-top: 1px solid var(--border); padding-top: 6px; }
.callout { border-radius: 9px; padding: 10px 12px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.callout.warn { background: var(--warn-bg); color: #6b4600; }
.callout.bad { background: var(--bad-bg); color: #8a1c13; }
.callout.info { background: var(--info-bg); color: #173d78; }
.callout.good { background: var(--good-bg); color: #155c2d; }
.callout .ico { font-weight: 700; }
.callout > div { min-width: 0; overflow-wrap: anywhere; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 25, 23, .45); display: none; align-items: flex-start; justify-content: center; z-index: 60; overflow-y: auto; padding: 40px 16px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: min(560px, 100%); }
.modal.wide { width: min(920px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px 20px; display: grid; gap: 12px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 12px 12px; }

/* PO document */
.po-doc { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 28px 32px; font-size: 12.5px; color: #111; }
.po-doc .po-top { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #111; padding-bottom: 14px; margin-bottom: 14px; }
.po-doc h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: .02em; }
.po-doc .addr { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 14px; }
.po-doc .addr h4 { margin: 0 0 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #555; }
.po-doc table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.po-doc th { text-align: left; border-bottom: 1px solid #111; padding: 6px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
.po-doc td { border-bottom: 1px solid #ddd; padding: 6px 6px; vertical-align: top; }
.withheld { display: flex; gap: 10px; align-items: center; border: 1.5px dashed #b45309; background: #fff8ec; color: #7a4300; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-weight: 600; }
.po-doc .foot { margin-top: 18px; color: #555; font-size: 11px; display: grid; gap: 4px; }

/* Recon */
.recon-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.batch-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; box-shadow: var(--shadow); display: grid; gap: 4px; text-align: left; }
.batch-tile.sel { outline: 2px solid var(--accent-2); }
.batch-tile .d { font-weight: 700; }
.batch-tile .amt { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.batch-tile.exc { border-color: #f1c0bb; }

/* Sync pills */
.sync-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); }
.pill .sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.pill.syncing .sdot { background: var(--warn); }
.pill.pending .sdot { background: var(--ink-3); }
.client-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.client-list { max-height: calc(100vh - 160px); overflow-y: auto; }
.client-item { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; display: grid; gap: 2px; }
.client-item:hover { background: var(--surface-2); }
.client-item.sel { background: var(--accent-soft); }

/* Toasts */
.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 80; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow-lg); font-size: 13px; max-width: 380px; animation: tin var(--t-med) var(--ease); }
.toast.warn { background: #7a4300; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

#printArea { display: none; }

/* Responsive */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .recon-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; background: none; }
  .sidebar { position: sticky; height: auto; z-index: 30; }
  .brand { padding: 12px 14px; }
  .nav-toggle { display: block; }
  .nav { display: none; padding-bottom: 10px; }
  .nav.open { display: flex; }
  .sidebar-foot { display: none; }
  .main { padding: 16px 14px 40px; }
  .cols-2, .cols-3, .client-layout { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(6, 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .recon-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr 1fr 32px; }
  .input.search { width: 100%; }
  .filters { width: 100%; }
  .filters > * { flex: 1 1 140px; }
}

/* ---------- Polish additions ---------- */
.btn.lg { padding: 10px 16px; font-size: 14.5px; border-radius: 9px; }
.demo-btn { justify-content: center; }
.card { position: relative; }
.card .actions .mono { white-space: nowrap; }
.card .actions .btn.small { padding: 3px 8px; font-size: 12px; }
.card.just-paid { border-color: #b42318; box-shadow: 0 0 0 3px rgba(180,35,24,.12), var(--shadow); }
.stamp { position: absolute; right: 10px; top: 34px; transform: rotate(-12deg) scale(1); border: 3px solid #b42318; color: #b42318; font-weight: 800; letter-spacing: .12em; font-size: 22px; padding: 2px 10px 0; border-radius: 6px; background: rgba(255,255,255,.82); text-align: center; line-height: 1.05; pointer-events: none; animation: stampIn var(--t-med) var(--ease) both; font-family: var(--mono); }
.stamp small { display: block; font-size: 9.5px; letter-spacing: .04em; font-weight: 700; padding-bottom: 3px; }
.stamp.fade { opacity: 0; transition: opacity .5s; }
@keyframes stampIn { from { transform: rotate(-12deg) scale(1.5); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }

/* Hero: paper proforma vs Order Desk card */
.aha { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 24px 26px; margin-bottom: 16px; box-shadow: var(--shadow); align-items: center; }
.aha h2 { font-size: 23px; line-height: 1.25; letter-spacing: -.02em; margin: 8px 0 8px; }
.aha h2 em { font-style: normal; background: var(--accent-soft); color: var(--accent); padding: 0 6px; border-radius: 6px; }
.aha p { color: var(--ink-2); margin: 0 0 14px; max-width: 56ch; }
.aha-stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 22px; margin-bottom: 16px; }
.aha-stats b { display: block; font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.aha-stats span { font-size: 12px; color: var(--ink-3); }
.aha-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.aha-visual { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: center; gap: 8px; }
.aha-arrow { font-size: 26px; color: var(--accent-2); text-align: center; font-weight: 700; }
.paper { position: relative; background: #fffdf7; border: 1px solid #e6e0cf; border-radius: 3px; padding: 14px 14px 46px; transform: rotate(-1.6deg); box-shadow: 0 10px 24px rgba(40,30,0,.12), 0 1px 0 #fff inset; min-height: 240px; font-size: 11px; color: #555; }
.paper::after { content: none; }
.paper-head { display: flex; justify-content: space-between; border-bottom: 1.5px solid #333; padding-bottom: 6px; margin-bottom: 10px; color: #222; font-size: 10.5px; letter-spacing: .04em; }
.paper-lines { display: grid; gap: 7px; margin: 8px 0; }
.paper-lines i { display: block; height: 5px; background: #e4e1d8; border-radius: 3px; width: 100%; }
.paper-row { color: #333; font-size: 10.5px; margin: 6px 0; }
.hw { position: absolute; font-family: var(--hand); color: var(--accent); font-size: 14px; line-height: 1.1; white-space: nowrap; font-weight: 600; }
.hw1 { top: 30px; right: 14px; transform: rotate(-4deg); font-size: 16px; }
.hw2 { top: 56px; right: 26px; transform: rotate(3deg); }
.hw3 { top: 74px; left: 18px; transform: rotate(-6deg); }
.hw3.circled { border: 2px solid var(--accent); border-radius: 50%; padding: 3px 7px; }
.hw4 { top: 134px; left: 26px; transform: rotate(-3deg); font-size: 13px; max-width: 70%; overflow: hidden; text-overflow: ellipsis; }
.hw5 { top: 164px; right: 16px; transform: rotate(2deg); }
.hw6 { bottom: 34px; left: 14px; transform: rotate(-2deg); font-size: 12.5px; }
.paper-tag { position: absolute; left: 0; right: 0; bottom: -1px; text-align: center; font-size: 11px; font-weight: 700; color: #8a1c13; background: #fde8e6; padding: 5px 6px; border-radius: 0 0 3px 3px; }
.aha-card-wrap { display: grid; gap: 8px; }
.aha-card-wrap .paper-tag { position: static; border-radius: 7px; }
.paper-tag.good { color: var(--good); background: var(--good-bg); }
.aha-card .card { cursor: pointer; box-shadow: var(--shadow-lg); border-color: var(--accent-line); }
.aha-fields { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12px; }
.aha-fields li { display: grid; grid-template-columns: 96px 1fr; gap: 6px; }
.aha-fields li > span:first-child { color: var(--ink-3); }

/* Before / after */
.ba { display: grid; grid-template-columns: 1fr 40px 1fr 1.1fr; gap: 12px; align-items: stretch; margin-bottom: 16px; }
.ba-col { border-radius: 14px; padding: 18px 20px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.ba-col.before { background: #fff7f6; border-color: #f4d3cf; }
.ba-col.after { background: #f2faf8; border-color: #cfe7e2; }
.ba-col.saved { background: var(--accent); color: #fff; border-color: var(--accent); }
.ba-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
.ba-big { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0; font-variant-numeric: tabular-nums; }
.ba-big small { font-size: 14px; font-weight: 600; letter-spacing: 0; opacity: .75; }
.ba-sub { font-size: 13px; opacity: .85; }
.ba-arrow { display: grid; place-items: center; font-size: 28px; color: var(--accent-2); font-weight: 700; }
.roi-grid { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); align-items: start; }
.roi-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.roi-inputs .src { font-size: 11.5px; font-style: italic; color: var(--ink-3); }
.input.their { border-color: #9db7e6; background: #f2f6fd; color: #1f4f99; font-weight: 700; }
.input.ours { border-color: #e7c77f; background: #fffaf0; color: #7a4300; font-weight: 700; }
.roi-table input.input { width: 62px; padding: 3px 6px; text-align: right; }
.roi-table tfoot td { border-top: 2px solid var(--border-strong); background: var(--surface-2); }
.formula { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 10px 12px; margin: 12px 0; font-size: 12.5px; overflow-x: auto; white-space: nowrap; }
.formula b { color: var(--accent); }
.payback { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.payback b { font-size: 26px; letter-spacing: -.02em; color: var(--accent); }
.payback.alt b { font-size: 18px; color: var(--ink-2); }
.payback span { color: var(--ink-3); font-size: 12.5px; }
.checks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; font-size: 13px; }
.checks li { display: grid; grid-template-columns: 58px 1fr; gap: 8px; align-items: start; }
.keepgo { display: grid; gap: 10px; }
.keepgo > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.keepgo b { width: 50px; font-size: 12.5px; }

/* Guided demo */
.tour { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.tour-block { position: absolute; inset: 0; pointer-events: auto; }
.tour-spot { position: absolute; border-radius: var(--r-panel); box-shadow: 0 0 0 9999px rgba(10, 22, 20, .58); outline: 3px solid #ffffff; outline-offset: 0; transition: top 360ms var(--ease), left 360ms var(--ease), width 360ms var(--ease), height 360ms var(--ease); pointer-events: none; }
.tour-spot::after { content: none; }
.tour-cap { position: absolute; pointer-events: auto; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.35); padding: 16px 18px 12px; width: 400px; transition: left 360ms var(--ease), top 360ms var(--ease), opacity var(--t-fast) var(--ease); border-top: 4px solid var(--accent-2); }
.tour.moving .tour-cap { opacity: .6; }
.tour-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.tour-n { color: var(--accent-2); font-weight: 800; }
.tour-title { margin: 6px 0 6px; font-size: 18px; letter-spacing: -.01em; line-height: 1.25; }
.tour-body { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.tour-bar { height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 10px; }
.tour-bar i { display: block; height: 100%; width: 0; background: var(--accent-2); }
.tour-ctl { display: flex; gap: 6px; align-items: center; }
.tour-cap.sheet { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto !important; }
.tour.finished .tour-cap { border-top-color: var(--good); }

@media (max-width: 1280px) {
  .aha { grid-template-columns: minmax(0, 1fr); }
  .ba { grid-template-columns: 1fr 1fr; }
  .ba-arrow { display: none; }
  .ba-col.saved { grid-column: 1 / -1; }
  .roi-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .aha { padding: 18px 16px; }
  .aha h2 { font-size: 19px; }
  .aha-visual { grid-template-columns: minmax(0, 1fr); }
  .aha-arrow { transform: rotate(90deg); }
  .aha-stats { gap: 14px; }
  .aha-stats b { font-size: 17px; }
  .ba { grid-template-columns: minmax(0, 1fr); }
  .roi-table th:nth-child(1), .roi-table td:nth-child(1) { min-width: 180px; }
  .roi-inputs { grid-template-columns: 1fr; }
  .page-head .toolbar { width: 100%; }
}

@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { display: block; position: absolute; left: 0; top: 0; width: 100%; }
  #printArea .po-doc { border: none; padding: 0; }
}
.client-item > div { align-items: flex-start; }
.tour.finished .tour-spot::after { display: none; }
.grid > * { min-width: 0; }
@media (max-width: 960px) {
  #reconGrid, #poGrid { grid-template-columns: minmax(0, 1fr) !important; }
  .t td, .t th { padding: 8px 9px; }
  .main section.panel { overflow-x: auto; }
}
/* Final QA: drawer forms on phones (long <select> options were pushing fields past the panel) */
.form-grid > *, .kv > * { min-width: 0; }
.form-grid .input, .kv .input { width: 100%; max-width: 100%; }
.drawer-body > .panel, .drawer-body .grid > * { min-width: 0; }
@media (max-width: 600px) {
  .drawer-head { padding: 14px 14px; }
  .drawer-body { padding: 12px 12px 40px; }
  .drawer .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .drawer .form-grid .span-2, .drawer #addLine .field:first-child, .drawer #addLine #alAdd { grid-column: 1 / -1; }
  .drawer .kv { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 32px; }
}
/* Final QA: Before/after page on phones. Formula wraps; ROI rows stack so the % inputs stay on screen */
@media (max-width: 600px) {
  .formula { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
  .panel-head { flex-wrap: wrap; }
  .panel-head h2 { white-space: nowrap; }
  .roi-table { min-width: 0 !important; width: 100%; }
  .roi-table thead { display: none; }
  .roi-table tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .roi-table td { border: 0 !important; padding: 2px 0 !important; text-align: left !important; min-width: 0 !important; font-size: 13px; }
  .roi-table td:first-child { grid-column: 1 / -1; padding-bottom: 6px !important; }
  .roi-table td:nth-child(n+2)::before { display: block; font-size: var(--fs-12); font-weight: 600; color: var(--ink-3); }
  .roi-table td:nth-child(2)::before { content: "Today"; }
  .roi-table td:nth-child(3)::before { content: "Cut"; }
  .roi-table td:nth-child(4)::before { content: "After"; }
  .roi-table td:nth-child(5)::before { content: "Hrs back"; }
  .roi-table tfoot td:nth-child(3)::before { content: ""; }
  .roi-table input.input { width: 52px; }
  .roi-table tfoot tr { border-bottom: 0; background: var(--surface-2); padding: 10px 8px; border-radius: 8px; }
  .roi-table tfoot td { background: none; }
}
.payback b { white-space: nowrap; }
@media (max-width: 600px) { .payback { flex-wrap: wrap; row-gap: 2px; } }
/* Final QA: PO preview on phones. Header stacks; the line table scrolls inside the document */
.modal, .modal-body { min-width: 0; }
@media (max-width: 600px) {
  .modal-backdrop { padding: 16px 8px; }
  .modal-head, .modal-body { padding-left: 14px; padding-right: 14px; }
  .po-doc { padding: 16px 14px; overflow-x: auto; }
  .po-doc .po-top { flex-direction: column; gap: 10px; }
  .po-doc .po-top > *:last-child { text-align: left !important; }
  .po-doc .addr { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .po-doc table { min-width: 560px; }
  .po-doc .addr, .po-doc .po-top { overflow-wrap: anywhere; }
}
/* Final QA: recon summary tiles were locked to 4 columns by an inline style, clipping $ values on phones */
.kpis.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .kpis.kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi .value { overflow-wrap: anywhere; }


/* ==========================================================================
   Design system v2: "Docket and ballpoint" (DESIGN.md). This layer wins over
   the rules above. Light rail, one ink-blue accent, print-derived type,
   radius by role, no gradients, no caps eyebrows, SVG icons only.
   ========================================================================== */
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.chip .i { width: 12px; height: 12px; vertical-align: -1px; }
.btn .i { width: 15px; height: 15px; }
.btn.icon { padding-left: 8px; padding-right: 8px; justify-content: center; }
.btn.icon .i { margin: 0; }
a, button, [data-open], .client-item, .batch-tile, .card, summary, label[for], select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 0; }

/* Rail: light, on the paper background, hairline edge. Active row is a white fill, no colour strip. */
.sidebar { background: var(--bg); color: var(--ink); border-right: 1px solid var(--border); }
.brand { padding: 20px 20px 16px; }
.brand-name { color: var(--ink); font-size: var(--fs-18); font-weight: 800; letter-spacing: -.02em; }
.brand-sub { color: var(--ink-3); font-size: var(--fs-12); }
.nav { padding: 4px 12px; gap: 2px; }
.nav a { color: var(--ink-2); padding: 8px 10px; border-radius: var(--r-ctl); font-weight: 500; gap: 10px; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.nav a .i { color: var(--ink-3); }
.nav a:hover { background: var(--n150); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-card); }
.nav a.active .i { color: var(--accent); }
.nav .count { background: var(--n150); color: var(--ink-2); border-radius: var(--r-chip); font-size: 11.5px; padding: 0 6px; }
.nav .count.warn { background: var(--bad-bg); color: var(--bad); }
.sidebar-foot { border-top: 1px solid var(--border); padding: 16px 20px 20px; gap: 8px; }
.user { color: var(--ink); }
.user .muted { color: var(--ink-3); }
.avatar { background: var(--n200); color: var(--ink); border-radius: 50%; }
.sidebar-foot .btn.ghost { color: var(--ink-2); border-color: transparent; background: transparent; justify-content: center; }
.sidebar-foot .btn.ghost:hover { background: var(--n150); }
.nav-toggle { border: 1px solid var(--border-strong); color: var(--ink); background: var(--surface); border-radius: var(--r-ctl); padding: 6px 8px; line-height: 0; }
.main { padding: 24px 32px 48px; }

/* Type scale */
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: var(--fs-27); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.page-head p { font-size: var(--fs-14); margin-top: 6px; }
.panel-head h2, .panel-head h3 { font-size: var(--fs-16); font-weight: 700; letter-spacing: -.005em; }
.small { font-size: 13px; }
.tiny { font-size: var(--fs-12); }
.num, .kpi .value, .ba-big, .payback b, .card .total, .batch-tile .amt, .aha-stats b, .totals { font-variant-numeric: tabular-nums; }

/* Controls */
.btn { border-radius: var(--r-ctl); font-weight: 600; padding: 7px 12px; gap: 6px; transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.btn:hover { background: var(--n50); border-color: var(--n400); }
.btn:active { background: var(--n150); }
.btn.primary:active { background: var(--accent-hover); }
.btn.lg { border-radius: var(--r-ctl); padding: 10px 16px; font-size: var(--fs-14); }
.btn.link { color: var(--accent); font-weight: 600; }
.btn.danger { border-color: var(--bad-line); }
.input, select.input, textarea.input { border-radius: var(--r-ctl); transition: border-color var(--t-fast) var(--ease); }
.input.their { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.input.ours { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.icon-btn { border-radius: var(--r-ctl); display: inline-grid; place-items: center; height: 32px; }
.icon-btn .i { width: 14px; height: 14px; }
.icon-btn:hover { border-color: var(--bad-line); }

/* Chips: small printed labels (4px), never pills */
.chip { border-radius: var(--r-chip); font-size: var(--fs-12); padding: 1px 6px; gap: 4px; }
.chip.code { font-weight: 700; font-size: 12.5px; background: var(--surface); border-color: var(--border-strong); }
.stage { border-radius: var(--r-chip); padding: 1px 7px; font-size: var(--fs-12); }
.pill { border-radius: var(--r-chip); }
.sr { border-radius: var(--r-chip); font-family: var(--mono); font-weight: 700; font-size: 12px; padding: 0 5px; letter-spacing: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); }
.sr.SYD, .sr.MEL, .sr.BNE { background: var(--surface); color: var(--ink); }

/* Panels: flat paper, hairline, no shadow */
.panel { border-radius: var(--r-panel); box-shadow: none; }
.panel-head { padding: 14px 16px; }
.grid { gap: 16px; }
.empty .big { color: var(--good); }
.empty .big .i { width: 24px; height: 24px; }
.callout { border-radius: var(--r-ctl); }
.callout .ico .i { width: 16px; height: 16px; vertical-align: -3px; }
.section-title { text-transform: none; letter-spacing: 0; font-size: var(--fs-16); color: var(--ink); font-weight: 700; }

/* KPI strip: one ruled strip, not six floating cards. The "hours back" cell is the only filled one. */
.kpis { gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); overflow: hidden; margin-bottom: 24px; }
.kpi { border: 0; border-radius: 0; box-shadow: none; border-left: 1px solid var(--border); padding: 14px 16px; transition: background-color var(--t-fast) var(--ease); }
.kpi:first-child { border-left: 0; }
.kpi:hover { background: var(--n50); }
.kpi .label { font-size: 13px; color: var(--ink-2); }
.kpi .value { font-size: var(--fs-27); font-weight: 700; line-height: 1.15; }
.kpi.hero { border-left-color: var(--accent); }
.kpi.hero:hover { background: var(--accent-hover); }
.kpis.kpis-4 { gap: 0; }

/* Tables: Stripe-style sentence-case headers, hairlines, no tinted header band */
.t th { text-transform: none; letter-spacing: 0; font-size: var(--fs-12); font-weight: 600; color: var(--ink-3); background: var(--surface); border-bottom: 1px solid var(--border-strong); }
.t tr.row-bad td { background: var(--bad-bg); }
.t tr.row-warn td { background: var(--warn-bg); }
.t tr.clickable:hover td { background: var(--n50); }

/* Bars */
.bar-fill { background: var(--accent); border-radius: 0 2px 2px 0; }
.bar-row .val { display: flex; justify-content: flex-end; gap: 10px; }
.bar-row .val span { color: var(--ink-3); min-width: 64px; text-align: right; }

/* Board: columns as folder pockets, cards as paper dockets */
.col { background: var(--n150); border-radius: var(--r-panel); }
.col-head { padding: 12px 12px 8px; }
.col-head .title { font-size: var(--fs-14); }
.col-head .dot { border-radius: 2px; }
.col-head .meta { font-size: var(--fs-12); }
.card { border-radius: var(--r-ctl); box-shadow: var(--shadow-card); border-color: var(--border); padding: 10px 12px 8px; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.card:hover { border-color: var(--n300); }
.card .so { font-size: 13px; }
.card .actions { border-top: 1px solid var(--n150); }
.card .actions .btn.small { gap: 4px; }
.card .actions .btn .i { width: 13px; height: 13px; }
.col-empty { border-radius: var(--r-ctl); }

/* Drawer, modal, toast, demo: the only raised surfaces */
.drawer-head h2 { font-size: var(--fs-22); }
.modal { border-radius: var(--r-sheet); }
.modal-foot { border-radius: 0 0 var(--r-sheet) var(--r-sheet); }
.toast { border-radius: var(--r-ctl); }
.withheld { border-radius: var(--r-ctl); border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.withheld .i { width: 18px; height: 18px; flex: none; }
.po-doc { border-radius: 0; box-shadow: var(--shadow-card); }
.batch-tile { border-radius: var(--r-panel); box-shadow: none; transition: border-color var(--t-fast) var(--ease); }
.batch-tile:hover { border-color: var(--n300); }
.batch-tile.sel { outline: 2px solid var(--accent); outline-offset: -1px; }
.batch-tile.exc { border-color: var(--bad-line); }
.client-item.sel { background: var(--accent-soft); }
.tour-cap { border-radius: var(--r-sheet); border-top: 0; box-shadow: var(--shadow-lg); padding: 18px 20px 14px; }
.tour-n { color: var(--accent); }
.tour-meta { font-weight: 600; }
.tour-title { font-size: var(--fs-22); font-weight: 700; letter-spacing: -.015em; }
.tour-body { font-size: var(--fs-16); }
.tour-bar { height: 3px; border-radius: 2px; }
.tour-bar i { background: var(--accent); }
.tour.finished .tour-bar i { background: var(--good); }

/* Hero: the paper proforma is the focal point */
.aha { padding: 32px; gap: 32px; box-shadow: none; margin-bottom: 24px; }
.aha h2 { font-size: var(--fs-34); line-height: 1.12; letter-spacing: -.025em; font-weight: 800; margin: 0 0 12px; max-width: 18ch; }
.aha .from-post { font-size: var(--fs-16); color: var(--ink-2); margin: 0 0 8px; }
.aha p { font-size: var(--fs-16); line-height: 1.55; max-width: 52ch; }
.aha-stats { gap: 32px; margin: 8px 0 24px; }
.aha-stats b { font-size: var(--fs-22); font-weight: 700; }
.aha-stats span { font-size: 13px; }
.aha-arrow { color: var(--ink-3); display: grid; place-items: center; }
.aha-arrow .i { width: 24px; height: 24px; }
.paper { border-radius: 0; background: #ffffff; border-color: var(--n300); box-shadow: 0 1px 0 rgba(24,28,36,.04), 0 10px 24px rgba(24,28,36,.12); }
.paper-head { font-family: var(--font); font-weight: 700; letter-spacing: .04em; }
.paper-row { display: flex; gap: 14px; }
.hw { font-weight: 700; }
.paper-tag { border-radius: 0; background: var(--bad-bg); color: var(--bad); }
.aha-card-wrap .paper-tag { border-radius: var(--r-ctl); }
.paper-tag.good { background: var(--accent-soft); color: var(--accent); }

/* Before / after: the "back in your week" cell is the focal block */
.ba { gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); overflow: hidden; margin-bottom: 24px; grid-template-columns: 1fr 48px 1fr 1.15fr; }
.ba-col { border: 0; border-radius: 0; box-shadow: none; padding: 20px 24px; background: var(--surface); }
.ba-col.before { background: var(--surface); border-right: 0; }
.ba-col.after { background: var(--surface); }
.ba-label { text-transform: none; letter-spacing: 0; font-size: var(--fs-14); font-weight: 600; opacity: 1; color: var(--ink-2); }
.ba-col.before .ba-big { color: var(--bad); }
.ba-col.saved .ba-label { color: #dfe5f6; }
.ba-big { font-size: 40px; font-weight: 800; line-height: 1.1; }
.ba-sub { color: var(--ink-2); opacity: 1; }
.ba-col.saved .ba-sub { color: #dfe5f6; }
.ba-col.saved .ba-sub b { color: #fff; }
.ba-arrow { color: var(--ink-3); }
.ba-arrow .i { width: 22px; height: 22px; }
.how { margin-top: 2px; }
.formula { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: var(--fs-14); }
.payback b { color: var(--accent); font-weight: 800; }
.roi-table tfoot td { background: var(--n50); border-top: 1px solid var(--border-strong); }

/* Section heads used inside panels in the savings column */
.panel-body > .section-title:first-child, .panel-body > h3:first-child { margin-top: 0; }

/* Reduced motion: no stamp thump, no slides, the spotlight jumps */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 1280px) {
  .ba { grid-template-columns: 1fr 1fr; }
  .ba-col.saved { grid-column: 1 / -1; }
  .ba-col.after { border-left: 1px solid var(--border); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis .kpi:nth-child(3n + 1) { border-left: 0; }
  .kpis .kpi:nth-child(n + 4) { border-top: 1px solid var(--border); }
}
@media (max-width: 960px) {
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); background: var(--surface); }
  .brand { padding: 12px 16px; }
  .main { padding: 16px 16px 40px; }
  .page-head h1 { font-size: var(--fs-22); }
  .aha { padding: 20px 16px; gap: 24px; }
  .aha h2 { font-size: var(--fs-27); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi { border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
  .kpis .kpi:nth-child(2n + 1) { border-left: 0; }
  .kpis .kpi:nth-child(-n + 2) { border-top: 0; }
  .kpi .value { font-size: var(--fs-22); }
  .ba { grid-template-columns: minmax(0, 1fr); }
  .ba-col.after { border-left: 0; border-top: 1px solid var(--border); }
  .ba-col.saved { grid-column: auto; }
  .ba-big { font-size: var(--fs-34); }
}
@media (min-width: 961px) {
  .kpis.kpis-4 .kpi { border-left: 1px solid var(--border); border-top: 0; }
  .kpis.kpis-4 .kpi:first-child { border-left: 0; }
}
/* hero headline: big, but the paper proforma stays the focal point */
.aha h2 { font-size: 30px; max-width: 22ch; }
@media (max-width: 960px) { .aha h2 { font-size: var(--fs-27); } }
.demo-btn { width: 100%; }
@media (max-width: 600px) {
  .aha-stats { grid-template-columns: repeat(2, max-content); gap: 12px 24px; }
  .aha-stats b { white-space: nowrap; font-size: 20px; }
  .aha-cta .btn { flex: 1 1 auto; justify-content: center; }
}
