@font-face { font-family: "Geist Serif"; src: url("/fonts/GeistSerif-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  interpolate-size: allow-keywords;
  --paper: #ffffff; --card: #f8fafd; --raised: #ffffff; --ink: #1f1f1f; --soft: #444746; --line: #dadce0; --track: #e3e3e3;
  --brand: #0b57d0; --brand-ink: #ffffff; --mark: #d3e3fd; --mark-ink: #041e49;
  --keep: #146c2e; --tax: #b3261e; --ni: #b26a00; --loan: #6d4fc2; --pension: #0b57d0;
  --warn-bg: #fce8e6; --warn: #8c1d18; --good-bg: #e6f4ea; --good: #0d652d; --info-bg: #e8f0fe; --info: #174ea6;
  --serif: "Geist Serif", Georgia, "Times New Roman", serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 20px; --radius-s: 12px;
  --shadow: 0 1px 2px rgb(60 64 67 / .15), 0 1px 3px 1px rgb(60 64 67 / .08);
}
:root[data-theme=dark] {
  color-scheme: dark;
  --paper: #131314; --card: #1e1f20; --raised: #282a2c; --ink: #e3e3e3; --soft: #c4c7c5; --line: #444746; --track: #3c4043;
  --brand: #a8c7fa; --brand-ink: #062e6f; --mark: #0842a0; --mark-ink: #d3e3fd;
  --keep: #6dd58c; --tax: #f2b8b5; --ni: #fdd663; --loan: #c5b3f5; --pension: #a8c7fa;
  --warn-bg: #601410; --warn: #f9dedc; --good-bg: #0f5223; --good: #c4eed0; --info-bg: #0842a0; --info: #d3e3fd;
  --shadow: 0 1px 3px rgb(0 0 0 / .4);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; overflow-y: scroll; scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 clamp(1rem, .97rem + .15vw, 1.0625rem)/1.6 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem); margin: 0 0 .35em; }
