/* =================================================================
   縮時森林 · 預約彈窗 Demo — styles.css
   森林 editorial 視覺 / RWD 375 / 768 / 1280
   ================================================================= */

/* ── Design Tokens ────────────────────────────────────────────── */
:root {
  --forest:      #36432F;
  --moss:        #7C8A6B;
  --moss-light:  #9EAB8E;
  --moss-dark:   #5A6650;
  --cream:       #F4F1E8;
  --paper:       #FBFAF5;
  --ink:         #2A2E26;
  --ink-mute:    #6B7060;
  --ink-faint:   #A8AD9E;
  --hairline:    rgba(54, 67, 47, .14);
  --hairline-strong: rgba(54, 67, 47, .24);
  --radius:      16px;
  --radius-sm:   10px;
  --radius-xs:   6px;
  --shadow-card: 0 8px 32px rgba(42, 46, 38, .14), 0 2px 8px rgba(42, 46, 38, .08);
  --shadow-sm:   0 2px 8px rgba(42, 46, 38, .10);
  --trans:       0.2s ease;

  /* typography */
  --font-serif: Georgia, 'Times New Roman', 'Noto Serif TC', serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', '微軟正黑體', 'PingFang TC', sans-serif;

  /* modal sizing */
  --modal-max: 520px;
  --modal-pad: 32px;

  /* progress */
  --progress-h: 3px;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}
button { cursor: pointer; border: none; background: none; font: inherit; }
input, button { -webkit-appearance: none; }
a { color: inherit; text-decoration: none; }

/* ── DEMO STAGE (觸發頁) ───────────────────────────────────────── */
.demo-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 80%, rgba(124,138,107,.12) 0%, transparent 70%),
    var(--cream);
}

.demo-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--moss-dark);
  text-transform: uppercase;
  margin-bottom: 32px;
}
.demo-brand__leaf {
  width: 20px;
  height: 25px;
  flex-shrink: 0;
}

.demo-headline {
  font-family: var(--font-serif);
  font-size: clamp(26px, 5vw, 42px);
  color: var(--forest);
  line-height: 1.25;
  letter-spacing: -.01em;
  margin-bottom: 12px;
}

.demo-sub {
  font-size: 15px;
  color: var(--ink-mute);
  letter-spacing: .02em;
  margin-bottom: 40px;
}

.demo-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--forest);
  color: var(--paper);
  border-radius: 100px;
  font-size: 15px;
  letter-spacing: .06em;
  font-family: var(--font-sans);
  transition: background var(--trans), transform var(--trans), box-shadow var(--trans);
  box-shadow: 0 4px 16px rgba(54,67,47,.3);
}
.demo-cta:hover {
  background: var(--moss-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(54,67,47,.36);
}
.demo-cta:active { transform: translateY(0); }

/* ── BACKDROP ─────────────────────────────────────────────────── */
.booking-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(42, 46, 38, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);

  /* initial state — hidden; app.js controls via class */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.booking-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── MODAL ROOT ───────────────────────────────────────────────── */
.booking-modal {
  position: fixed;
  inset: 0;
  z-index: 901;
  display: flex;
  align-items: flex-end;    /* mobile: sheet from bottom */
  justify-content: center;
  pointer-events: none;
  padding: 0;

  /* initial hidden state */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.booking-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* inner card */
.booking-modal::after { display: none; } /* no pseudo */
/* NOTE: removed `.booking-modal > *:not(.booking-step){position:relative}`
   — its specificity (0,2,0) was overriding .booking-modal__close{position:absolute}
   and pinning the close button into normal flow. */

/* ── Modal Inner Card Layout ──────────────────────────────────── */
/* We nest all visible content in .booking-step + header elements
   BUT the modal itself is the card on desktop.
   Let's use a wrapper approach: */

.booking-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-mute);
  transition: background var(--trans), color var(--trans);
  flex-shrink: 0;
}
.booking-modal__close svg { width: 18px; height: 18px; }
.booking-modal__close:hover { background: var(--hairline); color: var(--forest); }

/* card body — overridden below in media queries */
.booking-progress,
.booking-step {
  /* contained by the inner-card below */
}

