@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces-Italic-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-Italic-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #F3F0E8;
  --surface: #FFFDF8;
  --ink: #1A2A24;
  --muted: #5C675F;
  --accent: #1A5A48;
  --accent-hover: #144538;
  --accent-soft: #E3EDE7;
  --line: #D8D4C8;
  --red: #9B2C1F;
  --amber: #9A5B12;
  --green: #1B6B45;
  --red-soft: #F8EBE8;
  --amber-soft: #F6EDE0;
  --green-soft: #E5F0EA;
  --font-sans: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(26, 42, 36, 0.06), 0 8px 24px rgba(26, 42, 36, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
}

.wrap {
  width: min(100%, 430px);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 20px 20px 32px;
  display: flex;
  flex-direction: column;
}

.legal-wrap {
  width: min(100%, 640px);
  padding: 28px 22px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.brand {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

h1, h2, .display {
  font-family: var(--font-serif);
  font-weight: 560;
  font-variation-settings: "SOFT" 40, "WONK" 0, "opsz" 48;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0;
}

h1 { font-size: clamp(36px, 10vw, 46px); }

h2 { font-size: 28px; }

.lede {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.hero-main { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; padding: 28px 0 24px; }

.btn[hidden], [hidden] { display: none !important; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  color: var(--surface);
  background: var(--accent);
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.btn[aria-disabled="true"],
.btn.is-pending {
  cursor: pointer;
}

.btn-secondary {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.btn-secondary:hover { background: var(--accent-soft); }

.btn-icon svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.fine {
  margin: 16px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.footer {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.back {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 0;
  cursor: pointer;
}

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

.progress {
  flex: 1;
  height: 4px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.question {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 22px;
}

.options { display: grid; gap: 10px; }

.option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 16px;
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.option:hover { border-color: var(--accent); background: var(--accent-soft); }
.option:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.field { margin: 0 0 14px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
}

.field input,
.field select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.field input:focus,
.field select:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.privacy-note {
  margin: 4px 0 18px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: 12px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.privacy-note a { color: var(--accent); }

.error {
  color: var(--red);
  font-size: 13px;
  margin: 0 0 12px;
}

.score-hero { text-align: center; margin: 8px 0 8px; }

.score-number {
  font-family: var(--font-serif);
  font-size: 72px;
  font-weight: 560;
  letter-spacing: -0.04em;
  line-height: 0.9;
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 72;
}

.score-number small {
  font-size: 28px;
  margin-left: 2px;
  color: var(--muted);
}

.score-number.is-red { color: var(--red); }
.score-number.is-amber { color: var(--amber); }
.score-number.is-green { color: var(--green); }

.score-caption { margin: 10px 0 16px; color: var(--muted); font-size: 14px; }

.bars { display: grid; gap: 10px; margin: 0 0 16px; }

.bar-row { display: grid; gap: 6px; }

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.bar-meta .pts { color: var(--muted); font-weight: 500; }

.bar-track {
  height: 10px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.45s ease;
}

.bar-fill.is-red { background: var(--red); }
.bar-fill.is-amber { background: var(--amber); }
.bar-fill.is-green { background: var(--green); }

.offer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 14px;
  margin: 0 0 10px;
  box-shadow: var(--shadow);
}

.offer .kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}

.offer h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 560;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}

.offer .price { font-weight: 600; margin: 0 0 8px; }
.offer p { margin: 0; color: var(--muted); font-size: 14px; }

.cta-stack { display: grid; gap: 8px; margin: 14px 0 8px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 390px);
  background: var(--ink);
  color: var(--surface);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 20;
}

.toast[hidden] { display: none; }

.area-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.screen[hidden] { display: none; }

.legal h1 { font-size: 36px; margin-bottom: 8px; }
.legal h2 { font-size: 22px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--ink); }
.legal p { margin: 0 0 12px; }
.pending-flag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-soft);
  padding: 2px 8px;
  border-radius: 99px;
  vertical-align: middle;
  margin-left: 6px;
}

@media (min-width: 800px) {
  body { background: #E7E3D8; }
  .wrap, .legal-wrap {
    margin: 24px auto 40px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    min-height: calc(100dvh - 64px);
  }
}


.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 0;
  overflow: hidden;
}

.day-grid,
.slot-grid {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
}

.day-grid { grid-template-columns: 1fr 1fr; }

.slot-grid { grid-template-columns: 1fr 1fr 1fr; }

.chip-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.chip-btn .muted { color: var(--muted); font-size: 12px; font-weight: 500; }

.chip-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

.chip-btn.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--surface);
}

.chip-btn.is-selected .muted { color: rgba(255, 253, 248, 0.8); }

.chip-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.slot-grid .chip-btn {
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 6px;
  font-size: 13px;
  font-weight: 600;
}

#slot-section[hidden],
#details-section[hidden] { display: none; }

.confirm-hero { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; padding: 28px 0 24px; }
