/* On-Tap ROI Calculator — mobile-first, cafe-trade aesthetic */
:root {
  --bg: #f1e8d9;
  --bg-tint: #e7dccb;
  --paper: #fffaf2;
  --paper-2: #f7efe3;
  --ink: #1b1410;
  --ink-soft: #5b4d41;
  --ink-faint: #8a7a6b;
  --line: #e1d2bf;
  --line-strong: #cbbba5;
  --copper: #c45c26;
  --copper-deep: #9a3f14;
  --copper-soft: #f6e4d6;
  --pine: #216348;
  --pine-deep: #164332;
  --pine-soft: #e3f0e9;
  --gold: #b8893e;
  --danger: #8f2d2d;
  --danger-soft: #f8e8e6;
  --shadow: 0 18px 50px rgba(27, 20, 16, 0.08);
  --shadow-sm: 0 8px 24px rgba(27, 20, 16, 0.06);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 18px;
  --header-h: 64px;
  --sticky-results-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(196, 92, 38, 0.09), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(33, 99, 72, 0.07), transparent 45%),
    var(--bg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--copper-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible {
  outline: 3px solid rgba(196, 92, 38, 0.55);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(241, 232, 217, 0.88);
  border-bottom: 1px solid rgba(27, 20, 16, 0.06);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.brand img { width: 32px; height: 32px; }
.brand span { font-family: var(--serif); font-size: 1.15rem; }
.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav a:hover { color: var(--ink); }

@media (max-width: 720px) {
  .site-header .wrap { gap: 10px; }
  .brand span { font-size: 1.02rem; }
  .nav { gap: 12px; flex-wrap: nowrap; }
  .nav a[href="#schedule"],
  .nav a[href="#email"] { display: none; }
}

/* Hero */
.hero {
  padding: 36px 0 12px;
}
.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--copper-soft);
  color: var(--copper-deep);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.05rem, 5.4vw, 3.55rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin: 0 0 14px;
  max-width: 18ch;
}
.hero .lede {
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 1.08rem;
  margin: 0 0 22px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 8px; }
.hero-note { color: var(--ink-faint); font-size: 0.88rem; margin: 10px 0 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: #000; color: var(--paper); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: rgba(255,255,255,0.5); color: var(--ink); }
.btn-secondary {
  background: var(--copper);
  color: #fff;
  border-color: var(--copper);
}
.btn-secondary:hover { background: var(--copper-deep); color: #fff; }

/* Layout */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 12px 0 48px;
  align-items: start;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.inputs { padding: 8px 4px 16px; }
.section {
  padding: 16px 18px 6px;
  border-top: 1px solid var(--line);
}
.section:first-child { border-top: 0; }
.section h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}
.section .hint {
  margin: 0 0 14px;
  color: var(--ink-faint);
  font-size: 0.88rem;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .choice-label, .check label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.field input[type="number"],
.field input[type="email"],
.field input[type="text"],
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
  font-size: 1rem;
}
.field input:focus, .field select:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.18);
  outline: none;
}
.prefix-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.prefix-input:focus-within {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.18);
}
.prefix-input span {
  padding: 0 0 0 12px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.prefix-input input {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  min-height: 44px;
  background: transparent !important;
}
.suffix-input { display: flex; align-items: center; }
.suffix-input .prefix-input, .suffix-input input { flex: 1; }
.suffix-input > em {
  font-style: normal;
  color: var(--ink-faint);
  font-size: 0.85rem;
  padding-left: 8px;
  white-space: nowrap;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choice-row input { position: absolute; opacity: 0; pointer-events: none; }
.choice-row label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 550;
}
.choice-row input:checked + label {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.choice-row input:focus-visible + label {
  outline: 3px solid rgba(196, 92, 38, 0.55);
  outline-offset: 2px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 12px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--copper); }

.capex-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: var(--paper-2);
  border-radius: 12px;
  font-size: 0.95rem;
}
.capex-total strong { font-variant-numeric: tabular-nums; font-size: 1.1rem; }

.reset-row { padding: 8px 18px 18px; }

/* Results */
.results-panel {
  padding: 18px;
}
@media (min-width: 920px) {
  .calc-grid { grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.9fr); }
  .results-wrap {
    position: sticky;
    top: calc(var(--header-h) + 12px);
  }
}

