:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --ink: #172b27;
  --muted: #4e625d;
  --line: #dce5e0;
  --accent: #126b60;
  --accent-dark: #0c5249;
  --mint: #e3f2eb;
  --paper: #fff;
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent-dark); }
button, input, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
p, h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #167d71; outline-offset: 4px; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.skip-link { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 8px 14px; background: white; border-radius: 6px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; min-height: 74px; gap: 45px; }
.brand { color: var(--ink); font-size: 1.29rem; letter-spacing: -.05em; font-weight: 750; display: inline-flex; align-items: center; gap: 11px; text-decoration: none; white-space: nowrap; }
.brand-hyphen { color: var(--accent); }
.topbar nav { display: flex; flex-wrap: wrap; align-items: stretch; align-self: stretch; gap: 0 26px; }
.nav-link { display: flex; align-items: center; font-size: .88rem; font-weight: 620; text-decoration: none; color: var(--muted); border-block: 2px solid transparent; }
.nav-link[aria-current] { border-bottom-color: var(--accent); color: var(--accent-dark); }
.nav-link:hover { color: var(--accent); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; border: 1px solid transparent; border-radius: 8px; padding: 8px 14px; font-size: .88rem; line-height: 1.35; font-weight: 680; text-decoration: none; }
.button .icon { width: 18px; height: 18px; }
.button-secondary { background: var(--paper); color: var(--accent-dark); border-color: #b8d1c6; }
.button-secondary:hover { background: #edf6f1; }

.section-head { margin-bottom: 18px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 345px), 1fr)); gap: 14px; }
.module-tile { max-width: 542px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; box-shadow: 0 2px 4px #243c3308; }
.module-tile:hover { border-color: #88b7a7; box-shadow: 0 5px 18px #243c3310; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-icon { display: inline-grid; width: 43px; height: 43px; place-items: center; border-radius: 10px; background: var(--mint); color: var(--accent-dark); flex: none; }
.module-tile h2 { margin-top: 3px; font-size: 1.25rem; letter-spacing: -.025em; }
.module-tile p { font-size: .9rem; color: var(--muted); }
.tile-arrow { color: var(--accent); }
.back-link:hover { text-decoration: underline; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); margin-top: 36px; padding-block: 19px 25px; font-size: .8rem; color: var(--muted); }
.site-footer a { text-underline-offset: 3px; }
.footer-brand { font-weight: 740; color: var(--ink); }

.inner-page { padding-top: 28px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 650; text-decoration: none; margin-bottom: 24px; }
.back-link .icon { width: 17px; height: 17px; }
.inner-page h1 { margin-top: 3px; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1; letter-spacing: -.055em; }
.page-intro { max-width: 72ch; margin-top: 8px; color: var(--muted); }
.surface { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 2px 4px #243c3308; }
.privacy-page { margin-top: 24px; max-width: 780px; padding: 24px; }
.privacy-page h2 { font-size: 1.15rem; }
.privacy-page h2:not(:first-child) { margin-top: 21px; }
.privacy-page p { margin: 8px 0 10px; color: var(--muted); }
.action-status:empty { display: none; }
.calculator h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); margin-bottom: 19px; }
.calculator-inputs, .comparison { padding: 18px 22px; }
.calculator-fields { display: grid; grid-template-columns: minmax(125px, .7fr) minmax(0, 1.7fr) minmax(0, 1.3fr); gap: 12px 16px; }
.field { display: grid; align-content: start; gap: 5px; min-width: 0; }
.field label { font-weight: 690; font-size: .86rem; }
.field-hint { color: var(--muted); font-size: .78rem; }
.field input, .field select { width: 100%; min-width: 0; min-height: 41px; padding: 7px 10px; border: 1px solid #cbd9d3; border-radius: 7px; color: var(--ink); background: var(--paper); }
.field input::placeholder { color: #6a7974; }
.field input[aria-invalid="true"] { border-color: #9f432e; }
.calculator-hint { margin-top: 8px; }
.comparison { margin-top: 14px; }
.comparison-heading { display: flex; flex-wrap: wrap; gap: 5px 14px; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.comparison-heading h2 { font-size: 1.28rem; letter-spacing: -.025em; }
.nominal-summary { color: var(--accent-dark); font-variant-numeric: tabular-nums; font-size: .88rem; font-weight: 700; }
.calc-message { border-radius: 8px; background: #f0f5f2; color: var(--muted); padding: 12px; }
.calc-message[data-error] { background: #fff0e9; color: #873421; }
.comparison-table { border-collapse: collapse; table-layout: fixed; width: 100%; font-variant-numeric: tabular-nums; }
.comparison-table th, .comparison-table td { padding: 8px 10px; text-align: center; }
.comparison-table thead th { font-size: .81rem; color: var(--muted); background: #f0f5f2; }
.comparison-table thead th span, .comparison-table tbody th span { display: block; font-weight: 500; font-size: .73rem; color: var(--muted); }
.comparison-table th:first-child { text-align: left; width: 18%; }
.comparison-table th:nth-child(2), .comparison-table th:nth-child(4) { width: 19%; }
.comparison-table tbody tr { border-bottom: 1px solid var(--line); }
.comparison-table tbody td { overflow-wrap: anywhere; }
.comparison-table td.chart-column, .comparison-table th.chart-column { padding-inline: 4px; }
.chart-column svg { display: block; width: 100%; height: 28px; }
.chart-column path { fill: none; vector-effect: non-scaling-stroke; }
.band-rail { stroke: #dce7e1; stroke-width: 2; }
.band-range { stroke: #88bfac; stroke-width: 9; }
.band-ends { stroke: #166353; stroke-width: 2; }
.band-nominal { stroke: #344942; stroke-dasharray: 3 3; }
.calculator-source { margin-top: 12px; color: var(--muted); font-size: .81rem; }
.calculator-source:empty { display: none; }
.calculator-source span { display: block; margin-top: 3px; }

@media (max-width: 760px) {
  .shell { width: calc(100% - 36px); }
  .topbar-inner { gap: 20px; }
  .topbar nav { gap: 12px; }
  .calculator-fields { grid-template-columns: minmax(125px, .55fr) minmax(0, 1fr); }
  #category-field { grid-column: 1 / -1; }
}

@media (max-width: 510px) {
  .topbar-inner { flex-wrap: wrap; gap: 0; padding-top: 10px; min-height: auto; }
  .topbar nav { order: 1; width: 100%; min-height: 43px; gap: 21px; }
  .calculator-fields { grid-template-columns: 1fr; }
  .calculator-inputs, .comparison { padding: 13px; }
  .comparison-table th, .comparison-table td { padding-inline: 3px; }
  .comparison-table th:first-child { width: 22%; }
  .comparison-table th:nth-child(2), .comparison-table th:nth-child(4) { width: 22%; }
  .comparison-table tbody td { font-size: .82rem; }
  .comparison-table thead th { overflow-wrap: anywhere; }
}
