/* cards.co.nz styles. House rule: no em dashes or en dashes anywhere.
   BRAND TOKENS (17 November 2026, from the Cards NZ logo pack brand/logo-pack/README.txt): Graphite #2A2F36 primary (tile,
   buttons, footer), Pressed #181B20, Copper #B4500F accent (the key result figure and highlights ONLY; never small text on
   dark, never on Graphite), Dark-mode primary #D6DAE0, Ink #14171A, Secondary #4C525B (also visible input outlines), Border
   #D9DBDF (decorative only), Surface #F6F6F4, Dark background #111316, Dark card #1B1E23. Typeface Geist. Restrained and
   precise: neutrals do most of the work. Contrast of every pair is checked in both themes (node contrast.mjs). */
:root {
  --brand: #2A2F36;          /* Graphite: buttons, links, active states */
  --brand-strong: #181B20;   /* Pressed */
  --brand-ink: #FFFFFF;      /* text on --brand */
  --brand-soft: #E9EAEC;
  --brand-softer: #F1F1EF;
  --mint: #F3E4D9;           /* soft copper tint behind highlighted figures, with Ink text */
  --mint-soft: #F8EFE8;
  --mint-ink: #14171A;
  --accent: #B4500F; --accent-soft: #F8EFE8;
  --ink: #14171A; --ink-2: #2E3339; --muted: #4C525B; --faint: #6B717A;
  --bg: #F6F6F4; --surface: #FFFFFF; --surface-2: #F6F6F4; --surface-3: #ECECE9;
  --line: #D9DBDF; --line-strong: #C3C6CB; --field-border: #4C525B;
  --good: #1D6B44; --good-soft: #E7F2EC; --warn: #8A4A00; --warn-soft: #FBF1E3; --bad: #A8281E; --bad-soft: #FBECEA;
  --focus: #2A2F36;
  --foot-bg: #2A2F36; --foot-ink: #FFFFFF; --foot-muted: rgba(255, 255, 255, .78); --foot-line: rgba(255, 255, 255, .18);
  --shadow-sm: 0 1px 2px rgba(20, 23, 26, .05);
  --shadow: 0 1px 2px rgba(20, 23, 26, .05), 0 6px 18px -10px rgba(20, 23, 26, .14);
  --shadow-lg: 0 1px 2px rgba(20, 23, 26, .05), 0 18px 40px -24px rgba(20, 23, 26, .22);
  --hero-glow: linear-gradient(var(--bg), var(--bg));
  --radius: 10px; --radius-sm: 8px; --radius-lg: 14px;
  --font: "Geist", "Geist Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #D6DAE0; --brand-strong: #EEF0F3; --brand-ink: #14171A; --brand-soft: rgba(214, 218, 224, .12); --brand-softer: rgba(214, 218, 224, .06);
    --mint: rgba(180, 80, 15, .28); --mint-soft: rgba(180, 80, 15, .14); --mint-ink: #F1F2F4; --accent: #B4500F; --accent-soft: rgba(180, 80, 15, .16);
    --ink: #F1F2F4; --ink-2: #D6DAE0; --muted: #A9AFB8; --faint: #868C95;
    --bg: #111316; --surface: #1B1E23; --surface-2: #22262C; --surface-3: #2A2F36; --line: #2E333A; --line-strong: #3D434B; --field-border: #8A919B;
    --good: #8FD4AE; --good-soft: rgba(143, 212, 174, .12); --warn: #F0B46A; --warn-soft: rgba(240, 180, 106, .12); --bad: #FF9A8F; --bad-soft: rgba(255, 154, 143, .12); --focus: #D6DAE0;
    --foot-bg: #1B1E23; --foot-ink: #FFFFFF; --foot-muted: rgba(255, 255, 255, .74); --foot-line: rgba(255, 255, 255, .12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -14px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .7);
    --hero-glow: linear-gradient(var(--bg), var(--bg));
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #D6DAE0; --brand-strong: #EEF0F3; --brand-ink: #14171A; --brand-soft: rgba(214, 218, 224, .12); --brand-softer: rgba(214, 218, 224, .06);
  --mint: rgba(180, 80, 15, .28); --mint-soft: rgba(180, 80, 15, .14); --mint-ink: #F1F2F4; --accent: #B4500F; --accent-soft: rgba(180, 80, 15, .16);
  --ink: #F1F2F4; --ink-2: #D6DAE0; --muted: #A9AFB8; --faint: #868C95;
  --bg: #111316; --surface: #1B1E23; --surface-2: #22262C; --surface-3: #2A2F36; --line: #2E333A; --line-strong: #3D434B; --field-border: #8A919B;
  --good: #8FD4AE; --good-soft: rgba(143, 212, 174, .12); --warn: #F0B46A; --warn-soft: rgba(240, 180, 106, .12); --bad: #FF9A8F; --bad-soft: rgba(255, 154, 143, .12); --focus: #D6DAE0;
  --foot-bg: #1B1E23; --foot-ink: #FFFFFF; --foot-muted: rgba(255, 255, 255, .74); --foot-line: rgba(255, 255, 255, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -14px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .7);
  --hero-glow: linear-gradient(var(--bg), var(--bg));
  color-scheme: dark;
}

/* Geist (SIL OFL 1.1), self-hosted variable font, weights 400 to 700, latin and latin-ext. Medium 500 body, Bold 700 headings.
   The fallback is Arial with metrics adjusted to Geist, so the swap does not shift the layout. */
