/* Paycheck State Calc — Editorial Financial Ledger UI (2026) */
:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-alt: #eef2ee;
  --ink: #0f211a;
  --ink-2: #0f211a;
  --muted: #4b6157;
  --line: #d4ddd7;
  --line-strong: #d4ddd7;
  --accent: #0b6647;
  --accent-dark: #084f37;
  --accent-soft: #e6f4ee;
  --accent-line: #0b6647;
  --warn: #7c4a03;
  --warn-bg: #fdf6e7;
  --warn-line: #7c4a03;
  --neg: #7c4a03;
  --bar-net: #0b6647;
  --bar-fed: #1d4ed8;
  --bar-fica: #084f37;
  --bar-state: #b45309;
  --bar-pre: #1d4ed8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 2px 10px rgba(15, 33, 26, 0.05), 0 1px 2px rgba(15, 33, 26, 0.04);
  --shadow-focus: 0 0 0 3px var(--accent-soft);
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

::selection { background: var(--accent-soft); color: var(--ink); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  caret-color: var(--accent);
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
a:hover { color: var(--accent-dark); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
main > section:not(.wrap) { max-width: 1080px; margin: 28px auto 0; padding: 0 24px; }

/* Header */
header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.hdr-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
header.site a.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
header.site .brand-mark { flex-shrink: 0; }
header.site nav {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
header.site nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  transition: background-color 0.14s ease, color 0.14s ease;
}
header.site nav a:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

/* Main Typography */
main { padding: 34px 0 72px; }

h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: var(--ink);
  text-wrap: balance;
}
h1 .yr {
  color: var(--accent);
  font-weight: 800;
}
h2 {
  font-size: clamp(1.22rem, 2vw, 1.48rem);
  font-weight: 700;
  margin: 46px 0 14px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}
h3 {
  font-size: 1.06rem;
  font-weight: 700;
  margin: 26px 0 8px;
  color: var(--ink);
}
p { margin: 0 0 14px; max-width: 74ch; }
.lede {
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 70ch;
  margin-bottom: 18px;
}
.answer {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--ink);
  font-size: 0.96rem;
  max-width: none;
  margin: 14px 0 22px;
}

/* Verified Meta Line */
.meta-bar, .annual-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0 0 14px;
}
.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

/* Primary Calculator Shell */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin: 18px 0 28px;
}
.calc {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.08fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 820px) {
  .calc { grid-template-columns: 1fr; gap: 22px; }
}

.calc-inputs { min-width: 0; }
.calc-output {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  min-width: 0;
}

/* Inputs & Controls */
label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-2);
  margin: 13px 0 5px;
}
label:first-child { margin-top: 0; }
input[type="number"], input[type="text"], input[type="search"], select {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 500;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
  font-variant-numeric: tabular-nums;
}
input:hover, select:hover { border-color: var(--accent); }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 6px;
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* Segmented Mode Control */
.seg {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.seg button {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] {
  background: var(--accent);
  color: #ffffff;
}

/* Quick Presets */
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.preset-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}
.preset-btn:hover, .preset-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

/* Mode visibility */
.mode-panel { display: none; }
.mode-panel.on { display: block; }
#salary-fields, #percheck-fields, #hourly-fields { display: none; }
#salary-fields.on, #percheck-fields.on, #hourly-fields.on { display: block !important; }
.state-fields { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.state-fields.on { display: block !important; }

details.adv {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
details.adv summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  list-style: none;
  padding: 4px 0;
}
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::before { content: "+ "; }
details.adv[open] summary::before { content: "2 "; }

/* Results Panel */
.results { position: relative; }
.results h2 {
  margin: 0 0 4px;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.net {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 4vw, 2.55rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.net-note {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 4px 0 14px;
}

/* Period Summary Strip */
.period-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 16px;
}
.period-tile {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
}
.period-tile .pk {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.period-tile .pv {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2px;
}

/* Interactive Stacked Proportion Bar */
.alloc-wrap { margin: 0 0 16px; }
.alloc-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
  gap: 1.5px;
}
.alloc-seg {
  height: 100%;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.alloc-seg.net-s { background: var(--bar-net); }
.alloc-seg.fed-s { background: var(--bar-fed); }
.alloc-seg.fica-s { background: var(--bar-fica); }
.alloc-seg.st-s { background: var(--bar-state); }
.alloc-seg.pre-s { background: var(--bar-pre); }
.alloc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--ink-2);
}
.alloc-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.alloc-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
}

