/* =============================================================================
   app.css — After Dark theme (v04)
   Off-white + near-black + one sharp deep purple. No gold, no meander, no
   italic serif. Geist sans does everything; Geist Mono for the technical bits.
   Drop-in over existing markup: every legacy class still resolves.
   ============================================================================= */

:root {
  /* Tell the browser this page supports both light and dark — stops Chrome's
     Auto Dark Theme from re-coloring form controls and surfaces inconsistently
     with the rest of the page. Dark variant is defined in the
     @media (prefers-color-scheme: dark) block at the bottom of this file. */
  color-scheme: light dark;

  /* Core palette */
  --paper:    #fafaf7;          /* true off-white, slightly warm */
  --paperDp:  #ececea;          /* soft section divider */
  --cardBg:   #ffffff;          /* raised */
  --ink:      #0a0a0d;          /* cool near-black */
  --inkSoft:  #2a2a32;
  /* --mu — secondary text. Darkened from #6a6a76 → #525260 so labels and
     muted captions hit ~7:1 against --paper (AAA) instead of borderline AA.
     Removes the "everything looks faint" feel in staff/admin panels. */
  --mu:       #525260;
  --mu2:      #8a8a96;          /* placeholder / disabled — kept lighter than --mu */
  --line:     rgba(10,10,13,0.08);
  --lineHard: rgba(10,10,13,0.18);
  /* Per-mode tints used inside hero / auth panels — light mode keeps the
     original white-on-ink look; dark mode lifts these so muted text on dark
     surfaces still meets WCAG AA (4.5:1 for body, 3:1 for labels). */
  --onInk:        rgba(255,255,255,0.92);
  --onInkMuted:   rgba(255,255,255,0.62);
  --onInkLine:    rgba(255,255,255,0.18);
  --onInkLineSoft:rgba(255,255,255,0.08);

  /* Sole accent — Aegean teal (brand sheet) */
  --purple:   #2D8F8F;          /* product accent — slightly darker than aegean for contrast on paper */
  --purpleSoft: rgba(124,212,212,0.14);
  --purpleDk: #1F6A6A;
  --purpleDp: #143F3F;
  --aegean:   #7CD4D4;          /* brand aegean */
  --deepSea:  #4FB3B3;          /* brand deep sea */

  --ok:       #1d7f3e;
  --er:       #b3261e;
  /* --warn: amber that hits AA against --paper (≥4.5:1). Replaces the
     previous "fold into --mu" placeholder so warn-state pills, used-coupon
     badges and similar semantic chips no longer read as plain captions. */
  --warn:     #8a6f2b;

  /* Legacy aliases — old class names + inline styles still resolve */
  --blue: var(--purple);
  --bd:   var(--purpleDk);
  --bdp:  var(--ink);          /* deepest dark is now ink, not navy */
  --w:    var(--cardBg);
  --cr:   var(--paperDp);
  --bo:   var(--line);
  --tx:   var(--ink);
  --gold: var(--purple);       /* gold→aegean anywhere it leaked through */
  --goldHi:#7CD4D4;            /* aegean — for "highlight" needs */
  --goldShd: var(--purpleDk);

  --tab-h: 76px;
  --top-h: 56px;

  /* Type — Geist does everything */
  --serif: 'Geist', 'Inter', system-ui, sans-serif;       /* legacy alias kept */
  --sans:  'Geist', 'Inter', system-ui, -apple-system, sans-serif;
  --mono:  'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
}

/* Dark-theme tokens live in the consolidated `:root[data-theme="dark"]`
   block at the bottom of this file — single source of truth for the
   palette plus the component overrides (.hero, .topbar, form fields, …)
   needed to keep the always-dark branded panels readable. */

/* ── Floating theme toggle (injected by /js/theme.js on every page) ───── */
.theme-toggle {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  right: 12px;
  margin-top: 12px;
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--cardBg);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.15s ease, background 0.2s ease;
}
.theme-toggle:hover { transform: scale(1.05); }
.theme-toggle:active { transform: scale(0.96); }
/* When docked inside an action bar (customer topbar, staff header), use a
   smaller pill and drop the fixed positioning. The base styles are
   theme-token-driven so the toggle stays visible on whichever surface the
   host happens to be (staff-top in light mode is light; customer topbar
   stays always-dark — see override below). */
