/* LocalTakehome. Display serif: Source Serif 4. Text: IBM Plex Sans. Both self-hosted. */
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-600-italic.woff2") format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/plex-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/plex-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/plex-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f4efe6;
  --surface: #fffcf7;
  --surface-2: #f8f2e8;
  --surface-3: #efe7d9;
  --ink: #14110e;
  --brand-ink: #1f272c;
  --brand-teal: #0c9784;
  --muted: #5d564d;
  --faint: #7d756a;
  --rule: rgba(20, 17, 14, 0.11);
  --rule-strong: rgba(20, 17, 14, 0.22);
  --accent: #0f6b4c;
  --accent-ink: #084833;
  --accent-soft: #e2efe6;
  --on-accent: #fbf8f1;
  --amber: #8a5a12;
  --amber-bg: #f6e9cf;
  --danger: #9a2f2f;
  --pos: #0f6b4c;
  --neg: #9a3a1c;
  /* where the money goes */
  --c-keep: #0f6b4c;
  --c-federal: #1f272c;
  --c-fica: #55788c;
  --c-state: #c98a2b;
  --c-local: #b8552f;
  --c-benefits: #9c8f79;
  --c-expenses: #c9bfae;
  --shadow: 0 1px 2px rgba(48, 32, 14, 0.04), 0 18px 48px rgba(48, 32, 14, 0.07);
  --shadow-sm: 0 1px 2px rgba(48, 32, 14, 0.05), 0 6px 18px rgba(48, 32, 14, 0.05);
  --font-display: "Source Serif 4", "Iowan Old Style", Palatino, Georgia, serif;
  --font-ui: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --max: 1180px;
  --radius: 20px;
  --radius-sm: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(720px 420px at -6% 14%, rgba(15, 107, 76, 0.1), transparent 62%),
    radial-gradient(520px 420px at 104% 30%, rgba(184, 97, 47, 0.09), transparent 62%),
    radial-gradient(900px 500px at 50% -12%, rgba(255, 252, 247, 0.9), transparent 70%),
    var(--bg);
  background-attachment: scroll;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
body.has-netbar { padding-bottom: 76px; }

::selection { background: rgba(15, 107, 76, 0.2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -200px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 60; border-radius: 8px; }
.skip:focus { top: 12px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.5rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2rem); margin-top: 2.6rem; }
h3 { font-size: 1.22rem; margin-top: 1.7rem; }
h4 { font-family: var(--font-ui); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); margin: 0; }
p { margin: 0.8rem 0; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
pre { background: var(--brand-ink); color: #f1ede4; padding: 16px 18px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 0.86rem; }
pre code { background: none; padding: 0; color: inherit; }
img { max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.page { padding-bottom: 56px; }
.narrow-col { max-width: 800px; }

/* ───────── header ───────── */
.site-header { padding: 14px 20px 0; position: relative; z-index: 30; }
.header-inner {
  max-width: calc(var(--max) - 40px); margin: 0 auto; display: flex; align-items: center; gap: 18px;
  background: rgba(255, 252, 247, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 22px; box-shadow: var(--shadow-sm); padding: 8px 18px 8px 14px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-lockup { width: 118px; height: auto; flex: none; }
.tagline { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; line-height: 1.2; letter-spacing: -0.01em; max-width: 15.5em; }
.tagline-live { color: var(--brand-teal); font-size: 1.16em; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.site-nav > a, .tools-menu > summary { padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 0.95rem; white-space: nowrap; cursor: pointer; }
.site-nav > a:hover, .tools-menu > summary:hover { background: var(--surface-3); }
.site-nav > a[aria-current="page"] { font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); border-radius: 10px 10px 0 0; }
.tools-menu { position: relative; }
.tools-menu > summary { list-style: none; font-weight: 500; }
.tools-menu > summary::-webkit-details-marker { display: none; }
.tools-menu > summary::after { content: ""; display: inline-block; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-3px); margin-left: 8px; }
.tools-panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(640px, 92vw); display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--shadow); padding: 10px; }
.tools-panel a { display: block; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.tools-panel a:hover, .tools-panel a[aria-current="page"] { background: var(--surface-2); }
.tools-panel strong { display: block; font-weight: 600; font-size: 0.95rem; }
.tools-panel span { display: block; color: var(--muted); font-size: 0.82rem; }
.menu-btn { display: none; margin-left: auto; border: 1px solid var(--rule-strong); background: var(--surface); border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 0.95rem; cursor: pointer; color: var(--ink); }

@media (max-width: 1060px) {
  .tagline { display: none; }
}
@media (max-width: 760px) {
  .site-header { padding: 10px 12px 0; }
  .header-inner { flex-wrap: wrap; padding: 6px 10px 6px 10px; gap: 10px; border-radius: 18px; }
  .brand-lockup { width: 84px; }
  .tagline { display: block; font-size: 0.86rem; max-width: 11.5em; }
  .menu-btn { display: block; }
  .site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; margin: 0; padding: 6px 0 8px; border-top: 1px solid var(--rule); }
  .site-nav.is-open { display: flex; }
  .site-nav > a, .tools-menu > summary { padding: 12px 10px; font-size: 1rem; }
  .site-nav > a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--ink); border-radius: 0 10px 10px 0; }
  .tools-panel { position: static; width: 100%; grid-template-columns: 1fr; box-shadow: none; border: 0; padding: 0 0 0 8px; background: none; }
}
@media (max-width: 380px) { .tagline { display: none; } }

