:root {
  color-scheme: light;
  --paper: #f3efe6;
  --paper-2: #e7e1d4;
  --card: #fffdf8;
  --ink: #1c1915;
  --muted: #5e584e;
  --line: #ddd4c4;
  --green: #1b5e3b;
  --green-ink: #143d28;
  --mint: #e7f3ec;
  --danger: #8f2d2d;
  --danger-bg: #f8ece8;
  --shadow: 0 18px 50px rgba(28, 25, 20, 0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at top, rgba(27, 94, 59, 0.08), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.shell {
  width: min(100%, 440px);
  margin: 0 auto;
  min-height: 100dvh;
}

.desk { display: none; }

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 0;
}

.brand, .brand-mark, .step, .kicker {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 750;
}

.brand, .brand-mark { color: var(--green-ink); }

.step, .kicker { color: var(--muted); }

.back {
  border: 0;
  background: transparent;
  padding: 10px 0;
  min-height: 44px;
  color: var(--green-ink);
  font-weight: 700;
}

.progress {
  height: 4px;
  margin: 12px 20px 0;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--green);
}

.screen-body {
  flex: 1;
  padding: 22px 20px 12px;
}

h1 {
  margin: 8px 0 0;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: clamp(2rem, 8vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 650;
}

h2 {
  margin: 22px 0 6px;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lede, .note, .unit, .from-row { color: var(--muted); }

.lede { margin: 10px 0 0; font-size: 1.05rem; }

.trust {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.trust li {
  padding: 8px 0 8px 28px;
  position: relative;
}

.trust li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  position: absolute;
  left: 0;
  top: 14px;
}

.from-row { margin: 18px 0 0; font-size: 0.92rem; }

.choices { display: grid; gap: 10px; margin-top: 18px; }

.choice {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  min-height: 64px;
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.choice:active { transform: scale(0.99); }

.choice.is-selected {
  border-color: var(--green);
  background: var(--mint);
}

.choice-copy { display: grid; gap: 2px; }

.choice-label { font-weight: 720; }

.choice-detail { color: var(--muted); font-size: 0.92rem; }

.choice-go { color: var(--green); font-size: 1.4rem; line-height: 1; }

.dock {
  position: sticky;
  bottom: 0;
  padding: 12px 20px calc(16px + var(--safe-bottom));
  background: linear-gradient(to top, var(--paper) 70%, rgba(243, 239, 230, 0));
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  text-decoration: none;
  font-weight: 750;
}

.btn-primary { background: var(--green); color: #f6fbf8; }

.btn-primary:active { background: var(--green-ink); }

.btn-secondary {
  background: transparent;
  color: var(--green-ink);
  border-color: var(--line);
}

.stack { display: grid; gap: 10px; margin-top: 18px; }

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-ink);
  font-weight: 720;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.price {
  font-size: 4.4rem;
  color: var(--green-ink);
  font-variant-numeric: tabular-nums;
}

.unit { margin: 4px 0 0; font-weight: 700; color: var(--ink); }

.receipt {
  margin-top: 18px;
  padding: 6px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.lines { list-style: none; margin: 0; padding: 0; }

.lines li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.lines li:last-child { border-bottom: 0; }

.lines .total { font-weight: 780; }

.note { font-size: 0.95rem; }

.field, .windows { display: grid; gap: 6px; margin-top: 16px; }

.field span, .windows legend { font-weight: 720; }

.windows { border: 0; padding: 0; }

input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
}

.field.is-invalid input { border-color: var(--danger); background: var(--danger-bg); }

.field-error { color: var(--danger); font-size: 0.92rem; font-weight: 650; }

.choices-compact { margin-top: 8px; }

.done-mark {
  width: 52px;
  height: 52px;
  margin: 8px 0 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green-ink);
  font-size: 1.5rem;
}

.quote-id {
  display: inline-flex;
  margin: 10px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  letter-spacing: 0.08em;
  font-weight: 760;
}

.summary {
  margin: 16px 0 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  border-radius: 14px;
  background: #1c1915;
  color: #f3efe6;
  font: 0.82rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (min-width: 960px) {
  body { min-height: 100dvh; }

  .shell {
    width: min(1040px, calc(100% - 64px));
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 48px;
    align-items: center;
  }

  .desk { display: block; }

  .desk h2 {
    margin: 12px 0 0;
    text-transform: none;
    letter-spacing: -0.03em;
    font-family: Georgia, "Iowan Old Style", Palatino, serif;
    font-size: 3rem;
    line-height: 1.05;
    font-weight: 650;
  }

  .desk p { color: var(--muted); font-size: 1.15rem; max-width: 36ch; }

  .app {
    min-height: 760px;
    background: rgba(255, 253, 248, 0.72);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .screen { min-height: 760px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .choice:active { transform: none; }
}