/* Pay Stub Lines Table */
table.lines {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
table.lines td, table.lines th {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
table.lines th {
  background: var(--surface-alt);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: left;
}
table.lines th:last-child, table.lines td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
table.lines tr:last-child td { border-bottom: 0; }
table.lines tr.total td, table.lines tr.net td {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  border-top: 2px solid var(--accent-line);
}
table.lines tr.muted td { color: var(--muted); }
table.lines td .sub {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.77rem;
  color: var(--muted);
  font-weight: 400;
}

.annual { margin-top: 12px; font-size: 0.85rem; color: var(--muted); }
.annual strong { color: var(--ink); font-family: var(--font-mono); }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}
.action-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}
.action-link:hover { background: var(--accent-dark); color: #ffffff; }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  cursor: pointer;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.action-btn.copied { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }

/* Employer Cost Panel */
.emp-block {
  margin-top: 18px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 12px;
}
.emp-block button.toggle {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
}
.emp-panel { display: none; margin-top: 10px; }
.emp-panel.on { display: block; }

/* Callouts & Notices (no thick colored border-left!) */
.note {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin: 14px 0;
  max-width: none;
}
.note strong { color: var(--warn); }

.sources {
  margin-top: 16px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
}
.sources b { color: var(--ink); font-weight: 700; }

/* Key Facts Strip */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 22px;
}
.stat-grid.cols4, .stat-grid.data-stat-grid { grid-template-columns: repeat(4, 1fr); }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.stat .k {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat .v {
  font-family: var(--font-mono);
  font-size: 1.32rem;
  font-weight: 600;
  color: var(--ink);
  margin: 4px 0 2px;
}

/* Data Tables */
.tbl-wrap { overflow-x: auto; margin: 10px 0 22px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0;
  background: #ffffff;
}
table.data th, table.data td {
  border-bottom: 1px solid var(--line);
  padding: 10px 13px;
  text-align: left;
  vertical-align: top;
}
table.data tr:last-child td { border-bottom: 0; }
table.data th {
  background: var(--surface-alt);
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
table.data td.num, table.data th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.data tbody tr:hover { background: var(--bg); }

/* State Hub Grid & Filters */
.hub-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 16px;
}
.hub-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.hub-pill {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink-2);
  cursor: pointer;
}
.hub-pill:hover { border-color: var(--accent); color: var(--accent-dark); }
.hub-pill.active { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.hub-search { max-width: 260px; }

.states {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.states a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}
.states a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}
.states a .st-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.states a strong { font-size: 0.98rem; color: var(--ink); }
.states a .st-rate {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.states a span.st-sub, .states a span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Cross-Link Bar */
.peer-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin: 14px 0 24px;
}
.peer-links a {
  display: block;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
}
.peer-links a span {
  display: block;
  font-size: 0.79rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}
.peer-links a:hover { border-color: var(--accent); background: var(--accent-soft); }

