@font-face { font-family: 'Public Sans'; src: url('/fonts/public-sans-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('/fonts/public-sans-latin-wght-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  --paper: #F2F4F1;
  --sheet: #FFFFFF;
  --ink: #17211D;
  --ink-2: #3A4743;
  --muted: #5E6B66;
  --faint: #8C9894;
  --rule: #D9DFDB;
  --rule-2: #E8ECE9;
  --ledger: #1F4D3A;
  --ledger-2: #2D6A51;
  --ledger-tint: #E3EEE8;
  --amber: #A86A12;
  --amber-tint: #FBF1DF;
  --red: #B42318;
  --red-tint: #FCE9E7;
  --blue: #2B5C8A;
  --blue-tint: #E6EEF6;
  --focus: #2B5C8A;
  --radius-s: 4px;
  --radius: 8px;
  --shadow-pop: 0 10px 30px rgba(23, 33, 29, .14), 0 2px 6px rgba(23, 33, 29, .08);
  --font: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121815; --sheet: #19211D; --ink: #E7ECE9; --ink-2: #C9D2CE; --muted: #9AA7A2; --faint: #74817C;
    --rule: #2C3833; --rule-2: #232D29; --ledger: #6FB592; --ledger-2: #8CCBAB; --ledger-tint: #1E3329;
    --amber: #E0A54A; --amber-tint: #33280F; --red: #F07A6E; --red-tint: #3A1C19; --blue: #7FB1E0; --blue-tint: #1B2A38; --focus: #7FB1E0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121815; --sheet: #19211D; --ink: #E7ECE9; --ink-2: #C9D2CE; --muted: #9AA7A2; --faint: #74817C;
  --rule: #2C3833; --rule-2: #232D29; --ledger: #6FB592; --ledger-2: #8CCBAB; --ledger-tint: #1E3329;
  --amber: #E0A54A; --amber-tint: #33280F; --red: #F07A6E; --red-tint: #3A1C19; --blue: #7FB1E0; --blue-tint: #1B2A38; --focus: #7FB1E0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--ledger); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 8px; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link { position: fixed; left: 12px; top: 8px; z-index: 200; padding: 8px 12px; background: var(--ink); color: var(--sheet); border-radius: 4px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.nav { background: var(--sheet); border-right: 1px solid var(--rule); padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 16px; font-weight: 700; font-size: 16px; color: var(--ink); }
.brand-mark { width: 26px; height: 22px; flex: none; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-s); color: var(--ink-2); font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--rule-2); }
.nav a.on { background: var(--ledger-tint); color: var(--ledger); font-weight: 650; }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.nav a .count.hot { color: var(--red); }
.nav .sep { height: 1px; background: var(--rule-2); margin: 10px 6px; }
.nav .foot { margin-top: auto; padding: 10px; font-size: 12px; color: var(--muted); }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.main { min-width: 0; display: flex; flex-direction: column; }
.demo-warning { padding: 9px 28px; background: #fff1c9; color: #6b4500; border-bottom: 1px solid #e7c66a; font-size: 13px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--rule); background: var(--sheet); position: sticky; top: 0; z-index: 20; }
.search { flex: 1; max-width: 460px; position: relative; }
.search input { width: 100%; padding-left: 32px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; color: var(--faint); }
.page { padding: 24px 28px 64px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; z-index: 50; left: 0; width: 240px; transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow-pop); }
  .nav.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .page { padding: 18px 16px 48px; }
}

/* ---------- controls ---------- */
button, .btn { font: inherit; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border-radius: var(--radius-s); border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.3; }
button svg, .btn svg { width: 17px; height: 17px; flex: none; }
button:hover, .btn:hover { border-color: var(--faint); text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ledger); border-color: var(--ledger); color: #fff; }
.btn-primary:hover { background: var(--ledger-2); border-color: var(--ledger-2); }
:root[data-theme="dark"] .btn-primary, :root:not([data-theme="light"]) .btn-primary { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0f1a15; } }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--rule)); }
.btn-danger:hover { background: var(--red-tint); border-color: var(--red); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--rule-2); border-color: transparent; }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 7px 10px; min-width: 0; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--focus) 45%, transparent); outline-offset: 0; border-color: var(--focus); }
textarea { resize: vertical; min-height: 70px; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: 13.5px; color: var(--ink); }
.check input { margin-top: 3px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius-s); overflow: hidden; background: var(--sheet); }
.seg button { border: 0; border-radius: 0; border-right: 1px solid var(--rule); padding: 6px 12px; font-weight: 550; color: var(--ink-2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ledger-tint); color: var(--ledger); }

