/* ======================================================
   Exact Take Home — design system
   Palette, typography, layout: contract §2
   ====================================================== */

/* Google Fonts loaded via <link> in HTML head — non-blocking */

:root {
  /* brand palette */
  --bg:      #F7F6F1;
  --ink:     #15161A;
  --muted:   #6B6B73;
  --border:  #E3E1D8;
  --card:    #FFFFFF;
  --accent:  #0F7A50;   /* take-home / net pay */
  --red:     #C2553D;   /* federal tax */
  --orange:  #D8924A;   /* social security */
  --yellow:  #C9A93A;   /* medicare (darkened for contrast on white) */
  --slate:   #5C7A8F;   /* state tax */
  --purple:  #8A6FA8;   /* local tax */
  --grey:    #9AA0A6;   /* pre-tax deductions */
  --warn-bg: #FFF8EC;
  --warn-bd: #E8C87A;
  --warn-ink:#7A5800;
  --blocked-bg: #FFF2F0;
  --blocked-bd: #E8B3AD;
  --blocked-ink:#8B3128;
  --ok-bg:   #EDF7F2;
  --ok-bd:   #96D4B4;
  --ok-ink:  #0F5C3A;

  /* type */
  --font-ui: 'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-num:'Newsreader', Georgia, serif;

  /* spacing */
  --radius:  8px;
  --radius-sm: 4px;
  --shadow:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.brand span { color: var(--accent); }

nav { display: flex; gap: 16px; flex-wrap: wrap; }

nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: color .15s;
}
nav a:hover, nav a.active { color: var(--ink); text-decoration: none; }

/* ── Page shell ── */
.shell {
  width: min(640px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.shell.wide {
  width: min(1080px, calc(100% - 32px));
}

/* ── Intro ── */
.intro { margin-bottom: 28px; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 6px;
}

.intro h1 {
  font-family: var(--font-num);
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 8px;
}

.intro p { color: var(--muted); max-width: 520px; }

/* ── Card / Panel ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Section heading inside card ── */
.card-section {
  padding: 20px 20px 0;
}
.card-section + .card-section { padding-top: 16px; }

.section-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Form grid ── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.field-row.thirds {
  grid-template-columns: 1fr 1fr 1fr;
}

.field-row.solo {
  grid-template-columns: 1fr;
}

/* ── Label + input ── */
label.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

label.field .label-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .02em;
}

/* dollar-prefix wrapper */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .prefix {
  position: absolute;
  left: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  pointer-events: none;
  user-select: none;
}

.input-wrap input { padding-left: 22px; }

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,122,80,.12);
}

input.salary-input {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 400;
  height: 50px;
}

.input-wrap .prefix.large { font-size: 17px; top: 50%; transform: translateY(-50%); left: 12px; }
.input-wrap.large input { padding-left: 26px; }

/* ── Segmented control (filing status) ── */
.seg-control {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}

.seg-control input[type="radio"] { display: none; }

.seg-control label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, color .12s;
  text-align: center;
  border-right: 1.5px solid var(--border);
  user-select: none;
}

.seg-control label:last-of-type { border-right: none; }

.seg-control input[type="radio"]:checked + label {
  background: var(--ink);
  color: #fff;
}

/* ── Range slider ── */
.slider-wrap { display: flex; align-items: center; gap: 10px; }

input[type="range"] {
  flex: 1;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
  background: transparent;
}

.slider-val {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  min-width: 38px;
  text-align: right;
}

/* ── Checkbox ── */
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  min-height: 32px;
}

.check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── Refine toggle ── */
.calc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.reset-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px 2px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s;
}
.reset-btn:hover { color: var(--ink); }

.refine-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, color .15s;
}

.refine-toggle:hover { border-color: var(--accent); color: var(--ink); }
.refine-toggle[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }

.refine-toggle .chevron {
  margin-left: auto;
  transition: transform .2s;
}

.refine-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.refine-panel {
  display: none;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  animation: slideDown .2s ease;
}

