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

: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: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-num: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

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

  /* Phase 102 design system */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem;
  --text-lg: 1.125rem; --text-xl: 1.25rem; --text-2xl: 1.5rem;
  --text-3xl: 1.875rem; --text-4xl: 2.25rem; --text-5xl: 3rem;
  --fw-normal: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
  --color-bg: #FAFAFA; --color-surface: #FFFFFF; --color-surface-alt: #F4F4F5;
  --color-text: #111827; --color-text-2: #6B7280; --color-text-3: #9CA3AF;
  --color-accent: #0F4C81; --color-accent-hover: #0A3660;
  --color-accent-light: #EBF2FA;
  --color-result: #047857; --color-result-bg: #ECFDF5;
  --color-border: #E5E7EB; --color-border-focus: #0F4C81;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-card: 0 0 0 1px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.06);
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-pill: 9999px;
}

*, *::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; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform .15s;
}
.skip-link:focus { transform: translateY(0); }

/* ── 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; }

.update-banner {
  padding: 8px 16px;
  border-bottom: 1px solid var(--ok-bd);
  background: var(--ok-bg);
  color: var(--ok-ink);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  min-height: 44px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.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 {
  min-height: 400px;
  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 {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  background: var(--input-bg, #fff);
}

.input-wrap .prefix {
  color: #555;
  font-size: 1rem;
  font-weight: 500;
  margin-right: 2px;
  pointer-events: none;
  user-select: none;
  flex-shrink: 0;
}

.input-wrap input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  height: 44px;
  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);
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

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

.input-wrap .prefix.large { font-size: 17px; }
.input-wrap.large input { font-size: 17px; }

/* ── 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"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.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;
}

.seg-control input[type="radio"]:focus-visible + label {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

/* ── 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); }

.calculate-actions { padding: 0 20px 20px; }
.calculate-btn {
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
}
.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-notice {
  min-height: 62px;
  box-sizing: border-box;
}

#state-notice.hidden {
  display: block !important;
  visibility: hidden;
}

/* ── 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: 700;
  color: #16a34a;
  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; }

.data-updated-stamp {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 12px;
}

.breakdown-section {
  padding: 12px 20px 0;
}

.breakdown-toggle {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.breakdown-table-wrapper {
  margin-top: 10px;
  overflow-x: auto;
}

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

.breakdown-table th,
.breakdown-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 4px;
  text-align: left;
}

.breakdown-table th:nth-child(n+2),
.breakdown-table td:nth-child(n+2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.breakdown-footnote {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 0;
}

.feedback-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 20px 0;
  font-size: 13px;
  color: var(--muted);
}

.feedback-widget.thanks {
  color: var(--ink);
}

.feedback-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  min-width: 36px;
  min-height: 36px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.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 {
  min-height: 160px;
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}

#result-placeholder.result-placeholder {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.result-placeholder svg { opacity: .25; margin-bottom: 12px; }
.result-placeholder p { font-size: 14px; }
.result-placeholder.data-loading p::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -2px;
  animation: data-loading-spin .7s linear infinite;
}
@keyframes data-loading-spin { to { transform: rotate(360deg); } }

.data-loading {
  position: relative;
  min-height: 180px;
}
.data-loading p {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

/* ── 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: #eff6ff;            color: #1e40af;            border: 1px solid #bfdbfe; }
.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-form { min-height: 420px; }
.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 region — fixed-height container prevents layout shift when card swaps with placeholder */
.result-region {
  min-height: 240px;
  position: relative;
}

#affiliate-cta-slot {
  min-height: 80px;
}

/* cls-safe-hidden: invisible but stays in flow so page height doesn't collapse */
.cls-safe-hidden {
  visibility: hidden;
  position: static;
  pointer-events: none;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Result card */
.result-card { min-height: 180px; margin-top: 16px; overflow: hidden; contain: layout; }

/* 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); }

.result-trust {
  margin: 14px 20px 0;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.result-trust p { margin: 0; }
.result-trust a { color: var(--accent); }
.result-methodology-link {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.result-methodology-link a { color: var(--muted); }

.methodology-link { margin-top: 12px; font-size: 13px; }
.methodology-summary { margin: 0 0 14px; padding-left: 18px; }
.methodology-summary li { margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.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;
}

/* Reserve the first-calculation footprint without changing global .hidden. */
.compare-toggle.hidden {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}

.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; scroll-margin-top: 60px; }

