/* ==========================================================================
   Lilibet's — first-party booking engine prototype

   Light theme. The page is nothing but the reservation form: no site chrome,
   no marketing sections. It is designed to sit inside an existing site (or an
   iframe-free /reservations route) and inherit its surroundings, so the
   surfaces stay near-white and the gold does the branding.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* The `hidden` attribute must always win. Several components below set an
   explicit `display` (.inspector is flex, .hold is flex), and an author rule
   beats the UA stylesheet's `[hidden] { display: none }` — which silently left
   the inspector panel open and intercepting every click on the right-hand side
   of the page. Toggling `hidden` in JS is the app's only hide mechanism, so
   this rule is load-bearing, not defensive. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--on-light);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  margin: 0;
  font-optical-sizing: auto;
}

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

/* ── Shared type ─────────────────────────────────────────────────────────── */

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.015em;
}
.section-title em { font-style: italic; color: var(--gold); }

.section-lede {
  font-size: 16.5px;
  color: var(--on-light-muted);
  max-width: 54ch;
  margin: 16px auto 0;
}
.section-lede a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  --btn-bg: var(--gold);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover:not(:disabled) { background: #8a7249; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--gold);
}
.btn--ghost:hover:not(:disabled) { background: var(--gold); color: #fff; border-color: var(--gold); }

.btn--sm { padding: 10px 18px; font-size: 10.5px; }
.btn--block { width: 100%; }

.btn.is-busy { pointer-events: none; opacity: 0.75; }
.btn.is-busy::after {
  content: '';
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.inline-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font: inherit;
}

/* `pulse` is still used by the hold-countdown dot below. */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Masthead ────────────────────────────────────────────────────────────── */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.masthead__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.masthead__nav { display: flex; align-items: center; gap: 26px; }
.masthead__nav--right { justify-content: flex-end; }
.masthead__nav a, .masthead__here {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--on-light-muted);
  transition: color var(--t-fast) var(--ease);
}
.masthead__nav a:hover { color: var(--gold); }
/* Current page — a marker, not a link. */
.masthead__here {
  color: var(--gold);
  font-weight: 600;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.masthead__logo img { height: 34px; width: auto; }

@media (max-width: 860px) {
  .masthead__nav--left { display: none; }
  .masthead__inner { grid-template-columns: 1fr auto; }
  .masthead__logo { order: -1; justify-self: start; }
}

/* ── Page frame ──────────────────────────────────────────────────────────── */

.reserve {
  padding: clamp(36px, 6vw, 68px) var(--gutter) clamp(44px, 6vw, 76px);
}
.reserve__head {
  max-width: 620px;
  margin: 0 auto clamp(28px, 4vw, 44px);
  text-align: center;
}
.reserve__foot {
  text-align: center;
  margin: 28px auto 0;
  font-size: 14px;
  color: var(--on-light-muted);
}
.reserve__foot a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* ── Engine shell ────────────────────────────────────────────────────────── */

/* Deliberately NOT `overflow: hidden` — the date popover is anchored inside the
   search step and would be clipped. The rail carries its own top radius instead,
   since it is the only differently-coloured element touching an engine corner. */
.engine {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

/* Progress rail */
.rail {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
  border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0;
  background: var(--canvas);
  overflow: hidden;
}
.rail__item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 15px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--on-light-faint);
  border-right: 1px solid var(--border-soft);
  transition: color var(--t-med) var(--ease), background var(--t-med) var(--ease);
}
.rail__item:last-child { border-right: 0; }
.rail__num {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border: 1px solid currentColor;
  border-radius: 50%;
  flex: none;
}
.rail__num svg { width: 13px; height: 13px; }
.rail__item.is-active { color: var(--gold); background: var(--surface); }
.rail__item.is-done { color: var(--on-light-muted); }
.rail__item.is-done .rail__num {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
/* Completed steps swap the step icon for a tick. */
.rail__item.is-done .rail__num svg { display: none; }
.rail__item.is-done .rail__num::after { content: '✓'; font-size: 12px; }

@media (max-width: 720px) {
  .rail__label { display: none; }
  .rail__item { padding: 13px 6px; }
}

/* Hold countdown */
.hold {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px;
  background: var(--warn-tint);
  border-bottom: 1px solid #eddcbf;
  font-size: 13px;
  color: #7d541f;
}
.hold strong { font-variant-numeric: tabular-nums; color: #593a12; }
.hold__pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warn);
  animation: pulse 1.6s var(--ease) infinite;
}
.hold.is-urgent { background: var(--danger-tint); border-color: #f0d3ce; color: #8c2a23; }
.hold.is-urgent .hold__pulse { background: var(--danger); }
.hold.is-urgent strong { color: #6f211b; }

/* Steps */
.step { padding: clamp(20px, 3.4vw, 34px); }
.step__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}
.step__summary { margin: 0; font-size: 14px; color: var(--on-light-muted); }
.step__summary strong { color: var(--on-light); font-weight: 600; }

.linkback {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold);
  font-size: 12.5px;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}