/* Inner card shell */
.booking-modal__inner {
  background: var(--paper);
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-card);
  padding: var(--modal-pad) var(--modal-pad) calc(var(--modal-pad) + env(safe-area-inset-bottom));
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Inject .booking-modal__inner via JS wrapping OR use modal itself as card.
   Since markup doesn't have explicit .inner wrapper, we style modal card directly: */

/* ── Re-approach: modal card IS the modal element ─────────────── */
.booking-modal {
  /* override: make modal the card */
  inset: unset;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--paper);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-card);
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--modal-pad) var(--modal-pad) calc(env(safe-area-inset-bottom) + var(--modal-pad));
  display: flex;
  flex-direction: column;
  align-items: stretch;     /* children fill card width (fix: progress/footer were content-width) */
  gap: 0;
  pointer-events: none;
  /* slide-in via CSS transition (app.js GSAP only touches opacity, not transform) */
  transform: translateY(40px);
  transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease;
}
.booking-modal.is-open {
  pointer-events: auto;
  transform: translateY(0);
}

/* ── PROGRESS BAR ─────────────────────────────────────────────── */
.booking-progress {
  position: relative;
  margin-bottom: 28px;
  flex-shrink: 0;
  /* #1 fix (Y-axis separation): close btn is top:20px height:36px → bottom 56px from modal top.
     Modal padding-top = 32px → progress would start at 32px (overlaps 32-56px).
     margin-top: 40px pushes start to 72px (standard) / 60px (small phone 20px pad),
     both > 56px → no Y overlap → no overlap at all.
     padding-right keeps label text away from the close btn area. */
  margin-top: 40px;
  padding-right: 44px;
}

/* The track */
.booking-progress::before {
  content: '';
  display: block;
  height: var(--progress-h);
  background: var(--hairline);
  border-radius: 100px;
  margin-bottom: 10px;
}

/* Fill */
.booking-progress__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: var(--progress-h);
  background: var(--moss);
  border-radius: 100px;
  width: 33.33%;            /* default step 1 — app.js updates */
  transition: width 0.5s ease;
}

/* Step labels */
.booking-progress__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.booking-progress__label {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: .05em;
  transition: color var(--trans);
  font-family: var(--font-sans);
}
.booking-progress__label.is-active {
  color: var(--moss-dark);
  font-weight: 600;
}
.booking-progress__label.is-done {
  color: var(--moss);
}

/* ── STEP PANELS ──────────────────────────────────────────────── */
.booking-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* default hidden — JS adds .booking-step--active or removes hidden */
}
.booking-step[hidden] { display: none; }
.booking-step--active { display: flex; }

.booking-step__heading {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--forest);
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: -.01em;
  flex-shrink: 0;
}

.booking-step__sub {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: -12px;
  flex-shrink: 0;
}

.booking-step__footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}
.booking-step__footer--split {
  justify-content: space-between;
}

/* ── BUTTONS ──────────────────────────────────────────────────── */
.booking-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 100px;
  font-size: 14px;
  letter-spacing: .04em;
  font-family: var(--font-sans);
  transition: background var(--trans), color var(--trans), border-color var(--trans),
              transform var(--trans), box-shadow var(--trans), opacity var(--trans);
  white-space: nowrap;
  min-width: 88px;
}

.booking-btn--primary {
  background: var(--forest);
  color: var(--paper);
  box-shadow: 0 3px 12px rgba(54,67,47,.25);
}
.booking-btn--primary:hover:not(:disabled) {
  background: var(--moss-dark);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(54,67,47,.30);
}
.booking-btn--primary:active:not(:disabled) { transform: translateY(0); }
.booking-btn--primary:disabled {
  background: var(--ink-faint);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

.booking-btn--ghost {
  background: transparent;
  color: var(--ink-mute);
  border: 1px solid var(--hairline-strong);
}
.booking-btn--ghost:hover {
  background: var(--hairline);
  color: var(--forest);
  border-color: var(--moss-light);
}

.booking-btn--line {
  background: #00B900;
  color: #fff;
  padding: 13px 24px;
  font-size: 14px;
  letter-spacing: .03em;
  border-radius: 100px;
  box-shadow: 0 4px 14px rgba(0,185,0,.30);
}
.booking-btn--line:hover {
  background: #00a000;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,185,0,.36);
}
.booking-btn__line-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background: #00B900; /* icon background matches btn for seamless look */
  border-radius: 4px;
}