@font-face { font-family: "Geist"; src: url(/fonts/geist-latin.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; src: url(/fonts/geist-latin-ext.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Fallback"; src: local("Arial"); size-adjust: 100%; ascent-override: 96%; descent-override: 24%; line-gap-override: 0%; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:lang(zh) body, body:lang(zh) { font-family: var(--font), "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
:lang(hi) body, body:lang(hi) { font-family: var(--font), "Nirmala UI", "Noto Sans Devanagari", sans-serif; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; letter-spacing: -.022em; margin: 0 0 .5em; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem); letter-spacing: -.035em; font-weight: 750; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem); }
h3 { font-size: 1.1rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
small { font-size: .85em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.tnum, .fig strong, table td, .steps b, .amount-input input { font-variant-numeric: tabular-nums; }
.js .no-js, .js-only, .js-only-flex, .js-only-block { display: none !important; }
.js .js-only { display: inline-flex !important; } .js .js-only-flex { display: flex !important; } .js .js-only-block { display: block !important; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .9rem; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin: 0 0 10px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 650; font-size: 1rem; text-decoration: none; cursor: pointer; transition: background .15s, transform .15s, box-shadow .15s; box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, var(--shadow-sm); }
.btn:hover { background: var(--brand-strong); color: var(--brand-ink); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .92rem; border-radius: 10px; }
.btn.link { background: none; border: 0; box-shadow: none; color: var(--brand); padding: 0 4px; }
.btn svg { flex: none; }

/* ---------- Header ---------- */
.site-head { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 18px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.12rem; letter-spacing: -.025em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand small { font-weight: 500; color: var(--muted); font-size: .82em; margin-left: 2px; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: .95rem; padding: 8px 11px; border-radius: 9px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.head-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; padding: 0; }
.icon-btn:hover { color: var(--brand); border-color: var(--line-strong); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; } :root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .sun { display: none; } :root:not([data-theme="light"]) .theme-toggle .moon { display: block; } }
.lang summary, .menu summary { list-style: none; cursor: pointer; }
.lang summary::-webkit-details-marker, .menu summary::-webkit-details-marker { display: none; }
.lang { position: relative; }
.lang summary { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--ink-2); background: var(--surface); }
.lang > div, .menu-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; min-width: 190px; z-index: 50; }
.lang > div a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.lang > div a:hover, .lang > div a[aria-current] { background: var(--brand-soft); }
.menu { position: relative; }
.menu summary { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; background: var(--surface); }
.bars { display: grid; gap: 4px; } .bars i { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
.menu-panel { width: min(560px, calc(100vw - 32px)); display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 14px; max-height: calc(100vh - 90px); overflow: auto; }
.menu-panel a { display: block; padding: 7px 10px; color: var(--ink); text-decoration: none; border-radius: 8px; font-size: .95rem; }
.menu-panel a:hover, .menu-panel a[aria-current] { background: var(--brand-soft); }
.menu-h { margin: 10px 10px 4px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.review { background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: .88rem; padding: 8px 0; color: var(--ink-2); }

/* ---------- Hero (home) ---------- */
.hero { position: relative; background: var(--hero-glow), var(--bg); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(700px 380px at 75% 20%, #000, transparent 75%); -webkit-mask-image: radial-gradient(700px 380px at 75% 20%, #000, transparent 75%); opacity: .45; pointer-events: none; }
.hero > .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 13fr); gap: 52px; align-items: start; padding-top: 56px; padding-bottom: 64px; }
.hero h1 { margin-bottom: 18px; }
.hero h1 .line2 { display: block; color: var(--brand); font-size: .62em; letter-spacing: -.03em; line-height: 1.15; margin-top: 10px; font-weight: 700; }
.hero-copy, .hero-app { min-width: 0; }
.hero .lead { font-size: 1.16rem; color: var(--ink-2); max-width: 34em; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .8rem; white-space: nowrap; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.points { list-style: none; padding: 0; margin: 30px 0 0; border-top: 1px solid var(--line); }
.points li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 15px 0 0; }
.points .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--brand); box-shadow: var(--shadow-sm); }
.points b { display: block; font-size: 1rem; }
.points span { color: var(--muted); font-size: .94rem; }
.trustline { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .88rem; margin-top: 22px; }

/* ---------- The app window ---------- */
.appwin { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.appwin-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.appwin-bar .dots { display: flex; gap: 6px; } .appwin-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.appwin-bar .addr { font-size: .78rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; }
.appwin-bar .grow { flex: 1; }
.tabs { display: flex; gap: 6px; padding: 12px 14px 0; }
.tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-weight: 650; font-size: .95rem; cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.tab:hover { border-color: var(--line-strong); color: var(--ink); }
.tab[aria-selected="true"], .tab.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
:root[data-theme="dark"] .tab[aria-selected="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tab[aria-selected="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); } }
.tab .tdot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .55; }
.panel-body { padding: 16px 18px 18px; }
.amount-input { position: relative; display: block; }
.amount-input > span.lbl { display: block; font-size: .82rem; font-weight: 650; color: var(--muted); margin: 0 0 6px; letter-spacing: .02em; }
.amount-input .box { display: flex; align-items: center; gap: 4px; border: 1.5px solid var(--line-strong); border-radius: 16px; background: var(--surface); padding: 0 16px; transition: border-color .15s, box-shadow .15s; }
.amount-input .box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.amount-input .cur { font-size: 2rem; font-weight: 600; color: var(--faint); }
.amount-input input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: clamp(2rem, 1.6rem + 1.6vw, 2.7rem); font-weight: 700; letter-spacing: -.03em; padding: 10px 0; }
.amount-input .clear { border: 0; background: var(--surface-2); color: var(--muted); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.quick-chips button { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.quick-chips button:hover { border-color: var(--brand); color: var(--brand); }
.history { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .82rem; color: var(--muted); font-weight: 650; }
.history-head button { border: 0; background: none; color: var(--muted); font: inherit; font-size: .82rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.history ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.history li button, .history li a { display: inline-flex; gap: 8px; align-items: baseline; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 6px 10px; font: inherit; font-size: .84rem; color: var(--ink); cursor: pointer; text-decoration: none; }
.history li button:hover, .history li a:hover { border-color: var(--brand); }
.history li small { color: var(--muted); }
.history .empty { font-size: .84rem; color: var(--faint); }

/* ---------- Results ---------- */
.result { position: relative; }
.result-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.result-head b { font-size: 1.15rem; letter-spacing: -.015em; }
.result-head span { color: var(--muted); font-size: .9rem; }
.halves { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.half { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: linear-gradient(180deg, var(--surface-2), var(--surface) 70%); animation: rise .35s ease both; }
.half.remove { animation-delay: .04s; }
.half header { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 8px; }
.half header small { color: var(--muted); font-size: .82rem; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.half.remove .pill { background: var(--mint); color: var(--mint-ink); }
.fig { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.half .fig:first-of-type, .figs .fig { border-top: 0; }
.fig small { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; font-weight: 600; }
.fig strong { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); overflow-wrap: anywhere; }
.fig.big strong { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.3rem); letter-spacing: -.035em; line-height: 1.1; }
.half.add .fig.big strong { color: var(--brand); }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 0 0 14px; }
.figs .fig { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.figs .fig.big { background: var(--brand-softer); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.figs .fig.big strong { color: var(--brand); font-size: clamp(1.45rem, 1.1rem + .9vw, 1.85rem); }
.fig strong { overflow-wrap: normal; word-break: normal; }
.figs .fig { min-width: 0; }
.copy { display: none; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 9px; padding: 0; width: 34px; height: 34px; font: inherit; font-size: .8rem; font-weight: 650; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.js .copy { display: inline-flex; }
.copy span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.copy.done svg { display: none; } .copy.done::after { content: "¹3"; font-weight: 800; }
.copy:hover { color: var(--brand); border-color: var(--brand); }
.copy.done { background: var(--good-soft); color: var(--good); border-color: transparent; }
.working h3, .how summary { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.how summary { cursor: pointer; margin: 10px 0 0; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; counter-increment: s; }
.steps li > span { color: var(--ink-2); }
.steps li > b { font-weight: 650; text-align: right; }
.steps li > em { grid-column: 1 / -1; font-style: normal; font-size: .78rem; }
.steps li.total > span, .steps li.total > b { font-weight: 750; color: var(--ink); }
.ref { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--faint); }
.ref:hover { color: var(--brand); }
.exactnote { font-size: .82rem; color: var(--muted); margin: 8px 0 0; }
.notes { margin: 14px 0 0; padding: 12px 14px 12px 30px; background: var(--surface-2); border-radius: 12px; font-size: .88rem; color: var(--ink-2); }
.notes li + li { margin-top: 6px; }
.callout { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--brand-softer); border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); font-size: .92rem; }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 28%, var(--line)); }
.callout ul { margin: 6px 0; padding-left: 20px; } .callout small { display: block; color: var(--muted); margin-top: 6px; }
.verdict { font-size: 1.02rem; font-weight: 550; }
.result.good .result-head b { color: var(--good); } .result.warn .result-head b { color: var(--warn); }
.is-error { border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); background: var(--bad-soft); border-radius: 12px; padding: 12px 14px; }
.err-lead { font-weight: 650; color: var(--bad); margin: 0 0 4px; } .err-list { margin: 0; padding-left: 20px; font-size: .92rem; }
.field-err { display: block; color: var(--bad); font-size: .84rem; font-weight: 600; margin-top: 4px; }
[aria-invalid="true"] { border-color: var(--bad) !important; box-shadow: 0 0 0 3px var(--bad-soft) !important; }
.meter { position: relative; height: 12px; border-radius: 999px; background: var(--surface-3); overflow: visible; margin: 14px 0 4px; }
.meter span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .4s ease; }
.meter-l { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin: 0 0 12px; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.mini { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 10px 0 0; }
table.mini th { text-align: left; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.mini td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.mini td small { display: block; color: var(--muted); }
table.mini tr.hit td { background: var(--brand-softer); font-weight: 650; }
table.mini tr.total td { font-weight: 750; border-top: 2px solid var(--ink); }
table.mini tr.sub td { font-weight: 650; background: var(--surface-2); }
table.mini tr.muted td { color: var(--muted); }
table.mini td:last-child, table.mini th:last-child { text-align: right; }
table.boxes td:first-child { width: 2.5em; color: var(--brand); }

/* ---------- Calculator pages ---------- */
.page-hero { background: var(--hero-glow), var(--bg); border-bottom: 1px solid var(--line); }
.page-hero .wrap { padding-top: 28px; padding-bottom: 36px; }
.page-hero h1 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem); max-width: 22em; }
.page-hero .lead { font-size: 1.1rem; color: var(--ink-2); max-width: 46em; }
.crumbs { font-size: .86rem; color: var(--muted); padding-top: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--brand); }
.tool { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0; margin-top: 22px; }
.tool > form { padding: 20px; border-right: 1px solid var(--line); }
.tool > .out { padding: 20px; background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.tool .out-inner { position: sticky; top: 90px; }
.tool-wide { grid-template-columns: 1fr; } .tool-wide > form { border-right: 0; border-bottom: 1px solid var(--line); }
.answer { margin: 18px 0 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; max-width: 60em; box-shadow: var(--shadow-sm); }
.answer p { margin: 0; } .answer .eyebrow { margin-bottom: 4px; }
.example-tag { font-size: .82rem; color: var(--muted); margin: 0 0 10px; }
.result-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Fields */
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 6px; color: var(--ink); }
.field > small { display: block; color: var(--muted); font-size: .82rem; margin-top: 5px; }
.field input, .field select, .field textarea, .cell input, .cell select { width: 100%; min-height: 46px; border: 1.5px solid var(--line-strong); border-radius: 11px; padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 130px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }
.field input:focus, .field select:focus, .field textarea:focus, .cell input:focus, .cell select:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.money { position: relative; display: block; }
.money::before { content: "$"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); font-weight: 600; pointer-events: none; }
.money input { padding-left: 26px; }
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; } .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; } .row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 10px; }
.radios { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.radios legend { font-weight: 600; font-size: .92rem; margin: 0 0 6px; padding: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.seg label { flex: 1 1 auto; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: 8px 12px; border-radius: 9px; font-size: .9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); outline: 1px solid var(--line); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.sub { font-size: .8rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 18px 0 10px; }
details.more { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin: 0 0 14px; background: var(--surface-2); }
details.more > summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: .92rem; }
.privacy-note { display: flex; gap: 8px; align-items: center; font-size: .82rem; color: var(--muted); margin: 6px 0 0; }

/* Repeating rows (invoice lines, transactions, periods) */
.lines { display: grid; gap: 8px; margin: 0 0 10px; }
.line { display: grid; gap: 6px; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1.5fr) 36px; align-items: end; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); animation: rise .25s ease both; }
.line.tx { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) minmax(0, 1.5fr) minmax(0, 1.4fr) minmax(0, .9fr) 36px; }
.line.per { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
.cell { display: block; min-width: 0; }
.cell > span { display: block; font-size: .72rem; font-weight: 650; color: var(--muted); margin: 0 0 3px; text-transform: uppercase; letter-spacing: .04em; }
.cell input, .cell select { min-height: 40px; padding: 7px 9px; font-size: .95rem; border-width: 1px; border-radius: 9px; }
.cell.money::before { top: auto; bottom: 10px; transform: none; left: 10px; }
.cell.money input { padding-left: 21px; }
.cell .field-err { font-size: .74rem; }
.rm { width: 36px; height: 40px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 9px; cursor: pointer; font-size: 1.1rem; }
.rm:hover { color: var(--bad); border-color: var(--bad); }
.row-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; }