/* ---------- surfaces ---------- */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.sheet-pad { padding: 18px 20px; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--rule-2); }
.sheet-head .grow { flex: 1; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 4px; }

table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--rule); background: var(--sheet); position: sticky; top: 0; white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.link { cursor: pointer; }
.t tbody tr.link:hover td { background: color-mix(in srgb, var(--ledger-tint) 45%, transparent); }
.t .num { text-align: right; }
.table-wrap { overflow-x: auto; }

/* status words, not candy pills */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.st::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: currentColor; flex: none; }
.st-ok { color: var(--ledger); }
.st-wait { color: var(--amber); }
.st-bad { color: var(--red); }
.st-info { color: var(--blue); }
.st-dim { color: var(--faint); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 3px; background: var(--rule-2); color: var(--ink-2); white-space: nowrap; }
.tag-ok { background: var(--ledger-tint); color: var(--ledger); }
.tag-bad { background: var(--red-tint); color: var(--red); }
.tag-wait { background: var(--amber-tint); color: var(--amber); }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } }
.figures { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); margin-bottom: 18px; }
.figures > div { padding: 16px 18px; border-right: 1px solid var(--rule-2); }
.figures > div:last-child { border-right: 0; }
.figures .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.figures .l { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
@media (max-width: 760px) { .figures { grid-template-columns: 1fr 1fr; } .figures > div:nth-child(2) { border-right: 0; } .figures > div:nth-child(-n+2) { border-bottom: 1px solid var(--rule-2); } }

.queue-item { display: grid; grid-template-columns: 4px 1fr auto; gap: 0 14px; padding: 12px 18px 12px 0; border-bottom: 1px solid var(--rule-2); cursor: pointer; align-items: center; }
.queue-item:last-child { border-bottom: 0; }
.queue-item:hover, .queue-item.sel { background: color-mix(in srgb, var(--ledger-tint) 45%, transparent); }
.queue-item .bar { align-self: stretch; border-radius: 0 3px 3px 0; background: var(--rule); }
.queue-item.urgent .bar { background: var(--red); }
.queue-item.medium .bar { background: var(--amber); }
.queue-item .what { font-weight: 600; }
.queue-item .why { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.queue-item .right { text-align: right; font-size: 13px; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 11px; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; color: var(--muted); background: var(--sheet); }

.readiness { display: flex; align-items: center; gap: 16px; }
.ring { width: 76px; height: 76px; flex: none; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule-2); }
.checklist li:last-child { border-bottom: 0; }
.checklist .box { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--faint); flex: none; display: grid; place-items: center; }
.checklist .done .box { background: var(--ledger); border-color: var(--ledger); color: #fff; }
.checklist .done span.lbl { color: var(--muted); text-decoration: line-through; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 116px; padding-top: 12px; overflow: hidden; }
.bars .col { flex: 1; max-width: 56px; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; min-width: 0; position: relative; }
.bars .seg-t { background: var(--ledger); border-radius: 2px 2px 0 0; }
.bars .seg-h { background: color-mix(in srgb, var(--ledger) 30%, var(--rule)); }
.bars .lbl { font-size: 10.5px; color: var(--faint); text-align: center; margin-top: 4px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.cause { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 7px 0; border-bottom: 1px solid var(--rule-2); }
.cause:last-child { border-bottom: 0; }
.cause .meter { grid-column: 1 / -1; height: 4px; background: var(--rule-2); border-radius: 2px; overflow: hidden; }
.cause .meter i { display: block; height: 100%; background: var(--red); opacity: .75; }

/* ---------- invoice detail ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
@media (max-width: 1150px) { .split { grid-template-columns: 1fr; } }
.docview { position: sticky; top: 74px; height: calc(100vh - 100px); min-height: 520px; display: flex; flex-direction: column; overflow: hidden; }
.docview iframe, .docview img { flex: 1; width: 100%; border: 0; background: #e9ece9; object-fit: contain; }
.docview .doc-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--rule-2); font-size: 12.5px; }
@media (max-width: 1150px) { .docview { position: static; height: 70vh; } }
.inv-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.inv-head .amt { margin-left: auto; text-align: right; }
.inv-head .amt .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 20px; margin-top: 14px; }
.facts .k { font-size: 12px; color: var(--muted); }
.facts .v { font-weight: 600; }
.conf-low { box-shadow: inset 0 -2px 0 var(--amber); }

/* the signature: three-row match strip */
.mline { padding: 14px 20px; border-bottom: 1px solid var(--rule-2); }
.mline:last-child { border-bottom: 0; }
.mline-top { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.mline-top .desc { font-weight: 600; flex: 1; min-width: 180px; }
.mline-top .amt { font-weight: 650; }
.strip { display: grid; grid-template-columns: 74px 1fr 92px; gap: 3px 10px; margin-top: 10px; align-items: center; font-size: 12px; }
.strip .lab { color: var(--muted); }
.strip .track { height: 9px; background: var(--rule-2); border-radius: 2px; position: relative; overflow: hidden; }
.strip .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.strip .fill.o { background: color-mix(in srgb, var(--ink) 38%, var(--rule)); }
.strip .fill.r { background: var(--ledger); }
.strip .fill.b-prev { background: color-mix(in srgb, var(--blue) 45%, var(--rule)); }
.strip .fill.b { background: var(--blue); }
.strip .fill.b.over { background: var(--red); }
.strip .fill.b.wait { background: repeating-linear-gradient(135deg, var(--amber) 0 5px, color-mix(in srgb, var(--amber) 55%, var(--sheet)) 5px 10px); }
.strip .qty { text-align: right; color: var(--ink-2); font-weight: 600; }
.mnote { font-size: 12.5px; margin-top: 8px; color: var(--muted); }
.mnote.ok { color: var(--ledger); }
.mnote.bad { color: var(--red); }
.mnote.wait { color: var(--amber); }

.exc { border-left: 3px solid var(--red); background: var(--sheet); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; border-top: 1px solid var(--rule); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 10px; }
.exc.warn { border-left-color: var(--amber); }
.exc.waiting { border-left-color: var(--amber); }
.exc.done { border-left-color: var(--rule); opacity: .8; }
.exc h3 { display: flex; gap: 10px; align-items: baseline; }
.exc h3 .risk { margin-left: auto; color: var(--red); font-weight: 650; font-size: 13px; }
.exc .msg { margin: 6px 0 10px; color: var(--ink-2); }
.exc .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.exc .form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--rule); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 6px 0; font-size: 13px; }
.timeline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-top: 6px; }
.timeline .dot.ok { background: var(--ledger); }
.timeline .dot.bad { background: var(--red); }
.timeline time { color: var(--faint); font-size: 12px; }

