/* taxdollars.nz — civic ledger design system
   Type: Archivo (variable, width axis) + IBM Plex Mono
   Modes: light (paper & ink) / dark (ledger night) */

/* ---------- fonts ---------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/fonts/archivo-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20A0-20CF, U+2113, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/fonts/archivo-var-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/plexmono-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/plexmono-500-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/plexmono-600-latin.woff2") format("woff2");
}

/* ---------- tokens ---------- */
:root {
  --paper: #f7f5f0;
  --surface: #fdfcfa;
  --ink: #141c30;
  --ink-2: #4a5266;
  --muted: #7d828e;
  --grid: #e6e3da;
  --line: rgba(20, 28, 48, 0.13);
  --line-soft: rgba(20, 28, 48, 0.07);
  --accent: #1c5cab;
  --rev: #205e73;
  --rev-soft: rgba(32, 94, 115, 0.14);
  --deficit: #c23b3b;
  --focus: #1c5cab;
  --tip-bg: #141c30;
  --tip-ink: #f7f5f0;
  --shadow: 0 10px 30px -12px rgba(20, 28, 48, 0.22);

  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --w: 1120px;

  /* category colours — validated (dataviz six checks, light) */
  --c-social-security: #2a64ba;
  --c-health: #0b8066;
  --c-education: #9a6a00;
  --c-finance-costs: #4a4a9e;
  --c-core-govt: #a659c4;
  --c-law-order: #b53a56;
  --c-transport: #bb4f17;
  --c-econ-industrial: #0b6d99;
  --c-defence: #9a83c6;
  --c-environment: #3d7d2f;
  --c-housing: #3579b8;
  --c-heritage: #c04f8d;
  --c-primary: #967f13;
  --c-other: #0d95ab;
}

[data-theme="dark"] {
  --paper: #101318;
  --surface: #171b21;
  --ink: #eef0f3;
  --ink-2: #b6bcc8;
  --muted: #7e8490;
  --grid: #262b33;
  --line: rgba(238, 240, 243, 0.14);
  --line-soft: rgba(238, 240, 243, 0.07);
  --accent: #5e95d3;
  --rev: #4295ad;
  --rev-soft: rgba(66, 149, 173, 0.18);
  --deficit: #e05b5b;
  --focus: #5e95d3;
  --tip-bg: #eef0f3;
  --tip-ink: #141c30;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);

  --c-social-security: #3d76cc;
  --c-health: #16a488;
  --c-education: #c08a17;
  --c-finance-costs: #605eba;
  --c-core-govt: #bd6ed8;
  --c-law-order: #d65d78;
  --c-transport: #dd6e35;
  --c-econ-industrial: #1a7fb0;
  --c-defence: #9d84d4;
  --c-environment: #58a04a;
  --c-housing: #5e95d3;
  --c-heritage: #d1609a;
  --c-primary: #a98d1f;
  --c-other: #14a0ba;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
strong { font-weight: 650; }
::selection { background: var(--accent); color: var(--paper); }

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.015em; line-height: 1.05; }
h1 { font-size: clamp(2.5rem, 6.4vw, 4.4rem); font-stretch: 115%; font-weight: 860; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-stretch: 112%; }
h3 { font-size: 1.12rem; font-stretch: 108%; letter-spacing: -0.008em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--grid); }

.mono { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--ink-2); }
.small { font-size: 0.85rem; color: var(--ink-2); }

section { padding: 88px 0 0; }
section:last-of-type { padding-bottom: 88px; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-head .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 830; font-stretch: 112%; font-size: 1.06rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.brand svg { display: block; }
.brand .tld { color: var(--muted); font-weight: 500; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  font-size: 0.83rem; font-weight: 560; color: var(--ink-2); text-decoration: none;
  padding: 6px 10px; border-radius: 7px;
}
.site-nav a:hover { background: var(--line-soft); color: var(--ink); }
.year-pill {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; appearance: none;
}
.theme-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-2); cursor: pointer; padding: 0;
}
.theme-btn:hover { color: var(--ink); background: var(--line-soft); }
@media (max-width: 760px) {
  .site-nav { display: none; }
  .site-head .wrap { gap: 10px; }
  .year-pill { margin-left: auto; }
}