/* Bulk CSV */
.drop { display: grid; place-items: center; text-align: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--line-strong); border-radius: 16px; background: var(--surface-2); color: var(--muted); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--brand); background: var(--brand-softer); }
.drop b { color: var(--ink); }
.preview { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.preview table { margin: 0; } .preview th { position: sticky; top: 0; background: var(--surface); }
.preview td.new { background: var(--brand-softer); font-weight: 600; }
.preview td.bad { background: var(--bad-soft); }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

/* ---------- Sections and cards ---------- */
section.band { padding: 64px 0; }
section.band.soft { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
section.tight { padding: 32px 0; }
.section-head { max-width: 46em; margin: 0 0 28px; }
.section-head p { color: var(--ink-2); font-size: 1.05rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); color: var(--ink); }
.card h3 { margin: 0; font-size: 1.04rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.card .go { font-size: .88rem; font-weight: 650; color: var(--brand); margin-top: 6px; }
.card .ci { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 6px; }
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 40px 0; }
.feature + .feature { border-top: 1px solid var(--line); }
.feature.flip > :first-child { order: 2; }
.feature h2 { font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.2rem); letter-spacing: -.03em; }
.feature p { color: var(--ink-2); font-size: 1.06rem; }
.feature .mock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px; }
.mock .mock-h { display: flex; justify-content: space-between; align-items: baseline; font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.mock .bigline { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: var(--brand-softer); margin-top: 10px; font-weight: 700; }
.mock .bigline strong { font-size: 1.4rem; color: var(--brand); letter-spacing: -.02em; }
.phone { width: 230px; margin: 0 auto; border: 10px solid var(--ink); border-radius: 36px; background: var(--surface); box-shadow: var(--shadow-lg); padding: 16px 12px; aspect-ratio: 9 / 17.5; display: flex; flex-direction: column; gap: 10px; }
.phone .ph-top { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; }
.phone .ph-top img { width: 26px; height: 26px; border-radius: 7px; }
.phone .ph-amt { border: 1.5px solid var(--brand); border-radius: 12px; padding: 8px 10px; font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; }
.phone .ph-row { display: flex; justify-content: space-between; font-size: .85rem; padding: 6px 0; border-bottom: 1px solid var(--line); }
.phone .ph-row b { color: var(--brand); }
.phone .ph-off { margin-top: auto; text-align: center; font-size: .75rem; color: var(--good); font-weight: 650; background: var(--good-soft); border-radius: 999px; padding: 4px; }
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.strip > div { padding: 20px 22px; }
.strip > div + div { border-left: 1px solid var(--line); }
.strip strong { display: block; font-size: 1.7rem; letter-spacing: -.03em; color: var(--ink); }
.strip span { color: var(--muted); font-size: .9rem; }
.formula { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.formula > div { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.formula code { display: block; font-size: 1.35rem; font-weight: 700; padding: 10px 12px; margin: 10px 0; background: var(--surface-2); border-radius: 10px; }
.faq { display: grid; gap: 10px; max-width: 900px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 16px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq summary::-webkit-details-marker { display: none; }
.faq details > div { padding: 0 0 14px; color: var(--ink-2); }

/* ---------- Prose, guides, reference ---------- */
.page-head { background: var(--hero-glow), var(--bg); border-bottom: 1px solid var(--line); padding: 8px 0 34px; }
.page-head h1 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.7rem); max-width: 24em; margin-top: 10px; }
.page-head .lead { font-size: 1.1rem; color: var(--ink-2); max-width: 46em; }
.byline { color: var(--muted); font-size: .92rem; }
.inshort { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 14px 16px; max-width: 52em; box-shadow: var(--shadow-sm); }
.prose { max-width: 46em; }
.prose h2 { margin-top: 1.8em; } .prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; } .prose li + li { margin-top: .35em; }
.prose table { width: 100%; }
.guide { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-top: 32px; padding-bottom: 48px; }
.aside { position: sticky; top: 90px; align-self: start; display: grid; gap: 14px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.box h3 { margin-top: 0; }
.toc { background: var(--surface-2); border-radius: 12px; padding: 14px 18px; margin: 0 0 24px; font-size: .94rem; }
.toc ol { margin: 6px 0 0; padding-left: 1.2em; }
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: .94rem; margin: 10px 0 16px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--surface-2); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.st-pass { color: var(--good); font-weight: 700; } .st-fail { color: var(--bad); font-weight: 700; }
.src { font-size: .86rem; color: var(--muted); }
.sources, .sources-line { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.sources h2, .sources-line h2 { font-size: 1.1rem; }
.sources ul, .sources-line ul { padding-left: 1.2em; font-size: .92rem; }
.tag-notlaw { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .06em; padding: 2px 8px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); vertical-align: middle; white-space: nowrap; }
.status { border: 1px solid color-mix(in srgb, var(--bad) 30%, var(--line)); background: var(--surface); border-radius: var(--radius); padding: 16px 18px; margin: 20px 0; }
.status h2 { font-size: 1.2rem; margin-top: 0; }
.status ul { padding-left: 1.2em; }
.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.bigrate { display: grid; gap: 4px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin: 0 0 20px; }
.bigrate strong { font-size: 2rem; letter-spacing: -.03em; color: var(--brand); }
.ad-slot { display: none; }

/* ---------- Footer ---------- */
.site-foot { background: var(--foot-bg); color: var(--foot-muted); margin-top: 0; padding: 48px 0 28px; }
.site-foot a { color: var(--foot-ink); text-decoration: none; } .site-foot a:hover { color: var(--foot-ink); text-decoration: underline; }
.site-foot .brand { color: var(--foot-ink); } .site-foot .lockup { display: block; width: 236px; height: auto; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h2 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--foot-muted); margin: 4px 0 12px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; font-size: .93rem; }
.foot-grid p { font-size: .92rem; }
.fine { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; border-top: 1px solid var(--foot-line); margin-top: 32px; padding-top: 18px; font-size: .84rem; color: var(--foot-muted); }