.refine-panel.open { display: block; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.field-note {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ── Notices ── */
.notice {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.notice.info {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

.notice.ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok-bd);
  color: var(--ok-ink);
}

.notice.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  color: var(--warn-ink);
}

.notice.blocked {
  background: var(--blocked-bg);
  border: 1px solid var(--blocked-bd);
  color: var(--blocked-ink);
}

.notice p + p { margin-top: 4px; }

.notice strong { font-weight: 700; }

/* ── State status banner ── */
.state-banner {
  margin: 0 20px 16px;
}

/* ── Result hero ── */
.result-hero {
  padding: 24px 20px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.result-hero-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.result-hero-amount {
  font-family: var(--font-num);
  font-size: clamp(40px, 10vw, 60px);
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.result-hero-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.result-hero-annual {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* ── Breakdown bar ── */
.breakdown-bar-wrap { padding: 16px 20px 0; }

.breakdown-bar {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  gap: 1px;
  background: var(--border);
}

.bar-seg {
  height: 100%;
  min-width: 0;
  transition: flex .25s ease;
  flex-shrink: 0;
}

.bar-seg:first-child { border-radius: 7px 0 0 7px; }
.bar-seg:last-child  { border-radius: 0 7px 7px 0; }

/* ── Line-item legend ── */
.legend { padding: 12px 20px 4px; }

.legend-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.legend-row:last-child { border-bottom: none; }

.legend-row.net {
  border-top: 2px solid var(--border);
  border-bottom: none;
  padding-top: 10px;
  margin-top: 4px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.legend-name {
  flex: 1;
  font-size: 13px;
  color: var(--muted);
}

.legend-row.net .legend-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.legend-per {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  min-width: 80px;
}

.legend-row.net .legend-per {
  font-size: 18px;
  color: var(--accent);
}

.legend-annual {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  min-width: 80px;
}

.legend-row.net .legend-annual { color: var(--accent); font-weight: 600; }

.legend-cols {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  padding: 6px 20px 8px;
  border-bottom: 1px solid var(--border);
}

.legend-col-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  min-width: 80px;
  text-align: right;
}

/* ── "How this is calculated" details ── */
.calc-details {
  border-top: 1px solid var(--border);
  margin: 0;
}

.calc-details summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  user-select: none;
  list-style: none;
  transition: color .15s;
}

.calc-details summary:hover { color: var(--ink); }
.calc-details summary::-webkit-details-marker { display: none; }

.calc-details[open] summary { color: var(--ink); border-bottom: 1px solid var(--border); }

.calc-details .chevron-sm {
  margin-left: auto;
  transition: transform .2s;
}

.calc-details[open] .chevron-sm { transform: rotate(180deg); }

.calc-body {
  padding: 16px 20px 20px;
}

.calc-step {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.calc-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.calc-step-body { flex: 1; }

.calc-step-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.calc-step-val {
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--accent);
  margin-left: 6px;
}

.calc-step-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.sources-list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.sources-list-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 8px;
}

.source-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.source-row a { font-size: 12px; color: var(--accent); }

.accuracy-row {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.accuracy-row strong { color: var(--ink); }

/* ── Limitations notice ── */
.limitations-notice {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* ── Empty / placeholder ── */
.result-placeholder {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}

.result-placeholder svg { opacity: .25; margin-bottom: 12px; }
.result-placeholder p { font-size: 14px; }

/* ── Status page table ── */
.status-table-wrap { overflow-x: auto; padding: 20px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

tr:last-child td { border-bottom: none; }

/* ── Pills ── */
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.pill-green  { background: var(--ok-bg);      color: var(--ok-ink);      border: 1px solid var(--ok-bd); }
.pill-yellow { background: var(--warn-bg);     color: var(--warn-ink);    border: 1px solid var(--warn-bd); }
.pill-red    { background: var(--blocked-bg);  color: var(--blocked-ink); border: 1px solid var(--blocked-bd); }
.pill-grey   { background: var(--bg);          color: var(--muted);       border: 1px solid var(--border); }

/* ── Methodology prose ── */
.prose { padding: 20px; }
.prose h2 { font-family: var(--font-num); font-size: 20px; font-weight: 600; margin: 24px 0 6px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--muted); line-height: 1.7; margin-bottom: 12px; }

/* ── Calc card inner layout ── */
.calc-inner { padding: 20px 20px 6px; }

.calc-group { margin-bottom: 16px; }
.calc-group:last-child { margin-bottom: 0; }

/* Detected-state badge next to State label */
.detected-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent);
  background: var(--ok-bg);
  border: 1px solid var(--ok-bd);
  border-radius: 999px;
  padding: 1px 7px;
  vertical-align: middle;
  margin-left: 4px;
}

/* State-specific section label inside refine panel */
.refine-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 14px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* W-4 advanced toggle inside refine panel */
.w4-details { margin-top: 14px; border-top: 1px solid var(--border); }

.w4-details > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  user-select: none;
  transition: color .15s;
}

.w4-details > summary:hover { color: var(--ink); }
.w4-details > summary::-webkit-details-marker { display: none; }
.w4-details[open] > summary { color: var(--ink); }
.w4-details[open] > summary .chevron { transform: rotate(180deg); }
.w4-details > summary .chevron { margin-left: auto; transition: transform .2s; }

.w4-body { padding-bottom: 4px; }

/* Result card */
.result-card { margin-top: 16px; overflow: hidden; }

/* Blocked / error notices above result card */
.blocked-msg { margin-top: 16px; }
.error-msg   { margin-top: 16px; }

/* Source list inside "how calculated" */
.source-list { list-style: none; margin: 8px 0 0; }
.source-list li { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.source-list a  { font-size: 12px; color: var(--accent); }
.source-date    { color: var(--muted); }

.methodology-link { margin-top: 12px; font-size: 13px; }
.limitation-box { background: var(--warn-bg); border: 1px solid var(--warn-bd); border-radius: var(--radius-sm); padding: 10px 14px; margin: 8px 0; font-size: 13px; color: var(--warn-ink); }
.limitation-box ul { padding-left: 16px; margin-top: 4px; }
.limitation-box li { margin-bottom: 2px; }

/* Utilities ── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.mt8  { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }

/* ── Compare toggle ── */
.compare-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, color .15s;
}

.compare-toggle:hover { border-color: var(--accent); color: var(--ink); }
.compare-toggle[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }

.compare-toggle .chevron {
  margin-left: auto;
  transition: transform .2s;
}

.compare-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

/* ── Compare section ── */
#compare-section { margin-top: 0; }

.compare-inputs-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin: 10px 0;
  flex-wrap: wrap;
}

