:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --ink: #1b1a17;
  --body: #33302b;
  --muted: #5f5a52;
  --line: #e7e2d9;
  --brand: #16624a;
  --brand-dark: #0e4a37;
  --brand-soft: #e7f2ec;
  --accent: #b4531f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 26, 23, 0.05), 0 8px 24px rgba(27, 26, 23, 0.06);
  --max: 1080px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  background: rgba(250, 249, 246, 0.92);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: url("favicon.svg") center / cover no-repeat;
  display: inline-block;
  flex: none;
}

.nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 550;
}
.nav a:hover { color: var(--brand); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 44px;
  align-items: center;
  padding: 60px 0 40px;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.05rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  color: var(--ink);
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 58ch;
  margin: 0 0 24px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.hero-card h2 {
  font-size: 0.95rem;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.mini-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.mini-table th, .mini-table td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.mini-table tr:last-child th, .mini-table tr:last-child td { border-bottom: 0; }
.hero-card .fineprint { margin: 12px 0 0; }

.fineprint { font-size: 0.8rem; color: var(--muted); }
.updated { font-size: 0.8rem; color: var(--muted); margin-top: 8px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
}
.btn:hover { background: var(--brand-dark); }
.btn-inline { width: auto; padding: 12px 22px; }

/* Page hero / breadcrumb */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  padding-top: 20px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { margin: 0 6px; color: #b7b1a6; }

.page-hero { padding: 16px 0 6px; }
.page-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  line-height: 1.14;
  color: var(--ink);
}

/* Calculator */
.calc-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: start;
  margin: 26px 0 8px;
}
.calc-grid > * { min-width: 0; }

.calc-card,
.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.calc-card fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
.calc-card legend {
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0;
  margin-bottom: 18px;
  color: var(--ink);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field-row .field { margin-bottom: 16px; }

label { font-weight: 600; font-size: 0.92rem; color: var(--ink); }

select,
input[type="number"] {
  width: 100%;
  max-width: 100%;
  padding: 11px 12px;
  border: 1px solid #d8d2c7;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}
select:focus,
input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22, 98, 74, 0.15);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  font-size: 0.93rem;
  margin: 4px 0 20px;
  cursor: pointer;
}
.checkbox input { width: 17px; height: 17px; accent-color: var(--brand); }

.calc-card .fineprint { margin: 12px 0 0; }

.result-card { border-top: 4px solid var(--brand); }
.result-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}
.result-range {
  margin: 6px 0 2px;
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  font-weight: 780;
  letter-spacing: -0.02em;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}
.result-sub {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}
.result-summary { margin: 0 0 18px; font-size: 0.88rem; color: var(--muted); }

.breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.breakdown th,
.breakdown td {
  text-align: left;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.breakdown td { text-align: right; font-variant-numeric: tabular-nums; }
.breakdown tr:last-child th,
.breakdown tr:last-child td { border-bottom: 0; }
.breakdown-total th,
.breakdown-total td { font-weight: 700; padding-top: 12px; }
.result-note { font-size: 0.78rem; color: var(--muted); margin: 14px 0 0; }

.callout {
  background: var(--brand-soft);
  border: 1px solid #cfe3d8;
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--brand-dark);
  font-size: 0.95rem;
}

/* Content */
.prose { max-width: 76ch; }
.prose h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 42px 0 12px;
  color: var(--ink);
}
.prose h3 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
  color: var(--ink);
}
.prose p, .prose li { color: var(--body); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--brand); }
.prose strong { color: var(--ink); }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 26px;
  font-size: 0.94rem;
  background: var(--surface);
  border: 1px solid var(--line);
}
.prose th,
.prose td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.prose thead th { background: #f2efe9; font-weight: 700; color: var(--ink); }
.prose tbody tr:last-child th,
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:last-child { font-variant-numeric: tabular-nums; }

.note {
  background: #fffaf0;
  border: 1px solid #f0dfc0;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 22px 0;
  font-size: 0.92rem;
}

.related {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding-top: 28px;
}
.related h2 { margin-top: 0; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 24px 0 40px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #d3cabb;
}
.card h3 { margin: 0 0 6px; font-size: 1.02rem; color: var(--ink); }
.card p { margin: 0; color: var(--muted); font-size: 0.91rem; }

.section-title {
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  margin: 44px 0 8px;
  color: var(--ink);
}
.section-intro { color: var(--muted); margin: 0 0 4px; max-width: 68ch; }

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-weight: 700; }
.faq details[open] summary::after { content: "\2013"; }
.faq p { margin: 10px 0 0; color: var(--muted); }

/* Ad placeholder */
.ad-slot {
  border: 1px dashed #d5cfc4;
  background: #f4f1eb;
  border-radius: 10px;
  min-height: 96px;
  display: grid;
  place-items: center;
  color: #8b857a;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 34px 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 56px;
  background: #f3f0ea;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 44px 0 28px;
}
.footer-grid p { color: var(--muted); font-size: 0.9rem; max-width: 38ch; margin: 12px 0 0; }
.footer-title {
  font-weight: 700;
  margin: 0 0 10px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.site-footer a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.site-footer a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); padding: 16px 0 28px; }
.footer-bottom p { margin: 0; color: #8b857a; font-size: 0.82rem; }

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; }
  .calc-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .header-inner { justify-content: center; }
  .nav { gap: 16px; justify-content: center; }
  .prose table { font-size: 0.86rem; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .prose th, .prose td { padding: 9px 9px; }
  .result-range { font-size: 1.9rem; }
}