/* ---------- Toast, result bar, install ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: .92rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.result-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: none; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, .25); font-size: .92rem; font-weight: 600; }
.result-bar a { white-space: nowrap; }
.js .install, .install { display: none !important; }
.js .install.on { display: inline-flex !important; }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--brand-soft); } 100% { box-shadow: 0 0 0 10px transparent; } }
.flash { animation: pulse .6s ease; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero > .wrap, .tool, .feature, .guide { grid-template-columns: minmax(0, 1fr) !important; }
  .nav { display: none; }
  .head-tools { margin-left: auto; }
  .hero > .wrap { grid-template-columns: 1fr; gap: 28px; padding-top: 26px; padding-bottom: 36px; }
  .hero .hero-copy .points, .hero .hero-copy .trustline { display: none; }
  .hero-points-mobile { display: block !important; }
  .feature { grid-template-columns: 1fr; gap: 24px; } .feature.flip > :first-child { order: 0; }
  .guide { grid-template-columns: 1fr; } .aside { position: static; }
  .tool { grid-template-columns: 1fr; } .tool > form { border-right: 0; border-bottom: 1px solid var(--line); } .tool .out-inner { position: static; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .strip { grid-template-columns: 1fr 1fr; } .strip > div:nth-child(3) { border-left: 0; } .strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
.hero-points-mobile { display: none; }
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  body { font-size: 15.5px; }
  .site-head .wrap { min-height: 58px; gap: 10px; }
  .brand { font-size: 1.02rem; } .brand small { display: none; }
  .lang summary { padding: 0 8px; } .lang summary .lname { display: none; }
  .hero h1 { font-size: 2rem; margin-bottom: 10px; }
  .hero .lead { font-size: 1rem; margin-bottom: 0; }
  .badge-row { display: none; }
  .appwin { border-radius: 16px; margin: 0 -4px; }
  .appwin-bar { display: none; }
  .tabs { padding: 10px 10px 0; gap: 4px; } .tab { font-size: .86rem; min-height: 40px; padding: 0 6px; } .tab .tdot { display: none; }
  .panel-body { padding: 12px; }
  .halves { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .half { padding: 10px; } .half header small { display: none; } .pill { font-size: .66rem; padding: 3px 7px; }
  .fig small { font-size: .74rem; }
  .steps li { font-size: .8rem; grid-template-columns: minmax(0, 1fr) auto; }
  .install.on span { display: none; } .js .install.on { padding: 0 10px; }
  .head-tools { gap: 4px; } .icon-btn, .menu summary { width: 38px; height: 38px; } .lang summary { height: 38px; }
  .hero h1 .line2 { font-size: .7em; }
  .quick-chips button:nth-of-type(n+5) { display: none; }
  .amount-input .cur { font-size: 1.6rem; }
  .row2, .row3, .row4 { grid-template-columns: 1fr; }
  .row2.keep { grid-template-columns: 1fr 1fr; }
  .line { grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr) minmax(0, 1fr) 34px; } .line .c-desc { grid-column: 1 / -1; }
  .line.tx { grid-template-columns: 1fr 1fr; } .line.tx .c-type { grid-column: 1 / -1; } .line.tx .rm { justify-self: end; grid-column: 2; }
  .rm { width: 34px; }
  .line.per { grid-template-columns: 1fr 1fr 36px; }
  .menu-panel { grid-template-columns: 1fr; position: fixed; left: 12px; right: 12px; width: auto; top: 66px; }
  .formula, .split2 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  section.band { padding: 44px 0; }
  .feature { padding: 28px 0; }
  .strip strong { font-size: 1.35rem; } .strip > div { padding: 14px; }
  .js .result-bar.show { display: flex; }
  .seg span { padding: 8px 8px; white-space: normal; }
  .tool > form, .tool > .out { padding: 14px; }
  .page-hero .wrap { padding-top: 14px; padding-bottom: 20px; } .page-hero .lead { font-size: 1rem; margin-bottom: .6em; } .answer { margin-top: 10px; padding: 10px 12px; } .answer p { font-size: .92rem; } .answer .eyebrow { font-size: .7rem; }
  section.tight { padding: 18px 0; }
  table.mini { font-size: .82rem; }
}

/* ---------- Print: the result and its working only ---------- */
@media print {
  .site-head, .site-foot, .crumbs, .tool > form, .result-tools, .copy, .ad-slot, .band, .faq, .result-bar, .toast, .explain, .more-tools, .history, .tabs, .appwin-bar, .install, .review { display: none !important; }
  body { background: #fff; color: #000; }
  .tool { display: block; } .tool > .out { background: none; padding: 0; }
  .appwin, .figs .fig, .half { box-shadow: none; border-color: #999; }
  a { color: #000; text-decoration: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.quick-chips > span { white-space: nowrap; }

/* ---------- Review fixes (17 Nov 2026) ---------- */
/* Money never clips: each figure scales with its own tile (container query units), and the headline gets a full row */
.fig { container-type: inline-size; }
.fig strong { white-space: nowrap; font-size: min(1.25rem, 8.5cqi); overflow: visible; }
.fig.big strong { font-size: min(2.3rem, 11.5cqi); }
.figs .fig.big strong { font-size: min(2.1rem, 10.5cqi); }
.half .fig.big strong { font-size: min(2.3rem, 13cqi); }
.figs { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.figs .fig.big { grid-column: 1 / -1; }
.figs.three .fig.big, .figs:has(.fig + .fig + .fig) .fig.big { grid-column: 1 / -1; }
.result-head b { overflow-wrap: anywhere; }
/* Empty amount box: a quiet prompt, never an error */
.is-empty { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 18px 16px; color: var(--muted); background: var(--surface-2); }
.empty-prompt { margin: 0; }
.working-h { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
/* Inner calculator pages: title and short answer side by side, tool higher */
.hero-split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; }
.hero-split .answer { margin-top: 6px; }
.byline-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.byline-chips .chip { font-size: .76rem; padding: 4px 10px; box-shadow: none; }
.page-hero .wrap.hero-split { padding-top: 18px; padding-bottom: 22px; }
.page-hero h1 { margin-bottom: 10px; }
.tool-sec { padding-top: 18px; }
.appwin.inner { box-shadow: var(--shadow); }
/* Home tabs: a real tablist plus a separate link */
.tabs { align-items: stretch; }
.tablist { display: flex; gap: 6px; flex: 2; }
.tablist .tab { flex: 1; }
.tab-link { flex: 1; background: transparent; border-style: dashed; }
/* Ad slots: invisible until ads are live; then space is reserved so filling never shifts the page */
.ad-slot { display: none; }
.ads-live .ad-slot { display: block; min-height: 280px; margin: 24px auto; position: relative; }
.ads-live .ad-slot::before { content: "Advertisement"; position: absolute; top: -18px; left: 0; font-size: .72rem; color: var(--muted); }
@media (min-width: 900px) { .ads-live .ad-slot { min-height: 250px; } }
/* Offline chip and install */
.offline-chip { display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: .78rem; font-weight: 700; white-space: nowrap; }
/* Language switcher: a language's home page when this page is not translated */
.lang a[data-home]::after { content: " (home page)"; color: var(--muted); font-size: .85em; }
/* Toast sits above the phone result bar */
.toast.above-bar { bottom: calc(76px + env(safe-area-inset-bottom)); }
/* Footer links in text are underlined (contrast in a block of text) */
.fine a, .foot-grid p a { text-decoration: underline; text-underline-offset: 3px; }
/* Remove-row button lines up with the inputs */
.line .rm { align-self: end; height: 40px; }
/* Invoice: printable document preview */
.doc-wrap { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px 14px; background: var(--surface); }
.doc-wrap > summary { cursor: pointer; padding: 12px 0; font-weight: 650; }
.invoice-doc { background: #FFFFFF; color: #111; border: 1px solid #DDD; border-radius: 8px; padding: 22px; font-size: .9rem; }
.invoice-doc p { margin: 0 0 2px; }
.invoice-doc .ph { color: #999; font-style: italic; }
.doc-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.doc-biz { font-weight: 750; font-size: 1.1rem; }
.doc-meta { text-align: right; }
.doc-title { font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; }
.doc-to { margin-bottom: 14px; } .doc-l { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #666; }
.doc-lines, .doc-totals { width: 100%; border-collapse: collapse; }
.doc-lines th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #555; border-bottom: 2px solid #111; padding: 6px 4px; }
.doc-lines td { border-bottom: 1px solid #E5E5E5; padding: 7px 4px; vertical-align: top; }
.doc-lines .n, .doc-totals .n { text-align: right; white-space: nowrap; }
.doc-totals { width: auto; margin: 12px 0 0 auto; min-width: 260px; } .doc-totals td { padding: 4px; } .doc-totals .grand td { font-weight: 800; border-top: 2px solid #111; }
.doc-note { margin-top: 10px !important; color: #444; }
/* Larger touch targets for fingers and gloves */
@media (pointer: coarse) {
  .copy { width: 44px; height: 44px; }
  .quick-chips button { min-height: 42px; padding: 0 14px; }
  .amount-input .clear { width: 44px; height: 44px; }
  .how summary, .doc-wrap > summary, details.more > summary { min-height: 44px; display: flex; align-items: center; }
  .rm { width: 44px; height: 44px; }
  .history li button, .history li a { min-height: 44px; }
}
@media (max-width: 1080px) { .hero-split { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
@media (max-width: 640px) {
  .quick-chips { flex-wrap: wrap; }
  .tabs { flex-wrap: wrap; } .tablist { flex: 1 1 100%; } .tab-link { flex: 1 1 100%; min-height: 38px; }
  .figs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* Invoice lines table: one card per line instead of six columns */
  table.stack thead { display: none; }
  table.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.stack td { border: 0; padding: 2px 0; text-align: left !important; }
  table.stack td::before { content: attr(data-l); display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  table.stack td:first-child { grid-column: 1 / -1; font-weight: 650; }
  .doc-meta { text-align: left; }
  .offline-chip { display: none; }
}
/* Printing an invoice or quote: only the document */
@media print {
  .print-doc body * { visibility: hidden; }
  .print-doc .invoice-doc, .print-doc .invoice-doc * { visibility: visible; }
  .print-doc .invoice-doc { position: absolute; left: 0; top: 0; width: 100%; border: 0; padding: 0; }
  .print-doc .doc-wrap { border: 0; }
}
@media (max-width: 640px) { .offline-chip { display: inline-flex; position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60; box-shadow: var(--shadow); } .offline-chip[hidden] { display: none; } }
.field textarea[name="notes"] { min-height: 64px; font-family: inherit; font-size: 1rem; }
@media print { .print-doc .result, .print-doc .out-inner, .print-doc .out, .print-doc .tool, .print-doc .appwin, .print-doc .doc-wrap, .print-doc section, .print-doc main { position: static !important; transform: none !important; } .print-doc .invoice-doc { top: 0 !important; } }
.phone .ph-off { color: var(--brand-strong); font-weight: 750; }

/* Brand (17 Nov 2026): mint marks the GST figures (Ink text on a mint highlight, never mint text on white) */
.half .fig:not(.big) strong, .figs .fig.gst strong { justify-self: start; background: linear-gradient(transparent 60%, var(--mint) 60%, var(--mint) 88%, transparent 88%); background-size: 100% 100%; padding: 0 3px; color: var(--ink); }
:root[data-theme="dark"] .half .fig:not(.big) strong { background: linear-gradient(transparent 82%, var(--mint) 82%, var(--mint) 94%, transparent 94%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .half .fig:not(.big) strong { background: linear-gradient(transparent 82%, var(--mint) 82%, var(--mint) 94%, transparent 94%); } }
.chip .dot { background: var(--mint); box-shadow: 0 0 0 3px var(--mint-soft); }
.meter span { background: linear-gradient(90deg, var(--brand), var(--mint)); }
.brand-name { font-weight: 700; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-weight: 700; }
h1, h2, h3, .brand { font-weight: 700; }
body { font-weight: 500; }
.lead, .prose p, .faq details > div { font-weight: 400; }
.fig strong, .steps b, table td, .amount-input input, .strip strong, .bigrate strong { font-variant-numeric: tabular-nums lining-nums; }
.phone { border-color: #15132B; }

/* Form fields: an outline of at least 3:1 against the card (WCAG 1.4.11) */
.field input, .field select, .field textarea, .cell input, .cell select, .amount-input .box { border-color: var(--field-border); }
.seg { border-color: var(--field-border); }
.seg input:checked + span { background: var(--surface); color: var(--ink); outline: 1.5px solid var(--brand); box-shadow: var(--shadow-sm); }

/* ---------- cards.co.nz: restrained finance look (17 November 2026) ---------- */
body { font-weight: 500; }
h1, h2, h3, .brand { font-weight: 700; }
h1 { font-weight: 700; letter-spacing: -.03em; }
.fig strong, .steps b, table td, .tbl td, .facts-table td, .result-head b, .bars b, .cost-table td, table.mini td, .amount-input input, .tnum { font-variant-numeric: tabular-nums; }
/* The key result figure is the one copper element on a calculator page */
.fig.big strong, .figs .fig.big strong { color: var(--accent); }
.figs .fig.big { background: var(--surface); border-color: var(--line-strong); }
.result.bad .fig.big strong, .result.is-error .fig.big strong { color: var(--bad); }
.half .fig:not(.big) strong, .figs .fig.gst strong { background: none; }
.chip .dot { background: var(--accent); box-shadow: none; }
.meter span { background: var(--brand); }
.hero, .page-hero, .page-head { background: var(--bg); }
.btn { border-radius: 8px; font-weight: 600; }
.card { border-radius: 10px; }
.eyebrow { color: var(--muted); }
.brand { gap: 10px; }
.brand-name small { color: var(--muted); font-weight: 700; font-size: .55em; letter-spacing: .03em; margin-left: 2px; }
/* Figures checked line under each page heading */
.checked-line { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.checked-line a { color: var(--muted); }
/* Results */
.result.bad .result-head b { color: var(--bad); }
.result.warn .result-head b { color: var(--warn); }
.compare-line { margin: 10px 0 0; font-size: .95rem; }
.chart { margin: 14px 0 6px; }
.chart svg { width: 100%; height: 160px; display: block; background: var(--surface-2); border-radius: 8px; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .line1 { fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart .line2 { fill: none; stroke: var(--faint); stroke-width: 2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.chart figcaption { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.chart .key { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.chart .key.k1 { background: var(--accent); } .chart .key.k2 { background: var(--faint); }
.chart .axis-note { margin-left: auto; }
.bars { display: grid; gap: 8px; margin: 10px 0 14px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 30%) 1fr auto; gap: 10px; align-items: center; font-size: .92rem; }
.bar { height: 10px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 5px; }
.status-line { margin: 12px 0; font-size: .95rem; }
.pill.ok { background: var(--good-soft); color: var(--good); }
/* NOT LAW box */
.notlaw { border: 1px solid var(--line-strong); border-left: 4px solid var(--bad); background: var(--surface); border-radius: 8px; padding: 14px 16px; margin: 18px 0; }
.notlaw p { margin: 0 0 8px; } .notlaw p:last-child { margin-bottom: 0; }
.notlaw-h { font-weight: 700; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* Dated fact tables */
.table-wrap { margin: 14px 0 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.facts-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 880px; }
.facts-table caption { caption-side: top; text-align: left; padding: 12px 14px; font-size: .85rem; color: var(--muted); }
.facts-table th, .facts-table td { padding: 9px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.facts-table th { background: var(--surface-2); font-size: .78rem; text-transform: none; letter-spacing: 0; color: var(--ink-2); white-space: nowrap; }
.facts-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-weight: 700; }
.facts-table th button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.facts-table .sort-ico::after { content: "\2195"; color: var(--faint); font-size: .9em; }
.facts-table th[aria-sort="ascending"] .sort-ico::after { content: "\2191"; color: var(--ink); }
.facts-table th[aria-sort="descending"] .sort-ico::after { content: "\2193"; color: var(--ink); }
.facts-table td.n { text-align: right; white-space: nowrap; }
.facts-table td small, .cost-table td small { display: block; color: var(--muted); font-size: .78rem; font-weight: 500; white-space: normal; }
.facts-table td small.flag { color: var(--warn); }
.facts-table td.t { min-width: 140px; }
.facts-table td.see a { color: var(--muted); font-style: italic; }
.facts-table tbody tr:hover td { background: var(--surface-2); }
.nowrap { white-space: nowrap; }
.src-cell { min-width: 170px; overflow-wrap: normal; font-size: .82rem; }
.callout.data-pending { border-style: dashed; }
.callout.pointer { background: var(--surface); }
/* Hardship letter outline */
.letter { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; font-size: .95rem; margin: 12px 0; }
.letter p { margin: 0 0 8px; }
/* Sources page */
.sources-tbl td:first-child { min-width: 220px; }
/* Hub cards: quieter */
.card .ci { color: var(--ink-2); background: var(--surface-2); }
.card:hover { border-color: var(--line-strong); }
.section-list { columns: 2 260px; column-gap: 32px; padding-left: 1.1em; }
.section-list li { break-inside: avoid; margin-bottom: 6px; }
@media (max-width: 640px) { .bar-row { grid-template-columns: 1fr auto; } .bar-row .bar { grid-column: 1 / -1; grid-row: 2; } }
@media print { .ad-slot, .site-head, .site-foot, .result-tools, .result-bar { display: none !important; } }
.table-note { font-size: .88rem; color: var(--muted); margin: 18px 0 0; max-width: 80ch; }
.facts-table caption { position: sticky; left: 0; }
.facts-table td.t { min-width: 200px; }
.checked-line + .inshort, .page-head .checked-line { margin-bottom: 14px; }

/* ---------- Review fixes (17 November 2026) ---------- */
/* Tables: labelled scroll region with a sticky header and first column, a right-edge fade and a visible scroll cue */
.table-shell { position: relative; }
.table-shell.more-right::after { content: ""; position: absolute; top: 1px; right: 1px; bottom: 1px; width: 44px; border-radius: 0 10px 10px 0; background: linear-gradient(to right, transparent, var(--surface)); pointer-events: none; }
.table-wrap { max-height: 80vh; overflow: auto; overscroll-behavior-x: contain; }
.table-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.facts-table thead th { position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--line); }
.facts-table .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; font-weight: 600; min-width: 120px; }
.facts-table thead th:first-child { left: 0; z-index: 3; }
.facts-table tbody tr:hover .sticky-col { background: var(--surface-2); }
.facts-table caption { position: static; }
.facts-table td.name { min-width: 190px; }
.table-note .scroll-cue { display: none; font-weight: 600; color: var(--ink-2); }
.table-note.has-more .scroll-cue { display: inline; }
.facts-table td.gap a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--faint); white-space: nowrap; }
.facts-table td.gap sup { font-size: .72em; margin-left: 1px; }
.facts-table th[aria-sort] button { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.table-notes { font-size: .82rem; color: var(--muted); columns: 2 380px; column-gap: 32px; margin: 10px 0 28px; padding-left: 1.6em; }
.table-notes li { break-inside: avoid; margin-bottom: 4px; }
.table-notes li:target { color: var(--ink); }
.table-scroll { overflow-x: auto; }
.not-enough { margin-top: 12px; }
/* Errors in red with a marker, never mistaken for help text */
.field > small.field-err, .cell > small.field-err, .field-err { color: var(--bad) !important; font-weight: 600; }
.field-err::before { content: "! "; font-weight: 700; }
/* One left edge: prose aligns to the wrap like the guides */
.wrap.prose { max-width: 1200px; }
.wrap.prose > * { max-width: 46em; }
.wrap.prose > .scroll, .wrap.prose > .table-shell, .wrap.prose > .table-wrap, .wrap.prose > .table-note, .wrap.prose > .table-notes, .wrap.prose > .ad-slot, .wrap.prose > .sources-line { max-width: none; }
/* The calculator keeps two columns down to 900px; the inputs stay in view beside the result */
.tool > form { position: sticky; top: 84px; align-self: start; }
@media (min-width: 901px) and (max-width: 1080px) {
  .tool { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .tool > form { border-right: 1px solid var(--line); border-bottom: 0; }
}
@media (max-width: 900px) { .tool > form { position: static; } }
@media (max-width: 480px) { .seg { flex-direction: column; } .seg span { text-align: left; } }
/* Brand: the small NZ stays on phones */
.brand-name small { display: inline !important; }
/* Guides: the On this page panel is the same in both themes */
.toc { background: var(--surface); border: 1px solid var(--line); }
/* Result tiles: figures line up even when a label wraps */
.figs .fig { align-content: space-between; }
/* Hub grids without half-empty rows */
.cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card .card-h { font-size: 1.05rem; margin: 0 0 6px; letter-spacing: -.01em; }
/* Chart with axes and a legend that wraps by item */
.chart svg { width: 100%; height: auto; max-height: 260px; background: var(--surface-2); border-radius: 8px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { stroke: var(--faint); stroke-width: 1; }
.chart .tl { fill: var(--muted); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .leg { white-space: nowrap; display: inline-flex; align-items: center; }
.chart .axis-note { margin-left: 0; flex-basis: 100%; }
/* NOT LAW one-line note */
.notlaw-line { border-left: 4px solid var(--bad); padding: 6px 12px; background: var(--surface); border-radius: 6px; font-size: .95rem; }
/* Sticky inputs need an ancestor that clips without becoming a scroll container */
.appwin, .appwin.inner { overflow: clip; }