.results-panel h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  margin: 0 0 14px;
  letter-spacing: -0.03em;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.metric {
  background: var(--paper-2);
  border-radius: 14px;
  padding: 12px;
  min-height: 92px;
}
.metric.span { grid-column: 1 / -1; }
.metric .label {
  display: block;
  color: var(--ink-faint);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.metric .value {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.metric .sub {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}
.metric.good { background: var(--pine-soft); }
.metric.good .value { color: var(--pine-deep); }
.metric.warn { background: var(--danger-soft); }
.metric.warn .value { color: var(--danger); }

.breakdown { margin: 18px 0 8px; }
.breakdown h3, .schedule-card h3, .monthly h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}
.bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 10px;
}
.bar-head { display: flex; justify-content: space-between; font-size: 0.88rem; }
.bar-track {
  height: 8px;
  background: var(--bg-tint);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill { height: 100%; background: var(--copper); border-radius: inherit; }
.bar.gas .bar-fill { background: #3d6e8c; }
.bar.clean .bar-fill { background: var(--pine); }
.stack-track {
  display: flex;
  height: 16px;
  background: var(--pine-soft);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 10px;
}
.stack-track span { display: block; height: 100%; }
.stack-track .s-product { background: var(--copper); }
.stack-track .s-gas { background: #3d6e8c; }
.stack-track .s-clean { background: var(--pine); }
.stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.stack-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  margin-right: 5px;
}
.stack-legend .l-product i { background: var(--copper); }
.stack-legend .l-gas i { background: #3d6e8c; }
.stack-legend .l-clean i { background: var(--pine); }
.stack-legend .l-margin i { background: var(--pine-soft); border: 1px solid var(--line); }

.monthly {
  margin: 16px 0;
  padding: 0;
  list-style: none;
  border-top: 1px dashed var(--line);
}
.monthly li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.monthly .profit { font-weight: 700; }

.schedule-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: #231c17;
  color: #f4eadb;
}
.schedule-card h3 { color: #f4eadb; }
.schedule-card p { margin: 0 0 10px; color: #d9ccba; font-size: 0.92rem; }
.schedule-card .cite {
  font-size: 0.8rem;
  color: #c3b29a;
}
.schedule-card a { color: #f0c7a6; }
.schedule-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.schedule-card .btn-ghost { color: #f4eadb; border-color: #5a4c3f; }
.schedule-card .btn-ghost:hover { background: rgba(255,255,255,0.06); color: #fff; }

.disclaimer {
  margin: 14px 0 0;
  color: var(--ink-faint);
  font-size: 0.8rem;
}

/* Email / affiliates / FAQ */
.band { padding: 12px 0 56px; }
.band h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.band .intro { color: var(--ink-soft); max-width: 62ch; margin: 0 0 20px; }

.email-card, .faq, .gear {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.email-card { padding: 22px; }
.email-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.form-status {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--pine-deep);
}
.form-status.error { color: var(--danger); }

.gear {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
}
.gear-item {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
}
.gear-item:first-child { border-top: 0; }
.gear-item h3 { margin: 0; font-size: 1rem; }
.gear-item p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.affiliate-placeholder {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  color: var(--ink-faint);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  pointer-events: none;
  width: fit-content;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 4px 18px;
}
.faq details:first-child { border-top: 0; }
.faq summary {
  cursor: pointer;
  list-style: none;
  min-height: 52px;
  display: flex;
  align-items: center;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  margin-left: auto;
  font-weight: 500;
  color: var(--ink-faint);
  font-size: 1.3rem;
}
.faq details[open] summary::after { content: "–"; }
.faq details p, .faq details li { color: var(--ink-soft); }
.faq details p { margin: 0 0 14px; }
.faq details ul { margin: 0 8px 14px 0; padding-left: 18px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.site-footer .wrap { display: grid; gap: 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.footer-links a { color: var(--ink-soft); }

.thanks-wrap {
  width: min(640px, calc(100% - 32px));
  margin: 12vh auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.thanks-wrap h1 { font-family: var(--serif); letter-spacing: -0.03em; margin: 0 0 12px; }

/* Sticky mobile summary */
.mobile-summary {
  display: none;
}

@media (max-width: 919px) {
  .field-grid { grid-template-columns: 1fr; }
  .mobile-summary {
    display: flex;
    position: sticky;
    bottom: 0;
    z-index: 15;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #231c17;
    color: #f4eadb;
    border-top: 1px solid #3a3028;
  }
  .mobile-summary span { font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: #c3b29a; display: block; }
  .mobile-summary strong { font-variant-numeric: tabular-nums; font-size: 0.98rem; }
  main { padding-bottom: 84px; }
}

@media print {
  .site-header, .hero, .inputs, .hero-actions, .nav, .email-card,
  .gear, .faq, .site-footer, .mobile-summary, .schedule-actions,
  .reset-row, .hero-note, .skip-link { display: none !important; }
  body { background: #fff; }
  .results-wrap, .results-panel, .schedule-card { box-shadow: none; border: 0; }
  .schedule-card { background: #fff; color: #000; }
  .schedule-card p, .schedule-card .cite, .schedule-card h3 { color: #000; }
  .print-only { display: block !important; }
  .calc-grid { display: block; }
  a[href]::after { content: ""; }
}

.print-only { display: none; }
.print-schedule {
  padding: 12px 0 32px;
}
.print-schedule h1 { font-family: var(--serif); }
.print-schedule table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.print-schedule th, .print-schedule td {
  border-bottom: 1px solid #ddd;
  text-align: left;
  padding: 6px 8px;
  vertical-align: top;
}

@media (min-width: 700px) {
  .email-grid { grid-template-columns: 1fr 1fr auto; }
  .gear { grid-template-columns: 1fr 1fr; }
  .gear-item:nth-child(1), .gear-item:nth-child(2) { border-top: 0; }
  .gear-item:nth-child(odd) { border-right: 1px solid var(--line); }
}