/* ---------- hero ---------- */
.hero { padding-top: 72px; }
.hero .lede {
  max-width: 46em; margin: 22px 0 0; font-size: 1.16rem; line-height: 1.65; color: var(--ink-2);
}
.hero .lede strong { color: var(--ink); font-weight: 700; }
.hero .lede .num { font-size: 0.94em; }

/* the note — signature element */
.note-fig { margin: 44px 0 0; }
.note-cap {
  display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px;
}
.note-cap .serial { letter-spacing: 0.08em; }
.note {
  position: relative;
  display: flex; width: 100%; height: 118px;
  border-radius: 12px; overflow: hidden;
  background: var(--paper);
  outline: 1px solid var(--line);
  outline-offset: 3px;
  border: 1px solid var(--line);
}
.note-seg {
  position: relative; height: 100%; border: 0; padding: 0; cursor: pointer;
  transition: filter 0.15s ease, flex-grow 0.9s cubic-bezier(0.22, 1, 0.3, 1);
  border-right: 2px solid var(--paper);
  min-width: 1px;
}
.note-seg:last-child { border-right: 0; }
.note-seg:hover, .note-seg:focus-visible { filter: brightness(1.13); }
.note-seg .seg-label {
  position: absolute; inset: 10px 10px auto 12px; text-align: left;
  color: #fff; pointer-events: none; overflow: hidden;
}
.note-seg .seg-label .amt {
  display: block; font-family: var(--sans); font-weight: 840; font-stretch: 118%;
  font-size: clamp(1.05rem, 2.5vw, 1.9rem); letter-spacing: -0.01em; line-height: 1;
}
.note-seg .seg-label.sm { inset: 10px 4px auto 8px; }
.note-seg .seg-label.sm .amt { font-size: clamp(0.68rem, 1.1vw, 0.88rem); letter-spacing: -0.01em; }
.note-seg .seg-label .cat {
  display: block; margin-top: 6px; font-size: clamp(0.62rem, 1.1vw, 0.78rem);
  font-weight: 560; opacity: 0.92; line-height: 1.25;
}
.note-legend {
  display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px;
  font-size: 0.78rem; color: var(--ink-2);
}
.note-legend button {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 2px 0; cursor: pointer;
  font: inherit; color: inherit;
}
.note-legend button:hover { color: var(--ink); text-decoration: underline; }
.chip { width: 9px; height: 9px; border-radius: 2.5px; flex: none; display: inline-block; }

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 18px 20px 16px;
}
.stat .v {
  font-weight: 840; font-stretch: 116%; font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.015em; line-height: 1.05; display: block;
}
.stat .k {
  display: block; margin-top: 6px; font-size: 0.82rem; color: var(--ink-2); line-height: 1.4;
}
@media (max-width: 700px) {
  .hero { padding-top: 48px; }
  .hero-stats { grid-template-columns: 1fr; }
  .note { height: 92px; }
  .note-seg .seg-label { inset: 8px 5px auto 9px; }
  .note-seg .seg-label .amt { font-size: 0.92rem; }
  .note-seg .seg-label .cat { font-size: 0.6rem; margin-top: 4px; }
}

/* ---------- explorer ---------- */
.sec-intro { max-width: 44em; margin: 14px 0 0; color: var(--ink-2); }
.explore-bar {
  display: flex; align-items: center; gap: 14px; margin: 30px 0 14px; min-height: 36px;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; flex-wrap: wrap; }
.crumbs button {
  background: none; border: 0; padding: 2px 4px; font: inherit; font-weight: 600;
  color: var(--accent); cursor: pointer; border-radius: 4px;
}
.crumbs button[disabled] { color: var(--ink); cursor: default; font-weight: 700; }
.crumbs .sep { color: var(--muted); }
.view-toggle {
  margin-left: auto; display: inline-flex; border: 1px solid var(--line);
  border-radius: 9px; overflow: hidden; flex: none;
}
.view-toggle button {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 7px 14px; border: 0; cursor: pointer;
  background: transparent; color: var(--ink-2);
}
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.explorer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 980px) { .explorer { grid-template-columns: 1fr; } }