.theme-toggle.theme-toggle-inline {
  position: static;
  width: 36px; height: 36px;
  margin: 0;
  box-shadow: none;
  background: transparent;
  border-color: var(--lineHard);
  color: var(--ink);
}
.theme-toggle.theme-toggle-inline:hover {
  background: var(--paperDp);
  color: var(--purple);
}
/* Customer topbar is always-dark in both themes, so its inline toggle needs
   a light icon regardless of the page theme. The selector .topbar .theme-toggle-inline
   wins over the token-driven base above. */
.topbar .theme-toggle-inline {
  border-color: rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.92);
}
.topbar .theme-toggle-inline:hover {
  background: rgba(255,255,255,0.08);
  color: #7CD4D4;
}
:root[data-theme="dark"] .theme-toggle {
  background: var(--sp-ink-3, #16161D);
  border-color: var(--sp-line, rgba(124,212,212,0.18));
  color: var(--sp-aegean, #7CD4D4);
  box-shadow: 0 0 12px rgba(124,212,212,0.18);
}

/* ── Reset / base ──────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ── Focus baseline ────────────────────────────────────────────────────────
   Keyboard users get a visible 2px purple ring on every interactive element.
   :focus-visible (not :focus) so mouse/touch users don't see it on click.
   This is the safety net — components are free to design their own focus
   state, but if they don't, this kicks in. */
:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: 2px;
}
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
/* min-height (not height) so the document can grow past the viewport and
   the page scrolls. With height:100% + overflow-x:hidden, the body becomes
   a 100vh scroll container and content beyond the viewport gets clipped
   below the fixed tabnav on desktop — which is what caused users to have
   to zoom out to see the bottom of book/index pages. */
html, body { min-height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: clip;
  /* Extra 3rem so the last card/button sits well above the fixed tabnav.
     Per-page overrides (index.html, account.html) can add more if needed. */
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 3rem);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ── Legacy ornament — hidden in v4 (kept as classes for backward compat) ─ */
.meander, .meander-on-dark, .wave-line,
.hero-sun, .auth-top-sun, .stop-sun { display: none; }

/* ── Top bar ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  height: var(--top-h);
  padding: 0 1rem;
  padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: space-between;
  color: var(--paper);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topbar-title {
  font-family: var(--sans);
  font-size: 0.78rem; letter-spacing: 0.32em; font-weight: 600;
  text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: center; gap: 0.6rem; }
.lang-btn {
  /* Visual flag stays 32x22, but the tap target extends to 44x44 via a
     transparent ::before — meets Apple HIG minimum without bloating the bar.
     Border defaults to theme-token so the button stays visible inside the
     staff-top header (which follows the theme). The customer .topbar is
     always-dark; an override below switches the border to light. */
  width: 32px; height: 22px;
  border-radius: 0;
  border: 1px solid var(--lineHard);
  background: transparent;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  position: relative;
  transition: transform 0.15s, border-color 0.15s;
}
/* Customer topbar always-dark — keep a light flag border there. */
.topbar .lang-btn { border-color: rgba(255,255,255,0.28); }
.lang-btn::before {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px;
}
.lang-btn:active { transform: scale(0.92); }
.lang-btn svg { width: 100%; height: 100%; display: block; }

/* ── Page container ────────────────────────────────────────────────────── */
.screen { padding: 1.2rem; max-width: 720px; margin: 0 auto; }
.screen-pad-bottom { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 3rem); }

.h1 {
  font-family: var(--sans);
  font-size: 2.8rem; font-weight: 300; line-height: 0.94;
  letter-spacing: -0.022em;
  margin-bottom: 0.3rem;
}
.h2 {
  font-family: var(--sans);
  font-size: 1.6rem; font-weight: 400; letter-spacing: -0.014em;
}
.h1 em, .h2 em { font-style: normal; color: var(--purple); }

.section-label, .eyebrow {
  font-family: var(--mono);
  font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--mu);
  margin-bottom: 0.45rem;
  display: block;
}
.muted { color: var(--mu); font-size: 0.85rem; }
.mono { font-family: var(--mono); }