.steps { display: flex; gap: 0; margin: 4px 0 2px; }
.steps .s { flex: 1; font-size: 12px; color: var(--faint); padding-top: 8px; border-top: 3px solid var(--rule); margin-right: 4px; }
.steps .s.done { color: var(--ledger); border-top-color: var(--ledger); }
.steps .s.now { color: var(--ink); border-top-color: var(--amber); font-weight: 600; }
.steps .s.bad { color: var(--red); border-top-color: var(--red); font-weight: 600; }

/* line editor */
.lines-edit td { padding: 4px 4px; }
.lines-edit input, .lines-edit select { width: 100%; padding: 5px 7px; font-size: 13px; }
.lines-edit .w-xs { width: 64px; } .lines-edit .w-s { width: 90px; } .lines-edit .w-m { width: 110px; }

/* drop zone */
.drop { border: 2px dashed var(--rule); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); background: var(--sheet); transition: border-color .1s, background .1s; }
.drop.over { border-color: var(--ledger); background: var(--ledger-tint); color: var(--ledger); }
.drop strong { color: var(--ink); }

/* toasts & dialogs */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow-pop); font-weight: 550; max-width: 90vw; pointer-events: auto; }
.toast.bad { background: var(--red); color: #fff; }
dialog { border: 1px solid var(--rule); border-radius: 10px; padding: 0; background: var(--sheet); color: var(--ink); box-shadow: var(--shadow-pop); width: min(560px, 94vw); }
dialog::backdrop { background: rgba(18, 26, 22, .35); }
dialog .d-head { padding: 16px 20px 0; }
dialog .d-body { padding: 14px 20px; max-height: 70vh; overflow: auto; }
dialog .d-foot { padding: 12px 20px 16px; display: flex; gap: 8px; justify-content: flex-end; }

/* auth & onboarding */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .pitch { background: var(--ledger); color: #EAF3EE; padding: 56px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth .pitch h1 { font-size: 34px; line-height: 1.15; color: #fff; max-width: 15ch; letter-spacing: -0.025em; }
.auth .pitch p { color: #CFE2D8; max-width: 44ch; font-size: 15px; }
.auth .form-side { display: grid; place-items: center; padding: 32px 20px; }
.auth form { width: min(380px, 100%); }
.auth .demo-strip { margin-top: 28px; }
.auth .form-side { grid-template-rows: 1fr auto; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.legal-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 12.5px; padding: 18px 0 4px; }
.legal-foot a { color: var(--muted); }
.legal-foot a:hover { color: var(--ink); }
.nav .legal-foot { justify-content: flex-start; gap: 2px 10px; padding: 10px 0 0; font-size: 11.5px; }
.nav .legal-foot a { display: inline; padding: 0; color: inherit; font-weight: 400; }
.nav .legal-foot a:hover { background: none; text-decoration: underline; }
.nav .foot .help-link { display: inline-block; padding: 6px 0 0; font-size: 12.5px; font-weight: 600; color: var(--ledger); }
.nav .foot .help-link:hover { background: none; text-decoration: underline; }
.support-line { margin: 14px 0 0; line-height: 1.5; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth .pitch { padding: 32px 24px; } .auth .pitch h1 { font-size: 26px; } }
.pitch-strip { display: grid; grid-template-columns: 70px 1fr; gap: 6px 10px; font-size: 12px; color: #CFE2D8; max-width: 380px; }
.pitch-strip .t { height: 10px; border-radius: 2px; background: rgba(255,255,255,.14); position: relative; overflow: hidden; align-self: center; }
.pitch-strip .t i { position: absolute; inset: 0 auto 0 0; border-radius: 2px; }
.onb { max-width: 680px; margin: 40px auto; padding: 0 16px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.choice { border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; background: var(--sheet); text-align: left; font-weight: 550; display: block; white-space: normal; }
.choice small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.choice.on { border-color: var(--ledger); background: var(--ledger-tint); box-shadow: inset 0 0 0 1px var(--ledger); }
.progress { height: 4px; background: var(--rule-2); border-radius: 2px; overflow: hidden; margin: 18px 0 26px; }
.progress i { display: block; height: 100%; background: var(--ledger); transition: width .25s ease; }

/* public pages (receiver / approver) */
.pub { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }
.pub .co { color: var(--muted); font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.big-choice { display: grid; gap: 10px; margin: 18px 0; }
.big-choice button { padding: 16px; font-size: 16px; justify-content: flex-start; align-items: flex-start; flex-direction: column; gap: 2px; text-align: left; white-space: normal; width: 100%; }
.big-choice button small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.done-mark { text-align: center; padding: 40px 10px; }
.done-mark svg { width: 56px; height: 56px; color: var(--ledger); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; }
.filter-grid label { margin-bottom: 4px; }
.pill-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.pill-tabs a { padding: 6px 12px; border-radius: var(--radius-s); color: var(--ink-2); font-weight: 550; text-decoration: none; }
.pill-tabs a:hover { background: var(--rule-2); }
.pill-tabs a.on { background: var(--ink); color: var(--paper); }
.pill-tabs a .n { color: inherit; opacity: .65; margin-left: 4px; font-weight: 600; }
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.settings-layout .subnav a { display: block; padding: 7px 10px; border-radius: var(--radius-s); color: var(--ink-2); font-weight: 550; }
.settings-layout .subnav a.on { background: var(--ledger-tint); color: var(--ledger); }
@media (max-width: 760px) { .settings-layout { grid-template-columns: 1fr; } .settings-layout .subnav { display: flex; flex-wrap: wrap; gap: 4px; } }
.callout { padding: 12px 14px; border-radius: var(--radius); background: var(--blue-tint); color: var(--ink-2); font-size: 13.5px; }
.callout.warn { background: var(--amber-tint); }
.callout.bad { background: var(--red-tint); }
.callout.ok { background: var(--ledger-tint); }

.le-list { display: flex; flex-direction: column; gap: 8px; }
.le-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) minmax(0, 1fr) 72px 34px; grid-template-areas: "type desc desc desc del" "sku qty uom price amt"; gap: 6px; padding: 10px; border: 1px solid var(--rule-2); border-radius: var(--radius); background: color-mix(in srgb, var(--paper) 50%, var(--sheet)); }
.le-row > * { min-width: 0; font-size: 13px; padding: 6px 8px; }
.le-row [name=line_type] { grid-area: type; } .le-row .le-desc { grid-area: desc; } .le-row [data-del] { grid-area: del; padding: 4px; }
.le-row .le-sku { grid-area: sku; } .le-row [name=qty] { grid-area: qty; } .le-row [name=uom] { grid-area: uom; } .le-row [name=unit_price] { grid-area: price; } .le-row [name=amount] { grid-area: amt; }
.le-row { grid-template-columns: 1.2fr 0.8fr 0.6fr 1fr 1fr; grid-template-areas: "type desc desc desc del" "sku qty uom price amt"; }
.le-row [data-del] { justify-self: end; }

/* ---------- premium additions ---------- */
.bell-wrap { position: relative; }
.bell { position: relative; padding: 6px 8px; }
.bell svg { width: 19px; height: 19px; }
.bell-n { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
.bell-pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, 92vw); max-height: 70vh; overflow-y: auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-pop); z-index: 60; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--rule-2); }
.bell-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--rule-2); color: var(--ink-2); text-decoration: none; font-size: 13px; }
.bell-item:hover { background: var(--rule-2); text-decoration: none; }
.bell-item.unread { color: var(--ink); font-weight: 550; box-shadow: inset 3px 0 0 var(--ledger); }
.bell-item time { display: block; color: var(--faint); font-size: 11.5px; font-weight: 400; margin-top: 2px; }
.co-switch { width: 100%; margin: 4px 0; font-size: 12.5px; }
@media (max-width: 560px) { .hide-s { display: none; } }
.paybar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-pop); margin-top: 14px; z-index: 10; }
.paybar .grow { flex: 1; min-width: 160px; }
.weekbars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; align-items: end; height: 110px; margin-top: 8px; }
.weekbars .wb { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; }
.weekbars .wb i { display: block; background: var(--ledger); border-radius: 2px 2px 0 0; min-height: 2px; }
.weekbars .wb span { font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; white-space: nowrap; overflow: hidden; }
.meter-bar { height: 8px; background: var(--rule-2); border-radius: 4px; overflow: hidden; }
.meter-bar > i { display: block; height: 100%; background: var(--ledger); }
.meter-bar.warn > i { background: var(--amber); }
.meter-bar.bad > i { background: var(--red); }
.saved-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: center; padding: 22px 24px; }
.saved-hero .big { font-size: 40px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; color: var(--ledger); }
@media (max-width: 760px) { .saved-hero { grid-template-columns: 1fr; } }
.qr-box { background: #fff; display: inline-block; padding: 6px; border-radius: var(--radius); border: 1px solid var(--rule); }
.qr-box svg { width: 180px; height: 180px; display: block; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; padding: 12px 14px; background: var(--rule-2); border-radius: var(--radius); }
.photo-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--rule); }
.res-ok { color: var(--ledger); } .res-warn { color: var(--amber); } .res-bad { color: var(--red); }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.catalog-grid .ci { border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px; background: var(--sheet); display: flex; flex-direction: column; gap: 4px; }
.pub.pub-wide { max-width: 860px; }
.hdot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--blue); } .hdot.ok { background: var(--ledger); } .hdot.bad { background: var(--red); } .hdot.warn { background: var(--amber); }
.weekbars .wb .bv { font-size: 10.5px; font-weight: 600; color: var(--muted); text-align: center; margin-bottom: 3px; white-space: nowrap; }
.figures.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { .figures.five { grid-template-columns: 1fr 1fr; } .figures.five > div { border-bottom: 1px solid var(--rule-2); } }
@media (max-width: 640px) { .dash > aside { order: -1; } }
.dash > * { min-width: 0; }
h2 > svg, h3 > svg, .callout svg, label.btn svg, a.small svg, .drop svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; flex: none; }
.drop svg { width: 26px; height: 26px; display: block; margin: 0 auto 6px; }
#page:focus { outline: none; }