.tm-hint { margin: 10px 8px 0; font-size: 0.8rem; color: var(--muted); max-width: 46em; }

.panel {
  position: sticky; top: 76px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 22px 22px 20px;
}
.panel .p-cat {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted);
}
.panel h3 { margin: 10px 0 2px; font-size: 1.3rem; }
.panel .p-amt {
  font-weight: 860; font-stretch: 118%; font-size: 2.3rem; letter-spacing: -0.02em;
  line-height: 1.1; display: block; margin-top: 10px;
}
.panel .p-sub { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); margin-top: 2px; }
.panel .p-blurb { font-size: 0.92rem; color: var(--ink-2); margin: 14px 0 0; }
.p-facts { margin: 16px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line-soft); }
.p-facts li {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.86rem;
}
.p-facts .k { color: var(--ink-2); }
.p-facts .v { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.p-facts .v.pos { color: var(--deficit); }
.p-includes { margin: 14px 0 0; padding-left: 0; list-style: none; font-size: 0.85rem; color: var(--ink-2); }
.p-includes li { padding: 3px 0 3px 18px; position: relative; }
.p-includes li::before {
  content: ""; position: absolute; left: 2px; top: 0.72em;
  width: 7px; height: 2px; background: var(--cat, var(--muted)); border-radius: 1px;
}
.p-drill {
  margin-top: 18px; width: 100%;
  font: inherit; font-weight: 650; font-size: 0.9rem;
  background: var(--ink); color: var(--paper); border: 0; border-radius: 9px;
  padding: 10px 14px; cursor: pointer;
}
.p-drill:hover { opacity: 0.9; }
.p-note { margin-top: 12px; font-size: 0.75rem; color: var(--muted); }

/* breakdown bars (both levels) */
.bars { display: flex; flex-direction: column; padding: 4px 0; }
.bars[hidden] { display: none; }
.b-count {
  font-family: var(--mono); font-size: 0.64rem; font-weight: 500; color: var(--muted);
  white-space: nowrap; margin-left: 6px;
}
.bar-row {
  display: grid; grid-template-columns: minmax(150px, 250px) 1fr auto; gap: 14px;
  align-items: center; padding: 8px 8px; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  border-top: 1px solid var(--line-soft); border-radius: 7px;
}
.bar-row:first-child { border-top: 0; }
.bar-row:hover { background: var(--line-soft); }
.bar-row.sel { background: var(--line-soft); box-shadow: inset 3px 0 0 var(--ink); }
.b-name { font-weight: 640; font-size: 0.92rem; line-height: 1.3; }
.b-name .approx { color: var(--muted); font-weight: 400; }
.b-track { position: relative; height: 22px; }
.b-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 4px; min-width: 2px;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.3, 1);
}
.b-amt { font-family: var(--mono); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.b-amt .pc { color: var(--muted); font-weight: 400; margin-left: 8px; display: inline-block; min-width: 42px; text-align: right; }
@media (max-width: 700px) {
  .bar-row { grid-template-columns: 1fr auto; grid-template-rows: auto 12px; row-gap: 5px; }
  .b-name { grid-row: 1; grid-column: 1; }
  .b-amt { grid-row: 1; grid-column: 2; }
  .b-track { grid-row: 2; grid-column: 1 / 3; height: 12px; }
}

/* list view */
.list-view { border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; background: var(--surface); }
.list-view table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.list-view th {
  font-family: var(--mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); text-align: right;
  padding: 12px 14px 8px; border-bottom: 1px solid var(--line);
}
.list-view th:first-child { text-align: left; }
.list-view td {
  padding: 9px 14px; border-bottom: 1px solid var(--line-soft);
  text-align: right; font-variant-numeric: tabular-nums;
}
.list-view td.name { text-align: left; font-weight: 600; }
.list-view td .chip { margin-right: 9px; position: relative; top: 0; }
.list-view td.num-cell { font-family: var(--mono); font-size: 0.84rem; }
.list-view tr:last-child td { border-bottom: 0; }
.list-view tbody tr { cursor: pointer; }
.list-view tbody tr:hover { background: var(--line-soft); }
.d-up { color: var(--deficit); }
.d-down { color: var(--rev); }
@media (max-width: 700px) { .hide-sm { display: none; } }

/* ---------- revenue ---------- */
.rev-total { margin: 26px 0 6px; }
.rev-total .v { font-weight: 860; font-stretch: 118%; font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -0.02em; }
.rev-total .k { color: var(--ink-2); font-size: 0.9rem; margin-left: 10px; }
.rev-rows { margin-top: 22px; display: flex; flex-direction: column; }
.rev-row { border-top: 1px solid var(--line-soft); }
.rev-row:last-child { border-bottom: 1px solid var(--line-soft); }
.rev-head {
  display: grid; grid-template-columns: minmax(140px, 250px) 1fr auto; gap: 14px;
  align-items: center; width: 100%; padding: 11px 4px; background: none; border: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 6px;
}
.rev-head:hover { background: var(--line-soft); }
.rev-head .rn { font-weight: 640; font-size: 0.93rem; display: flex; align-items: center; gap: 8px; }
.rev-head .rn .tw { color: var(--muted); font-size: 0.7rem; transition: transform 0.15s; flex: none; }
.rev-row.open .rn .tw { transform: rotate(90deg); }
.rev-track { height: 20px; border-radius: 4px; background: transparent; position: relative; }
.rev-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--rev);
  min-width: 2px; transition: width 0.7s cubic-bezier(0.22, 1, 0.3, 1);
}
.rev-amt { font-family: var(--mono); font-size: 0.84rem; font-weight: 600; white-space: nowrap; }
.rev-amt .pc { color: var(--muted); font-weight: 400; margin-left: 8px; }
.rev-kids { padding: 2px 4px 12px; display: none; }
.rev-row.open .rev-kids { display: block; }
.rev-kid {
  display: grid; grid-template-columns: minmax(140px, 250px) 1fr auto; gap: 14px;
  align-items: center; padding: 5px 0 5px 22px; font-size: 0.85rem; color: var(--ink-2);
}
.rev-kid .rev-track { height: 12px; }
.rev-kid .rev-fill { background: var(--rev-soft); border: 1px solid var(--rev); }
.rev-blurb { padding: 2px 4px 14px 26px; max-width: 40em; font-size: 0.85rem; color: var(--ink-2); display: none; }
.rev-row.open .rev-blurb { display: block; }
@media (max-width: 700px) {
  .rev-head, .rev-kid { grid-template-columns: 1fr auto; }
  .rev-head .rev-track, .rev-kid .rev-track { display: none; }
}