/* ───────── page top ───────── */
.crumbs { margin-top: 18px; font-size: 0.85rem; color: var(--muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--faint); }
.crumbs a { color: var(--muted); }
.mast { padding: 34px 0 20px; max-width: 900px; }
.crumbs + .mast, .wrap:has(.crumbs) + .wrap .mast { padding-top: 18px; }
.kicker, .eyebrow { font-size: 0.76rem; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.lede { font-size: clamp(1.05rem, 1rem + 0.35vw, 1.2rem); color: var(--muted); margin: 14px 0 0; max-width: 46em; }
.lede strong { color: var(--ink); font-weight: 600; }
.mast-note { font-size: 0.86rem; color: var(--muted); margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.mast-note span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-teal); margin-right: 8px; transform: translateY(-1px); }

/* ───────── form controls ───────── */
.field { display: block; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.label, legend.label { display: block; font-size: 0.84rem; color: var(--muted); margin-bottom: 6px; padding: 0; font-weight: 500; }
.control { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); transition: border-color 0.12s, box-shadow 0.12s; min-width: 0; }
.control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 107, 76, 0.14); }
.control input { flex: 1 1 auto; min-width: 0; width: 100%; border: 0; background: none; font: inherit; color: var(--ink); padding: 11px 12px; outline: none; font-variant-numeric: tabular-nums; }
.control input::placeholder { color: #a39a8c; }
.affix { flex: none; color: var(--faint); font-size: 0.92rem; padding: 0 12px; white-space: nowrap; }
.affix:first-child { padding-right: 0; }
.control input + .affix { padding-left: 4px; }
.control select { flex: none; border: 0; border-left: 1px solid var(--rule); background-color: transparent; font: inherit; font-size: 0.92rem; color: var(--ink); padding: 11px 30px 11px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; cursor: pointer; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235d564d' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field > select, .whatif-card select { display: block; width: 100%; font: inherit; color: var(--ink); background-color: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); padding: 11px 34px 11px 12px; cursor: pointer; text-overflow: ellipsis; }
.field > select:focus-visible, .control select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
select:disabled { color: var(--faint); background-color: var(--surface-2); cursor: default; }
.field.big .control input { font-size: 1.3rem; font-weight: 500; padding: 12px 12px; }
.field.big .affix:first-child { font-size: 1.2rem; color: var(--ink); }
.hint { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.hint.quiet { margin: -4px 0 14px; }
.error { display: block; font-size: 0.84rem; color: var(--danger); margin-top: 4px; }
.error:empty { display: none; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 0 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .grid-3 { grid-template-columns: 1fr; } .grid-2.stack { grid-template-columns: 1fr; } }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-3); border-radius: 999px; padding: 4px; margin: 0 0 16px; }
.seg label { position: relative; text-align: center; cursor: pointer; min-width: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 9px 8px; border-radius: 999px; font-size: 0.94rem; color: var(--muted); transition: background 0.14s, color 0.14s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg input:checked + span { background: var(--ink); color: var(--on-accent); font-weight: 500; box-shadow: 0 2px 8px rgba(20, 17, 14, 0.2); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg.four span { font-size: 0.86rem; padding: 9px 4px; }
.seg span span, .seg input:checked + span span { display: inline; padding: 0; color: inherit; background: none; box-shadow: none; font-weight: inherit; }
.seg .short, .seg input:checked + span .short { display: none; }
@media (max-width: 480px), (min-width: 900px) and (max-width: 1140px) {
  .seg .long, .seg input:checked + span .long { display: none; }
  .seg .short, .seg input:checked + span .short { display: inline; }
}
fieldset.field .seg { margin-bottom: 0; }

.check { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 14px; font-size: 0.93rem; cursor: pointer; }
.check input { flex: none; width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 0.95rem; font-weight: 500; border-radius: 999px; padding: 11px 20px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform 0.08s, background 0.14s, box-shadow 0.14s; }
.btn:active { transform: translateY(1px); }
.btn.solid { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 16px rgba(15, 107, 76, 0.24); }
.btn.solid:hover { background: var(--accent-ink); color: var(--on-accent); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.small { padding: 8px 14px; font-size: 0.88rem; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 0.9rem; color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.link-btn:hover { color: var(--accent); }
.chip { font: inherit; font-size: 0.88rem; background: var(--surface); border: 1px solid var(--rule-strong); color: var(--ink); border-radius: 999px; padding: 7px 14px; cursor: pointer; text-decoration: none; transition: background 0.12s, border-color 0.12s; }
.chip:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }

.fold { border-top: 1px solid var(--rule); }
.fold > summary { list-style: none; cursor: pointer; padding: 14px 28px 14px 0; font-weight: 600; position: relative; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 8px; height: 8px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform 0.15s; }
.fold[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.fold-sub { display: block; font-weight: 400; font-size: 0.82rem; color: var(--muted); }
.fold > :last-child { margin-bottom: 16px; }

/* ───────── calculator ───────── */
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
@media (max-width: 760px) {
  .examples { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px 14px; padding: 2px 20px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .examples::-webkit-scrollbar { display: none; }
  .examples .chip { flex: none; }
}
.calc { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.9); border-radius: var(--radius); box-shadow: var(--shadow); overflow: clip; }
.calc-in { padding: 24px; min-width: 0; }
@media (min-width: 900px) {
  /* The form stays in view while a long result scrolls past. */
  .calc-in { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; scrollbar-width: thin; }
}
.calc-out { padding: 24px 26px 26px; background: linear-gradient(180deg, #fbf5ea, var(--surface-2)); border-left: 1px solid var(--rule); min-width: 0; }
@media (max-width: 899px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .calc-out { border-left: 0; border-top: 1px solid var(--rule); }
  .calc-in, .calc-out { padding: 18px 16px 20px; }
}
.restored { font-size: 0.85rem; color: var(--muted); background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; margin: 0 0 14px; }
.blocks { margin-bottom: 8px; }
.block { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 12px 12px 2px; margin-bottom: 10px; background: var(--surface-2); }
.block-top { display: flex; align-items: flex-end; gap: 12px; }
.block-top .field { flex: 1; }
.block-top .link-btn { margin-bottom: 26px; }
.block-flags { display: flex; gap: 18px; flex-wrap: wrap; }
.block-total { font-size: 0.86rem; color: var(--muted); }
.row-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.save-row { display: flex; align-items: flex-end; gap: 10px; }
.save-row .field { flex: 1; }
.save-row .btn { margin-bottom: 14px; }
.saved-list { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.saved { display: inline-flex; align-items: center; gap: 8px; }

.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--ink); }
.result-head .eyebrow { margin: 0; color: var(--ink); }
.result-where { margin: 4px 0 0; font-size: 0.88rem; color: var(--muted); }
.flag { flex: none; font-size: 0.76rem; font-weight: 600; background: var(--amber-bg); color: var(--amber); border-radius: 999px; padding: 4px 12px; }
.net { padding: 18px 0 6px; }
.view-tabs { display: inline-flex; background: rgba(20, 17, 14, 0.06); border-radius: 999px; padding: 3px; }
.view-tabs button { font: inherit; font-size: 0.84rem; border: 0; background: none; color: var(--muted); padding: 5px 14px; border-radius: 999px; cursor: pointer; }
.view-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(20, 17, 14, 0.14); }
.net-figure { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.7rem, 1.6rem + 5vw, 4.3rem); line-height: 1; letter-spacing: -0.03em; color: var(--accent); margin: 14px 0 6px; font-variant-numeric: tabular-nums lining-nums; overflow-wrap: anywhere; }
.net-figure small { font-family: var(--font-ui); font-size: 0.95rem; font-weight: 500; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.net-sub { margin: 0; color: var(--muted); font-size: 0.93rem; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0 4px; }
.stat { background: rgba(255, 252, 247, 0.8); border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.stat-label { display: block; font-size: 0.78rem; color: var(--muted); }
.stat strong { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; margin: 2px 0; font-variant-numeric: tabular-nums lining-nums; }
.stat-sub { display: block; font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
@media (max-width: 420px) { .stat strong { font-size: 1.3rem; } .stat { padding: 10px 12px; } }

.calc-out h3, .tool-out h3 { font-family: var(--font-ui); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin: 26px 0 12px; }
.where-row { display: flex; align-items: center; gap: 22px; }
.donut-wrap { position: relative; width: 150px; flex: none; }
.donut { display: block; width: 100%; transform: rotate(0deg); }
.donut-track { stroke: rgba(20, 17, 14, 0.07); }
.donut circle { transition: stroke-dasharray 0.3s ease, stroke-dashoffset 0.3s ease; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.donut-center strong { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }
.donut-center span { font-size: 0.74rem; color: var(--muted); margin-top: 3px; }
.seg-keep { stroke: var(--c-keep); background: var(--c-keep); }
.seg-federal { stroke: var(--c-federal); background: var(--c-federal); }
.seg-fica { stroke: var(--c-fica); background: var(--c-fica); }
.seg-state { stroke: var(--c-state); background: var(--c-state); }
.seg-local { stroke: var(--c-local); background: var(--c-local); }
.seg-benefits { stroke: var(--c-benefits); background: var(--c-benefits); }
.seg-expenses { stroke: var(--c-expenses); background: var(--c-expenses); }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; font-size: 0.9rem; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 4px 0; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.legend-pct { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.84rem; }
.legend-amt { font-variant-numeric: tabular-nums; min-width: 4.6em; text-align: right; font-weight: 500; }
@media (max-width: 480px) { .where-row { gap: 14px; } .donut-wrap { width: 108px; } .donut-center strong { font-size: 1.3rem; } .legend { font-size: 0.84rem; } .legend-pct { display: none; } .legend li { grid-template-columns: 12px minmax(0, 1fr) auto; } }

.lines-head { display: grid; grid-template-columns: minmax(0, 1fr) 7em 6em; align-items: end; gap: 10px; margin: 26px 0 4px; }
.lines-head h3 { margin: 0; }
.col { font-size: 0.74rem; color: var(--faint); text-align: right; text-transform: uppercase; letter-spacing: 0.06em; }
.line-group { border-top: 1px solid var(--rule); padding: 8px 0 4px; }
.line-group h4 { margin: 4px 0 2px; }
.line, .line > summary { display: grid; grid-template-columns: minmax(0, 1fr) 7em 6em; gap: 10px; align-items: baseline; }
.line { padding: 6px 0; }
details.line { display: block; padding: 0; }
.line > summary { list-style: none; cursor: pointer; padding: 6px 0; border-radius: 8px; }
.line > summary::-webkit-details-marker { display: none; }
.line > summary:hover .line-name { color: var(--accent-ink); }
.line-name { display: block; min-width: 0; font-size: 0.96rem; padding-left: 19px; text-indent: -19px; }
.line-name .dot { margin-right: 9px; text-indent: 0; }
details.line .line-name::after { content: "+"; color: var(--faint); font-size: 0.9rem; margin-left: 8px; }
details.line[open] .line-name::after { content: "−"; }
.tone-ink { background: var(--ink); } .tone-federal { background: var(--c-federal); } .tone-fica { background: var(--c-fica); } .tone-state { background: var(--c-state); } .tone-local { background: var(--c-local); } .tone-benefit { background: var(--c-benefits); } .tone-muted { background: var(--c-expenses); }
.line-name .dot { transform: translateY(-1px); }
.amt { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.96rem; white-space: nowrap; }
.amt.yr { color: var(--muted); font-size: 0.88rem; }
.line.minus .amt:not(.yr)::before { content: "−"; color: var(--faint); margin-right: 1px; }
.line-why { margin: 0 0 8px 19px; font-size: 0.85rem; color: var(--muted); line-height: 1.45; max-width: 44em; }
.src { display: inline-block; font-size: 0.74rem; background: rgba(20, 17, 14, 0.06); border-radius: 999px; padding: 1px 9px; margin-left: 4px; white-space: nowrap; }
.line.total { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; font-weight: 600; }
.line.total .line-name { font-size: 1.05rem; padding-left: 0; text-indent: 0; }
.line.total .amt { font-size: 1.05rem; color: var(--accent); }
.line.total .amt.yr { font-size: 0.95rem; }
.fine { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
@media (max-width: 480px) { .lines-head, .line, .line > summary { grid-template-columns: minmax(0, 1fr) 6.2em 5em; gap: 6px; } .line-name, .amt { font-size: 0.9rem; } .amt.yr { font-size: 0.8rem; } }

.math-fold, .sources-fold { margin-top: 10px; }
.math-fold > summary, .sources-fold > summary { font-size: 0.95rem; }
.math-grid { display: grid; gap: 18px; }
.math-block h4 { margin-bottom: 6px; }
table.math { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.math th { text-align: left; font-weight: 400; padding: 5px 0; }
table.math td { text-align: right; font-variant-numeric: tabular-nums; padding: 5px 0; }
table.math tr.sum th, table.math tr.sum td { font-weight: 600; border-top: 1px solid var(--rule-strong); }
.notes ul { margin: 0; padding: 0; list-style: none; font-size: 0.88rem; color: var(--muted); }
.notes li { padding: 7px 0 7px 16px; border-top: 1px solid var(--rule); position: relative; line-height: 1.45; }
.notes li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.notes li.warn { color: var(--amber); }
.notes li.warn::before { background: var(--amber); }
.sources { font-size: 0.86rem; padding-left: 18px; margin: 0 0 12px; }
.sources li { margin: 4px 0; }
.disclaimer { font-size: 0.8rem; color: var(--faint); border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 18px; line-height: 1.5; }

.whatif-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.whatif-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.whatif-title { display: block; font-size: 0.8rem; color: var(--muted); }
.whatif-card strong { display: block; font-family: var(--font-display); font-size: 1.22rem; font-weight: 600; margin: 3px 0 4px; letter-spacing: -0.01em; }
.whatif-text { display: block; font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.whatif-card select { padding: 7px 30px 7px 10px; font-size: 0.92rem; margin-top: 4px; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
@media (max-width: 440px) { .whatif-grid { grid-template-columns: 1fr; } }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 22px; }

.netbar { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: var(--on-accent); border-radius: 18px; padding: 10px 12px 10px 18px; box-shadow: 0 12px 36px rgba(20, 17, 14, 0.35); }
.netbar-label { display: block; font-size: 0.72rem; opacity: 0.72; text-transform: uppercase; letter-spacing: 0.08em; }
.netbar strong { font-family: var(--font-display); font-size: 1.4rem; font-variant-numeric: tabular-nums lining-nums; }
.netbar-unit { font-size: 0.8rem; opacity: 0.72; }
@media (min-width: 900px) { .netbar { display: none !important; } body.has-netbar { padding-bottom: 0; } }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: var(--on-accent); padding: 10px 18px; border-radius: 999px; font-size: 0.9rem; z-index: 70; box-shadow: var(--shadow); max-width: 92vw; text-align: center; }

/* ───────── tools ───────── */
.tool { background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.9); border-radius: var(--radius); box-shadow: var(--shadow); overflow: clip; }
.tool-form { padding: 22px 24px 8px; }
.tool-out { padding: 22px 24px 24px; background: linear-gradient(180deg, #fbf5ea, var(--surface-2)); border-top: 1px solid var(--rule); }
.tool-share { margin: 10px 4px 0; }
@media (max-width: 600px) { .tool-form, .tool-out { padding-left: 16px; padding-right: 16px; } }
.two-up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
@media (max-width: 640px) { .two-up { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px 2px; margin: 0; min-width: 0; background: var(--surface-2); }
.panel legend { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; padding: 0 8px; }
.answer { font-family: var(--font-display); font-size: clamp(1.25rem, 1.05rem + 1vw, 1.7rem); font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 16px; text-wrap: balance; }
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
@media (max-width: 720px) { .figures { grid-template-columns: 1fr; } }
.figure { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.figure-label { display: block; font-size: 0.8rem; color: var(--muted); }
.figure strong { display: block; font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; margin: 2px 0; font-variant-numeric: tabular-nums lining-nums; overflow-wrap: anywhere; }
.figure.pos strong { color: var(--accent); }
.figure-sub { display: block; font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
.more-link { font-weight: 500; }

.tilemap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; max-width: 660px; margin: 6px 0 10px; }
.tile { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: clamp(0.6rem, 0.3rem + 1.3vw, 0.84rem); font-weight: 600; text-decoration: none; transition: transform 0.1s; }
a.tile:hover { transform: scale(1.12); position: relative; z-index: 2; box-shadow: var(--shadow-sm); }
.b0 { background: #0f6b4c; color: #fff; } .b1 { background: #4f9477; color: #fff; } .b2 { background: #a9c9b3; color: var(--ink); } .b3 { background: #e9cf9f; color: var(--ink); } .b4 { background: #d99a5b; color: var(--ink); }
.tile-key { font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tile-key .tile { width: 16px; height: 16px; aspect-ratio: auto; border-radius: 4px; display: inline-block; }

/* ───────── content ───────── */
.below { margin-top: 34px; }
.prose { max-width: 800px; }
.prose p, .prose li { color: #2b2620; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.wide { max-width: none; }
section + section { margin-top: 8px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; margin: 16px 0; -webkit-overflow-scrolling: touch; }
.table-wrap.narrow { max-width: 460px; }
.table-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.table-pair .table-wrap { max-width: none; margin: 8px 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
caption { caption-side: top; text-align: left; padding: 12px 16px 4px; font-size: 0.84rem; color: var(--muted); }
th, td { padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
thead th { font-size: 0.76rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); background: var(--surface-2); white-space: normal; line-height: 1.3; vertical-align: bottom; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 500; }
tbody tr:hover { background: rgba(15, 107, 76, 0.04); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
thead th.num { white-space: normal; }
td.strong, tr.sum th, tr.sum td { font-weight: 600; }
tr.sum { background: var(--accent-soft); }
td.diff { color: var(--muted); }
td.rank { color: var(--faint); width: 3em; }

.faq details { border-top: 1px solid var(--rule); }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 15px 30px 15px 0; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 13px; font-size: 1.25rem; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0 0 16px; color: #2b2620; max-width: 46em; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.card-link { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 14px 16px; text-decoration: none; color: var(--ink); transition: transform 0.1s, box-shadow 0.14s, border-color 0.14s; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--accent); color: var(--ink); }
.card-link strong { display: block; font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; }
.card-link span { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.link-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.link-cloud a { background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; text-decoration: none; font-size: 0.9rem; color: var(--ink); }
.link-cloud a:hover { border-color: var(--accent); background: var(--accent-soft); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 18px 0; }
.kpi { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 14px 16px; }
.kpi span { display: block; font-size: 0.8rem; color: var(--muted); }
.kpi strong { display: block; font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; letter-spacing: -0.015em; margin-top: 2px; }
.kpi small { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.callout { background: var(--accent-soft); border-radius: 16px; padding: 14px 18px; margin: 18px 0; font-size: 0.95rem; }
.callout.amber { background: var(--amber-bg); }
.callout p { margin: 0.4rem 0; }
.steps, .prose .steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 46px; margin: 18px 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.95rem; }
.steps h3 { margin: 0 0 4px; padding-top: 4px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.updated { font-size: 0.84rem; color: var(--muted); }
.noscript { background: var(--amber-bg); border-radius: 12px; padding: 10px 14px; font-size: 0.9rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head a { font-size: 0.92rem; white-space: nowrap; }
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin: 16px 0; }
.state-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.state-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); color: var(--ink); }
.state-card strong { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.state-card em { font-style: normal; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); }
.state-card span { grid-column: 1 / -1; font-size: 0.8rem; color: var(--muted); }
.embed-code { position: relative; }

/* ───────── footer ───────── */
.site-footer { margin-top: 40px; background: var(--brand-ink); color: #d9d4ca; padding: 40px 0 34px; }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.footer-cols h2 { font-family: var(--font-ui); font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: #9fb3ad; margin: 0 0 10px; font-weight: 600; }
.footer-cols a { display: block; color: #f1ede4; text-decoration: none; padding: 4px 0; font-size: 0.93rem; }
.footer-cols a:hover { color: #fff; text-decoration: underline; }
.footer-note { font-size: 0.82rem; color: #a9a59c; margin: 22px 0 0; max-width: 64em; line-height: 1.5; }
.footer-note + .footer-note { margin-top: 8px; }
@media (max-width: 720px) { .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ───────── embed and print ───────── */
body.embed .site-header, body.embed .site-footer, body.embed .mast, body.embed .below, body.embed .crumbs, body.embed .netbar, body.embed .examples { display: none !important; }
body.embed { background: transparent; padding: 0; }
body.embed .wrap { padding: 0; }
body.embed .embed-credit { display: block; }
.embed-credit { display: none; font-size: 0.8rem; text-align: right; padding: 8px 6px 0; }

@media print {
  body { background: #fff; font-size: 12pt; }
  .site-header, .site-footer, .calc-in, .examples, .actions, .netbar, .whatif, .below, .view-tabs, .crumbs, .tool-form, .tool-share, .toast { display: none !important; }
  .calc, .tool { display: block; box-shadow: none; border: 0; }
  .calc-out, .tool-out { background: #fff; border: 0; padding: 0; }
  details.line > .line-why { display: block; }
  .mast { padding-top: 0; }
  a { color: inherit; text-decoration: none; }
}
