:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #eef0eb;
  --ink: #172021;
  --muted: #5e6869;
  --line: #d9ddda;
  --brand: #17627a;
  --brand-strong: #0d4354;
  --brand-soft: #e3f0f3;
  --accent: #9b5b16;
  --accent-soft: #f7ead7;
  --danger: #a13d33;
  --focus: #1b70c9;
  --shadow: 0 12px 30px rgba(23, 45, 50, .07);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1415;
  --surface: #151d1f;
  --surface-2: #202a2c;
  --ink: #edf3f4;
  --muted: #aab5b7;
  --line: #344145;
  --brand: #6fc4dc;
  --brand-strong: #a9e1ef;
  --brand-soft: #15323a;
  --accent: #efb56f;
  --accent-soft: #3b2a18;
  --danger: #ff9185;
  --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; }
svg { display: block; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 70%, transparent); outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 12px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--surface); }
.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: 850; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 5px; background: var(--brand-strong); color: #fff; font-size: 13px; }
.brand-copy { line-height: 1.05; }
.brand-copy small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 650; }
.desktop-nav { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.desktop-nav a { color: var(--muted); font-size: 14px; font-weight: 750; 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; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-button svg { width: 20px; height: 20px; }
.menu-button, .mobile-nav { display: none; }
.container { width: min(1180px, calc(100% - 40px)); margin: 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: 850; text-transform: uppercase; letter-spacing: .08em; }
h1, h2, h3 { margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
h1 { max-width: 850px; font-size: clamp(38px, 6vw, 68px); font-weight: 850; }
h2 { font-size: 28px; }
h3 { font-size: 18px; }
.hero p { max-width: 740px; margin: 18px 0 0; color: var(--muted); font-size: 18px; }
.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; font-weight: 800; text-decoration: none; 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 { margin: 5px 0 0; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; 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 { color: var(--muted); font-size: 13px; font-weight: 800; }
.field input, .field select { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--ink); }
.field.full, .form-submit, .toggle-row, [data-change-fields] { grid-column: 1 / -1; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 12px 0; }
.toggle-row label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--brand); }
[data-change-fields] { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 18px; background: var(--surface-2); border: 1px solid var(--line); }
[data-change-fields][hidden] { display: none; }
.form-submit .button { width: 100%; }
.result-panel { margin-top: 20px; padding: 26px; border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); border-radius: 6px; background: var(--brand-soft); }
.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"] { color: var(--danger); background: var(--accent-soft); }
.result-total { margin: 12px 0 4px; font-size: clamp(36px, 6vw, 58px); font-weight: 850; line-height: 1; }
.result-sub { color: var(--muted); }
.result-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 24px; border: 1px solid var(--line); background: 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; }
.limit-track { height: 14px; margin-top: 24px; overflow: hidden; border-radius: 3px; background: var(--surface); border: 1px solid var(--line); }
.limit-fill { height: 100%; width: 68%; background: var(--brand); }
.sidebar { display: grid; gap: 18px; }
.sidebar-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.sidebar-card h3 { margin-bottom: 10px; }
.sidebar-card p, .sidebar-card li { color: var(--muted); font-size: 14px; }
.sidebar-card ul { margin: 0; padding-left: 18px; }
.related-link-list { display: grid; gap: 8px; }
.related-link-list a { color: var(--brand-strong); font-size: 14px; font-weight: 800; }
.source-list { margin: 0; padding: 0; list-style: none; }
.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); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.data-point { min-width: 0; padding: 22px; background: var(--surface); }
.data-point strong { display: block; 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; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none; }
.content-card:hover { border-color: var(--brand); }
.content-card .kicker { color: var(--brand); font-size: 12px; font-weight: 850; }
.content-card h3 { margin-top: 12px; }
.content-card p { color: var(--muted); font-size: 14px; }
.content-card .arrow { margin-top: auto; color: var(--brand); font-weight: 800; }
.article { padding: 42px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.breadcrumbs { padding: 18px 0; color: var(--muted); font-size: 13px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.article h1 { font-size: clamp(34px, 5vw, 52px); }
.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, .source-table { width: 100%; border-collapse: collapse; }
.article-section th, .article-section td, .source-table th, .source-table td { padding: 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.article-section th, .source-table th { background: var(--surface-2); }
.notice { padding: 16px; border: 1px solid var(--line); background: var(--brand-soft); }
.source-table { border: 1px solid var(--line); background: var(--surface); }
.source-table a { color: var(--brand); font-weight: 750; }
.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; }
@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); } }
@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; border-bottom: 1px solid var(--line); font-weight: 750; text-decoration: none; }
  .hero { padding-top: 38px; }
  h1 { font-size: 40px; }
  .section { padding: 38px 0; }
  .form-grid, [data-change-fields], .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; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
