@font-face {
  font-family: 'DM Sans';
  src: url('./fonts/dm-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Serif';
  src: url('./fonts/instrument-serif.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f5ed;
  --surface: #fffef9;
  --ink: #222c24;
  --muted: #555d52;
  --line: #d9dcd0;
  --forest: #234937;
  --forest-dark: #173425;
  --green-tint: #eef3e8;
  --clay: #75412d;
  --clay-tint: #f8eee4;
  --serif: 'Instrument Serif', Georgia, serif;
  font: 15px/1.55 'DM Sans', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--forest); text-underline-offset: 0.18em; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid #315943; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
section[id], article[id], div[id] { scroll-margin-top: 20px; }

.shell { width: min(1160px, calc(100% - 88px)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: absolute; top: 8px; left: 8px; padding: 8px 14px; z-index: 1; background: var(--surface); }

.masthead { border-bottom: 1px solid #dfded2; }
.masthead-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.masthead-inner { min-height: 69px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-size: 21px; font-weight: 700; letter-spacing: -.06em; color: var(--ink); text-decoration: none; }
.brand-icon { width: 27px; height: 27px; display: inline-flex; justify-content: center; align-items: end; gap: 2px; padding-bottom: 6px; background: var(--forest); border-radius: 6px; }
.brand-icon i { width: 3px; height: 6px; background: #d7e5c5; border-radius: 1px; }
.brand-icon i:nth-child(2) { height: 10px; }
.brand-icon i:nth-child(3) { height: 14px; }
nav { display: flex; align-items: center; gap: 24px; }
nav a { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; }
nav a:hover, .footer a:hover { text-decoration: underline; }
.nav-report { display: inline-flex; align-items: center; gap: 9px; border: 1px solid #cbd1c3; border-radius: 6px; padding: 8px 13px; }

.hero { padding: 54px 0 34px; }
.kicker { display: flex; align-items: center; gap: 8px; color: var(--forest); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.kicker span { width: 7px; height: 7px; background: #547251; border-radius: 50%; }
h1, .section-heading h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.023em; line-height: .96; }
h1 { max-width: 860px; font-size: clamp(58px, 7.25vw, 106px); margin: 13px 0 16px; }
h1 em { font-weight: 400; color: var(--forest); }
.hero-intro { max-width: 575px; color: #4b5549; font-size: 17px; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 15px; margin-top: 19px; color: var(--muted); font-size: 12px; font-weight: 600; }
.hero-meta span + span { border-left: 1px solid #c9cec0; padding-left: 15px; }

.workspace { display: grid; grid-template-columns: minmax(0, 350px) minmax(0, 1fr); gap: 22px; align-items: start; }
.input-panel, .results { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.input-panel { padding: 21px; }
.input-heading, .results-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -.035em; line-height: 1.2; }
h3 { font-size: 16px; font-weight: 700; line-height: 1.32; }
.text-button { padding: 7px 0; border: 0; background: transparent; color: var(--forest); font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.form-group { margin-top: 15px; }
fieldset.form-group { border-top: 1px solid var(--line); padding-top: 6px; }
legend { padding: 0 7px 0 0; font-weight: 700; font-size: 13px; }
label { display: block; margin: 8px 0 4px; font-size: 12px; font-weight: 700; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 39px; padding: 7px 9px; border: 1px solid #c8cec1; border-radius: 5px; background: #fffefa; color: var(--ink); font-size: 13px; }
input:user-invalid { border-color: #a25335; }
textarea { resize: vertical; }
select { padding-right: 7px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 9px; align-items: end; }
.hint { color: var(--muted); font-size: 11px; margin-top: 7px; }
.input-privacy { margin-top: 14px; }
details { margin-top: 9px; border-top: 1px solid #e6e7dd; }
summary { padding: 8px 0 0; font-size: 12px; font-weight: 700; color: var(--forest); }
.details-body { padding-bottom: 2px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: #f1f1e9; border: 1px solid #e2e4d8; border-radius: 6px; margin-bottom: 3px; }
.segmented label { position: relative; margin: 0; cursor: pointer; text-align: center; }
.segmented input { position: absolute; opacity: 0; min-height: 0; width: 1px; height: 1px; }
.segmented span { display: block; padding: 6px 3px; border-radius: 4px; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--forest-dark); box-shadow: 0 1px 3px #23322820; }
.segmented input:focus-visible + span { outline: 2px solid #315943; }

.outcome-panel { min-width: 0; }
.results { padding: 21px; }
.results-heading { margin-bottom: 17px; align-items: start; }
#result-basis { margin-top: 4px; color: var(--muted); font-size: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 12px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 700; text-decoration: none; line-height: 1.35; text-align: center; }
.button-secondary { color: var(--forest-dark); background: transparent; border-color: #cbd1c3; }
.button-secondary:hover, .nav-report:hover { background: var(--green-tint); }
.button-primary { color: #fffef9; background: var(--forest); }
.button-primary:hover { background: #183b29; }
.copy-button { flex-shrink: 0; }
.copy-icon { width: 11px; height: 11px; position: relative; border: 1px solid currentColor; border-radius: 2px; margin: 0 1px 1px 3px; }
.copy-icon::before { content: ''; position: absolute; width: 7px; height: 8px; top: 3px; left: -4px; border: 1px solid currentColor; border-width: 0 0 1px 1px; border-radius: 0 0 0 2px; }
#summary-fallback { margin: 0 0 12px; }
.mobile-results { display: none; }
.shared-base { display: flex; gap: 12px; justify-content: space-between; align-items: center; background: #f2f2e9; border: 1px solid #e4e6db; border-radius: 7px; padding: 11px 13px; margin-bottom: 12px; font-size: 13px; font-weight: 700; }
.shared-base > div:last-child { text-align: right; }
.shared-base small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.shared-base strong { font-variant-numeric: tabular-nums; font-size: 16px; }
.source-link { margin-left: 4px; font-size: 11px; white-space: nowrap; }
.shared-base .source-link { margin-left: 0; }

.result-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; align-items: stretch; }
.result-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--card-line); border-radius: 8px; padding: 14px 13px 10px; background: var(--card-bg); }
.fin-card { --card-bg: #edf2e8; --card-line: #d5dfd0; --card-ink: #24503a; }
.zd-card { --card-bg: #f9efe6; --card-line: #eadbce; --card-ink: #75412d; }
.result-card h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.vendor-mark { display: inline-flex; align-items: center; justify-content: center; gap: 2px; width: 23px; height: 23px; border-radius: 5px; background: var(--card-ink); flex-shrink: 0; }
.fin-mark i { display: block; width: 1px; height: 7px; background: white; }
.fin-mark i:nth-child(2) { height: 11px; }
.zd-mark i:first-child, .zd-mark i:last-child { width: 5px; height: 5px; background: #fff9ed; }
.zd-mark i:first-child { clip-path: polygon(0 0,100% 0,0 100%); transform: translateY(-2px); }
.zd-mark i:last-child { clip-path: polygon(100% 0,100% 100%,0 100%); transform: translateY(2px); }
.increment { display: grid; gap: 3px; margin: 10px 0; }
.increment strong { color: var(--card-ink); font-family: var(--serif); font-size: clamp(35px, 4vw, 54px); font-weight: 400; line-height: .96; overflow-wrap: anywhere; }
.increment .text-amount { font-size: 36px; }
.increment span, .card-source { color: var(--muted); font-size: 11px; }
.card-source { margin: 7px 0 0; }
.card-source a { color: var(--card-ink); }
.result-rows { margin-bottom: auto; }
.result-rows div, .card-total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-top: 1px solid var(--card-line); padding: 6px 0; font-size: 11px; }
.result-rows dt { color: #3d493e; }
.result-rows dd, .card-total strong { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.card-total { margin-top: 6px; font-size: 12px; }
.card-total span { font-weight: 600; }
.card-issues { margin: 4px 0 8px; padding-left: 15px; color: #533821; font-size: 11px; }
.card-issues li + li { margin-top: 3px; }
.comparison { display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 10px 12px; border-radius: 6px; background: #e8efdf; color: var(--forest-dark); font-size: 13px; }
.comparison.pending { background: #f0eddf; color: #4a422e; }
.comparison p { font-size: 11px; }
.compare-symbol { display: grid; place-items: center; flex: 0 0 23px; height: 23px; border-radius: 50%; background: #d1dfc2; font-weight: 700; }
.comparison.pending .compare-symbol { background: #e0d8bf; }
.result-note { color: var(--muted); font-size: 11px; margin-top: 9px; }

.report-teaser { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 13px; border: 1px solid #d9d8c8; padding: 15px 17px; border-radius: 8px; background: #efeddf; }
.report-teaser h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1; }
.report-teaser p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.report-teaser .button { flex-shrink: 0; }
.report-teaser a { display: inline-block; margin-top: 5px; font-size: 12px; }

.method { margin: 52px 0 34px; }
.section-heading h2 { margin-top: 9px; font-size: clamp(41px, 5.3vw, 67px); }
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 30px; margin-top: 22px; }
.method-grid article { border-top: 1px solid #d6d8ca; padding: 16px 0 18px; }
.method-grid h3, .source-panel h3 { font-size: 18px; }
.method-grid p, .source-panel p { margin-top: 8px; color: #485246; font-size: 13px; }
.method-grid .formula { background: #edeee5; border-left: 2px solid #66836a; padding: 6px 9px; color: #2d4030; font-size: 12px; }
.source-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); gap: 12px; align-items: start; padding: 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.source-panel ul { columns: 2; padding-left: 17px; margin: 0; }
.source-panel li { break-inside: avoid; color: #68806a; font-size: 12px; padding: 2px 0; }

.config-note { background: #f1eddd; color: #4a422e; font-size: 12px; border-radius: 5px; padding: 8px 9px; margin-top: 10px; }
.footer { border-top: 1px solid #dbddcf; }
.footer-inner { min-height: 65px; font-size: 12px; color: var(--muted); }
.footer .wordmark { font-size: 17px; }

@media (max-width: 1040px) {
  .shell { width: calc(100% - 56px); }
  .workspace { grid-template-columns: minmax(0, 315px) minmax(0, 1fr); gap: 14px; }
  .input-panel, .results { padding: 16px; }
  .report-teaser { align-items: start; }
}

@media (max-width: 800px) {
  .workspace { grid-template-columns: 1fr; }
  .shell { width: min(620px, calc(100% - 36px)); }
  .hero { padding: 33px 0 23px; }
  .hero-intro { font-size: 15px; }
  h1 { font-size: clamp(52px, 9.8vw, 76px); }
  .mobile-results { display: flex; width: 100%; margin-top: 14px; }
  input, select, textarea { font-size: 16px; min-height: 43px; }
  .button { min-height: 42px; }
  .method { margin-top: 33px; }
}

@media (max-width: 510px) {
  .masthead-inner { min-height: 58px; }
  .nav-method { display: none; }
  .hero-meta { gap: 6px 9px; }
  .hero-meta span + span { padding-left: 9px; }
  .hero-meta span:last-child { width: 100%; padding: 0; border: 0; }
  .results-heading { flex-wrap: wrap; }
  .results-heading .button { min-height: 38px; }
  .result-cards, .method-grid, .source-panel { grid-template-columns: minmax(0, 1fr); }
  .report-teaser { align-items: stretch; flex-direction: column; }
  .source-panel ul { columns: 1; }
  .footer-inner { flex-wrap: wrap; gap: 8px 12px; padding: 12px 0; }
  .footer-inner p { order: 1; width: 100%; }
}