/* ── REGION SELECT (兩層下拉：縣市 + 鄉鎮市區) ───────────────── */
.booking-region-select {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .booking-region-select {
    flex-direction: row;
  }
  .booking-region-select .booking-select-wrap {
    flex: 1;
  }
}

/* Wrapper provides the custom arrow indicator */
.booking-select-wrap {
  position: relative;
  flex: 1;
}
.booking-select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--ink-mute);
  pointer-events: none;
  transition: border-top-color var(--trans);
}
.booking-select-wrap:focus-within::after {
  border-top-color: var(--moss);
}

/* Native <select> styled to match forest editorial */
.booking-select {
  width: 100%;
  padding: 11px 36px 11px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-family: var(--font-sans);
  letter-spacing: .02em;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.booking-select:focus {
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(124,138,107,.14);
}
.booking-select:hover:not(:disabled) {
  border-color: var(--moss-light);
}
.booking-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(168,173,158,.08);
}
/* Placeholder option colour */
.booking-select option[value=""] {
  color: var(--ink-faint);
}

/* Calendar disabled state: when no city/township selected */
.booking-cal.is-disabled {
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}
/* Hint text shown by app.js below the calendar */
.booking-cal__hint {
  font-size: 13px;
  color: var(--moss-dark);
  text-align: center;
  padding: 6px 0;
  letter-spacing: .03em;
}
.booking-cal__hint[hidden] { display: none; }

/* ── CALENDAR ─────────────────────────────────────────────────── */
.booking-cal {
  flex-shrink: 0;
}

.booking-cal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.booking-cal__title {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--forest);
  letter-spacing: .02em;
}

.booking-cal__nav {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-mute);
  transition: background var(--trans), color var(--trans);
}
.booking-cal__nav svg { width: 18px; height: 18px; }
.booking-cal__nav:hover { background: var(--hairline); color: var(--forest); }

/* Weekday header cells — injected by app.js into [data-cal-grid] as the
   first row, so they share the same 7-column grid as the day cells. */
.cal-header-cell {
  text-align: center;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: .06em;
  padding: 4px 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* Calendar grid */
.booking-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

/* Day cell — generated by JS (no booking-cal__day class; use data-cal-day attr) */
[data-cal-day] {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--forest);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--trans), color var(--trans), border-color var(--trans), transform 0.15s ease;
  position: relative;
  line-height: 1;
  /* #3: clean GSAP scale target — origin at center, isolate stacking context */
  transform-origin: center;
  isolation: isolate;
}

/* empty cells (spacers) — app.js uses class="cal-blank" */
.cal-blank {
  background: transparent !important;
  cursor: default;
  pointer-events: none;
}

/* availability states */
[data-cal-day].is-available:hover {
  background: rgba(124,138,107,.12);
  border-color: var(--moss-light);
  color: var(--forest);
}

/* partial — dots indicator */
[data-cal-day].is-partial::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--moss-light);
}
[data-cal-day].is-partial:hover {
  background: rgba(124,138,107,.10);
  border-color: var(--moss-light);
}

/* full — visually unavailable but soft */
[data-cal-day].is-full {
  color: var(--ink-faint);
  background: rgba(168,173,158,.10);
  cursor: not-allowed;
}
[data-cal-day].is-full:hover { background: rgba(168,173,158,.10); }

/* blocked — strong disabled */
[data-cal-day].is-blocked {
  color: var(--hairline-strong);
  background: rgba(168,173,158,.08);
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-color: var(--ink-faint);
  opacity: .55;
}

/* past */
[data-cal-day].is-past {
  color: var(--ink-faint);
  cursor: not-allowed;
  opacity: .40;
}

/* today marker */
[data-cal-day].is-today {
  border-color: var(--moss-light);
  font-weight: 700;
}

/* selected — #3: strong moss fill, GSAP-scale-friendly target */
[data-cal-day].is-selected {
  background: var(--moss) !important;
  color: var(--paper) !important;
  border-color: var(--moss-dark) !important;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(90,102,80,.40), 0 0 0 2px var(--moss-dark);
  z-index: 1; /* lift above neighbours during scale pop */
}

