:root, [data-theme="light"] {
  color-scheme: light;
  --page: #f3f6f5;
  --panel: #fff;
  --ink: #142522;
  --muted: #4b615c;
  --line: #cbd7d4;
  --brand: #006b5d;
  --wash: #e1f2ed;
  --tax: #61736f;
  --focus: #006b5d;
  --error: #a32626;
  --shadow: 0 2px 8px #152b2210;
}
[data-theme="dark"] {
  color-scheme: dark;
  --page: #101917;
  --panel: #182421;
  --ink: #edf8f3;
  --muted: #afc4bd;
  --line: #46605a;
  --brand: #65e1c2;
  --wash: #203b34;
  --tax: #9cb6ae;
  --focus: #65e1c2;
  --error: #ffaaa4;
  --shadow: 0 2px 8px #0003;
}
* { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); font: 1rem/1.55 Inter, system-ui, sans-serif; }
.shell { width: min(100% - 2rem, 65rem); margin-inline: auto; }
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.nav-shell { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.wordmark { display: inline-flex; gap: .6rem; align-items: center; color: var(--ink); text-decoration: none; font-weight: 800; }
.brand-icon { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; background: var(--wash); color: var(--brand); border-radius: .55rem; }
button, input, select { font: inherit; }
.theme-button, .calculate { border: 1px solid var(--line); border-radius: .6rem; background: var(--panel); color: var(--ink); min-height: 2.75rem; padding: .5rem .85rem; font-size: .875rem; font-weight: 700; }
.calculate { min-height: 3rem; background: var(--brand); border-color: var(--brand); color: var(--panel); padding-inline: 1.25rem; }
.theme-button:hover { background: var(--wash); }
.calculate:hover { opacity: .88; }
:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: none; }
.skip-link { position: absolute; top: .5rem; left: .5rem; z-index: 2; padding: .5rem; background: var(--panel); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.intro { margin-block: clamp(1.75rem, 5vw, 3.5rem) 1.5rem; }
.intro p { color: var(--muted); margin: 0; }
.intro .period { color: var(--brand); font-size: .875rem; font-weight: 700; }
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1.05; letter-spacing: -.055em; font-weight: 800; margin: .45rem 0 .65rem; }
h2 { font-size: 1.125rem; font-weight: 750; margin: 0 0 1rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 3vw, 1.65rem); box-shadow: var(--shadow); margin-bottom: 1rem; }
.form-grid { display: grid; gap: .75rem; }
.form-label { font-size: .875rem; font-weight: 650; margin-bottom: .35rem; display: block; }
.input-group-text, .form-control, .form-select { min-height: 3rem; border: 1px solid var(--line); background-color: var(--panel); color: var(--ink); }
.input-group { display: flex; }
.form-control { min-width: 0; }
.input-group-text { background: var(--page); color: var(--muted); }
.field-help, .field-error { font-size: .875rem; margin: .65rem 0 0; color: var(--muted); }
.field-error { color: var(--error); }
.result { background: var(--wash); display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 1rem; }
.result h2 { margin-bottom: .45rem; }
.headline { margin: 0; font-size: clamp(1.85rem, 6vw, 3.65rem); line-height: 1.12; letter-spacing: -.045em; font-weight: 800; overflow-wrap: anywhere; }
.headline-currency { font-size: .45em; letter-spacing: 0; color: var(--brand); }
.result-tax { display: grid; gap: .15rem; color: var(--muted); font-size: .875rem; }
.result-tax strong { font-size: 1.375rem; color: var(--ink); }
.detail-grid { display: grid; }
table { width: 100%; border-collapse: collapse; font-size: clamp(.8125rem, 2.4vw, .95rem); }
caption { caption-side: top; color: var(--muted); padding: 0 0 .5rem; }
th, td { padding: .7rem .15rem; border-bottom: 1px solid var(--line); }
th { text-align: left; }
td, thead th:not(:first-child) { text-align: right; }
td { overflow-wrap: anywhere; }
tbody tr:last-child > * { font-weight: 750; color: var(--brand); border-bottom: 0; }
.headline, table, input, .result-tax, .chart-legend { font-variant-numeric: tabular-nums; }
.chart-wrap { position: relative; width: 11rem; aspect-ratio: 1; margin: 0 auto 1rem; }
.chart-fallback { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--brand) 0 var(--net-share, 96%), var(--tax) 0); }
.chart-fallback::after { content: ""; position: absolute; inset: 21%; border-radius: inherit; background: var(--panel); }
.chart-fallback.is-empty { background: var(--line); }
.chart-legend { display: grid; gap: .35rem; list-style: none; margin: 0; padding: 0; font-size: .875rem; }
.chart-legend li { display: flex; gap: .5rem; align-items: center; }
.chart-legend strong { margin-left: auto; }
.swatch { width: .75rem; height: .75rem; border-radius: 50%; background: var(--brand); }
.tax-swatch { background: var(--tax); }
summary { cursor: pointer; font-weight: 750; min-height: 1.7rem; }
.explanation-body { margin-top: 1rem; }
.explanation-body li + li { margin-top: .35rem; }
.explanation-body a, .skip-link { color: var(--brand); }
footer { padding: .5rem 0 2rem; color: var(--muted); font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 42rem) {
  .form-grid { grid-template-columns: minmax(0, 1fr) minmax(9rem, .5fr) auto; align-items: end; }
  .detail-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .theme-button, .calculate { transition: opacity .15s ease; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}

.shell { width: min(100% - 2rem, 74rem); }
.nav-shell { min-height: 4.5rem; }
.wordmark { gap: 0; letter-spacing: -.04em; font-size: 1.125rem; }
.brand-icon { margin-inline-end: .65rem; background: var(--brand); color: var(--panel); font-weight: 800; font-size: 1.125rem; }
.wordmark-accent { color: var(--brand); }
.nav-actions { display: flex; align-items: center; gap: clamp(.65rem, 3vw, 1.5rem); }
.nav-actions a { color: var(--muted); font-size: .875rem; font-weight: 650; }
.theme-button { padding-inline: .75rem; }
.intro { margin-block: clamp(1.65rem, 4.5vw, 3.25rem) 1.5rem; }
.intro .period { display: inline-block; padding: .22rem .65rem; border: 1px solid var(--line); border-radius: 2rem; background: var(--panel); }
.intro h1 { margin: .6rem 0 .55rem; }
.workspace { display: grid; gap: 1rem; margin-bottom: 1rem; }
.workspace > .panel { margin: 0; }
.form-grid { grid-template-columns: minmax(0, 1fr) minmax(6.25rem, .55fr); align-items: end; }
.extra-fields { display: grid; gap: .8rem; border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .85rem; }
.calculate { display: block; width: 100%; margin-top: .95rem; }
.form-control, .form-select, .input-group-text { padding: .65rem .7rem; }
.input-group-text { display: flex; align-items: center; border-radius: .55rem 0 0 .55rem; border-right: 0; font-size: .8rem; font-weight: 700; }
.input-group .form-control { border-radius: 0 .55rem .55rem 0; }
.extra-fields input, .form-select { border-radius: .55rem; }
.form-select { appearance: auto; }
.result { display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 1.2rem; border-top: 4px solid var(--brand); }
.headline { color: var(--brand); font-size: clamp(2.35rem, 6vw, 4.3rem); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); padding-top: 1rem; gap: .5rem; }
.result-tax { align-content: start; font-size: .78rem; }
.result-tax strong { font-size: clamp(.97rem, 2.2vw, 1.3rem); overflow-wrap: anywhere; }
.analysis { padding: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: 1rem clamp(1rem, 3vw, 1.65rem) .65rem; }
.section-heading h2 { margin: 0; }
.tab-list { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); padding-inline: clamp(.7rem, 2vw, 1.3rem); }
.tab-list button { background: transparent; border: 0; border-bottom: 3px solid transparent; padding: .7rem clamp(.5rem, 2vw, .95rem); color: var(--muted); font-size: .875rem; font-weight: 650; cursor: pointer; }
.tab-list button:hover, .tab-list .selected, .tab-list [aria-selected="true"] { color: var(--brand); }
.tab-list .selected, .tab-list [aria-selected="true"] { border-bottom-color: var(--brand); }
.analysis-pane, .analysis .detail { padding: clamp(1rem, 3vw, 1.65rem); }
.detail-grid { gap: 0; }
.chart-detail { background: var(--page); border-radius: 0 0 1rem 1rem; }
.chart-legend { margin-inline: auto; max-width: 22rem; }
h3 { font-size: 1rem; font-weight: 750; margin: 0 0 .5rem; }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 23rem; }
#band-rows tr:last-child > *, #comparison-rows tr:last-child > * { border-bottom: 0; }
.comparison-delta { color: var(--brand); font-size: 1.25rem; font-weight: 750; }
.explanation h2 { margin: 0; }
.method-button { display: flex; align-items: center; justify-content: space-between; width: 100%; cursor: pointer; text-align: left; min-height: 2rem; }
.method-open span { transform: rotate(180deg); }
.explanation-body p, .explanation-body ol { margin-bottom: .75rem; }
.explanation-body ol { list-style: decimal; padding-inline-start: 1.5rem; }
@media (max-width: 24rem) {
  .nav-actions a { display: none; }
}
@media (min-width: 36rem) {
  .extra-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 48rem) {
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .chart-detail { border-radius: 0 0 1rem 0; border-left: 1px solid var(--line); }
}