/* ---------- the gap ---------- */
.gap-fig { margin-top: 30px; }
.gap-row { display: grid; grid-template-columns: 118px 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.gap-row .gl { font-family: var(--mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); text-align: right; }
.gap-bar { position: relative; height: 44px; }
.gap-bar .fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 6px;
  display: flex; align-items: center; overflow: hidden;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.3, 1);
}
.gap-bar .fill.revenue { background: var(--rev); }
.gap-bar .fill .in-label {
  color: #fff; font-weight: 700; font-size: 0.95rem; padding-left: 14px; white-space: nowrap;
  font-stretch: 110%;
}
.gap-bar .spend-seg { position: absolute; top: 0; bottom: 0; }
.gap-bar .deficit-seg {
  position: absolute; top: 0; bottom: 0; border-radius: 0 6px 6px 0;
  background: repeating-linear-gradient(135deg, var(--deficit) 0 5px, transparent 5px 9px);
  border: 1.5px solid var(--deficit); border-left: 0;
}
.gap-note { display: flex; gap: 10px; align-items: baseline; margin: 18px 0 0; font-size: 0.95rem; color: var(--ink-2); max-width: 46em; }
.gap-note .swatch {
  flex: none; width: 14px; height: 14px; border-radius: 3px; position: relative; top: 2px;
  background: repeating-linear-gradient(135deg, var(--deficit) 0 4px, transparent 4px 7px);
  border: 1.5px solid var(--deficit);
}
.gap-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; }
@media (max-width: 900px) { .gap-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .gap-stats { grid-template-columns: 1fr; } }