.linkback:hover { color: #7d6740; }

/* ── Search bar ──────────────────────────────────────────────────────────── */

/* Information architecture: Date → Guests → Service → Find a table. Date takes
   the flexible space; Guests, Service and the button are each only as wide as
   their content. */
.searchbar {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 16px;
  align-items: end;
}
/* Below the desktop row: Date spans the top, then Guests + Service share a row,
   and the button takes a full row of its own. */
@media (max-width: 900px) {
  .searchbar { grid-template-columns: auto 1fr; }
  .field--date { grid-column: 1 / -1; }
  .field--guests { grid-column: 1; }
  .field--service { grid-column: 2; }
  .btn--search { grid-column: 1 / -1; }
}

.field { display: grid; gap: 8px; }
.field > label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--on-light-faint);
}

/* Guests: two round increment buttons flanking the count. The buttons carry the
   interaction; the wrapper is a quiet field frame the same height as its
   neighbours. Palette per brief: warm cream idle, deepening on hover/press. */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 52px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.stepper__btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f2ece5;
  border: 1px solid #e8dfd1;
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.stepper__btn:hover:not(:disabled) { background: #d1c3b5; border-color: #b9a997; }
.stepper__btn:active:not(:disabled) { background: #b9a997; border-color: #b9a997; }
.stepper__btn:disabled { opacity: 0.45; cursor: not-allowed; }
.stepper__val {
  width: 32px;
  height: 100%;
  border: 0;
  background: none;
  text-align: center;
  color: var(--on-light);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  cursor: default;
}
.stepper__val:focus { outline: none; }

.datepick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--on-light);
  font-size: 15px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease);
}
.datepick:hover { border-color: var(--gold); }
.datepick svg { color: var(--gold); flex: none; }

/* Service: a segmented Any / Lunch / Dinner toggle. Non-active segments are
   white; hover lifts to warm cream; the active segment is muddy bronze —
   lighter than the gold CTA so it reads as "chosen", not "click me". */
