:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1c1d1f;
  --muted: #5d6066;
  --border: #e3e1da;
  --accent: #0f6b5c;
  --accent-contrast: #ffffff;
  --accent-soft: #e3f1ee;
  --warn: #b4441f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131416;
    --surface: #1c1e21;
    --text: #ecebe7;
    --muted: #a3a6ad;
    --border: #2e3136;
    --accent: #4fc2ab;
    --accent-contrast: #0d1f1b;
    --accent-soft: #17302b;
    --warn: #f08a63;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 640px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.site-header nav { display: flex; align-items: center; gap: 20px; }
.site-header nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-header nav a:not(.btn):hover { color: var(--text); }
@media (max-width: 640px) { .site-header nav a:not(.btn) { display: none; } }

/* Buttons */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-contrast);
  font: inherit; font-weight: 600; padding: 12px 20px; border-radius: 999px;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn-small { padding: 8px 14px; font-size: 14px; }

/* Hero */
.hero { padding: 72px 0 56px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 12px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 20px; max-width: 18ch; }
.lead { font-size: 19px; color: var(--muted); max-width: 60ch; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Sections */
section h2 { font-size: clamp(24px, 3.2vw, 32px); letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 12px; }
.section-lead { color: var(--muted); max-width: 70ch; margin: 0 0 24px; }
.calculator, .how, .get { padding: 56px 0; }
.how { background: var(--surface); border-block: 1px solid var(--border); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

/* Calculator form */
.calc-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } }
fieldset { margin: 0; min-width: 0; }
legend { font-weight: 600; padding: 0 6px; margin-left: -6px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }
input, select {
  font: inherit; font-size: 15px; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; width: 100%; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input:disabled { opacity: 0.5; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); margin: 4px 0 0; }
label.check input { width: auto; margin-top: 4px; accent-color: var(--accent); }

.items-scroll { overflow-x: auto; margin: 0 -4px 12px; padding: 0 4px; }
table { border-collapse: collapse; width: 100%; }
.items { min-width: 560px; }
.items th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 0 4px 8px; white-space: nowrap; }
.items td { padding: 3px 4px; }
.items td:first-child { width: 32%; }
.items input { padding: 7px 8px; }
.items input[data-k="qty"] { min-width: 76px; }
.remove { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.remove:hover { color: var(--warn); background: var(--bg); }

/* Results */
.results { margin-top: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--bg); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.highlight { background: var(--accent-soft); }
.stat.highlight .stat-value { color: var(--accent); }
.note { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.result-table { min-width: 640px; font-variant-numeric: tabular-nums; }
.result-table th { font-size: 13px; font-weight: 500; color: var(--muted); text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
.result-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); }
.result-table .n { text-align: right; }
.result-table .strong { font-weight: 600; }
.result-table .warn { color: var(--warn); }
.cta-inline { margin: 16px 0 0; font-weight: 500; }
.muted { color: var(--muted); margin: 0; }
.disclaimer { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* How it works */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: s; background: var(--bg); border-radius: var(--radius); padding: 20px; color: var(--muted); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 12px; }
.steps strong { display: block; color: var(--text); margin-bottom: 4px; }

/* Install */
.ticks { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.ticks li { padding-left: 28px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.get-card .btn { width: 100%; text-align: center; }
.form-status { min-height: 1.5em; margin: 12px 0 0; font-size: 14px; color: var(--muted); text-align: center; }

.site-footer { padding: 32px 0 48px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--border); }