/* Note: the `.bilingual-en` class was removed from templates. The CSS hide
   rule is gone too — see git blame if you hit a stray .bilingual-en in
   third-party content. */

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--cardBg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 1rem 1.1rem;
  margin-bottom: 0.7rem;
}
.card-action { cursor: pointer; transition: border-color 0.15s, transform 0.1s, background 0.15s; }
.card-action:active { transform: scale(0.99); }
.card-action:hover { border-color: var(--purple); }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; }
.card-title {
  font-family: var(--sans); font-weight: 500; font-size: 1.1rem;
  letter-spacing: -0.012em; line-height: 1.15;
}
.card-sub { color: var(--mu); font-size: 0.82rem; margin-top: 0.2rem; }
.card-price {
  font-family: var(--mono); font-weight: 500;
  font-size: 1rem; color: var(--ink); letter-spacing: 0.02em;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--ink); color: var(--paper);
  border: none;
  border-radius: 0;
  padding: 0.95rem 1.2rem;
  font-family: var(--sans); font-size: 0.98rem; font-weight: 500;
  letter-spacing: -0.005em;
  min-height: 50px;
  transition: transform 0.1s, background 0.15s, color 0.15s;
  width: 100%;
}
.btn:active { transform: translateY(1px); }
.btn:hover:not([disabled]) { background: var(--purpleDk); }
.btn[disabled] { opacity: 0.42; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--lineHard);
}
.btn-ghost:hover:not([disabled]) { border-color: var(--ink); background: var(--paperDp); }
.btn-sm {
  padding: 0.6rem 1rem; font-size: 0.88rem; min-height: 44px; width: auto;
  font-weight: 500;
}
.btn-danger { background: transparent; color: var(--er); border: 1px solid rgba(179,38,30,0.35); }
.btn-danger:hover:not([disabled]) { background: rgba(179,38,30,0.06); }

.btn-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink); border-bottom: 1px solid var(--ink);
  padding: 10px 4px 4px;  /* 44pt-tall hit zone, label still visually anchored */
  background: none; cursor: pointer;
}
.btn-link.btn-link-gold { color: var(--purple); border-bottom-color: var(--purple); }
.btn-link.btn-link-danger { color: var(--er); border-bottom-color: var(--er); }

/* ── Form ──────────────────────────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--mu); margin-bottom: 0.4rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--lineHard);
  border-radius: 0;
  padding: 0.55rem 0;
  color: var(--ink);
  outline: none;
  font-family: var(--mono);
  font-size: 1rem;
  transition: border-color 0.15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--mu2); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-bottom-color: var(--ink);
}
.field textarea {
  resize: vertical; min-height: 80px;
  font-family: var(--sans); font-size: 0.95rem;
  border: 1px solid var(--lineHard); padding: 0.7rem 0.85rem;
}

/* ── Banner / alerts ───────────────────────────────────────────────────── */
.banner {
  padding: 0.8rem 1rem;
  border-radius: 0;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: flex; align-items: flex-start; gap: 0.6rem;
  border: 1px solid var(--line);
  background: var(--cardBg);
}
.banner-ok   { background: rgba(29,127,62,0.06); color: var(--ok); border-color: rgba(29,127,62,0.28); }
.banner-err  { background: rgba(179,38,30,0.06); color: var(--er); border-color: rgba(179,38,30,0.3); }
.banner-info { background: var(--purpleSoft);     color: var(--purple); border-color: rgba(45,143,143,0.25); }
.banner-warn { background: rgba(184,137,61,0.08); color: #8a6f2b;   border-color: rgba(184,137,61,0.35); }

/* ── Bottom tab nav ────────────────────────────────────────────────────── */
.tabnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: flex;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--mu);
  padding: 0.5rem 0;
  position: relative;
}
.tab svg { width: 22px; height: 22px; stroke-width: 1.4; }
.tab span:not(.tab-dot) {
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  margin-top: 1px;
  font-weight: 500;
}
.tab.on { color: var(--ink); }
.tab.on svg { stroke: var(--ink); }
.tab.on .tab-dot { opacity: 1; transform: scale(1); }
.tab-dot {
  width: 16px; height: 1.5px; border-radius: 0;
  background: var(--purple);
  opacity: 0; transform: scale(0);
  transition: all 0.2s;
  position: absolute; top: 5px;
}
.tab-icon-wrap { position: relative; }

