:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --ink: #173126;
  --muted: #587064;
  --line: #cdd7d0;
  --brand: #176b52;
  --brand-strong: #134c3c;
  --brand-soft: #ddede4;
  --accent: #c7653a;
  --accent-soft: #fae9df;
  --focus: #2277cc;
  --shadow: 0 12px 28px rgba(23, 49, 38, .08);
  --radius: 6px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1412;
  --surface: #141d1a;
  --surface-2: #1b2723;
  --ink: #edf4f0;
  --muted: #a9b6b1;
  --line: #33413c;
  --brand: #58c6a5;
  --brand-strong: #9be2cc;
  --brand-soft: #17372e;
  --accent: #ff9b71;
  --accent-soft: #42251d;
  --focus: #79b8ff;
  --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.65; }
a { color: inherit; }
img, svg { display: block; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 70%, transparent); outline-offset: 3px; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; background: var(--ink); color: var(--surface); padding: 10px 14px; }
.skip-link:focus { top: 12px; }
.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); }
.header-inner { width: min(1180px, calc(100% - 40px)); min-height: 72px; margin: auto; display: flex; align-items: center; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: var(--brand-strong); color: #fff; border-radius: 5px; font-size: 14px; }
.brand-copy { line-height: 1.05; }
.brand-copy small { display: block; color: var(--muted); font-size: 10px; font-weight: 650; margin-top: 5px; }
.desktop-nav { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.desktop-nav a { color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.desktop-nav a:hover, .desktop-nav a[aria-current="page"] { color: var(--brand); }
.header-actions { display: flex; gap: 6px; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 5px; display: grid; place-items: center; cursor: pointer; }
.icon-button svg { width: 20px; height: 20px; }
.menu-button { display: none; }
.mobile-nav { display: none; }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.page-grid { display: grid; grid-template-columns: minmax(0, 840px) 300px; gap: 40px; align-items: start; }
.hero { padding: 58px 0 34px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--brand); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
h1, h2, h3 { line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
h1, h2 { font-family: Newsreader, Georgia, serif; }
h1 { max-width: 820px; font-size: 58px; font-weight: 700; }
h2 { font-size: 28px; }
h3 { font-size: 18px; }
.hero p { max-width: 730px; color: var(--muted); font-size: 18px; margin: 18px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid var(--brand-strong); border-radius: 5px; background: var(--brand-strong); color: #fff; text-decoration: none; font-weight: 800; cursor: pointer; }
.button.secondary { background: transparent; color: var(--brand-strong); }
.section { padding: 50px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.section-heading p { color: var(--muted); margin: 5px 0 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.calculator { padding: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; }
.field label, .field legend { color: var(--muted); font-size: 13px; font-weight: 800; }
.field input, .field select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--ink); padding: 0 13px; }
.field-help { color: var(--muted); font-size: 12px; line-height: 1.45; }
.field-help a { color: var(--brand-strong); font-weight: 800; }
.field.full, .form-submit { grid-column: 1 / -1; }
.form-submit { margin-top: 4px; }
.form-submit .button { width: 100%; }
.result-panel { margin-top: 20px; padding: 26px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); border-radius: var(--radius); }
.status-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: var(--surface); color: var(--brand-strong); font-size: 12px; font-weight: 800; }
.status-pill[data-tone="danger"] { background: var(--accent-soft); color: var(--accent); }
.result-total { margin: 12px 0 4px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 48px; font-weight: 600; line-height: 1; }
.result-sub { color: var(--muted); }
.rule-status { margin: 18px 0 0; padding: 12px 14px; border-left: 3px solid var(--brand); background: color-mix(in srgb, var(--surface) 72%, transparent); color: var(--muted); font-size: 13px; }
.rule-status strong { color: var(--ink); }
.result-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 24px; background: var(--line); border: 1px solid var(--line); }
.metric { min-width: 0; padding: 16px; background: var(--surface); }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.cliff-chart { height: 230px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; margin-top: 28px; padding-top: 34px; border-bottom: 1px solid var(--line); }
.chart-column { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; text-align: center; }
.chart-bar { min-height: 4px; background: var(--brand); border-radius: 4px 4px 0 0; }
.chart-bar.warning { background: var(--accent); }
.chart-bar.danger { background: #a52d23; }
.chart-value { font-size: 12px; font-weight: 800; margin-bottom: 4px; }
.chart-column span { min-height: 42px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.sidebar { display: grid; gap: 18px; }
.sidebar-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.sidebar-card h3 { margin-bottom: 10px; }
.sidebar-card p, .sidebar-card li { color: var(--muted); font-size: 14px; }
.sidebar-card ul { padding-left: 18px; margin: 0; }
.related-link-list { display: grid; gap: 8px; }
.related-link-list a { color: var(--brand-strong); font-size: 14px; font-weight: 800; }
.source-list { list-style: none; padding: 0; margin: 0; }
.source-list li + li { border-top: 1px solid var(--line); }
.source-list a { display: block; padding: 10px 0; color: var(--brand); font-size: 13px; font-weight: 750; text-decoration: none; }
.data-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: var(--line); gap: 1px; }
.data-point { min-width: 0; background: var(--surface); padding: 22px; }
.data-point strong { display: block; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 26px; }
.data-point span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.content-card { min-height: 220px; display: flex; flex-direction: column; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.content-card:hover { border-color: var(--brand); }
.content-card .kicker { color: var(--brand); font-size: 12px; font-weight: 800; }
.content-card h3 { margin-top: 12px; }
.content-card p { color: var(--muted); font-size: 14px; }
.content-card .arrow { color: var(--brand); font-weight: 800; margin-top: auto; }
.article { padding: 42px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.breadcrumbs { padding: 18px 0; color: var(--muted); font-size: 13px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.article h1 { font-size: 48px; }
.article-lead { color: var(--muted); font-size: 19px; }
.answer-box { margin: 28px 0; padding: 20px; border-left: 4px solid var(--accent); background: var(--accent-soft); }
.article-section { padding-top: 32px; margin-top: 32px; border-top: 1px solid var(--line); }
.article-section h2 { margin-bottom: 14px; }
.article-section p, .article-section li { color: var(--muted); }
.article-section table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.article-section th, .article-section td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }
.article-section th { color: var(--ink); background: var(--surface-2); }
.notice { padding: 16px; background: var(--brand-soft); border: 1px solid var(--line); }
.source-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
.source-table th, .source-table td { padding: 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.source-table th { background: var(--surface-2); }
.source-table a { color: var(--brand); font-weight: 700; }
.site-footer { margin-top: 70px; padding: 44px 0; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
.footer-grid h3 { font-size: 14px; }
.footer-grid a, .footer-grid p { display: block; margin: 8px 0; color: var(--muted); font-size: 13px; text-decoration: none; }
.fine-print { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.home-hero { padding: 52px 0 58px; border-bottom: 1px solid var(--line); }
.home-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 52px; align-items: start; }
.home-intro { padding-top: 42px; }
.home-intro h1 { max-width: 560px; margin-top: 14px; font-size: 58px; line-height: 1.04; }
.home-intro > p { max-width: 540px; margin: 22px 0 0; color: var(--muted); font-size: 17px; }
.law-status { display: inline-flex; align-items: center; gap: 9px; margin-top: 24px; color: var(--muted); font-size: 12px; font-weight: 700; }
.law-status span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.quick-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 38px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quick-fact { min-width: 0; padding: 18px 16px 18px 0; }
.quick-fact + .quick-fact { padding-left: 16px; border-left: 1px solid var(--line); }
.quick-fact strong { display: block; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 19px; }
.quick-fact span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.hero-tool { min-width: 0; }
.tool-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 14px; }
.tool-heading h2 { margin-top: 4px; font-size: 27px; }
.tool-heading a, .section-heading > a, .text-link { color: var(--brand); font-size: 13px; font-weight: 800; text-decoration: none; }
.home-hero .calculator { padding: 22px; }
.home-hero .form-grid { gap: 14px; }
.home-hero .field input, .home-hero .field select { min-height: 44px; }
.home-hero .result-panel { padding: 20px; }
.home-hero .result-total { font-size: 40px; }
.home-hero .result-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-hero .metric { padding: 12px; }
.home-hero .cliff-chart { height: 180px; }
.threshold-section { padding: 62px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.threshold-section .section-heading { align-items: end; margin-bottom: 24px; }
.threshold-section .section-heading h2 { margin-top: 6px; font-size: 34px; }
.threshold-section .data-strip { background: transparent; border-width: 1px 0; gap: 0; }
.threshold-section .data-point { padding: 24px 24px 24px 0; }
.threshold-section .data-point + .data-point { padding-left: 24px; border-left: 1px solid var(--line); }
.threshold-section .data-point strong { color: var(--brand-strong); font-size: 28px; }
.method-section { padding: 72px 0; }
.method-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 90px; align-items: start; }
.method-intro h2 { margin-top: 8px; font-size: 40px; line-height: 1.08; }
.method-intro p { margin: 18px 0; color: var(--muted); }
.method-steps { border-top: 1px solid var(--line); }
.method-step { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 22px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.step-number { font-family: "IBM Plex Mono", ui-monospace, monospace; color: var(--brand); font-size: 15px; font-weight: 600; }
.method-step h3 { font-size: 18px; }
.method-step p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.guide-band { padding: 66px 0 72px; background: var(--brand-strong); color: #fff; }
.guide-band .eyebrow, .guide-band .section-heading > a, .guide-band .content-card .kicker, .guide-band .content-card .arrow { color: #bfe2d3; }
.guide-band .section-heading h2 { margin-top: 6px; font-size: 38px; }
.guide-band .content-card { min-height: 200px; background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .2); }
.guide-band .content-card:hover { border-color: #bfe2d3; }
.guide-band .content-card p { color: #d7e5df; }

@media (max-width: 1024px) {
  .page-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .home-hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .home-intro { padding-top: 12px; }
  .method-layout { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 760px) {
  .header-inner, .container { width: auto; margin-left: 14px; margin-right: 14px; }
  .header-inner { min-height: 64px; }
  .desktop-nav { display: none; }
  .menu-button { display: grid; }
  .mobile-nav[data-open] { display: grid; padding: 10px 14px 18px; border-top: 1px solid var(--line); background: var(--surface); }
  .mobile-nav a { padding: 12px; color: var(--ink); font-weight: 750; text-decoration: none; border-bottom: 1px solid var(--line); }
  .hero { padding-top: 38px; }
  h1 { font-size: 40px; }
  .section { padding: 38px 0; }
  .form-grid, .sidebar, .card-grid, .footer-grid { grid-template-columns: 1fr; }
  .data-strip, .result-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { width: 100%; max-width: 100%; }
  .calculator, .result-panel, .article { padding: 20px; }
  .article-section { overflow-x: auto; }
  .article-section table { min-width: 620px; }
  .source-table { display: block; overflow-x: auto; white-space: nowrap; }
  .article h1 { font-size: 38px; }
  .home-hero { padding: 32px 0 42px; }
  .home-hero-grid { gap: 34px; }
  .home-intro { padding-top: 0; }
  .home-intro h1 { font-size: 42px; }
  .home-intro > p { font-size: 15px; }
  .quick-facts { margin-top: 28px; }
  .quick-fact { padding: 14px 8px 14px 0; }
  .quick-fact + .quick-fact { padding-left: 8px; }
  .quick-fact strong { font-size: 15px; }
  .quick-fact span { font-size: 9px; }
  .tool-heading { align-items: start; }
  .tool-heading h2 { font-size: 25px; }
  .home-hero .form-grid { grid-template-columns: 1fr; }
  .home-hero .field.full, .home-hero .form-submit { grid-column: auto; }
  .home-hero .calculator, .home-hero .result-panel { padding: 16px; }
  .home-hero .result-total { font-size: 34px; }
  .home-hero .cliff-chart { height: 160px; gap: 8px; }
  .threshold-section { padding: 42px 0; }
  .threshold-section .section-heading { display: block; }
  .threshold-section .section-heading > a { display: inline-block; margin-top: 12px; }
  .threshold-section .section-heading h2 { font-size: 30px; }
  .threshold-section .data-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .threshold-section .data-point { padding: 18px 12px; border-bottom: 1px solid var(--line); }
  .threshold-section .data-point + .data-point { padding-left: 12px; }
  .threshold-section .data-point:nth-child(3) { border-left: 0; }
  .threshold-section .data-point strong { font-size: 21px; }
  .method-section { padding: 48px 0; }
  .method-intro h2 { font-size: 34px; }
  .method-step { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; }
  .guide-band { padding: 46px 0 52px; }
  .guide-band .section-heading { align-items: start; }
  .guide-band .section-heading h2 { font-size: 32px; }
  .guide-band .card-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
