:root {
  --ink: #18231d;
  --muted: #66716a;
  --paper: #f5f3ec;
  --surface: #fffdf8;
  --green: #2f6845;
  --green-dark: #214d33;
  --green-soft: #e4eee6;
  --line: #d9ded8;
  --warning: #81572e;
  --warning-bg: #f6ecde;
  --shadow: 0 24px 70px rgba(24,35,29,.10);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(47,104,69,.10), transparent 32rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 30px 0 48px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 38px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 760; letter-spacing: -.02em; }
.mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--ink); color: #fff; font-family: Georgia, serif; font-size: 19px; }
.top-note { color: var(--muted); font-size: 13px; }

.intro { max-width: 780px; margin-bottom: 34px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--green-dark); font-size: 12px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--green); }
h1 { max-width: 760px; margin: 15px 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 6vw, 72px); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
.intro p { max-width: 670px; margin: 0; color: var(--muted); font-size: clamp(16px, 2vw, 19px); }

.calculator { display: grid; grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr); gap: 22px; align-items: start; }
.panel { background: var(--surface); border: 1px solid rgba(47,104,69,.13); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.inputs { padding: 28px; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.section-head h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.reset { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; transition: .18s ease; }
.reset:hover, .reset:focus-visible { color: var(--ink); border-color: #aab4ad; outline: none; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { min-width: 0; }
label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: #39453e; font-size: 13px; font-weight: 680; }
label small { color: var(--muted); font-weight: 500; }
.input-wrap { position: relative; }
input[type="number"] { width: 100%; min-height: 52px; padding: 0 44px 0 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); font-size: 17px; font-weight: 650; outline: none; transition: border-color .18s, box-shadow .18s; }
input[type="number"]:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(47,104,69,.11); }
.suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }

details { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 700; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); font-size: 19px; }
details[open] summary::after { content: "−"; }
.advanced { padding-top: 16px; }
.helper { margin: 16px 0 0; color: var(--muted); font-size: 12px; }

.results { background: var(--ink); color: #f9f7f1; }
.result-hero { padding: 34px 34px 30px; background: linear-gradient(145deg, #18231d 0%, #253d2e 100%); }
.result-label { color: #b9c9be; font-size: 12px; font-weight: 730; letter-spacing: .11em; text-transform: uppercase; }
.result-value { margin: 8px 0 2px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(48px, 7vw, 78px); font-variant-numeric: tabular-nums; letter-spacing: -.055em; line-height: 1; }
.result-sub { display: flex; align-items: center; gap: 9px; color: #d5dfd8; font-size: 14px; }
.pill { display: inline-flex; padding: 6px 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; background: rgba(255,255,255,.08); color: #fff; font-weight: 700; }

.breakdown { padding: 28px 34px 30px; }
.breakdown h2 { margin: 0 0 17px; font-size: 16px; }
.row { display: flex; justify-content: space-between; gap: 22px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.10); color: #cbd6cf; font-size: 14px; }
.row strong { color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.total { margin-top: 7px; border-bottom: 0; color: #fff; font-size: 15px; }
.row.total strong { color: #cde4d2; font-size: 18px; }
.formula { margin-top: 22px; padding: 15px 16px; border-radius: 14px; background: rgba(255,255,255,.06); color: #bfcac3; font-size: 12px; }

.after { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; margin-top: 22px; padding: 22px 24px; border: 1px solid rgba(47,104,69,.14); border-radius: 18px; background: rgba(255,253,248,.72); }
.after strong { display: block; margin-bottom: 4px; font-size: 17px; }
.after p { margin: 0; color: var(--muted); font-size: 13px; }
.cta { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border-radius: 13px; background: var(--green); color: #fff; font-weight: 730; text-decoration: none; transition: transform .18s, background .18s; }
.cta:hover, .cta:focus-visible { background: var(--green-dark); transform: translateY(-1px); outline: none; }

.disclaimer { max-width: 910px; margin: 22px auto 0; color: var(--muted); font-size: 11px; text-align: center; }
.warning { color: var(--warning); }
.footer { display: flex; justify-content: space-between; gap: 18px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .shell { width: min(100% - 24px, 660px); padding-top: 20px; }
  .topbar { margin-bottom: 30px; }
  .calculator { grid-template-columns: 1fr; }
  .result-value { font-size: clamp(52px, 14vw, 76px); }
}
@media (max-width: 560px) {
  .top-note { display: none; }
  .intro { margin-bottom: 24px; }
  .field-grid { grid-template-columns: 1fr; }
  .inputs, .result-hero, .breakdown { padding-left: 20px; padding-right: 20px; }
  .section-head { align-items: center; }
  .after { grid-template-columns: 1fr; }
  .cta { width: 100%; }
  .footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