/* ── Floating cart pill ────────────────────────────────────────────────── */
.cart-fab {
  position: fixed;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px);
  left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  border: none;
  border-radius: 0;
  padding: 0.8rem 1.4rem;
  display: none;
  align-items: center; gap: 0.6rem;
  box-shadow: 0 6px 24px rgba(10,10,13,0.3);
  z-index: 55;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 500; letter-spacing: -0.005em;
  transition: transform 0.15s;
}
.cart-fab:active { transform: translateX(-50%) translateY(1px); }
.cart-fab.on { display: inline-flex; }
.cart-badge {
  background: var(--purple); color: var(--paper);
  border-radius: 0;
  min-width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 600; font-size: 0.74rem;
}

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(10,10,13,0.65);
  z-index: 100;
  display: none; align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal-bg.on { display: flex; }
.modal {
  background: var(--paper);
  width: 100%; max-width: 540px;
  border-top: 2px solid var(--ink);
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.2rem 1.1rem calc(1.6rem + env(safe-area-inset-bottom));
  animation: slide-up 0.22s ease-out;
}
@keyframes slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-grip {
  width: 36px; height: 2px;
  background: var(--ink);
  margin: 0 auto 0.9rem;
}
.modal-title {
  font-family: var(--sans);
  font-size: 1.65rem; font-weight: 400;
  letter-spacing: -0.018em; margin-bottom: 0.7rem;
}

/* ── Spinner ───────────────────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 1.5px solid var(--line);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 1.4rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Slot grid ─────────────────────────────────────────────────────────── */
.slot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.35rem;
}
.slot {
  background: var(--cardBg); border: 1px solid var(--line);
  padding: 0.7rem 0.4rem;
  border-radius: 0;
  text-align: center;
  font-family: var(--mono); font-size: 0.95rem; letter-spacing: 0.02em;
  transition: all 0.15s;
  min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.slot.avail { cursor: pointer; color: var(--ink); }
.slot.avail:hover { border-color: var(--ink); }
.slot.on {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.slot.taken {
  color: var(--mu2); background: transparent; cursor: not-allowed;
  border-style: dashed;
  text-decoration: line-through;
}
.slot.waitlist {
  cursor: pointer; color: var(--purple);
  background: transparent;
  border: 1px dashed var(--purple);
  position: relative;
}
.slot.waitlist::after {
  content: ''; position: absolute; top: 4px; right: 4px;
  width: 3px; height: 3px; background: var(--purple);
}
.slot.waitlist.on {
  background: var(--purple); color: var(--paper); border-color: var(--purple);
  border-style: solid;
}

/* ── Step indicator ────────────────────────────────────────────────────── */
.steps {
  display: flex; gap: 0;
  margin-bottom: 1.6rem;
  background: transparent;
  padding: 0;
  border: none;
}
.step {
  flex: 1; text-align: left;
  padding: 0.7rem 0 0.4rem;
  border-top: 2px solid var(--line);
  border-radius: 0;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em;
  color: var(--mu); text-transform: uppercase;
  transition: all 0.2s;
}
.step.on {
  border-top-color: var(--ink); color: var(--ink);
  font-family: var(--sans); font-size: 0.86rem; font-weight: 500;
  letter-spacing: -0.005em; text-transform: capitalize;
}
.step.done {
  border-top-color: var(--purple);
  color: var(--purpleDk);          /* darker than the line so done labels read at AA on cream */
  font-weight: 500;
}

/* ── Hero — flat ink panel, single big action ──────────────────────────── */
/* Hero used to be hard-pinned to dark in both themes (--ink bg + --paper
   text + hard-coded rgba(255,255,255,…) helper colours). Now flips with
   the theme: light page → light hero, dark page → dark hero. The dark-mode
   block further down keeps a slightly elevated #1a1a22 surface so the hero
   still stands out from the page in dark mode. */
.hero {
  background: var(--paper);
  color: var(--ink);
  padding: 2.4rem 1.4rem 2rem;
  margin: -1.2rem -1.2rem 1.4rem;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.hero h1 {
  font-family: var(--sans);
  font-size: 3rem; font-weight: 300; line-height: 0.94; letter-spacing: -0.024em;
  margin-bottom: 0.4rem;
}
.hero h1 em { font-style: normal; color: var(--purple); }
.hero p {
  color: var(--mu);
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  max-width: 320px; margin: 0.9rem 0 1.4rem;
}
.hero p::before { content: '— '; }

.hero-tagline {
  max-width: none;
  margin: 0.9rem 0 1.4rem;
  padding: 0.2rem 0;
  overflow: hidden;
  color: var(--inkSoft);
  font-family: var(--sans);
  font-size: 0.96rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-transform: none;
}
.hero-tagline::before { content: none; }
.hero-tagline__track {
  display: inline-flex;
  align-items: center;
  gap: 1.4rem;
  white-space: nowrap;
  will-change: transform;
  animation: heroTaglineMarquee 18s linear infinite;
}
.hero-tagline__text {
  display: inline-block;
  white-space: nowrap;
  color: var(--ink);
}
.hero-tagline__clone {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}
@keyframes heroTaglineMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-tagline__track {
    animation: none;
    transform: none;
  }
}

.hero-next {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 1.2rem 0 0;
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}
.hero-next .hn-label {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--mu);
}
.hero-next .hn-when {
  font-family: var(--mono); font-weight: 500; font-size: 1.8rem;
  margin-top: 6px; line-height: 1; letter-spacing: -0.01em;
}
.hero-next .hn-when em { font-style: normal; color: #7CD4D4; }
.hero-next .hn-meta {
  font-family: var(--mono); font-size: 0.66rem; color: var(--mu);
  margin-top: 6px; letter-spacing: 0.12em;
}
.hero-next .hn-arrow {
  width: 44px; height: 44px;
  border: 1px solid var(--lineHard); color: var(--ink);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: transparent;
}

/* ── Auth screens ──────────────────────────────────────────────────────── */
/* Auth panels now follow the theme (used to be hard-pinned to dark).
   Light page → light auth banner, dark page → dark auth banner. The
   dark-mode block keeps the elevated #1a1a22 surface for visual lift. */
.auth-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--paper);
}
.auth-top {
  padding: 2.5rem 1.5rem 2rem;
  text-align: left;
  color: var(--ink);
  position: relative;
  border-bottom: 1px solid var(--line);
}
.auth-top h1 {
  font-family: var(--sans);
  font-size: 2.6rem; font-weight: 300; line-height: 0.94; letter-spacing: -0.022em;
  margin-bottom: 0.4rem;
}
.auth-top h1 em { font-style: normal; color: var(--purple); }
.auth-top p {
  color: var(--mu);
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  margin-top: 0.6rem;
}
.auth-top p::before { content: '— '; }

