:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #152230;
  --muted: #607080;
  --line: #dbe2ea;
  --blue: #123a5a;
  --green: #0f4c3a;
  --accent: #16a34a;
  --warn: #b45309;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(247, 248, 250, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand,
.main-nav,
.trust-strip,
.checkbox-row,
.mini-stats {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  color: var(--blue);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--green);
  color: white;
}

.main-nav {
  gap: 18px;
  color: var(--muted);
  font-size: 0.94rem;
  flex-wrap: wrap;
}

.main-nav a:hover {
  color: var(--blue);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-tool {
  padding: 46px 0 24px;
}

.hero-copy,
.page-hero {
  max-width: 760px;
  margin-bottom: 22px;
}

.page-hero {
  padding: 52px 0 18px;
}

.page-hero.compact {
  max-width: 820px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: var(--blue);
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  line-height: 0.98;
}

.compact h1,
.state-hero h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
}

h2 {
  color: var(--blue);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: 18px;
  align-items: stretch;
}

.calc-panel,
.results-panel,
.content-card,
.method-preview,
.state-card,
.example-card,
.citation-card,
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calc-panel,
.results-panel,
.content-card,
.method-preview {
  padding: 22px;
}

.calc-panel h2 {
  margin-bottom: 16px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f5;
}

.segmented input {
  position: absolute;
  width: auto;
  min-height: 0;
  opacity: 0;
}

.segmented span {
  display: block;
  min-height: 38px;
  padding: 9px;
  border-radius: 6px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.segmented input:checked + span {
  background: white;
  color: var(--green);
  box-shadow: 0 1px 4px rgba(18, 58, 90, 0.14);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: 0;
}

input:focus,
select:focus {
  outline: 3px solid rgba(22, 163, 74, 0.18);
  border-color: var(--accent);
}

details {
  margin-top: 16px;
}

summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 800;
}

details .field-grid {
  margin-top: 14px;
}

.checkbox-row {
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.salary-field,
.hourly-field,
.bonus-field {
  display: none;
}

body[data-income-type="salary"] .salary-field,
body[data-income-type="hourly"] .hourly-field,
body[data-income-type="bonus"] .bonus-field {
  display: grid;
}

.ny-local,
.local-field {
  display: none;
}

body[data-state-code="NY"] .ny-local,
body[data-state-code="PA"] .local-field,
body[data-state-code="OH"] .local-field {
  display: flex;
}

body[data-state-code="PA"] .local-field,
body[data-state-code="OH"] .local-field {
  display: grid;
}

.results-panel {
  position: sticky;
  top: 84px;
  align-self: start;
  background: #fbfdfc;
}

.result-top {
  padding: 18px;
  border-radius: 8px;
  background: var(--green);
  color: white;
}

.result-top span,
.result-top small {
  display: block;
  color: rgba(255, 255, 255, 0.78);
}

.result-top strong {
  display: block;
  margin: 6px 0;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1;
}

.mini-stats {
  gap: 10px;
  margin: 12px 0;
}

.result-warning {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #f3c98b;
  border-radius: 8px;
  background: #fff8eb;
  color: var(--warn);
  font-size: 0.88rem;
}

.result-warning span {
  color: #79510b;
  line-height: 1.45;
}

.mini-stats div {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.mini-stats span,
.mini-stats strong {
  display: block;
}

.mini-stats span {
  color: var(--muted);
  font-size: 0.78rem;
}

.breakdown {
  display: grid;
  gap: 10px;
}

.break-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
}

.break-row span {
  color: var(--muted);
}

.break-row i {
  display: block;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #7ccf93);
}

.trust-note {
  margin: 14px 0 0;
  font-size: 0.84rem;
}

.trust-strip {
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0;
  padding: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--blue);
  font-weight: 800;
  font-size: 0.9rem;
}

.section {
  padding: 34px 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 18px;
}

.state-grid,
.example-grid,
.step-grid,
.content-grid,
.citation-grid {
  display: grid;
  gap: 14px;
}

.state-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.state-card,
.example-card,
.step,
.citation-card {
  padding: 16px;
}

.state-card span,
.example-card span,
.step span {
  color: var(--accent);
  font-weight: 900;
}

.state-card strong,
.state-card small,
.example-card strong,
.example-card small,
.citation-card strong,
.citation-card span {
  display: block;
}

.state-card strong,
.example-card strong {
  margin: 5px 0;
  color: var(--blue);
  font-size: 1.15rem;
}

small,
.citation-card span {
  color: var(--muted);
}

.step-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.step {
  min-height: 104px;
}

.example-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.method-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 34px 0;
}

.calculator-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.calculator-entry h2 {
  margin-bottom: 8px;
}

.calculator-entry p:last-child {
  margin-bottom: 0;
}

.priority-links {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.quick-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.quick-link-grid a {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.quick-link-grid strong {
  color: var(--blue);
}

.quick-link-grid span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.cta-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 7px;
  background: var(--blue);
  color: white;
  font-weight: 800;
  white-space: nowrap;
}

.secondary-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.status-pill {
  display: inline-flex;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid #b7d7c4;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--green);
  font-weight: 800;
}

.content-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  margin: 28px 0 14px;
}

.content-card.wide {
  margin: 18px 0;
}

.content-card li {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.5;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  font-size: 0.92rem;
}

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

th {
  color: var(--blue);
  background: #f2f6f8;
}

.policy-table td:first-child {
  width: 28%;
  color: var(--blue);
  font-weight: 800;
}

.citation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.citation-card strong {
  color: var(--blue);
}

.citation-card span {
  margin-top: 8px;
}

.link-list {
  display: grid;
  gap: 10px;
}

.link-list a {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--blue);
  font-weight: 800;
}

.link-list a:hover {
  border-color: #b7d7c4;
  background: #f4fbf7;
}

.cta-card {
  background: #fbfdfc;
}

.faq details {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.faq details + details {
  margin-top: 10px;
}

.faq p {
  margin: 12px 0 0;
}

.prose h2 {
  margin-top: 20px;
}

.timeline {
  display: grid;
  gap: 16px;
  padding-left: 22px;
}

.timeline li {
  color: var(--muted);
}

.timeline time,
.timeline strong,
.timeline span {
  display: block;
}

.timeline time {
  color: var(--green);
  font-weight: 800;
}

.timeline strong {
  margin: 4px 0;
  color: var(--blue);
}

.site-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 44px;
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-group {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-group span {
  color: var(--blue);
  font-weight: 900;
}

.footer-group a:hover {
  color: var(--blue);
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .calculator-shell,
  .content-grid,
  .priority-links {
    grid-template-columns: 1fr;
  }

  .results-panel {
    position: static;
  }

  .state-grid,
  .example-grid,
  .citation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  main {
    width: min(100% - 24px, 1180px);
  }

  .main-nav {
    gap: 12px;
    font-size: 0.84rem;
  }

  .calculator-shell {
    gap: 12px;
  }

  .calc-panel,
  .results-panel,
  .content-card,
  .method-preview {
    padding: 16px;
  }

  .field-grid,
  .state-grid,
  .example-grid,
  .citation-grid,
  .quick-link-grid,
  .step-grid {
    grid-template-columns: 1fr;
  }

  .method-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .calculator-entry {
    align-items: flex-start;
    flex-direction: column;
  }

  .cta-row {
    justify-content: flex-start;
  }

  .mini-stats {
    flex-direction: column;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}