/* ── DATE SUMMARY CHIP (step 2 top) ───────────────────────────── */
.booking-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(124,138,107,.10);
  border: 1px solid var(--hairline-strong);
  border-radius: 100px;
  font-size: 13px;
  color: var(--moss-dark);
  letter-spacing: .03em;
  align-self: flex-start;
  flex-shrink: 0;
}
.booking-date-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--moss);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── APPLE WHEEL CLOCK ────────────────────────────────────────── */
.booking-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.booking-clock__label {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: .08em;
  text-transform: uppercase;
  align-self: flex-start;
}

.booking-clock__wheels {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}

.booking-clock__wheel-wrap {
  position: relative;
  width: 72px;
  /* 3 visible items × 60px = 180px (engineer uses scrollTo(idx*60) with 1 spacer top/bottom) */
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
}

/* scroll container */
.booking-clock__wheel {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
}
.booking-clock__wheel::-webkit-scrollbar { display: none; }

/* each item — filled by JS */
.booking-clock__item {
  height: 60px;   /* 3 visible in 180px; engineer uses scrollTo(idx*60) */
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--ink-mute);
  opacity: 0.55;
  cursor: pointer;
  transition: color 0.15s ease, font-size 0.15s ease, opacity 0.15s ease;
  user-select: none;
}

/* 'selected' item state — JS adds .is-selected */
.booking-clock__item.is-selected {
  color: var(--forest);
  font-size: 33px;
  font-weight: 700;
  opacity: 1;
}

/* dimmed (unavailable slot) */
.booking-clock__item.is-dim {
  opacity: .25;
  cursor: not-allowed;
  pointer-events: none;
}

/* spacer items (top / bottom padding) */
.booking-clock__item--spacer {
  height: 60px; /* 1 spacer top + 1 spacer bottom, matches ITEM_HEIGHT 60px */
  pointer-events: none;
  scroll-snap-align: none;
  visibility: hidden;
}

/* top + bottom gradient fades */
.booking-clock__fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 60px; /* = 1 item height */
  z-index: 2;
  pointer-events: none;
}
.booking-clock__fade--top {
  top: 0;
  background: linear-gradient(to bottom, var(--paper) 0%, rgba(251,250,245,0) 100%);
}
.booking-clock__fade--bottom {
  bottom: 0;
  background: linear-gradient(to top, var(--paper) 0%, rgba(251,250,245,0) 100%);
}

/* Center selection indicator box — #4a aligned */
.booking-clock__selector {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  /* KEY FIX: `margin-top: -30px` removed.
     `top:50%; transform:translateY(-50%)` already centres the box at 90px.
     The old extra margin-top was pulling it to 60px — that was the alignment bug.
     Engineer's scrollTo(idx*60) with 1 spacer centres item at 90px → now matches. */
  transform: translateY(-50%);
  height: 60px; /* = ITEM_HEIGHT, selector spans exactly one row */
  border-top: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
  background: rgba(124,138,107,.06);
  border-radius: 4px;
  z-index: 3;
  pointer-events: none;
}

/* ── WHEEL classes generated by app.js setupWheel() ──────────── */
/* The JS builds a <ul class="wheel-track"> with <li class="wheel-item"> inside
   [data-wheel] containers. These rules mirror .booking-clock__item above. */
.wheel-track {
  list-style: none;
  padding: 0;
  margin: 0;
  /* translateY is applied by JS via transform; no extra offset needed */
}

.wheel-item {
  height: 60px; /* kept in sync with ITEM_HEIGHT=60 / .booking-clock__item */
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--ink-faint);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, font-size 0.15s ease, opacity 0.15s ease;
}

.wheel-item.is-selected {
  color: var(--forest);
  font-size: 32px;
  font-weight: 600;
}

