/* Statement-to-Ledger: "Working ledger" design system. Tokens and rationale in DESIGN.md. */
@font-face { font-family: "Plex Sans"; src: url("../vendor/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../vendor/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../vendor/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../vendor/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../vendor/fonts/newsreader-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../vendor/fonts/newsreader-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../vendor/fonts/newsreader-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../vendor/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  /* color */
  --paper: #f5f6f3; --sheet: #fff; --ink: #17212e;
  --accent: #1f4e8c; --accent-d: #183e70; --accent-t: #e8eef6;
  --n50: #f5f6f3; --n100: #edefea; --n200: #dee2db; --n300: #c8cdc5; --n400: #9ba2a9;
  --n500: #687180; --n600: #4a5361; --n700: #333c49; --n800: #232c38; --n900: #17212e;
  --ok: #1e6b45; --ok-l: #e7f1ea; --bad: #b42318; --bad-l: #fbeae8; --warn: #8a5300; --warn-l: #fbf1de;
  --hi: #f5c84b;
  /* legacy aliases used by inline styles in js */
  --bg: var(--paper); --card: var(--sheet); --ink-2: var(--n600); --muted: var(--n500); --line: var(--n200); --line-2: var(--n100);
  --pri: var(--accent); --pri-d: var(--accent-d); --pri-l: var(--accent-t); --grey-l: var(--n100);
  /* type */
  --sans: "Plex Sans", "Segoe UI", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --mono: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  /* shape + motion */
  --r-chip: 3px; --r-ctl: 4px; --r: 6px; --r-float: 8px;
  --sh-float: 0 1px 2px rgba(23, 33, 46, .08), 0 8px 24px rgba(23, 33, 46, .14);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 2px; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.side :focus-visible, .mobile-top :focus-visible { outline-color: #9dbbe6; }
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* sidebar: the dark binding of the ledger */
.side { background: var(--ink); color: #c9d1dc; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 20px 18px 16px; display: flex; gap: 12px; align-items: center; color: #fff; cursor: pointer; }
.logo { width: 32px; height: 32px; border-radius: var(--r-ctl); background: var(--accent); color: #fff; display: grid; place-items: center; font: 600 15px/1 var(--serif); flex: none; }
.brand b { display: block; font: 600 17px/1.2 var(--serif); }
.brand small { color: #8f9bab; font-size: 12px; }
.side h6 { margin: 16px 18px 6px; font-size: 12px; color: #8f9bab; font-weight: 500; }
.clist { overflow-y: auto; flex: 1; padding: 0 8px; }
.citem { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-ctl); cursor: pointer; color: #c9d1dc; transition: var(--t); }
.citem:hover { background: #1f2b3b; }
.citem.on { background: #263447; color: #fff; box-shadow: inset 2px 0 0 #9dbbe6; }
.citem .av { width: 24px; font-size: 12px; font-weight: 600; color: #8f9bab; flex: none; font-variant-numeric: tabular-nums; }
.citem.on .av { color: #c9d1dc; }
.citem .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: #4a5668; }
.dot.ok { background: #5fbf8a; } .dot.bad { background: #e26a5e; } .dot.wip { background: #e0b04a; } .dot.done { background: #8fb2e3; }
.side-foot { padding: 12px 14px 16px; border-top: 1px solid #263447; font-size: 12px; color: #9aa6b5; }
.privacy { display: flex; gap: 8px; line-height: 1.45; margin-bottom: 12px; }
.privacy svg { flex: none; margin-top: 2px; }
.btn-ghost-dark { background: transparent; border: 1px solid #334256; color: #c9d1dc; border-radius: var(--r-ctl); padding: 6px 10px; cursor: pointer; width: 100%; font-size: 13px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; transition: var(--t); }
.btn-ghost-dark:hover { background: #1f2b3b; }

/* main */
.main { min-width: 0; padding: 24px 32px 64px; max-width: 1400px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.topbar h1 { font: 600 27px/1.15 var(--serif); margin: 0; letter-spacing: -.01em; }
.sub { color: var(--n500); font-size: 13px; margin-top: 4px; }
.crumbs { font-size: 13px; color: var(--n500); margin-bottom: 4px; }
.crumbs a { text-decoration: none; cursor: pointer; }
.crumbs a:hover { text-decoration: underline; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--n200); margin: 8px 0 24px; overflow-x: auto; }
.tab { padding: 10px 12px; border: 0; background: none; cursor: pointer; color: var(--n600); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; display: flex; gap: 8px; align-items: center; transition: var(--t); }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab .n { font-size: 12px; background: var(--n100); color: var(--n600); border-radius: var(--r-chip); padding: 0 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tab .n.bad { background: var(--bad-l); color: var(--bad); }
.tab .n.ok { background: var(--ok-l); color: var(--ok); }
.tab .step { font-size: 12px; color: var(--n500); font-weight: 600; font-variant-numeric: tabular-nums; }
.tab.on .step { color: var(--accent); }

/* sheets */
.card { background: var(--sheet); border: 1px solid var(--n200); border-radius: var(--r); }
.card > .hd { padding: 12px 16px; border-bottom: 1px solid var(--n200); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card > .hd h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card > .bd { padding: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--n500); } .small { font-size: 13px; } .mono { font-family: var(--mono); font-size: 12px; }
.right { text-align: right; } .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.btn { border: 1px solid var(--n300); background: var(--sheet); border-radius: var(--r-ctl); padding: 7px 12px; cursor: pointer; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; transition: var(--t); }
.btn:hover { background: var(--n50); border-color: var(--n400); }
.btn:active { background: var(--n100); }
.btn.pri { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.pri:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn.pri:active { background: #12305a; }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 8px; font-size: 13px; }
.btn.icon { padding: 4px 6px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.input, select.input, textarea.input { border: 1px solid var(--n300); border-radius: var(--r-ctl); padding: 6px 8px; background: var(--sheet); min-width: 0; transition: var(--t); }
.input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-t); border-color: var(--accent); }
label.f { display: block; font-size: 13px; color: var(--n600); font-weight: 500; }
label.f .input { display: block; width: 100%; margin-top: 4px; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: var(--r-chip); background: var(--n100); color: var(--n600); white-space: nowrap; }
.chip.ok { background: var(--ok-l); color: var(--ok); } .chip.bad { background: var(--bad-l); color: var(--bad); }
.chip.warn { background: var(--warn-l); color: var(--warn); } .chip.pri { background: var(--accent-t); color: var(--accent); }
.chip.vio { background: var(--accent-t); color: var(--accent); }
.chip.wrap { white-space: normal; line-height: 1.4; padding: 2px 8px; max-width: 100%; }
.chip .bar { width: 24px; height: 4px; border-radius: 2px; background: rgba(23, 33, 46, .12); overflow: hidden; }
.chip .bar i { display: block; height: 100%; background: currentColor; }

/* summary strip (one ruled sheet, four cells) */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; background: var(--sheet); border: 1px solid var(--n200); border-radius: var(--r); }
.kpis .card { border: 0; border-radius: 0; background: none; }
.kpis .kpi + .kpi { border-left: 1px solid var(--n200); }
.kpi { padding: 16px; }
.kpi .l { font-size: 13px; color: var(--n500); font-weight: 500; }
.kpi .v { font-size: 27px; font-weight: 600; letter-spacing: -.01em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .d { font-size: 13px; color: var(--n600); margin-top: 4px; }

/* tables */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; color: var(--n500); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--n200); background: var(--n50); position: sticky; top: 0; z-index: 1; }
table.t td { padding: 8px 12px; border-bottom: 1px solid var(--n100); vertical-align: middle; }
table.t th.num, table.mini th.num { text-align: right; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--n50); }
table.t tr[role]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
table.t tr[role]:focus-visible td { background: var(--accent-t); }
table.t tr.hl td { background: #fdf6e3; }
table.t tr.cur td { background: var(--accent-t); }
.scroll { overflow: auto; }
.tbl-wrap { max-height: 560px; overflow: auto; border-radius: 0 0 var(--r) var(--r); }

/* tie-out */
.badge-big { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--r); font-weight: 600; }
.badge-big .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; font-weight: 700; }
.badge-big .ic svg.i { width: 20px; height: 20px; stroke-width: 2.25; }
.badge-big .t1 { font: 600 27px/1.15 var(--serif); letter-spacing: -.01em; }
.badge-big .t2 { font-size: 13px; font-weight: 400; margin-top: 4px; color: var(--n700); }
.badge-big.ok { background: var(--ok-l); color: var(--ok); border: 1px solid #bcd9c6; } .badge-big.ok .ic { background: var(--ok); }
.badge-big.bad { background: var(--bad-l); color: var(--bad); border: 1px solid #efc2bc; } .badge-big.bad .ic { background: var(--bad); }
.badge-big.pend { background: var(--n100); color: var(--n700); border: 1px solid var(--n200); } .badge-big.pend .ic { background: var(--n400); }
.badge-big.ovr { background: var(--warn-l); color: var(--warn); border: 1px solid #ecd29f; } .badge-big.ovr .ic { background: #b07400; }
.eq { display: grid; grid-template-columns: 1fr auto; row-gap: 8px; column-gap: 12px; align-items: center; font-variant-numeric: tabular-nums; }
.eq .lbl { color: var(--n600); }
.eq .lbl small { color: var(--n500); }
.eq .val { text-align: right; font-weight: 600; }
.eq .rule { grid-column: 1 / -1; border-top: 1px solid var(--n300); margin: 4px 0; }
.eq input.input { width: 140px; text-align: right; font-weight: 600; }
/* accounting convention: a proven total gets a double underline */
.diff-ok { color: var(--ok); }
.proven { border-bottom: 3px double currentColor; padding-bottom: 1px; justify-self: end; }
.diff-bad { color: var(--bad); }
.callout { border-radius: var(--r-ctl); padding: 12px; font-size: 13px; display: block; }
.callout.flex { display: flex; gap: 12px; align-items: flex-start; }
.callout.bad { background: var(--bad-l); color: #7a1d15; } .callout.warn { background: var(--warn-l); color: #5f3a00; }
.callout.info { background: var(--accent-t); color: #173a66; } .callout.ok { background: var(--ok-l); color: #12452c; }
.callout b { font-weight: 600; }
.unread { border: 1px dashed #dda59d; border-radius: var(--r-ctl); padding: 12px; background: #fffaf9; }
.unread + .unread { margin-top: 8px; }

/* categorize grid */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--n200); }
.fchip { border: 1px solid var(--n300); background: var(--sheet); border-radius: var(--r-ctl); padding: 4px 10px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--n600); transition: var(--t); }
.fchip:hover { border-color: var(--n400); color: var(--ink); }
.fchip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.fchip .c { opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }
.bulk { display: flex; gap: 12px; align-items: center; background: var(--ink); color: #fff; padding: 8px 16px; flex-wrap: wrap; }
.bulk select { min-width: 260px; }
.g td.desc .raw { font-family: var(--mono); font-size: 12px; color: var(--n500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.g td.desc .payee { font-weight: 500; }
.g td.desc input.input { padding: 3px 8px; font-size: 13px; width: 220px; }
.g select.input { width: 250px; padding: 4px 6px; font-size: 13px; }
.g select.input.empty { border-color: #dda59d; background: #fffaf9; color: var(--bad); }
.g tr.excl td { opacity: .45; text-decoration: line-through; }
.g tr.excl td.keep { text-decoration: none; }
.amt-in { color: var(--ok); font-weight: 600; } .amt-out { color: var(--ink); font-weight: 500; }
.splitbox { font-size: 12px; line-height: 1.45; background: var(--accent-t); color: #173a66; border-radius: var(--r-ctl); padding: 4px 8px; width: 250px; font-variant-numeric: tabular-nums; }
.flag { font-size: 12px; font-weight: 600; padding: 0 6px; border-radius: var(--r-chip); background: var(--warn-l); color: var(--warn); margin-right: 4px; white-space: nowrap; }
.flag.bad { background: var(--bad-l); color: var(--bad); }

/* popover / toast */
.pop { position: absolute; z-index: 50; width: 360px; background: var(--sheet); border: 1px solid var(--n200); border-radius: var(--r-float); box-shadow: var(--sh-float); padding: 16px; }
.pop:before { content: ""; position: absolute; top: -7px; left: 30px; width: 12px; height: 12px; background: var(--sheet); border-left: 1px solid var(--n200); border-top: 1px solid var(--n200); transform: rotate(45deg); }
.pop h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.pop .row { margin-top: 12px; }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-ctl); box-shadow: var(--sh-float); z-index: 80; font-size: 14px; }

/* import */
.drop { border: 1px dashed var(--n400); border-radius: var(--r); padding: 24px; text-align: center; background: var(--n50); cursor: pointer; transition: var(--t); }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-t); }
.drop .big { font-size: 15px; font-weight: 600; }
.sample { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--n200); border-radius: var(--r-ctl); cursor: pointer; background: var(--sheet); transition: var(--t); }
.sample:hover { border-color: var(--accent); background: #fafcff; }
.sample + .sample { margin-top: 8px; }
.ftype { width: 36px; height: 44px; border-radius: 2px 8px 2px 2px; display: grid; place-items: end center; padding-bottom: 6px; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.ftype.csv { background: var(--ok); } .ftype.pdf { background: var(--bad); }
.map { display: flex; gap: 8px; flex-wrap: wrap; }
.map span { font-size: 12px; background: var(--n100); border-radius: var(--r-chip); padding: 2px 8px; }
.map span b { color: var(--accent); }

/* time saved: solid ink panel, the figure is the point */
.ts { background: var(--ink); color: #fff; border-radius: var(--r); padding: 16px; }
.ts .l { font-size: 13px; color: #aab6c6; font-weight: 500; }
.ts .big { font-size: 34px; font-weight: 600; letter-spacing: -.01em; margin: 4px 0; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ts .cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 12px; background: #2c3a4d; border: 1px solid #2c3a4d; border-radius: var(--r-ctl); overflow: hidden; }
.ts .cmp div { background: var(--ink); padding: 8px 12px; font-size: 12px; color: #c4cedb; }
.ts .cmp b { display: block; font-size: 17px; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.ts .note { font-size: 12px; color: #aab6c6; margin-top: 12px; }
.ts input { width: 46px; background: #232f40; border: 1px solid #3a4a60; color: #fff; border-radius: var(--r-chip); padding: 1px 4px; text-align: right; }

/* bars (single series) */
.bars { display: grid; grid-template-columns: 190px 1fr 64px; gap: 8px 12px; align-items: center; font-size: 13px; }
.bars .track { height: 12px; position: relative; }
.bars .fill { height: 100%; background: var(--accent); border-radius: 0 2px 2px 0; min-width: 2px; transition: var(--t); }
.bars .fill:hover { background: var(--accent-d); }
.bars .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--n600); }
.bars .num { font-weight: 600; }

.empty { text-align: center; padding: 48px 24px; color: var(--n500); }
.empty .ic { color: var(--n400); margin-bottom: 8px; display: flex; justify-content: center; }
.empty .ic svg.i { width: 32px; height: 32px; stroke-width: 1.5; }
.empty h3 { color: var(--ink); margin: 4px 0; font: 600 17px/1.3 var(--serif); }
.gate { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r-ctl); }
.gate svg.i { width: 20px; height: 20px; stroke-width: 2.25; }
.gate.ok { background: var(--ok-l); color: var(--ok); } .gate.bad { background: var(--bad-l); color: var(--bad); } .gate.ovr { background: var(--warn-l); color: var(--warn); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 13px; }
.kv dt { color: var(--n500); } .kv dd { margin: 0; font-weight: 500; }
.mobile-top { display: none; }

@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpis .kpi:nth-child(3) { border-left: 0; }
  .kpis .kpi:nth-child(n+3) { border-top: 1px solid var(--n200); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-top { display: flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; padding: 8px 12px; position: sticky; top: 0; z-index: 20; }
  .mobile-top select { flex: 1; min-width: 0; background: #1f2b3b; color: #fff; border: 1px solid #334256; border-radius: var(--r-ctl); padding: 6px 8px; }
  .main { padding: 16px 16px 48px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kpi { padding: 12px; }
  .kpi .v { font-size: 22px; }
  .bars { grid-template-columns: 110px 1fr 52px; }
  .topbar h1 { font-size: 22px; }
  .badge-big .t1 { font-size: 22px; }
  .pop { width: calc(100vw - 24px); left: 12px !important; }
  .hide-m { display: none; }
}
table.t.nowrap td { white-space: nowrap; }
table.t.small td { font-size: 13px; }
.split > *, .stack > *, .grid2 > *, .grid3 > * { min-width: 0; }

/* nav, hero, asks, savings, tour */
.snav { padding: 0 8px 8px; border-bottom: 1px solid #263447; margin-bottom: 4px; }
.sitem { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-ctl); cursor: pointer; font-size: 14px; color: #c9d1dc; transition: var(--t); }
.sitem:hover { background: #1f2b3b; }
.sitem.on { background: #263447; color: #fff; box-shadow: inset 2px 0 0 #9dbbe6; }
.sitem .si { width: 24px; display: flex; justify-content: center; color: #8f9bab; flex: none; }
.sitem.on .si { color: #fff; }
.sitem.demo { color: #fff; font-weight: 500; }
.sitem.demo .si { color: #9dbbe6; }
.h2 { font: 600 22px/1.2 var(--serif); margin: 0; letter-spacing: -.01em; }
.btn.lg { padding: 10px 16px; font-size: 15px; font-weight: 600; }
.mobile-top .btn { flex: none; }

.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; padding: 16px 0 32px; border-bottom: 1px solid var(--n200); }
.hero-for { font-size: 14px; color: var(--n600); margin: 0 0 12px; }
.hero-h { font: 600 40px/1.1 var(--serif); letter-spacing: -.015em; margin: 0 0 16px; max-width: 15ch; }
.lede { font-size: 16px; line-height: 1.6; color: var(--n700); margin: 0 0 24px; max-width: 54ch; }
.lede b { color: var(--ink); font-weight: 600; }
.hero-cta { gap: 12px; }
.hero-stat { margin-top: 24px; font-size: 14px; color: var(--n600); cursor: pointer; max-width: 54ch; }
.hero-stat b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-stat span { color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #a9bfdc; transition: var(--t); }
.hero-stat:hover span { text-decoration-color: var(--accent); }
/* the ledger sheet: the most characteristic object in the firm's world */
.hero-r { background: var(--sheet); border: 1px solid var(--n200); border-radius: var(--r); padding: 20px 20px 16px; min-width: 0; }
.ba-h { font-size: 13px; margin: 0 0 8px; color: var(--n600); }
.ba-h .tag { margin-right: 8px; }
.ba-h b { color: var(--ink); font-weight: 600; }
.tag { font: 600 15px/1 var(--serif); color: var(--ink); }
.tag.ok { color: var(--ok); }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; border-top: 1px solid var(--n300); }
table.mini th { text-align: left; font-weight: 600; color: var(--n500); padding: 6px 8px; font-size: 12px; border-bottom: 1px solid var(--n300); }
table.mini td { padding: 6px 8px; border-bottom: 1px solid var(--n100); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
table.mini th + th, table.mini td + td { border-left: 1px solid var(--n100); }
table.mini.mono td { font-family: var(--mono); font-size: 12px; color: var(--n700); }
table.mini.mono th:first-child { width: 96px; } table.mini.mono th:last-child { width: 88px; }
table.mini:not(.mono) th:nth-child(1) { width: 32%; }
table.mini:not(.mono) th:nth-child(2) { width: 36%; }
table.mini:not(.mono) th:nth-child(3), table.mini:not(.mono) th:nth-child(4) { width: 76px; }
table.mini td b { color: var(--ink); font-weight: 600; }
table.mini tr.loan td { background: var(--accent-t); }
table.mini .muted { color: var(--n500); }
.ba-arrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 12px 0 20px; padding: 8px; font-size: 13px; color: var(--n600); background: var(--n50); border-radius: var(--r-ctl); font-variant-numeric: tabular-nums; }
.ba-arrow b { color: var(--ok); font-weight: 600; border-bottom: 3px double currentColor; }
.ok-t { color: var(--ok); }
.ba-foot { font-size: 12px; color: var(--n500); margin-top: 12px; }

.asks { display: grid; gap: 16px; }
.ask .q { font: italic 400 17px/1.4 var(--serif); color: var(--ink); }
.ask .a { font-size: 13px; color: var(--n600); margin-top: 4px; line-height: 1.55; }
.ask .a a, .callout a { cursor: pointer; font-weight: 600; }

.quote { margin: 0 0 24px; padding: 0; font: italic 400 22px/1.4 var(--serif); color: var(--ink); max-width: 62ch; }
.quote cite { display: block; font: 400 13px/1.4 var(--sans); color: var(--n500); margin-top: 8px; }
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ba-col .hd h3 { font-size: 15px; }
.big-h { font-size: 27px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.big-h small { font-size: 13px; font-weight: 400; color: var(--n500); margin-left: 4px; letter-spacing: 0; }
.ba-col.before .big-h { color: var(--bad); }
.mline { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 12px 0; border-bottom: 1px solid var(--n100); }
.mline:last-child { border-bottom: 0; }
.mline .ml { font-weight: 500; }
.mline .mf { grid-column: 1; font-size: 12px; color: var(--n500); font-family: var(--mono); }
.mline .mv { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; }
.result { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 16px; background: var(--ink); color: #fff; border-radius: var(--r); overflow: hidden; }
.result > div { padding: 20px 24px; border-right: 1px solid #2c3a4d; }
.result > div:last-child { border-right: 0; }
.result .rl { font-size: 13px; color: #aab6c6; font-weight: 500; }
.result .rv { font-size: 34px; font-weight: 600; letter-spacing: -.01em; margin: 4px 0; font-variant-numeric: tabular-nums; line-height: 1.15; }
.result > div:first-child .rv { color: #8fd6ae; display: inline-block; border-bottom: 3px double currentColor; }
.result .rs { font-size: 13px; color: #c4cedb; line-height: 1.45; }
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; align-items: end; }
.inp-u { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.inp-u .input { width: 100%; margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.inp-u i { font-style: normal; color: var(--n500); font-size: 12px; min-width: 28px; }

/* guided demo: the spotlight move is the one orchestrated motion */
.tour { position: fixed; inset: 0; z-index: 900; }
.tour-shade { position: absolute; inset: 0; }
.tour-hole { position: fixed; border-radius: var(--r); box-shadow: 0 0 0 200vmax rgba(15, 22, 32, .6), 0 0 0 3px var(--hi); transition: left 320ms var(--ease), top 320ms var(--ease), width 320ms var(--ease), height 320ms var(--ease); pointer-events: none; }
.tour-card { position: fixed; width: 370px; max-width: calc(100vw - 24px); background: var(--sheet); border-radius: var(--r-float); box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 16px 40px rgba(0, 0, 0, .3); padding: 16px 16px 12px; transition: left 320ms var(--ease), top 320ms var(--ease); }
.tour-card.final { width: 440px; }
.tc-top { display: flex; align-items: center; gap: 12px; }
.tc-step { font-size: 12px; font-weight: 600; color: var(--n500); font-variant-numeric: tabular-nums; }
.tc-dots { display: flex; gap: 3px; flex: 1; }
.tc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--n200); }
.tc-dots i.d { background: #a9bfdc; } .tc-dots i.c { background: var(--accent); width: 14px; border-radius: 3px; }
.tc-x { border: 0; background: none; cursor: pointer; color: var(--n500); padding: 4px; border-radius: var(--r-ctl); display: grid; place-items: center; transition: var(--t); }
.tc-x:hover { color: var(--ink); background: var(--n100); }
.tc-title { margin: 12px 0 4px; font: 600 20px/1.25 var(--serif); letter-spacing: -.01em; }
.tc-body { font-size: 14px; line-height: 1.55; color: var(--n600); }
.tc-body b { color: var(--ink); font-weight: 600; }
.tc-bar { height: 2px; background: var(--n100); margin: 16px 0 12px; overflow: hidden; }
.tc-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 100ms linear; }
.tc-nav { display: flex; gap: 8px; align-items: center; }
.tour-row { outline: 3px solid var(--hi); outline-offset: 1px; }
body.touring .toast { display: none !important; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero-h { max-width: 20ch; }
  .result { grid-template-columns: 1fr 1fr; }
  .result > div:nth-child(2) { border-right: 0; }
  .result > div:nth-child(n+3) { border-top: 1px solid #2c3a4d; }
  .calc-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .hero { padding: 8px 0 24px; gap: 24px; }
  .hero-h { font-size: 31px; }
  .lede { font-size: 15px; }
  .hero-r { padding: 12px; }
  .ba-grid { grid-template-columns: 1fr; }
  .quote { font-size: 18px; }
  .result .rv { font-size: 24px; }
  .result > div { padding: 16px; }
  .calc-grid { grid-template-columns: 1fr; }
  table.mini.mono th:nth-child(1), table.mini.mono td:nth-child(1) { display: none; }
}
@media (max-width: 560px) {
  .btn.lg { width: 100%; justify-content: center; }
  table.mini:not(.mono) th:nth-child(1), table.mini:not(.mono) td:nth-child(1) { display: none; }
  table.mini:not(.mono) th:nth-child(2) { width: auto; }
  table.mini td, table.mini th { padding: 6px; }
  .ba-arrow { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