/* FAQ Accordion / List */
.faq { margin: 14px 0 26px; }
.faq dt {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  margin: 18px 0 5px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.faq dt:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.faq dd { margin: 0 0 6px; color: var(--ink-2); max-width: 76ch; }

/* Related / Citation / 1099 / Legacy Compatibility */
.related { list-style: none; padding: 0; margin: 14px 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.related li { margin: 0; }
.related a { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px 15px; text-decoration: none; color: var(--ink); background: #ffffff; font-weight: 600; font-size: 0.92rem; }
.related a:hover { border-color: var(--accent); background: var(--accent-soft); }

.not-included { margin: 16px 0 24px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: #ffffff; font-size: 0.92rem; }
.not-included ul { margin: 6px 0 0; padding-left: 18px; }

.cite-row { margin: 14px 0; }
.cite-label { display: block; font-size: 0.76rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.citeblock { position: relative; background: #ffffff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 46px; font-size: 0.87rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.citeblock pre { margin: 0; font: inherit; white-space: pre-wrap; word-break: break-word; }
.citeblock .copybtn { position: absolute; right: 10px; bottom: 10px; }
.copybtn { font: inherit; font-size: 0.82rem; font-weight: 600; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: #ffffff; color: var(--ink); cursor: pointer; }
.copybtn:hover { border-color: var(--accent); color: var(--accent-dark); }
.copybtn.copied { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.share a, .share button { font-size: 0.85rem; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: #ffffff; color: var(--ink); text-decoration: none; cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--accent); }
.embednote { font-size: 0.85rem; color: var(--muted); margin: 6px 0 0; }
.embedcode { width: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.85rem; line-height: 1.45; resize: vertical; min-height: 96px; }

.btn, .c99 button[type="submit"], .c99 button[type="button"], #c99go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  border-radius: 9px;
  cursor: pointer;
  margin-top: 8px;
}
.btn:hover, .c99 button[type="submit"]:hover, .c99 button[type="button"]:hover, #c99go:hover { background: var(--accent-dark); }
#t7clr { background: #ffffff; color: var(--ink); border: 1px solid var(--line-strong); margin-left: 8px; }
#t7clr:hover { border-color: var(--accent); background: var(--accent-soft); }

.c99 fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0 0 12px; background: #ffffff; }
.c99 legend { font-weight: 700; padding: 0 6px; color: var(--ink); }
.c99 label { display: block; margin: 7px 0; cursor: pointer; font-weight: 400; color: var(--ink); font-size: 0.94rem; }
.c99 input[type="number"], .c99 input[type="date"], .c99 textarea { max-width: 340px; }
.c99 textarea { max-width: 100%; min-height: 110px; font-family: var(--font-mono); font-size: 0.88rem; padding: 10px; border: 1px solid var(--line-strong); border-radius: 9px; }
.c99 .res { border: 1.5px solid var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 15px; margin: 14px 0; }
.sub { font-size: 0.88rem; margin: 0 0 14px; color: var(--muted); }
.disc { font-size: 0.85rem; }
.src { font-size: 0.85rem; color: var(--muted); }
table.t99 { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 0.92rem; background: #ffffff; }
table.t99 td, table.t99 th { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
table.t99 th { background: var(--surface-alt); font-weight: 700; }
.mut { color: var(--muted); font-size: 0.87rem; }

.crumb { font-size: 0.84rem; color: var(--muted); margin: 0 0 14px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); text-decoration: underline; }
.datameta { font-size: 0.85rem; color: var(--muted); margin: 6px 0 0; }
.figure { margin: 18px 0 26px; }
.figure img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; background: #ffffff; }
.figure figcaption { font-size: 0.84rem; color: var(--muted); margin-top: 8px; }
.dlgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.dlgrid a { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--ink); background: #ffffff; }
.dlgrid a span { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 3px; }
.dlgrid a:hover { border-color: var(--accent); }
.citebox { background: #ffffff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 0.86rem; white-space: pre-wrap; word-break: break-word; }
ol.srcs { padding-left: 22px; font-size: 0.92rem; line-height: 1.55; }
ol.srcs li { margin: 7px 0; }
code { overflow-wrap: anywhere; word-break: break-word; font-family: var(--font-mono); font-size: 0.86em; background: var(--surface-alt); padding: 1px 5px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Footer */
footer.site {
  border-top: 1px solid var(--line);
  background: #ffffff;
  padding: 40px 0 32px;
  font-size: 0.85rem;
  color: var(--muted);
}
.ft-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 0.9fr;
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.ft-head {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.86rem;
  margin-bottom: 10px;
}
.ft-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ft-links.cols2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}
footer.site a {
  color: var(--muted);
  text-decoration: none;
}
footer.site a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}
.ft-bottom {
  padding-top: 18px;
}
.ft-bottom p { max-width: none; margin: 0 0 6px; }
.ft-meta { font-size: 0.8rem; color: var(--muted); }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 900px) {
  .ft-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid.cols4, .stat-grid.data-stat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .wrap, main > section:not(.wrap) { padding: 0 16px; }
  .card { padding: 16px; }
  .calc-output { padding: 15px; }
  .row2, .row3, .stat-grid, .stat-grid.cols4, .stat-grid.data-stat-grid, .period-strip, .ft-grid { grid-template-columns: 1fr; }
  header.site nav { margin-left: 0; gap: 4px; }
  header.site nav a { padding: 5px 8px; font-size: 0.84rem; }
  .hub-search { max-width: 100%; width: 100%; }
  .btn, .c99 button[type="submit"], #c99go { width: 100%; }
}