/* page switching: a slim bar only when the next page takes a moment */
body.nav-busy::before { content: ''; position: fixed; top: 0; left: 0; height: 2px; width: 40%; z-index: 100; background: var(--ledger); animation: navbusy 1s ease-in-out infinite; }
@keyframes navbusy { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { body.nav-busy::before { animation: none; width: 100%; opacity: .6; } }

/* billing */
.bill-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 28px; font-size: 13px; border-bottom: 1px solid var(--rule); }
.bill-bar .btn { white-space: nowrap; }
.bill-info { background: var(--blue-tint); }
.bill-warn { background: var(--amber-tint); }
.bill-bad { background: var(--red-tint); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan ul { margin: 10px 0 14px; padding-left: 18px; color: var(--ink-2); }
.plan-price { font-size: 28px; font-weight: 650; margin-top: 6px; }
.plan-pick { outline: 2px solid var(--ledger); }
.meter { height: 4px; background: var(--rule-2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ledger); }
@media (max-width: 800px) { .plans { grid-template-columns: 1fr; } .bill-bar { padding: 9px 16px; flex-wrap: wrap; } }

/* "Load more" under long lists */
.more-slot { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 12px; }
.more-slot:empty { display: none; }

/* ---------- leak check report ---------- */
.leak-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.leak-controls .grow { flex: 1; }
.leak-dates { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.leak-report { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px 26px; }
.leak-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--ledger); margin-bottom: 18px; flex-wrap: wrap; }
.leak-kicker { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ledger); }
.leak-co { font-size: 26px; margin: 2px 0 2px; letter-spacing: -.02em; }
.leak-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.leak-brand .brand-mark { width: 24px; height: 20px; }
.leak-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); margin-bottom: 12px; }
.leak-big { padding: 14px 16px; border-right: 1px solid var(--rule-2); min-width: 0; }
.leak-big:last-child { border-right: 0; }
.leak-big .l { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.leak-big .v { font-size: 28px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.leak-big:first-child .v { color: var(--red); }
.leak-big.ok .v { color: var(--ledger); }
.leak-big .s { font-size: 12px; color: var(--muted); }
.leak-note { font-size: 13.5px; color: var(--amber); margin: 0 0 6px; }
.leak-sec { margin-top: 20px; }
.leak-sec h3 { font-size: 15px; margin: 0 0 8px; }
.leak-t td, .leak-t th { padding: 8px 10px; }
.leak-total td { border-top: 2px solid var(--rule); }
.leak-bank { margin: 0; padding-left: 18px; font-size: 14px; }
.leak-bank li { margin-bottom: 4px; }
.leak-foot { margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--rule-2); }
.leak-foot p { margin: 0 0 6px; }
@media (max-width: 760px) { .leak-hero { grid-template-columns: 1fr 1fr; } .leak-big:nth-child(2) { border-right: 0; } .leak-big:nth-child(-n+2) { border-bottom: 1px solid var(--rule-2); } .leak-report { padding: 16px; } }

@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --paper: #FFFFFF; --sheet: #FFFFFF; --ink: #17211D; --ink-2: #3A4743; --muted: #5E6B66; --faint: #8C9894; --rule: #D9DFDB; --rule-2: #E8ECE9;
    --ledger: #1F4D3A; --ledger-2: #2D6A51; --ledger-tint: #E3EEE8; --amber: #A86A12; --amber-tint: #FBF1DF; --red: #B42318; --blue: #2B5C8A; color-scheme: light;
  }
  @page { margin: 10mm 11mm; }
  html, body { background: #fff !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .nav, .topbar, #bill-slot, .demo-warning, .toasts, .skip-link, .pill-tabs, .page-head, .no-print, .menu-btn { display: none !important; }
  .shell { display: block; min-height: 0; }
  .main { display: block; }
  .page { padding: 0; max-width: none; }
  .leak-report { border: 0; padding: 0; border-radius: 0; }
  .leak-hero { grid-template-columns: repeat(4, 1fr); }
  .leak-big:nth-child(2) { border-right: 1px solid var(--rule-2); }
  .leak-big { border-bottom: 0 !important; }
  .table-wrap { overflow: visible !important; }
  .t th { position: static; }
  tr, .leak-big, .leak-bank li { break-inside: avoid; }
  .leak-sec h3 { break-after: avoid; }
  body { font-size: 12.5px; }
  .leak-head { padding-bottom: 10px; margin-bottom: 12px; }
  .leak-co { font-size: 22px; }
  .leak-big { padding: 10px 12px; } .leak-big .v { font-size: 22px; }
  .leak-sec { margin-top: 8px; } .leak-sec h3 { margin-bottom: 4px; font-size: 14px; }
  .leak-big .s { font-size: 11px; }
  .leak-t td, .leak-t th { padding: 4px 8px; }
  .leak-foot { margin-top: 10px; padding-top: 8px; font-size: 10.5px; line-height: 1.4; }
  .leak-foot p { margin-bottom: 3px; }
  .leak-bank { font-size: 12px; }
  .leak-note { margin-bottom: 0; }
  a { color: inherit; text-decoration: none; }
}