h2 { font-size: clamp(1.6rem, 1.35rem + 1.2vw, 2.1rem); margin: 2em 0 .5em; }
h3 { font-size: 1.3rem; margin: 1.6em 0 .4em; }
p { margin: 0 0 1em; text-wrap: pretty; }
.wrap { width: min(1280px, 100% - clamp(24px, 5vw, 48px)); margin-inline: auto; }
.prose { max-width: 70ch; }
.ic { width: 1.15em; height: 1.15em; flex: none; display: inline-block; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--raised); padding: 8px 14px; border-radius: 999px; z-index: 30; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.site-head { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 2px 20px; min-height: 56px; flex-wrap: wrap; padding-block: 4px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 400 1.35rem var(--serif); color: var(--ink); text-decoration: none; margin-right: auto; }
.brand svg { width: 28px; height: 28px; }
.brand svg .logo-bg { fill: var(--brand); }
.brand svg .logo-ln { stroke: var(--brand-ink); }
.site-nav { order: 2; display: flex; gap: 2px; font-size: .92rem; font-weight: 500; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.site-nav a { color: var(--soft); text-decoration: none; padding: 9px 14px; border-radius: 999px; white-space: nowrap; }
.site-nav a:hover { background: var(--card); color: var(--ink); }
.site-nav a[aria-current] { background: var(--mark); color: var(--mark-ink); }

.crumbs { font-size: .82rem; color: var(--soft); margin: 20px 0 12px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.lead { font-size: clamp(1.08rem, 1rem + .4vw, 1.25rem); color: var(--soft); max-width: 60ch; line-height: 1.5; }
.byline { font-size: .86rem; color: var(--soft); display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 24px; }

/* Calculator */
.tool-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.tool-head > div:first-child { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.presets { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-block: 2px; }
.presets-label { display: inline-flex; align-items: center; gap: 3px; font-size: .8rem; font-weight: 500; color: var(--soft); }
.preset { flex: none; font: 500 .8rem var(--sans); color: var(--brand); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; min-height: 34px; cursor: pointer; transition: background .12s, border-color .12s, transform .08s; }
.preset:hover { background: var(--mark); color: var(--mark-ink); border-color: transparent; }
.preset:active { transform: scale(.96); }
.preset[aria-pressed=true] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.tool-head h1 { font-size: clamp(1.65rem, 1.4rem + 1.2vw, 2.25rem); margin: 0; }
.tool-head .lead { margin: 0; font-size: 1rem; }
.bar { background: var(--card); border-radius: var(--radius); padding: 22px 24px 20px; }
.fields { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 16px; align-items: start; }
.fields[hidden] { display: none; }
.bar > .fields:first-child { min-height: 92px; }
.field { display: block; min-width: 0; }
.field[hidden], .opt[hidden], .week-row[hidden] { display: none; }
.field > span:first-child, .label { display: block; font-size: .8rem; font-weight: 500; color: var(--soft); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23808080' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
input[inputmode=decimal], select {
  width: 100%; font: 500 1rem var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); background: var(--raised);
  border: 1px solid var(--soft); border-radius: 8px; padding: 8px 10px; min-height: 44px; transition: border-color .12s, box-shadow .12s;
}
input[inputmode=decimal] { -moz-appearance: textfield; appearance: textfield; }
input[inputmode=decimal]::-webkit-inner-spin-button, input[inputmode=decimal]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[inputmode=decimal]:hover, select:hover { border-color: var(--ink); }
input[inputmode=decimal]:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.affix { display: flex; align-items: stretch; position: relative; }
.affix b { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; padding: 0 10px; font-weight: 500; font-size: .92rem; color: var(--soft); pointer-events: none; }
.affix b:first-child { left: 0; }
.affix b:last-child { right: 0; }
.affix b:first-child + input { padding-left: 26px; }
.affix input:first-child { padding-right: 44px; }
.affix input { flex: 1; min-width: 0; }
.has-range input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; margin: 3px 0 0; display: block; cursor: pointer; background: transparent; --p: 0%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--brand) var(--p), var(--track) var(--p)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--track); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--brand); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--brand); border: 0; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: box-shadow .12s; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--brand); border: 0; }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 14%, transparent); }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 1259px) {
  .opt:has([name=current]) { grid-column: span 2; }
}
@media (min-width: 1260px) {
  .opts { display: flex; flex-wrap: nowrap; }
  .opts .opt { flex: 1 1 auto; min-width: 0; }
}
.opt { position: relative; display: flex; min-width: 0; }
.opt .menu { width: 100%; }
.opt.toggle span { flex: 1; white-space: nowrap; }
.extras .opt.toggle { align-self: end; min-height: 44px; }
.opt > .ic { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--soft); pointer-events: none; z-index: 1; }
.opt:has(.on) > .ic, .opt:has(input:checked) > .ic { color: var(--mark-ink); }
.opt select { width: auto; max-width: 100%; min-height: 36px; padding: 4px 26px 4px 30px; border-radius: 8px; border-color: var(--line); background-color: var(--raised); font-size: .84rem; cursor: pointer; }
.opt select.on { background-color: var(--mark); color: var(--mark-ink); border-color: transparent; }
.opt.toggle { align-items: center; cursor: pointer; }
.opt.toggle input { position: absolute; opacity: 0; }
.opt.toggle span { display: grid; place-items: center; min-height: 36px; padding: 4px 10px 4px 29px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); font-size: .82rem; font-weight: 500; }
.opt.toggle input:checked ~ span { background: var(--mark); color: var(--mark-ink); border-color: transparent; }
.opt.toggle:hover span { border-color: var(--soft); }
.opt.toggle .sel { display: none; }
.opt.toggle input:checked ~ .sel { display: block; }
.opt.toggle input:checked ~ .off { display: none; }
.opt.toggle input:focus-visible ~ span { outline: 2px solid var(--brand); outline-offset: 2px; }
.enhanced { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.menu { position: relative; width: 100%; min-width: 0; }
.menu-btn { position: relative; display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 30px 8px 10px; font: 500 1rem var(--sans); color: var(--ink); background: var(--raised); border: 1px solid var(--soft); border-radius: 8px; cursor: pointer; text-align: left; transition: background .12s, border-color .12s, box-shadow .12s; }
.menu-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border: solid var(--soft); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); transition: transform .15s, margin .15s; }
.menu-btn[aria-expanded=true]::after { transform: rotate(-135deg); margin-top: -2px; }
.menu-btn:hover { border-color: var(--ink); }
.menu-btn[aria-expanded=true] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.opt .menu-btn { min-height: 36px; padding: 4px 24px 4px 29px; font-size: .82rem; border-color: var(--line); }
.opt .menu-btn:hover { background: var(--card); border-color: var(--soft); }
.menu-btn.on, .opt .menu-btn.on:hover { background: var(--mark); color: var(--mark-ink); border-color: transparent; }
.menu-btn.on::after { border-color: var(--mark-ink); }
.menu-list { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 100%; width: max-content; max-width: min(320px, calc(100vw - 24px)); max-height: min(340px, 56vh); overflow-y: auto; margin: 0; padding: 8px 0; list-style: none; background: var(--raised); border-radius: 12px; box-shadow: 0 2px 6px 2px rgb(60 64 67 / .15), 0 1px 2px rgb(60 64 67 / .3); outline: none; animation: menu-in .12s ease-out; transform-origin: top; }
.menu.up .menu-list { top: auto; bottom: calc(100% + 4px); transform-origin: bottom; }
.menu.right .menu-list { left: auto; right: 0; }
.menu-list[hidden] { display: none; }
.menu-list li { position: relative; display: flex; align-items: center; min-height: 44px; padding: 8px 20px 8px 42px; font-size: .92rem; color: var(--ink); cursor: pointer; white-space: nowrap; }
.menu-list li.active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.menu-list li[aria-selected=true] { background: var(--mark); color: var(--mark-ink); font-weight: 500; }
.menu-list li[aria-selected=true]::before { content: ""; position: absolute; left: 18px; top: 50%; width: 6px; height: 12px; margin-top: -8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
@keyframes menu-in { from { opacity: 0; transform: scaleY(.92); } to { opacity: 1; transform: none; } }
.icon-btn { order: 3; display: grid; place-items: center; width: 40px; height: 40px; flex: none; color: var(--soft); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.icon-btn:hover { background: var(--card); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .sun, [data-theme=dark] .icon-btn .moon { display: none; }
[data-theme=dark] .icon-btn .sun { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.extras { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.extras.open { grid-template-rows: 1fr; }
.extras-in { overflow: hidden; min-height: 0; }
.extras .fields, .extras .week-row { padding-top: 16px; }
.extras .field[hidden] { display: none; }
.opt.disabled { opacity: .45; cursor: not-allowed; }
.opt.disabled span { cursor: not-allowed; }
.menu-btn { display: inline-grid; grid-template-columns: minmax(0, 1fr); }
.menu-text, .menu-ghost { grid-area: 1 / 1; }
.menu-ghost { visibility: hidden; height: 0; overflow: hidden; }
.field .menu-btn { display: grid; }
.week-row[hidden] { display: none; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 76px)); gap: 4px; }
.day { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.day button { font: 500 .76rem var(--sans); padding: 4px 0; border: 1px solid var(--soft); border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; min-height: 36px; }
.day button[aria-pressed=true] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.day input { padding: 4px 1px; text-align: center; font-size: .8rem; min-height: 36px; }
#head { margin-top: 24px; }
.tabbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 4px 12px; border-bottom: 1px solid var(--line); margin-top: 28px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; font: 500 .9rem var(--sans); color: var(--soft); background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px 8px; cursor: pointer; white-space: nowrap; min-height: 44px; }
.tabs button:hover { color: var(--ink); background: var(--card); border-radius: 8px 8px 0 0; }
.tabs button[aria-selected=true] { color: var(--brand); border-bottom-color: var(--brand); }
.actions { display: flex; gap: 2px; padding-bottom: 4px; }
.btn { display: inline-flex; align-items: center; gap: 4px; font: 500 .82rem var(--sans); border: 0; background: transparent; color: var(--brand); padding: 6px 10px; border-radius: 999px; cursor: pointer; min-height: 36px; }
.btn:hover { background: var(--mark); color: var(--mark-ink); }
#copy-status { position: fixed; left: 50%; bottom: 24px; z-index: 40; width: max-content; max-width: min(520px, calc(100vw - 32px)); margin: 0; padding: 12px 18px; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: .88rem; box-shadow: 0 4px 12px rgb(0 0 0 / .3); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .18s, transform .18s; }
#copy-status.show { opacity: 1; transform: translate(-50%, 0); }
#results { display: grid; margin-top: 24px; }
.panel { grid-area: 1 / 1; min-width: 0; visibility: hidden; opacity: 0; transition: opacity .16s ease; }
#results[data-tab=main] [data-panel=main], #results[data-tab=hours] [data-panel=hours], #results[data-tab=checks] [data-panel=checks], #results[data-tab=compare] [data-panel=compare], #results[data-tab=slip] [data-panel=slip], #results[data-tab=next] [data-panel=next] { visibility: visible; opacity: 1; }
.start-hint { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--soft); margin: 0 0 14px; min-height: 1.5em; }
.related { margin-top: 44px; padding-top: 8px; }
.prose .related { margin-top: 16px; padding-top: 0; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.related a { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--card); border-radius: 14px; text-decoration: none; color: var(--ink); font-weight: 500; }
.related a:hover { box-shadow: var(--shadow); }
.related .ic { color: var(--brand); }
.insight a { color: inherit; }
.meta { font-size: .84rem; color: var(--soft); margin: 32px 0 0; }

/* Results */
.hero-nums { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
.hero-num { background: var(--card); border-radius: var(--radius); padding: 16px 20px; min-width: 0; }
.hero-num.main { background: var(--brand); color: var(--brand-ink); }
.hn-label { display: flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 500; }
.hn-label .ic { opacity: .75; }
.hero-num strong { display: block; font: 400 clamp(1.6rem, 1.3rem + 1vw, 2.15rem)/1.15 var(--serif); margin: 8px 0 4px; overflow-wrap: anywhere; }
.hero-num small { font: 500 .42em var(--sans); }
.hn-sub { display: block; font-size: .8rem; opacity: .9; min-height: 1.3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot { display: flex; margin-top: 12px; min-height: 76px; }
.slot .insight { flex: 1; margin: 0; align-content: center; transition: background .18s, color .18s; }
.slot .insight.is-warn { display: flex; align-items: center; gap: 10px; background: var(--warn-bg); color: var(--warn); }
.insight.is-warn .ic { width: 20px; height: 20px; }
.badge { position: absolute; top: 4px; right: -2px; display: grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--tax); color: var(--paper); font-size: .66rem; font-weight: 600; }
.badge[hidden] { display: none; }
.tabs button { position: relative; }
.insight { background: var(--mark); color: var(--mark-ink); padding: 14px 20px; border-radius: 16px; margin: 12px 0 0; font-size: .95rem; line-height: 1.5; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; align-items: start; }
.panel-grid.wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.panel-h { font-size: 1.2rem; margin: 28px 0 12px; }
.panel-grid .panel-h:first-child { margin-top: 6px; }
.slip { background: var(--card); border-radius: var(--radius); padding: 20px 22px; }
.slip-title { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--soft); border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.slip dl { margin: 0; font-size: .94rem; }
.slip-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.slip-row dd { margin: 0; white-space: nowrap; font-weight: 500; }
.slip-row.minus dd { color: var(--tax); }
.slip-row.sub { border-top: 1px solid var(--line); margin-top: 3px; }
.slip-row.total { border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 9px; font-weight: 600; font-size: 1.02rem; }
.slip-foot { font-size: .82rem; color: var(--soft); margin: 8px 0 0; }
.cmp { display: grid; gap: 9px; }
.cmp-row { display: grid; grid-template-columns: 8.4em minmax(40px, 1fr) auto; gap: 10px; align-items: center; font-size: .85rem; }
.cmp-track { background: var(--track); height: 8px; border-radius: 4px; overflow: hidden; }
.cmp-fill { display: block; height: 100%; background: var(--soft); border-radius: 4px; transition: width .25s ease; }
.cmp-row.keep .cmp-fill { background: var(--keep); }
.cmp-row.keep-muted .cmp-fill { background: color-mix(in srgb, var(--keep) 45%, var(--track)); }
.cmp-val { font-weight: 500; }
.stack { margin: 0; }
.stack-bar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--track); gap: 2px; }
.seg { display: block; height: 100%; transition: width .25s ease; }
.stack ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; }
.stack li { display: flex; align-items: center; gap: 6px; }
.stack li b { font-weight: 600; }
.stack li i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.c-keep { background: var(--keep); }
.c-tax { background: var(--tax); }
.c-ni { background: var(--ni); }
.c-loan { background: var(--loan); }
.c-pension { background: var(--pension); }
.chart { margin: 0; background: var(--card); border-radius: var(--radius); padding: 12px; }
.chart svg { width: 100%; }
.chart figcaption { font-size: .82rem; color: var(--soft); padding: 2px 6px 4px; }
.grid { stroke: var(--line); stroke-width: 1; }
.tick, .axis { fill: var(--soft); font: 12px var(--sans); }
.plot { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; }
.mark-line { stroke: var(--tax); stroke-dasharray: 4 4; }
.mark-dot { fill: var(--tax); stroke: var(--card); stroke-width: 2; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-s); -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data caption { caption-side: bottom; text-align: left; padding: 8px 12px; margin: 0; }
table.data th, table.data td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data th:first-child { text-align: left; white-space: normal; }
table.data thead th { font-size: .8rem; font-weight: 500; color: var(--soft); vertical-align: bottom; }
table.data tbody th { font-weight: 400; }
table.data tr.now { background: var(--mark); color: var(--mark-ink); font-weight: 600; }
table.data .best { background: color-mix(in srgb, var(--good-bg) 70%, transparent); }
.pill { display: block; font-size: .68rem; font-weight: 600; color: var(--good); }
.holiday { margin-top: 14px; font-size: .95rem; }
.flags { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.flag { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-s); font-size: .9rem; }
.flag > .ic { width: 20px; height: 20px; margin-top: 1px; }
.flag a { color: inherit; }
.flag.warn { background: var(--warn-bg); color: var(--warn); }
.flag.good { background: var(--good-bg); color: var(--good); }
.flag.info { background: var(--info-bg); color: var(--info); }
.flag-tag { font-weight: 600; margin-right: 4px; }
.flag-tag::after { content: ":"; }
.viz { margin: 1.4em 0; }
.viz-bar { display: flex; height: 52px; border-radius: 12px; overflow: hidden; gap: 2px; }
.viz-bar span { display: grid; place-items: center; min-width: 0; font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; }
.viz .c-brand { background: var(--brand); color: var(--brand-ink); }
.viz .c-keep { background: var(--keep); }
.viz .c-off { background: var(--track); color: var(--soft); }
.viz .c-ni { background: var(--ni); color: var(--paper); }
.viz .c-ni-soft { background: color-mix(in srgb, var(--ni) 35%, var(--track)); color: var(--ink); }
.viz-key { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; padding: 0; font-size: .86rem; }
.viz-key li { display: flex; align-items: center; gap: 6px; }
.viz-key i { width: 11px; height: 11px; border-radius: 50%; }
.viz-scale { position: relative; height: 1.5em; font-size: .82rem; color: var(--soft); margin-top: 5px; }
.viz-scale span { position: absolute; transform: translateX(-50%); }
.viz figcaption { font-size: .86rem; color: var(--soft); margin-top: 10px; }
.routes td { text-align: left; white-space: normal; }
.routes thead th { text-align: left; }
.tick, .dash { display: inline-flex; align-items: center; gap: 5px; }
.tick { color: var(--good); font-weight: 500; }
.dash { color: var(--soft); }
.tick .ic, .dash .ic { width: 18px; height: 18px; }
.goal { background: var(--card); border-radius: var(--radius-s); padding: 12px 14px; margin-top: 14px; }
.goal-out { margin: 0; font-size: .92rem; }
.fine { font-size: .84rem; color: var(--soft); margin-top: 8px; }
@media (max-width: 1000px) {
  .fields { grid-template-columns: repeat(min(var(--cols, 3), 3), minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .panel-grid, .panel-grid.wide-left { grid-template-columns: minmax(0, 1fr); }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .slot { min-height: 128px; order: 3; }
  .start-hint { height: 2.8rem; align-items: flex-start; margin-bottom: 6px; overflow: hidden; }
  /* On phones the result comes first and stays pinned while the inputs change. */
  .site-head { position: static; backdrop-filter: none; }
  .site-head .wrap { min-height: 0; padding-block: 6px 2px; }
  .brand { font-size: 1.15rem; }
  .brand svg { width: 22px; height: 22px; }
  .site-nav { font-size: .84rem; }
  .site-nav a { padding: 5px 10px; }
  .tool-page .crumbs, .tool-head .lead { display: none; }
  .tool-head { margin: 16px 0 10px; }
  .tool-head h1 { font-size: 1.45rem; }
  .tool { display: flex; flex-direction: column; }
  #head { display: contents; }
  .hero-nums { order: 1; position: sticky; top: 0; z-index: 8; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--paper); padding: 4px 0 6px; margin-bottom: 2px; }
  .hero-num { padding: 8px 10px; border-radius: 14px; }
  .hn-label { font-size: .68rem; line-height: 1.2; min-height: 2.4em; }
  .hero-num strong { font-size: 1.3rem; margin: 2px 0 0; }
  .hero-num small { font-size: .5em; }
  .hn-sub { display: none; }
  .hn-label .ic { display: none; }
  .tool-head { flex-direction: column; align-items: stretch; }
  .tabs button .ic { display: none; }
  .bar { order: 2; padding: 14px; margin-top: 8px; }
  .slot { margin-top: 16px; }
  .tabbar { order: 5; margin-top: 20px; }
  #results { order: 7; }
  .opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 12px; padding-top: 12px; }
  .opt { display: flex; min-width: 0; }
  .opt[hidden] { display: none; }
  .opt .menu { width: 100%; }
  .opt select, .opt.toggle span, .opt .menu-btn { width: 100%; font-size: .8rem; min-height: 36px; padding-block: 3px; text-overflow: ellipsis; }
  .opt .menu-btn { padding-inline: 27px 20px; }
  .opt > .ic { left: 7px; }
  .opt.toggle span { padding-left: 27px; }
  .site-nav { order: 4; flex-basis: 100%; }
  .menu-btn { min-height: 42px; }
  input[inputmode=decimal], select { min-height: 42px; }
  table.compare { font-size: .84rem; }
  table.compare th, table.compare td { padding: 9px 6px; white-space: normal; }
  table.compare th:first-child { padding-left: 10px; }
}