.auth-card {
  flex: 1;
  background: var(--paper);
  padding: 2rem 1.4rem 2rem;
}
.auth-tabs { display: flex; margin-bottom: 1.6rem; gap: 1.4rem; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.auth-tab {
  padding: 0 0 10px;
  margin-bottom: -11px;
  font-family: var(--sans); font-size: 1rem; font-weight: 500;
  color: var(--mu); transition: all 0.15s;
  border-bottom: 2px solid transparent;
  background: transparent;
  letter-spacing: -0.005em;
}
.auth-tab.on { color: var(--ink); border-bottom-color: var(--ink); }

.divider {
  display: flex; align-items: center; gap: 0.8rem; margin: 1.4rem 0;
  color: var(--mu);
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.btn-google {
  background: var(--cardBg); color: var(--ink);
  border: 1px solid var(--lineHard);
  font-family: var(--sans); font-size: 0.92rem; font-weight: 500;
  letter-spacing: -0.005em;
}
.btn-google:hover:not([disabled]) { background: var(--paperDp); border-color: var(--ink); }

@media (min-width: 600px) {
  .auth-wrap { width: 100%; max-width: 440px; margin: 0 auto; min-height: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.45); }
  body.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #050507; }
}

/* ── Responsive: desktop ───────────────────────────────────────────────── */
@media (min-width: 720px) {
  body { background: var(--paperDp); }
  .screen { padding: 1.6rem; max-width: 560px; background: var(--paper); }
  .hero { margin: -1.6rem -1.6rem 1.4rem; padding: 3rem 2rem 2.5rem; }
  .hero h1 { font-size: 3.4rem; }
  .tabnav { max-width: 560px; left: 50%; transform: translateX(-50%); }
  .cart-fab { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 18px); }
  .modal { max-width: 480px; }
  .topbar { max-width: 560px; margin: 0 auto; position: sticky; }
  /* Pump desktop bottom padding well past the fixed tabnav so the last
     card / button / confirm card on book/index/my-bookings is always fully
     visible and reachable without zooming out. */
  body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 6rem); }
}