.wheel-item.is-dim {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

/* Padding items inserted at top/bottom so selected item can reach centre */
.wheel-pad {
  height: 60px; /* matches ITEM_HEIGHT */
  pointer-events: none;
  visibility: hidden;
}

/* .wheel-highlight is created inside the scroll container (overflow:scroll),
   so it would scroll with the list. We suppress it; .booking-clock__selector
   (a positioned sibling on .booking-clock__wheel-wrap) provides the visual frame. */
.wheel-highlight {
  display: none;
}

/* Colon separator */
.booking-clock__colon {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--forest);
  padding: 0 6px;
  align-self: center;
  user-select: none;
  flex-shrink: 0;
}

/* Time readout */
.booking-clock__readout {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--moss-dark);
  letter-spacing: .04em;
  padding: 6px 16px;
  background: rgba(124,138,107,.08);
  border-radius: 100px;
  border: 1px solid var(--hairline);
  text-align: center;
  min-width: 120px;
}

/* Booked/unavailable start time warning (blocks "next") */
.booking-clock__slot-warning {
  font-size: 12px;
  color: #C45454;
  letter-spacing: .02em;
  text-align: center;
  margin-top: 6px;
}
.booking-clock__slot-warning[hidden] { display: none; }

/* ── DURATION PILLS ───────────────────────────────────────────── */
.booking-duration {
  flex-shrink: 0;
}
.booking-duration__label {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.booking-duration__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.booking-pill {
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink-mute);
  font-size: 13px;
  letter-spacing: .03em;
  transition: background var(--trans), color var(--trans), border-color var(--trans), box-shadow var(--trans);
}
.booking-pill:hover {
  border-color: var(--moss-light);
  color: var(--forest);
}
.booking-pill.is-active,
.booking-pill[aria-pressed="true"] {
  background: var(--moss);
  border-color: var(--moss);
  color: var(--paper);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(124,138,107,.30);
}

/* ── HEADCOUNT STEPPER ────────────────────────────────────────── */
.booking-headcount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: rgba(244,241,232,.5);
  flex-shrink: 0;
}

.booking-headcount__label {
  font-size: 14px;
  color: var(--forest);
  letter-spacing: .02em;
}

.booking-headcount__controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.booking-headcount__btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: var(--paper);
  color: var(--forest);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--trans), border-color var(--trans), color var(--trans);
}
.booking-headcount__btn:hover {
  background: var(--moss);
  border-color: var(--moss);
  color: var(--paper);
}
.booking-headcount__btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.booking-headcount__btn:disabled:hover {
  background: var(--paper);
  border-color: var(--hairline-strong);
  color: var(--forest);
}

/* #4b: headcount input replaces the old static <span>.
   Keeps the same typographic style but is now editable. */
.booking-headcount__input {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--forest);
  width: 52px;
  min-width: 40px;
  text-align: center;
  line-height: 1;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-xs);
  padding: 4px 4px;
  outline: none;
  transition: border-color var(--trans), background var(--trans);
  -webkit-appearance: none;
  appearance: none;
}
.booking-headcount__input:focus {
  border-color: var(--moss);
  background: rgba(124,138,107,.05);
}
/* Hide number spinners (input type=text+inputmode=numeric shows none by default,
   but guard against any browser quirk) */
.booking-headcount__input::-webkit-inner-spin-button,
.booking-headcount__input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── FORM (step 3) ────────────────────────────────────────────── */
.booking-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex-shrink: 0;
}