.compare-inputs-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin: 10px 0 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; }
.state-content-card p a { text-decoration: underline; }

.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); }

/* ── Tool cards (/tools/ page) ── */
.tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; }
.tool-card h3 { font-size: 16px; margin-bottom: 4px; }
.tool-card p { font-size: 14px; color: var(--muted); margin: 0; }
.tool-icon { font-size: 24px; margin-bottom: 8px; }

/* ── Contact form ── */
.contact-form { margin-top: 20px; }
.contact-form .form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.contact-form label { font-size: 14px; font-weight: 500; color: var(--text); }
.contact-form input, .contact-form textarea { padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 16px; font-family: inherit; width: 100%; box-sizing: border-box; }
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn-primary { display: inline-block; padding: 10px 22px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { opacity: 0.88; }
.form-privacy-note { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* ── 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-placeholder {
  display: none;
  min-height: 90px;
  width: 100%;
  background: transparent;
}

.ad-placeholder:empty {
  display: none !important;
  min-height: 0 !important;
}

.affiliate-slot {
  display: none;
}

/* Pre-reserve ad slot heights to prevent CLS from future ad injection */
.ad-slot-below-result {
  min-height: 90px;
  width: 100%;
}
.ad-slot-mid-article {
  min-height: 250px;
  width: 100%;
}
.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(--ok-ink); 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; }
.verification-block { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.verification-block p { margin: 2px 0; }
.verification-block a { color: var(--accent); }

/* ── 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); min-height: 48px; }
/* CLS fix: reserve layout slot so revealing nudge never shifts content */
#returning-nudge.hidden {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
  border-color: transparent;
  background: transparent;
}
.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: 16px; 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; padding: 16px 20px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; min-height: 60px; }
.affiliate-label { margin: 0 0 10px; color: var(--ink); font-size: 14px; font-weight: 600; }
.affiliate-btn { display: inline-block; padding: 8px 14px; color: var(--accent); border: 1px solid var(--ok-bd); border-radius: 7px; background: var(--ok-bg); font-size: 14px; font-weight: 600; text-decoration: none; }
.affiliate-btn:hover { text-decoration: underline; }
.affiliate-cta .affiliate-disclosure { margin: 9px 0 0; }