.segset {
  display: inline-flex;
  height: 52px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.seg {
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: var(--surface);
  color: var(--on-light-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
.seg:hover:not(.is-on) { background: var(--chip-hover); color: var(--on-light); }
.seg.is-on {
  background: var(--chip-active);
  border-color: var(--chip-active-line);
  color: var(--on-light);
  font-weight: 600;
}

.btn--search { height: 52px; }

/* ── Calendar ────────────────────────────────────────────────────────────── */

/* A popover anchored under the date button, not an accordion. Opening it must
   not reflow the search bar or shift the buttons under the user's cursor. */
.field--date { position: relative; }

.calendar {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 70;
  width: 340px;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  animation: drop var(--t-fast) var(--ease-out);
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* On mobile the date field sits in column 2, so a left-anchored popover would
   spill off the right edge. Hug the field's right edge and grow leftward — its
   right edge is the search bar's right gutter, so it always stays on screen. */
@media (max-width: 900px) {
  .calendar { left: auto; right: 0; }
}

.calendar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--on-light);
  font-family: var(--font-display);
  font-size: 17px;
}
.calendar__nav {
  width: 32px; height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--gold);
  font-size: 17px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.calendar__nav:hover:not(:disabled) { background: var(--canvas); }
.calendar__nav:disabled { color: var(--border); cursor: not-allowed; }

.calendar__dow, .calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar__dow {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--on-light-faint);
  text-align: center;
}
.cal-day {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  color: var(--on-light);
  font-size: 13.5px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.cal-day:hover:not(:disabled) { background: rgba(156,130,86,0.12); border-color: var(--gold); }
.cal-day:disabled { color: #cdc5b6; cursor: not-allowed; }
.cal-day.is-empty { visibility: hidden; }
.cal-day.is-selected { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }
.cal-day__dot {
  position: absolute;
  bottom: 5px;
  width: 4px; height: 4px;
  border-radius: 50%;
}
.cal-day.is-selected .cal-day__dot { display: none; }

.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin: 0 5px 0 12px; }
.dot--good, .cal-day__dot--good { background: var(--ok); }
.dot--low, .cal-day__dot--low { background: var(--warn); }
.dot--none, .cal-day__dot--none { background: #d3cabb; }

.calendar__key {
  margin: 14px 0 0;
  font-size: 11px;
  color: var(--on-light-faint);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Slots ───────────────────────────────────────────────────────────────── */

.slots-out { display: grid; gap: 18px; }

/* Social-proof bar — the "table held for 5:00" bar, repurposed while the guest
   is still choosing. Informational gold, not the urgent warn tone of the hold. */
.viewbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border: 1px solid #ece3d0;
  border-radius: var(--r-md);
  background: rgba(156,130,86,0.07);
  font-size: 13px;
  color: var(--on-light-muted);
}
.viewbar svg { width: 16px; height: 16px; color: var(--gold); flex: none; }
.viewbar strong { color: var(--on-light); font-weight: 600; }

/* Step 2 is table-first: one product card per seating area. A landscape thumb
   sits beside the title + description in a top row; the full-width timetable
   runs beneath. (The image no longer stretches to the card's full height now
   that lunch + dinner share one card.) */
.tablecard {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.tablecard__top {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: start;
}
.tablecard__thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--r-sm);
  display: block;
}
.tablecard__meta { display: grid; gap: 7px; }
.tablecard__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.tablecard__head h3 { font-size: 21px; }
.tablecard__dur {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}
.tablecard__meta p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--on-light-muted);
}
.area__more {
  background: none; border: 0; padding: 0;
  color: var(--gold);
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* The day's timetable inside a card: a labelled row per shift. */
.timetable { display: grid; gap: 14px; }
.timetable__shift {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  align-items: start;
}
.timetable__label {
  padding-top: 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--on-light-faint);
}
.timetable__shift + .timetable__shift { padding-top: 14px; border-top: 1px solid var(--border-soft); }

/* Time slots are compact pills laid out on a grid that stretches them to fill
   the row — so there's never a ragged gap between the last pill and the edge. */
.times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 7px;
}
.time-btn {
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--on-light);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  min-width: 0;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}
.time-btn:hover { background: var(--chip-hover); border-color: var(--chip-active); color: var(--on-light); }
.time-btn.is-selected {
  background: var(--chip-active);
  border-color: var(--chip-active-line);
  color: var(--on-light);
  font-weight: 600;
}
/* Late request-only slots — dashed to read as "enquire", not "instant". */
.time-btn--request { border-style: dashed; color: var(--on-light-muted); }
/* Filled slots stay visible so the timetable reads honestly — greyed, struck,
   not interactive. */
.time-btn--filled {
  border-style: dashed;
  border-color: var(--border-soft);
  background: var(--canvas);
  color: #bcb3a3;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* The Evening row: the late request chip(s) sit inline with a contact line, so
   the guest sees at a glance that a late table is booked by phone. */
.timetable__shift--evening .timetable__label { color: var(--gold); }
.evening { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.times--evening { display: flex; gap: 7px; }
.times--evening .time-btn { min-width: 72px; flex: none; }
.evening__note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--on-light-muted);
}
.evening__tel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.evening__tel svg { width: 15px; height: 15px; flex: none; }
.evening__tel:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Below desktop the card's top row stacks: image above the title + description. */
@media (max-width: 720px) {
  .tablecard__top { grid-template-columns: 1fr; }
  .tablecard__thumb { aspect-ratio: 16 / 9; }
}
/* On phones the shift label sits above its times, and pills go to four even
   columns so there's no ragged edge. */