.compare-state-field { flex: 0 0 220px; }

#compare-local-section { flex: 0 0 220px; }

/* ── Two-column comparison layout ── */
.compare-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.compare-col {
  padding: 18px 20px 16px;
}

.compare-col-right {
  border-left: 1px solid var(--border);
}

.compare-col-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 2px;
}

.compare-col-state {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}

/* Compact hero inside compare columns */
.result-hero-amount.compact {
  font-size: clamp(28px, 6vw, 40px);
  margin-bottom: 4px;
}

.result-hero-sub.compact {
  font-size: 12px;
  margin-bottom: 10px;
}

/* Compact breakdown bar (reuses .breakdown-bar, no change needed) */

/* Compact legend — no annual column */
.legend.compact .legend-annual { display: none; }

.legend.compact .legend-row { padding: 5px 0; }

.legend.compact .legend-per {
  font-size: 13px;
  min-width: 70px;
}

.legend.compact .legend-name { font-size: 12px; }

.legend.compact .legend-row.net .legend-per {
  font-size: 15px;
}

/* Compact limitations/blocked notice inside compare col */
.compare-notice {
  margin-top: 8px;
  font-size: 12px;
}

/* ── Delta summary line ── */
.delta-summary {
  margin-top: 12px;
  text-align: center;
  padding: 14px 20px;
  font-family: var(--font-num);
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 400;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
}