/* =============================================================================
   Book-flow tweaks (added v5)
   - Bilingual subtitle is hidden because it always showed the wrong language.
   - Book screen widens to ~720px on desktop so big stylist cards have room
     without going edge-to-edge.
   ============================================================================= */
@media (min-width: 980px) {
  body .screen.book-wide {
    max-width: 760px;
  }
}

/* ── Accessibility helpers ─────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Reduced-motion fallback. Anything not already covered by component-level
   guards collapses to instant transitions when the user prefers it. We keep
   transitions at a sliver (0.01ms) rather than `none` so that JS code that
   relies on transitionend still fires. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Waitlist status badge ─────────────────────────────────────────────────── */
.bk-status.waitlist { background: var(--primary, #7c6fff); color: #fff; }

/* =============================================================================
   DARK THEME — single source of truth.
   Activated by `:root[data-theme="dark"]`, which theme.js sets based on the
   saved user pref or the OS preference. Paired theming (not inverted): every
   token is tuned for AA contrast (4.5:1 body, 3:1 large/labels). Includes
   component overrides for the always-dark branded panels (hero, topbar, auth)
   that use `var(--ink)` as bg in light mode and would otherwise turn white.
   ============================================================================= */
:root[data-theme="dark"] {
  /* Surfaces — progressively lighter as elevation increases */
  --paper:    #0e0e12;
  --paperDp:  #1a1a20;
  --cardBg:   #16161c;

  /* Text. --mu raised to #b8becc → ~7.5:1 on --paper for AAA captions. */
  --ink:      #f2f2ee;
  --inkSoft:  #d4d4d0;
  --mu:       #b8becc;
  --mu2:      #7e8492;

  /* Dividers */
  --line:     rgba(255,255,255,0.10);
  --lineHard: rgba(255,255,255,0.22);

  /* Accent — aegean teal #7CD4D4 ≈ 8.5:1 on --paper (AAA) */
  --purple:     #7CD4D4;
  --purpleSoft: rgba(124,212,212,0.16);
  --purpleDk:   #9CE5E5;
  --purpleDp:   #4FB3B3;

  /* Status retuned for dark surfaces */
  --ok:       #4ade80;
  --er:       #ff6b6b;
  --warn:     #f2c265;

  /* Legacy aliases that need their hex values re-tuned for dark.
     The rest (--w / --cr / --bo / --tx / --gold) auto-flip because they were
     declared as `var(--cardBg)` etc. in the default :root block. */
  --goldHi:   #7CD4D4;
  --goldShd:  var(--purpleDp);
  --bdp:      var(--paper);

  /* Sane defaults for native form controls / scrollbars */
  color-scheme: dark;
}

/* Topbar stays "always dark" — it's the brand-identity strip. Its inner
   helper text (eyebrow, muted, unstyled <p>) uses --mu / --inkSoft tokens
   that flip dark in light mode and would be invisible on the dark topbar.
   Pin them to readable light tones in BOTH themes.
   Hero and auth panels are NOT included here — they now follow the theme
   (light in light, dark in dark), so the semantic tokens already work. */
.topbar .eyebrow,
.topbar .muted {
  color: rgba(255,255,255,0.55);
}
.topbar p:not([class]) {
  color: rgba(255,255,255,0.78);
}
/* In dark mode, .hero / .auth-* would otherwise sit flat against the
   --paper page surface (both around #0e0e12). Lift them to #1a1a22 for
   the same elevation feel the always-dark panels had in light mode. Text
   colours are NOT overridden here — the semantic tokens (--ink, --mu,
   --inkSoft) already flip to light in dark mode, and the new theme-aware
   hero/auth rules above use those tokens. */
:root[data-theme="dark"] .hero,
:root[data-theme="dark"] .auth-wrap,
:root[data-theme="dark"] .auth-top {
  background: #1a1a22;
  border-bottom-color: rgba(255,255,255,0.08);
}
/* Topbar stays always-dark in both themes — text and border pinned. */
:root[data-theme="dark"] .topbar {
  background: #1a1a22;
  color: #f2f2ee;
  border-bottom-color: rgba(255,255,255,0.08);
}
:root[data-theme="dark"] .topbar-title { color: #f2f2ee; }
:root[data-theme="dark"] .lang-btn { border-color: rgba(255,255,255,0.18); }
/* Modal grip indicator — the inner border-top of .modal also uses --ink */
:root[data-theme="dark"] .modal { border-top-color: #f2f2ee; }
:root[data-theme="dark"] .modal-grip { background: #f2f2ee; }

/* Form fields — explicit colours so browser UA dark styles don't override */
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .field textarea {
  color: var(--ink);
  background: transparent;
  border-bottom-color: var(--lineHard);
}
:root[data-theme="dark"] .field textarea {
  border: 1px solid var(--lineHard);
  background: var(--cardBg);
}
:root[data-theme="dark"] .field input:focus,
:root[data-theme="dark"] .field select:focus,
:root[data-theme="dark"] .field textarea:focus { border-bottom-color: var(--ink); }
:root[data-theme="dark"] .field input::placeholder,
:root[data-theme="dark"] .field textarea::placeholder { color: var(--mu2); }
:root[data-theme="dark"] select option { background: var(--cardBg); color: var(--ink); }

/* Buttons — primary inverts so it pops on dark page */
:root[data-theme="dark"] .btn {
  background: var(--paper); color: var(--ink); border: 1px solid var(--lineHard);
}
:root[data-theme="dark"] .btn:hover:not([disabled]) { background: var(--paperDp); }
:root[data-theme="dark"] .btn-ghost { background: transparent; color: var(--ink); }
:root[data-theme="dark"] .btn-ghost:hover:not([disabled]) { background: var(--paperDp); border-color: var(--ink); }
:root[data-theme="dark"] .btn-google { background: var(--cardBg); color: var(--ink); border-color: var(--lineHard); }

/* Slot grid */
:root[data-theme="dark"] .slot.avail { color: var(--ink); }
:root[data-theme="dark"] .slot.avail:hover { border-color: var(--ink); }
:root[data-theme="dark"] .slot.on { background: var(--paper); color: var(--ink); border-color: var(--paper); }
:root[data-theme="dark"] .slot.taken { color: var(--mu2); }

/* Step indicator */
:root[data-theme="dark"] .step.on { border-top-color: var(--ink); color: var(--ink); }

/* Modal scrim — stronger on already-dark page */
:root[data-theme="dark"] .modal-bg { background: rgba(0,0,0,0.72); }

/* Cart pill + bottom tab nav */
:root[data-theme="dark"] .cart-fab {
  background: var(--paper); color: var(--ink);
  box-shadow: 0 6px 24px rgba(0,0,0,0.6);
}
:root[data-theme="dark"] .cart-badge { background: var(--purple); color: #0a0a0d; }
:root[data-theme="dark"] .tabnav { background: var(--paper); border-top-color: var(--line); }
:root[data-theme="dark"] .tab.on { color: var(--ink); }
:root[data-theme="dark"] .tab.on svg { stroke: var(--ink); }

/* Banners — keep semantic colour, raise alpha for dark */
:root[data-theme="dark"] .banner-ok   { background: rgba(74,222,128,0.10); color: var(--ok); border-color: rgba(74,222,128,0.32); }
:root[data-theme="dark"] .banner-err  { background: rgba(255,107,107,0.10); color: var(--er); border-color: rgba(255,107,107,0.32); }
:root[data-theme="dark"] .banner-info { background: var(--purpleSoft); color: var(--purple); border-color: rgba(124,212,212,0.30); }
:root[data-theme="dark"] .banner-warn { background: rgba(242,194,101,0.10); color: #f2c265; border-color: rgba(242,194,101,0.32); }

/* Desktop wrap — flatten the body bg so it doesn't sit darker than the .screen card */
@media (min-width: 720px) {
  :root[data-theme="dark"] body { background: #0a0a0e; }
  :root[data-theme="dark"] body.auth-body { background: #0a0a0e; }
}

/* Leaflet attribution */
:root[data-theme="dark"] .leaflet-control-attribution {
  background: rgba(20,20,26,0.85) !important;
  color: #c0c0cc !important;
}