@media (max-width: 520px) {
  .tablecard { padding: 16px; gap: 16px; }
  .timetable__shift { grid-template-columns: 1fr; gap: 7px; }
  .timetable__label { padding-top: 0; }
  .times { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .time-btn { padding: 8px 4px; font-size: 12.5px; }
  .evening { gap: 10px; }
}

/* Empty / error states */
.empty {
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--canvas);
}
.empty h3 { font-size: 21px; margin-bottom: 8px; }
.empty p { margin: 0 auto 20px; font-size: 14px; color: var(--on-light-muted); max-width: 44ch; }
.empty__alts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.skeleton { display: grid; gap: 10px; }
.skeleton__row {
  height: 46px;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--canvas) 0%, var(--border-soft) 50%, var(--canvas) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skeleton__row:nth-child(1) { width: 40%; }
.skeleton__row:nth-child(2) { height: 90px; }
.skeleton__row:nth-child(3) { height: 90px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Forms ───────────────────────────────────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  align-items: start;
}
@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; }
  /* Form FIRST, then the summary + its CTA (natural DOM order). Sticky would put
     the tall card on top of the inputs; static keeps it a review the guest
     reaches on the way to the button. */
  .summary-rail { position: static; top: auto; }
}

.form { display: grid; gap: 16px; }
.form__title {
  font-size: 24px;
  margin-bottom: 2px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

.input { display: grid; gap: 7px; }
.input label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--on-light-faint);
}
.input .opt { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: 0.8; }

.input input, .input select, .input textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--on-light);
  font-family: var(--font-sans);
  font-size: 15px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input textarea { resize: vertical; line-height: 1.55; }
.input input::placeholder, .input textarea::placeholder { color: #a8a093; }
.input input:focus, .input select:focus, .input textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(156,130,86,0.14);
}
.input select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239c8256' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.input.has-error input, .input.has-error select, .input.has-error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(163,52,44,0.1);
}
.input__err {
  font-size: 12px;
  color: var(--danger);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}

.chips { border: 0; padding: 0; margin: 0; display: grid; gap: 9px; }
.chips legend {
  padding: 0;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--on-light-faint);
}
.chips legend .opt { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: 0.8; }
.chips__row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--on-light-muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.chip:hover { background: var(--chip-hover); border-color: var(--chip-active); color: var(--on-light); }
.chip.is-on { background: var(--chip-active); border-color: var(--chip-active-line); color: var(--on-light); font-weight: 600; }

.check {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--on-light-muted);
  cursor: pointer;
  line-height: 1.5;
}
.check input {
  width: 17px; height: 17px;
  margin: 2px 0 0;
  accent-color: var(--gold);
  flex: none;
  cursor: pointer;
}
.check.has-error span { color: var(--danger); }

.notice {
  padding: 13px 15px;
  border-left: 2px solid var(--gold);
  background: rgba(156,130,86,0.08);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13.5px;
  color: var(--on-light-muted);
  line-height: 1.55;
}
.notice strong { color: var(--on-light); display: block; }

.fineprint { margin: -6px 0 0; font-size: 12px; color: var(--on-light-faint); }
.fineprint code {
  background: var(--canvas);
  border: 1px solid var(--border-soft);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  font-size: 11.5px;
}

.policy {
  max-height: 168px;
  overflow-y: auto;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--canvas);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--on-light-muted);
}
.policy h5 {
  margin: 0 0 5px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--gold);
}
.policy p { margin: 0 0 13px; }
.policy p:last-child { margin-bottom: 0; }

.form-error {
  padding: 12px 15px;
  border-radius: var(--r-sm);
  background: var(--danger-tint);
  border: 1px solid #eccfcb;
  color: #8c2a23;
  font-size: 13.5px;
}

/* ── Summary card ────────────────────────────────────────────────────────── */

/* The right rail now carries the summary card AND the step's primary action,
   pinned together so the CTA stays above the fold as the form scrolls. */
.summary-rail {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: grid;
  gap: 16px;
  align-content: start;
}
.summary {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--canvas);
  overflow: hidden;
}
.summary__img { width: 100%; height: 128px; object-fit: cover; }
.summary__body { padding: 18px; }
.summary__title {
  font-size: 19px;
  margin-bottom: 3px;
}
.summary__area {
  font-size: 11px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 16px;
}
.summary__rows { display: grid; gap: 10px; }
.summary__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 13.5px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.summary__row:last-child { border-bottom: 0; padding-bottom: 0; }
.summary__row dt { color: var(--on-light-faint); margin: 0; }
.summary__row dd { margin: 0; color: var(--on-light); text-align: right; font-weight: 500; }