.delta-summary.saves {
  color: var(--accent);
  border-color: var(--ok-bd);
  background: var(--ok-bg);
}

.delta-summary.costs {
  color: var(--muted);
}

.delta-summary.same {
  color: var(--muted);
  font-size: 16px;
}

/* ── Phase 29: State SEO pages ── */
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--muted); text-decoration: underline; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { margin: 0 6px; }

.state-intro {
  margin-bottom: 32px;
}
.state-intro h1 {
  font-family: var(--font-num);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.2;
}
.state-intro .tagline {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}

.state-content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  margin: 32px 0;
}
.state-content-card h2 {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text);
}
.state-content-card p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 14px;
}
.state-content-card p:last-child { margin-bottom: 0; }

.key-facts {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.key-facts li {
  font-size: 14px;
  color: var(--text);
  padding: 5px 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.key-facts li::before {
  content: "·";
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.source-disclaimer {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-style: italic;
}
.source-ref {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.source-ref a { color: var(--muted); text-decoration: underline; }

.compare-links-section {
  margin: 24px 0;
}
.compare-links-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}
.compare-links-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.compare-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.compare-link:hover {
  border-color: var(--accent);
  background: var(--ok-bg);
  color: var(--accent);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  margin-top: 8px;
}
.back-link:hover { color: var(--accent); text-decoration: underline; }

/* "Calculate by state" grid on main page */
.state-grid-section {
  margin: 40px 0 0;
}
.state-grid-section h2 {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px;
}
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.state-grid-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  gap: 6px;
}
.state-grid-item:hover {
  border-color: var(--accent);
  background: var(--ok-bg);
  color: var(--accent);
}
.state-grid-item--soon {
  color: var(--muted);
  cursor: default;
}
.state-grid-item--soon:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--muted);
}
.state-grid-abbr {
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  min-width: 24px;
}
.state-grid-item:not(.state-grid-item--soon) .state-grid-abbr {
  color: var(--accent);
}

/* ── Phase 30: prose extensions (legal pages) ── */
.prose ul { padding-left: 24px; margin: 8px 0 16px; }
.prose li { color: var(--muted); line-height: 1.7; margin-bottom: 4px; }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }
/* Legal pages use var(--text) for body copy so dense legalese is fully readable */
.legal-prose p, .legal-prose li { color: var(--text); }