/* ── Employer and savings CTAs ── */
.employer-cta, .savings-cta { margin: 20px 0; padding: 16px 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.employer-cta p, .savings-cta p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.employer-cta a { color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; }
.employer-cta a:hover { text-decoration: underline; }

.email-capture .form-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.email-capture > p:first-child { margin-top: 0; font-weight: 600; }
.email-capture form { display: flex; gap: 8px; flex-wrap: wrap; }
.email-capture form input { flex: 1; min-width: 200px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 16px; }
.email-capture form button { padding: 9px 18px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; font-size: 14px; font-weight: 600; }

/* ── 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; }

.last-verified {
  margin: 20px auto 0;
  padding: 0 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* ── 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; }

.compare-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0 12px;
}
.compare-table th, .compare-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}
.compare-table th { background: var(--bg); font-size: 13px; }
.compare-table th:first-child, .compare-table td:first-child { text-align: left; }
.compare-table .winner { background: var(--ok-bg); color: var(--ok-ink); font-weight: 600; }
.compare-table .positive { color: var(--accent); font-weight: 700; }
.compare-table .negative { color: #b42318; font-weight: 700; }
.compare-table .neutral { color: var(--muted); }
.compare-summary { margin: 0 0 24px; color: var(--muted); font-size: 14px; }

.state-quick-facts dl {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 8px 16px;
  margin: 0;
}
.state-quick-facts dt { font-weight: 600; color: var(--ink); }
.state-quick-facts dd { margin: 0; color: var(--muted); }
.state-quick-facts dd a { text-decoration: underline; }
.table-note { color: var(--muted); font-size: 13px; }

.state-footer-links { margin: 18px 0; color: var(--muted); font-size: 13px; }
.state-footer-links p { margin: 0; }
.state-footer-links a { color: var(--accent); }

.state-guide-fallback {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid var(--ok-bd);
  border-radius: var(--radius);
  background: var(--ok-bg);
  font-weight: 700;
}

/* 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; }
.related-articles {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.related-articles h3 { margin: 0 0 8px; }
.related-articles ul { margin: 0; padding-left: 20px; }
.related-articles li { margin: 6px 0; }
.related-articles a { color: var(--accent); }

/* 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);
}

@media print {
  nav, footer, .trust-badges, .ad-slot, .ad-placeholder,
  .state-grid, .compare-toggle, .refine-panel, .update-banner,
  .skip-link, .affiliate-cta, .affiliate-slot, .related-articles,
  .cta-box, .verification-block, .result-methodology-link { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .result-card { border: 1px solid #000; break-inside: avoid; }
  .card { box-shadow: none; }
  a[href]::after { content: none; }
}

/* ── Phase 98: Homepage conversion sections ── */
.homepage-section { margin-top: 32px; }
.homepage-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 12px; }
.popular-states { display: flex; flex-wrap: wrap; gap: 8px; }
.popular-states a { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.popular-states a:hover { border-color: var(--accent); background: var(--ok-bg); text-decoration: none; }
.hub-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hub-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; display: block; transition: border-color .15s; }
.hub-card:hover { border-color: var(--accent); text-decoration: none; }
.hub-card-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.hub-card-desc { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }
.compare-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.compare-pills a { display: inline-block; padding: 5px 11px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--muted); font-weight: 500; text-decoration: none; transition: border-color .15s, color .15s; }
.compare-pills a:hover { border-color: var(--accent); color: var(--ink); text-decoration: none; }
.blog-preview-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.blog-preview-list li { border-bottom: 1px solid var(--border); }
.blog-preview-list li:last-child { border-bottom: none; }
.blog-preview-list a { display: block; padding: 12px 0; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
.blog-preview-list a:hover { color: var(--accent); text-decoration: none; }
.blog-preview-list .preview-desc { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.see-also-line { font-size: 13px; color: var(--muted); margin-top: 24px; text-align: center; }
.see-also-line a { color: var(--accent); }

/* ── Phase 101: Salary page quick-answer table ── */
.quick-answer { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1.25rem 1.5rem; margin-bottom: 2rem; }
.answer-table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; font-size: 0.95rem; }
.answer-table th { text-align: left; padding: 0.5rem 0.75rem; background: #edf2f7; font-weight: 600; }
.answer-table td { padding: 0.5rem 0.75rem; border-top: 1px solid #e2e8f0; }
.answer-note { font-size: 0.85rem; color: #64748b; margin: 0.5rem 0 0; }

/* ── Phase 101: Popular salary/state pills (homepage + hub pages) ── */
.popular-questions { margin-bottom: 28px; }
.popular-questions h2 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.salary-pills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 8px; }
.salary-pills li a { display: inline-block; padding: 6px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.salary-pills li a:hover { border-color: var(--accent); background: var(--ok-bg); text-decoration: none; }
.popular-questions > p { font-size: 13px; color: var(--muted); }
.popular-questions > p a { color: var(--accent); }

/* ── Phase 102: Premium design ── */
#calc-card {
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
#calc-card input[type="text"],
#calc-card select {
  min-height: 48px;
}
#calc-card input[type="text"]:focus,
#calc-card select:focus {
  box-shadow: 0 0 0 3px rgb(15 76 129 / 0.12);
  outline: none;
  border-color: var(--color-border-focus);
}
.calculate-btn {
  min-height: 52px;
}
@media (max-width: 680px) {
  .calculate-actions { position: sticky; bottom: 1rem; z-index: 1; }
}

/* B1/B2: result card extras */
.result-keep-pct {
  font-size: 0.9rem;
  color: var(--color-text-secondary, #6b7280);
  margin-top: 0.25rem;
  font-style: italic;
}
.email-result-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--color-text-secondary, #6b7280);
  text-decoration: none;
  margin-top: 0.5rem;
  margin-left: 0.75rem;
}
.email-result-link:hover { text-decoration: underline; }

/* Result display */
.result-hero-amount {
  font-size: var(--text-5xl);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #16a34a;
  letter-spacing: 0;
}
@media (max-width: 680px) {
  .result-hero-amount { font-size: var(--text-4xl); }
}
.result-card.visible {
  animation: resultReveal 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes resultReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.legend-col-header,
.legend td:not(:first-child),
.result-hero-annual {
  font-variant-numeric: tabular-nums;
}

/* Typography B4 */
.intro h1, .state-intro h1 {
  letter-spacing: -0.02em;
}
.answer-table th {
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.salary-pills li a {
  border-radius: var(--radius-pill);
  background: var(--color-accent-light, #EBF2FA);
}

/* Accessibility B5 */
*:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
*:focus:not(:focus-visible) { outline: none; }

/* No-income-tax banner B6 */
.no-tax-banner {
  background: var(--color-result-bg, #ECFDF5);
  border: 1px solid var(--ok-bd);
  border-radius: var(--radius-md, 10px);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--ok-ink);
}

/* Phase 102: Rankings page */
.rankings-table { width: 100%; border-collapse: collapse; }
.rankings-table th { text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--border); font-size: 13px; font-weight: 700; }
.rankings-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.rankings-table tr:hover td { background: var(--ok-bg); }
.rank-num { color: var(--muted); font-size: 13px; }
.rank-positive { color: var(--ok-ink); }
.rank-negative { color: var(--red); }

/* ── Phase 104: Internal linking sections ── */
.related-comparisons, .related-salaries, .related-states {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--color-surface, #fafafa);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
}
.related-comparisons h2, .related-salaries h2, .related-states h2 { font-size: 1rem; margin-bottom: 0.75rem; }
.compare-links, .salary-links, .state-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; }
.compare-links li a, .salary-links li a, .state-links li a { font-size: 0.875rem; color: var(--color-accent, #0F7A50); text-decoration: underline; text-underline-offset: 2px; }

/* ── Phase 104: New state quick facts ── */
section.state-quick-facts {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--color-result-bg, #ECFDF5);
  border: 1px solid var(--ok-bd);
  border-radius: var(--radius-md, 10px);
}
section.state-quick-facts h2 { font-size: 1rem; margin-bottom: 0.75rem; }
.quick-facts-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.quick-facts-table th { text-align: left; padding: 6px 8px; font-weight: 600; color: var(--color-text-primary, #111827); border-bottom: 1px solid var(--ok-bd); width: 55%; }
.quick-facts-table td { padding: 6px 8px; border-bottom: 1px solid var(--ok-bd); font-variant-numeric: tabular-nums; }
.quick-facts-table tr:last-child th, .quick-facts-table tr:last-child td { border-bottom: none; }

/* ── Phase 104: Accuracy commitment ── */
.accuracy-commitment { margin: 2rem 0; }
.commitment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.commitment-item {
  padding: 1rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  background: var(--color-surface, #fafafa);
}
.commitment-item strong { display: block; margin-bottom: 0.5rem; color: var(--color-text-primary, #111827); }

/* ── Phase 104: Copy result button ── */
.copy-result-btn {
  background: none;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 0.75rem;
  color: var(--color-text-secondary, #6b7280);
  display: block;
}
.copy-result-btn:hover { background: var(--color-surface, #fafafa); }

/* ── Phase 104: Result source footnote ── */
.result-source-footnote {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ── 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%; }
  .state-quick-facts dl { grid-template-columns: 1fr; gap: 4px; }
  .state-quick-facts dd { margin-bottom: 6px; }
}

/* ── Phase 106: Methodology page upgrades ── */
.methodology-sources { margin: 2rem 0; }
.sources-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 1rem; }
.sources-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: var(--color-result-bg, #f0fdf4);
  border-bottom: 2px solid var(--color-border, #e5e7eb);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sources-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  vertical-align: top;
}
.sources-table a { color: var(--color-link, #15803d); }

.methodology-decisions { margin: 2rem 0; }
.decision-item {
  border-left: 3px solid var(--color-accent, #15803d);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: var(--color-surface, #fafafa);
}
.decision-item h3 {
  font-size: 0.95rem;
  margin: 0 0 0.4rem 0;
  color: var(--color-text-primary, #111827);
}

/* ── Phase 106: Effective Tax Rate data asset page ── */
.eff-rate-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin-top: 1rem; }
.eff-rate-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: var(--color-result-bg, #f0fdf4);
  border-bottom: 2px solid var(--color-border, #e5e7eb);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.eff-rate-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.eff-rate-table tr:nth-child(even) { background: #fafafa; }
.eff-rate-table a { color: var(--color-link, #15803d); }
.data-asset-intro { margin-bottom: 1.5rem; }
.data-asset-intro p { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }
.data-asset-list { list-style: none; padding: 0; margin: 1.5rem 0; }
.data-asset-list li {
  padding: 1rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  margin-bottom: 1rem;
}
.data-asset-list li a { color: var(--color-link, #15803d); text-decoration: none; }
.data-asset-list li a:hover { text-decoration: underline; }
.data-asset-list li p {
  margin: 0.4rem 0 0 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary, #6b7280);
}