/* ── Confirmation ────────────────────────────────────────────────────────── */

.done { text-align: center; padding: 14px 0 8px; }
.done__mark {
  width: 62px; height: 62px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(156,130,86,0.1);
  color: var(--gold);
  font-size: 27px;
  animation: pop var(--t-slow) var(--ease-out);
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.done h2 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 10px; }
.done h2 em { font-style: italic; color: var(--gold); }
.done__lede { color: var(--on-light-muted); font-size: 15.5px; max-width: 48ch; margin: 0 auto 26px; }
.done__ref {
  display: inline-block;
  padding: 7px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 28px;
}
.done__card {
  max-width: 420px;
  margin: 0 auto 26px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--canvas);
  overflow: hidden;
}
.done__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.done__tracked {
  max-width: 560px;
  margin: 32px auto 0;
  padding: 18px;
  border: 1px solid #cfdfd0;
  border-radius: var(--r-md);
  background: var(--ok-tint);
  text-align: left;
}
.done__tracked h4 {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: #3f6642;
  margin-bottom: 10px;
}
.done__tracked ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--on-light-muted); line-height: 1.7; }
.done__tracked code { color: #3f6642; font-size: 12px; }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--on-light-muted);
  padding: clamp(40px, 5vw, 64px) var(--gutter) 26px;
}
.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 34px;
}
@media (max-width: 880px) { .footer__inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer__inner { grid-template-columns: 1fr; } }
.footer__brand img { height: 36px; width: auto; margin-bottom: 16px; }
.footer__brand p { font-family: var(--font-display); font-size: 17px; font-style: italic; color: var(--on-light); margin: 0; }
.footer__col h2 {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 13px;
}
.footer__col p { margin: 0 0 11px; font-size: 14px; line-height: 1.6; }
.footer__col a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.footer__legal {
  max-width: var(--container);
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  font-size: 11.5px;
  color: var(--on-light-faint);
}

/* ── Tracking inspector ──────────────────────────────────────────────────── */

.inspector-fab {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 90;
  width: 50px; height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--surface);
  color: var(--gold);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}
.inspector-fab:hover { transform: translateY(-2px); background: var(--gold); color: #fff; }
.inspector-fab__count {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 20px;
  padding: 0 5px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--claret);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.inspector {
  position: fixed;
  top: 0; right: 0;
  z-index: 100;
  width: min(440px, 100vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(20,16,12,0.14);
  animation: slidein var(--t-med) var(--ease-out);
}
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }

.inspector__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.inspector__head h2 { font-size: 20px; margin-bottom: 5px; }
.inspector__head p { margin: 0; font-size: 12.5px; color: var(--on-light-faint); line-height: 1.5; }
.inspector__close {
  width: 32px; height: 32px;
  flex: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--on-light-muted);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}
.inspector__close:hover { background: var(--canvas); color: var(--on-light); }

.inspector__tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--canvas); }
.inspector__tab {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--on-light-faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.inspector__tab:hover { color: var(--on-light); }
.inspector__tab.is-on { color: var(--gold); border-bottom-color: var(--gold); background: var(--surface); }

.inspector__body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.inspector__hint { margin: 0 0 14px; font-size: 12.5px; color: var(--on-light-faint); line-height: 1.6; }
.inspector__foot { padding: 14px 20px; border-top: 1px solid var(--border); }

.evlog { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.evlog__item {
  padding: 11px 13px;
  border: 1px solid var(--border-soft);
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--canvas);
  animation: drop var(--t-fast) var(--ease-out);
}
.evlog__item--goal { border-left-color: var(--ok); background: var(--ok-tint); border-color: #d9e6da; }
.evlog__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.evlog__name {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: #7d6740;
  word-break: break-all;
}
.evlog__item--goal .evlog__name { color: #3f6642; }
.evlog__time { font-size: 10.5px; color: var(--on-light-faint); font-variant-numeric: tabular-nums; flex: none; }
.evlog__params {
  margin: 7px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.65;
  color: var(--on-light-muted);
  word-break: break-word;
}
.evlog__params b { color: var(--on-light-faint); font-weight: 400; }
.evlog__empty { font-size: 13px; color: var(--on-light-faint); }

.code {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--canvas);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  color: #4a4235;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