/* Article */
.article { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 16px; }
.article .table-wrap { margin-bottom: 1em; }
.article figure.diagram { margin: 1.4em 0; background: var(--card); border-radius: var(--radius); padding: 16px; }
.article figure.diagram figcaption { font-size: .85rem; color: var(--soft); margin-top: 8px; }
.sources { font-size: .92rem; padding-left: 1.1em; }
.sources li { margin-bottom: 4px; }
.faq { border-top: 1px solid var(--line); margin-top: 8px; }
.faq h2 { margin-top: 1.6em; }
.qa { border-bottom: 1px solid var(--line); }
.qa summary { position: relative; display: block; list-style: none; padding: 16px 36px 16px 0; cursor: pointer; border-radius: 6px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary h3 { font: 600 1.02rem/1.4 var(--sans); letter-spacing: 0; margin: 0; color: var(--ink); transition: color .12s; }
.qa summary:hover h3, .qa[open] summary h3 { color: var(--brand); }
.qa summary::after { content: ""; position: absolute; right: 8px; top: 22px; width: 8px; height: 8px; border: solid var(--soft); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .18s; }
.qa[open] summary::after { transform: rotate(-135deg); top: 26px; }
.qa p { margin: 0; padding: 0 36px 18px 0; color: var(--soft); font-size: .97rem; }
.qa::details-content { block-size: 0; overflow: clip; transition: block-size .2s ease, content-visibility .2s allow-discrete; }
.qa[open]::details-content { block-size: auto; }
.callout { background: var(--mark); color: var(--mark-ink); padding: 14px 18px; border-radius: var(--radius-s); margin: 1.2em 0; }
.formula { background: var(--card); padding: 12px 16px; border-radius: var(--radius-s); overflow-wrap: anywhere; font-weight: 500; }

/* Home */
.home-hero { padding: clamp(32px, 7vw, 72px) 0 clamp(16px, 3vw, 32px); text-align: center; }
.home-hero .lead { margin-inline: auto; }
.home-hero h1 { max-width: 20ch; margin-inline: auto; }
.trust { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 8px 16px; border-radius: 999px; background: var(--card); color: var(--soft); font-size: .86rem; text-align: left; }
.trust .ic { color: var(--brand); width: 18px; height: 18px; }
.home-section { margin: 0 0 48px; }
.home-section h2 { margin: 0 0 16px; }
.section-lead { color: var(--soft); margin-top: -8px; }
.asks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.asks a { height: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; font-weight: 500; transition: background .12s, border-color .12s; }
.asks a:hover { background: var(--card); border-color: var(--brand); }
.asks .ic { color: var(--brand); width: 20px; height: 20px; }
.asks span { flex: 1; }
.asks .go-ic { color: var(--soft); transition: transform .15s; }
.asks a:hover .go-ic { transform: translateX(3px); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.fact { background: var(--card); border-radius: var(--radius); padding: 20px 22px; }
.fact strong { display: block; font: 400 2.2rem/1.1 var(--serif); color: var(--brand); margin-bottom: 8px; }
.fact p { margin: 0; color: var(--soft); font-size: .95rem; }
.tool-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; margin: 10px 0 40px; }
.tool-card { background: var(--card); border-radius: var(--radius); padding: 22px; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s, background .15s; }
.tool-card:hover { box-shadow: var(--shadow); background: var(--raised); }
.tool-card h2 { font: 500 .9rem var(--sans); color: var(--soft); letter-spacing: 0; margin: 0; order: -1; }
.tool-card p { margin: 0; color: var(--soft); font-size: .95rem; }
.tool-card .q { font: 400 1.35rem/1.25 var(--serif); color: var(--brand); }
.card-ic { order: -2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--mark); color: var(--mark-ink); margin-bottom: 6px; }
.card-ic .ic { width: 24px; height: 24px; }
.go { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 10px; font-size: .88rem; font-weight: 500; color: var(--brand); }
.go .ic { transition: transform .15s; }
.tool-card:hover .go .ic { transform: translateX(3px); }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 24px; }
.pillars h3 { margin: 6px 0 4px; }
.pillars .ic { width: 24px; height: 24px; color: var(--brand); }
.pillars p { font-size: .96rem; color: var(--soft); }

.site-foot { margin-top: 64px; background: var(--card); padding: 28px 0; font-size: .9rem; color: var(--soft); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 10px; }
.site-foot a { display: inline-block; padding: 4px 0; }

@media (max-width: 420px) {
  .cmp-row { grid-template-columns: 6.6em minmax(30px, 1fr) auto; }
  .actions { width: 100%; justify-content: flex-end; }
  .btn span { display: none; }
  .btn { min-width: 40px; justify-content: center; }
  .btn .ic { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media print {
  :root, :root[data-theme=dark] { --ink: #000; --paper: #fff; --card: #fff; --soft: #333; --line: #bbb; --mark: #eee; --mark-ink: #000; --brand: #000; --brand-ink: #fff; }
  .site-head, .site-foot, .bar, .tabbar, .article, .crumbs, .meta { display: none; }
  .panel { display: block !important; margin-bottom: 20px; }
  body { background: #fff; color: #000; }
}