/* ── Tax disclaimer ── */
.tax-disclaimer {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin: 16px 0;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* ── Ad slot ── */
.ad-slot {
  margin: 20px 0;
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}
.ad-slot-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Trust badges ── */
.trust-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.trust-badge { font-size: 11px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 100px; padding: 3px 10px; white-space: nowrap; }

/* ── Returning visitor nudge ── */
.returning-nudge { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: var(--ink); }
.nudge-text { flex: 1; }
.nudge-dismiss { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 14px; padding: 2px 4px; line-height: 1; }
.nudge-dismiss:hover { color: var(--ink); }

/* ── Email capture ── */
.email-capture { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px 24px; margin: 20px 0; }
.email-capture-heading { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.email-capture-sub { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.email-capture-row { display: flex; gap: 8px; flex-wrap: wrap; }
.email-input { flex: 1; min-width: 200px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; background: var(--bg); color: var(--ink); }
.email-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.email-submit-btn { padding: 9px 18px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.email-submit-btn:hover { opacity: 0.9; }
.email-submit-btn:disabled { opacity: 0.5; cursor: default; }
.email-capture-privacy { font-size: 11px; color: var(--muted); margin: 10px 0 0; }
.email-capture-privacy a { color: var(--muted); text-decoration: underline; }
.email-capture-success { color: var(--accent); font-size: 14px; font-weight: 600; margin-top: 8px; }
.email-capture-error { color: #c0392b; font-size: 13px; margin-top: 8px; }

/* ── Lead magnet CTA ── */
.lead-magnet-cta { background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); border-radius: 8px; padding: 16px 20px; margin: 16px 0; }
.lead-magnet-title { font-size: 14px; font-weight: 700; margin: 0 0 4px; }
.lead-magnet-desc { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.lead-magnet-btn { display: inline-block; background: var(--accent); color: #fff; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none; }
.lead-magnet-btn:hover { opacity: 0.9; }

/* ── Inline CTA ── */
.cta-inline { font-size: 14px; margin: 12px 0; }
.cta-inline a { color: var(--accent); text-decoration: underline; }

/* ── Affiliate section ── */
.affiliate-list { list-style: none; padding: 0; margin: 12px 0; }
.affiliate-list li { margin-bottom: 10px; }
.affiliate-pending { color: var(--muted); cursor: default; }
.affiliate-pending-note { color: var(--muted); font-size: 13px; font-style: normal; }
.affiliate-disclosure { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.affiliate-cta { margin: 16px 0; }
.affiliate-cta a { color: var(--accent); text-decoration: underline; }

/* ── Site footer ── */
.site-footer {
  margin-top: 48px;
  padding: 20px 0 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.footer-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-links span { color: var(--border); font-size: 13px; }
.footer-copy { font-size: 12px; color: var(--muted); margin: 0; }

/* ── SEO Growth Engine — Phase 31 ── */

/* FAQ section (visible HTML on state, compare, salary, hourly pages) */
.faq-section { margin: 32px 0 0; }
.faq-section h2 {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--ink);
}
.faq-item {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
.faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-q {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}
.faq-a {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

/* Comparison table and salary breakdown table */
.seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0 24px;
}
.seo-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg);
  font-weight: 600;
  color: var(--ink);
  border-bottom: 2px solid var(--border);
  font-size: 13px;
}
.seo-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  vertical-align: top;
}
.seo-table tr:last-child td { border-bottom: none; }
.seo-table td:first-child { font-weight: 500; color: var(--ink); }
.seo-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* CTA box */
.cta-box {
  background: var(--ok-bg);
  border: 1px solid var(--ok-bd);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cta-box p {
  font-size: 15px;
  font-weight: 500;
  color: var(--ok-ink);
  margin: 0;
  flex: 1;
}
.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 20px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.cta-btn:hover { opacity: 0.88; text-decoration: none; }

/* Page intro (slim variant used on content pages) */
.intro.slim { margin-bottom: 20px; }
.intro.slim h1 {
  font-family: var(--font-num);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 6px 0 8px;
}
.intro.slim p { color: var(--muted); max-width: 600px; }

/* Related links section */
.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.related-links-label {
  width: 100%;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 2px;
}
.related-links a {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--ok-bd);
  border-radius: 6px;
  background: var(--ok-bg);
}
.related-links a:hover { text-decoration: underline; }

/* Gross-pay highlight used on salary and hourly pages */
.gross-highlight {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 16px 0 24px;
}
.gross-highlight-item {
  flex: 1;
  min-width: 120px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}
.gross-highlight-item .ghi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 4px;
}
.gross-highlight-item .ghi-value {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

/* ── Mobile responsive ── */
@media (max-width: 430px) {
  /* Abbreviate "Head of household" so it fits on one line in the segmented control */
  .seg-control label[for="fs-hoh"] { font-size: 0; }
  .seg-control label[for="fs-hoh"]::after { content: "HoH"; font-size: 13px; font-weight: 600; }
}

@media (max-width: 680px) {
  .site-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  nav { width: 100%; gap: 12px; }
  .shell { width: calc(100% - 24px); padding: 20px 0 48px; }

  .field-row       { grid-template-columns: 1fr; }
  .field-row.thirds{ grid-template-columns: 1fr; }

  .legend-annual { display: none; }
  .legend-col-header:last-child { display: none; }

  /* Compare: stack vertically on mobile */
  .compare-columns { grid-template-columns: 1fr; }
  .compare-col-right { border-left: none; border-top: 1px solid var(--border); }
  .compare-state-field { flex: 1 1 100%; }
  #compare-local-section { flex: 1 1 100%; }
}