/* trend chart */
.trend-fig { margin-top: 54px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; padding: 22px; }
.trend-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.trend-head h3 { font-size: 1.02rem; }
.trend-legend { display: flex; gap: 18px; font-size: 0.8rem; color: var(--ink-2); }
.trend-legend .li { display: inline-flex; align-items: center; gap: 7px; }
.trend-legend .sw { width: 14px; height: 3px; border-radius: 2px; }
#trend { display: block; width: 100%; margin-top: 8px; }
#trend .axis text { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); }
#trend .gridline { stroke: var(--grid); stroke-width: 1; }
#trend .t-label { font-family: var(--mono); font-size: 11px; font-weight: 600; }
.trend-note { margin: 10px 2px 0; font-size: 0.8rem; color: var(--muted); max-width: 46em; }

/* ---------- calculator ---------- */
.calc {
  margin-top: 30px; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: 16px; padding: 30px; display: grid; grid-template-columns: 300px 1fr; gap: 36px;
}
@media (max-width: 880px) { .calc { grid-template-columns: 1fr; } }
.calc-in label { font-weight: 650; font-size: 0.95rem; display: block; }
.income-wrap { position: relative; margin-top: 12px; }
.income-wrap .cur {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); color: var(--muted); font-size: 1rem;
}
#income {
  width: 100%; font-family: var(--mono); font-size: 1.35rem; font-weight: 600;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px 12px 34px;
}
#income:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
#income-slider { width: 100%; margin-top: 16px; accent-color: var(--accent); }
.calc-tax { margin-top: 22px; }
.calc-tax .v { font-weight: 860; font-stretch: 118%; font-size: 2.4rem; letter-spacing: -0.02em; display: block; line-height: 1.05; }
.calc-tax .k { font-size: 0.83rem; color: var(--ink-2); display: block; margin-top: 4px; }
.calc-fun { margin-top: 18px; font-size: 0.88rem; color: var(--ink-2); border-left: 3px solid var(--grid); padding-left: 12px; }
.calc-note { margin-top: 18px; font-size: 0.75rem; color: var(--muted); }
.calc-out .co-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-family: var(--mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.co-rows { list-style: none; margin: 0; padding: 0; }
.co-rows li { display: grid; grid-template-columns: 15px minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 7.5px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.88rem; }
.co-rows li:last-child { border-bottom: 0; }
.co-rows .chip { top: 0; }
.co-rows .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-rows .yr { font-family: var(--mono); font-weight: 600; }
.co-rows .wk { font-family: var(--mono); color: var(--muted); font-size: 0.78rem; width: 84px; text-align: right; }

/* ---------- about ---------- */
.about-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 44px; margin-top: 26px; }
@media (max-width: 880px) { .about-cols { grid-template-columns: 1fr; } }
.about-cols h3 { margin-bottom: 10px; }
.about-cols p, .about-cols li { font-size: 0.92rem; color: var(--ink-2); }
.about-cols ul { padding-left: 18px; margin: 8px 0; }
.year-list { list-style: none; padding: 0; margin: 10px 0 0; }
.year-list li { border-top: 1px solid var(--line-soft); }
.year-list a {
  display: flex; justify-content: space-between; padding: 10px 2px; text-decoration: none;
  color: var(--ink); font-weight: 600; font-size: 0.95rem;
}
.year-list a:hover { background: var(--line-soft); }
.year-list .yl-r { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); font-weight: 400; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line-soft); padding: 30px 0 44px; margin-top: 0; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: baseline; }
.site-foot p { margin: 0; font-size: 0.78rem; color: var(--muted); }
.site-foot a { color: var(--ink-2); }

/* ---------- tooltip ---------- */
#tip {
  position: fixed; z-index: 90; pointer-events: none; opacity: 0;
  background: var(--tip-bg); color: var(--tip-ink);
  border-radius: 8px; padding: 8px 11px; font-size: 0.8rem; line-height: 1.45;
  max-width: 260px; box-shadow: var(--shadow); transition: opacity 0.1s;
}
#tip.on { opacity: 1; }
#tip .t-name { font-weight: 700; }
#tip .t-row { font-family: var(--mono); font-size: 0.74rem; opacity: 0.85; }

/* skip link */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

@media print {
  .site-head, .theme-btn, .view-toggle, #tip { display: none !important; }
  section { padding: 24px 0; }
}