.booking-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.booking-form__label {
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.booking-form__label span { color: var(--moss); }

.booking-form__input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.booking-form__input::placeholder { color: var(--ink-faint); }
.booking-form__input:focus {
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(124,138,107,.14);
}
.booking-form__input.has-error {
  border-color: #C45454;
  box-shadow: 0 0 0 3px rgba(196,84,84,.10);
}

.booking-form__error {
  font-size: 12px;
  color: #C45454;
  letter-spacing: .02em;
  min-height: 16px;
  display: block;
}

/* ── SUCCESS SCREEN ───────────────────────────────────────────── */
.booking-step--success {
  align-items: center;
  text-align: center;
  gap: 20px;
  padding-top: 12px;
}

.booking-success__lottie {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  /* GSAP fallback: a simple animated circle + check */
  position: relative;
}

/* GSAP fallback circle  (app.js will draw via canvas or GSAP SVG) */
.booking-success__lottie-fallback {
  width: 100%;
  height: 100%;
}

.booking-success__heading {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--forest);
  font-weight: normal;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.booking-success__summary {
  background: rgba(124,138,107,.08);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 13px;
  color: var(--forest);
  line-height: 1.8;
  width: 100%;
  text-align: left;
  letter-spacing: .02em;
}
/* Summary rows inserted by JS: <span class="sum-label">地區</span>北部 */
.sum-label {
  color: var(--ink-mute);
  display: inline-block;
  min-width: 48px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* One-click copy of booking info (for pasting into LINE) */
.booking-success__copy-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.booking-btn--copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--paper);
  color: var(--forest);
  border: 1px solid var(--moss);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.booking-btn--copy:hover { background: rgba(124,138,107,.10); }
.booking-btn--copy.is-copied {
  background: var(--moss);
  color: #fff;
  border-color: var(--moss);
}
.booking-btn__copy-icon { width: 16px; height: 16px; flex-shrink: 0; }
.booking-success__copy-note {
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: .02em;
  line-height: 1.6;
  max-width: 300px;
  text-align: center;
}

.booking-success__line-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.booking-success__line-note {
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: .02em;
  line-height: 1.6;
  max-width: 280px;
}

.booking-success__close {
  font-size: 13px;
  padding: 10px 24px;
  color: var(--ink-faint);
  border-color: var(--hairline);
}
.booking-success__close:hover {
  color: var(--ink-mute);
  border-color: var(--hairline-strong);
}

/* ── SCROLLBAR (modal inner) ──────────────────────────────────── */
.booking-modal::-webkit-scrollbar { width: 4px; }
.booking-modal::-webkit-scrollbar-track { background: transparent; }
.booking-modal::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 4px; }

/* ================================================================
   RWD — 375 (default above), 768, 1280
   ================================================================ */

/* ── 768+ (tablet / desktop: centered card) ───────────────────── */
@media (min-width: 768px) {
  /* Desktop: modal element IS the centered card (single authoritative block,
     removed the earlier conflicting redefinition that set align-items:center). */
  .booking-modal {
    position: fixed;
    width: min(var(--modal-max), calc(100vw - 48px));
    max-height: calc(100dvh - 80px);
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%) translateY(20px); /* GSAP will animate */
    background: var(--paper);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: var(--modal-pad);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;     /* children fill card width (fix: was inheriting center) */
    gap: 0;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    /* slide-in via CSS transition (app.js GSAP only touches opacity, not transform) */
    transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease;
  }
  .booking-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%);
  }

  /* Calendar: slightly larger day cells on tablet */
  [data-cal-day] {
    font-size: 14px;
  }

  /* Duration pills: no wrap on 768 */
  .booking-duration__pills {
    flex-wrap: nowrap;
  }

  /* Headcount */
  .booking-headcount {
    padding: 14px 22px;
  }
}

/* ── 1280+ (large desktop: slightly wider card) ───────────────── */
@media (min-width: 1280px) {
  :root {
    --modal-max: 540px;
  }
}

/* ── Small phones 320-374 ─────────────────────────────────────── */
@media (max-width: 374px) {
  :root {
    --modal-pad: 20px;
  }
  .booking-step__heading { font-size: 19px; }
  .booking-clock__wheel-wrap { width: 64px; }
  /* Heights stay 60px; only shrink font size on tiny screens */
  .booking-clock__item { font-size: 24px; }
  .booking-clock__item.is-selected { font-size: 28px; }
  .wheel-item { font-size: 24px; }
  .wheel-item.is-selected { font-size: 28px; }
  .booking-pill { padding: 7px 12px; font-size: 12px; }
  .booking-progress__label { font-size: 10px; }
  /* Headcount input: slightly narrower on tiny screens */
  .booking-headcount__input { width: 44px; font-size: 20px; }
}

/* ── Safe area (iOS notch) ────────────────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .booking-modal {
    padding-bottom: calc(var(--modal-pad) + env(safe-area-inset-bottom));
  }
  @media (min-width: 768px) {
    .booking-modal { padding-bottom: var(--modal-pad); }
  }
}

/* ── Focus visible (a11y) ─────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 2px;
}
button:focus:not(:focus-visible) { outline: none; }

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
