/* SportsFit design system — "The Thermal Line", brand-aligned 2026-11-12
 * Colours come from the SportsFit logo: deep navy, ember-orange "S" (HEAT),
 * sky-blue "F" (COLD) — heat and cold are literally the brand's product.
 * Ember = primary actions; sky-blue = calm/confirmed contexts; the thermal
 * hairline runs ember → sky. Both appearances hand-set; contrast beside each. */
:root {
  color-scheme: light dark;

  /* surfaces */
  --bg: #f6f7fa;            /* cool paper */
  --surface: #ffffff;       /* cards on light */
  --surface-2: #eef1f7;     /* nested panels, input fills */
  --surface-3: #e3e7f2;     /* pressed chips */

  /* content (navy family — brand ink) */
  --ink: #1c2440;           /* brand navy · ~14.9:1 on --surface */
  --ink-2: #4a5375;         /* secondary text · 6.9:1 */
  --ink-3: #8b93b2;         /* disabled/hint · 3.1:1 — large text/decoration only */

  /* hairlines & depth */
  --line: rgba(28, 36, 64, .13);
  --line-strong: rgba(28, 36, 64, .24);
  --shadow: 0 1px 2px rgba(16, 20, 40, .05), 0 4px 16px rgba(16, 20, 40, .07);

  /* the one accent (primary actions, active states) — brand EMBER */
  --accent: #cf431f;                    /* white text ~4.8:1 */
  --accent-contrast: #ffffff;
  --accent-tint: rgba(207, 67, 31, .10);
  --accent-ink: #a03014;                /* ~6.3:1 on tint */

  /* the emblematic pair (thermal hairline): brand orange → brand sky */
  --ember: #cf431f;
  --plunge: #35a4ea;

  /* calm/confirmed context — brand SKY, darkened for text (~4.9:1) */
  --cold-ink: #0d6fa4;

  /* signals (accessible on both appearances) */
  --ok-ink: #14603c;
  --warn-ink: #8a5a14;
  --danger-bg: #fbeeec;
  --danger-ink: #9c2130;
  --warn-bg: #faf3e2;

  /* aliases used by the admin dashboard JS (kept stable) */
  --teal: var(--cold-ink);
  --ok: var(--ok-ink);
  --warn: var(--warn-ink);
  --danger: var(--danger-ink);
  --navy-2: var(--surface-2);

  /* radius & space */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  /* type: one clean family, weight carries hierarchy */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141828;
    --surface: #1b2033;
    --surface-2: #232840;
    --surface-3: #2c3250;
    --ink: #e9ecf8;            /* 14:1 on --surface(1b2033) */
    --ink-2: #a7aecf;          /* 6.4:1 */
    --ink-3: #6b7398;
    --line: rgba(233, 236, 248, .15);
    --line-strong: rgba(233, 236, 248, .26);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    --accent: #ff6b3d;             /* dark-ink on ember: ~6:1 */
    --accent-contrast: #230d05;
    --accent-tint: rgba(255, 107, 61, .17);
    --accent-ink: #ffa582;
    --ember: #ff6b3d;
    --plunge: #4fc2f8;
    --cold-ink: #66c8fa;
    --ok-ink: #5fc491;
    --warn-ink: #dcb56b;
    --danger-bg: #2e1b1e;
    --danger-ink: #f2949b;
    --warn-bg: #2a2214;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;            /* iOS body default */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 0 var(--sp-4); }
.narrow { max-width: 640px; margin: 0 auto; padding: 0 var(--sp-4); }
.admin-shell { max-width: 1280px; }

/* ---------- type scale ---------- */
h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.022em; line-height: 1.25; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.014em; line-height: 1.3; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: 15px; font-weight: 600; letter-spacing: 0; }
p  { line-height: 1.55; }
a  { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.mono, code { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; font-size: .88em; letter-spacing: .02em; }
.small { font-size: 14px; line-height: 1.45; }
.tiny { font-size: 12px; line-height: 1.4; }
.muted { color: var(--ink-2); }
.overline {
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-2);
}
.mb { margin-bottom: var(--sp-4); }
.mt { margin-top: var(--sp-4); }
.mt2 { margin-top: var(--sp-5); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- the signature element: the thermal hairline ---------- */
.thermal-line {
  height: 3px; border-radius: 2px; max-width: 120px;
  background: linear-gradient(90deg, var(--ember), var(--plunge));
  margin: var(--sp-3) 0;
}
.site-header { padding: var(--sp-5) 0 var(--sp-2); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.brand-logo { width: 44px; height: 44px; object-fit: cover; border-radius: 11px; flex: none; box-shadow: var(--shadow); }
.brand small { display: block; font-weight: 450; color: var(--ink-2); font-size: 12px; letter-spacing: 0; }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: var(--sp-4); }
.sep { border: 0; border-top: 1px solid var(--line); margin: var(--sp-5) 0; }
.hr-soft { border: 0; border-top: 1px solid var(--line); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 var(--sp-5);
  border-radius: var(--r);
  border: 1px solid transparent;
  font: 600 17px/1.2 var(--font);
  letter-spacing: -0.005em;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform 90ms ease, filter 90ms ease, background 120ms ease;
  touch-action: manipulation;
}
.btn:active { transform: scale(.98); filter: brightness(.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.full { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 var(--sp-3); font-size: 14px; border-radius: var(--r-sm); }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary[disabled] { background: var(--surface-3); color: var(--ink-3); cursor: not-allowed; }
.btn-tinted { background: var(--accent-tint); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger-bg); color: var(--danger-ink); border-color: transparent; }
.btn-link { background: none; border: 0; color: var(--accent-ink); min-height: 44px; padding: 0 var(--sp-2); }
.btn-link:hover { text-decoration: underline; }
a.btn { text-decoration: none; }

/* ---------- form fields ---------- */
label { display: block; font-size: 14px; font-weight: 510; color: var(--ink-2); margin: var(--sp-4) 0 6px; }
input, select, textarea {
  width: 100%;
  font: 400 17px/1.4 var(--font);
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 12px;
  transition: border-color 120ms ease, background 120ms ease;
  min-height: 48px;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; background: var(--surface);
}
::placeholder { color: var(--ink-3); }
textarea { min-height: 84px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); flex: none; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--ink); }
.checkbox-row input { margin-top: 2px; }
.checkbox-row label { font-weight: 450; margin: 0; color: var(--ink); }
.row-flex { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: var(--sp-3); }
@media (min-width: 700px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- pills, dots, status ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 12px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}
.pill.ok { background: color-mix(in srgb, var(--ok-ink) 12%, transparent); color: var(--ok-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.err { background: var(--danger-bg); color: var(--danger-ink); }
.pill.teal { background: var(--accent-tint); color: var(--accent-ink); }
.pill.mut { background: var(--surface-2); color: var(--ink-2); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot.new { background: var(--ember); }
.dot.returning { background: var(--cold-ink); }

/* ---------- alerts ---------- */
.alert { border-radius: var(--r); padding: 12px 14px; font-size: 15px; line-height: 1.5; border: 1px solid transparent; }
.alert.ok { background: color-mix(in srgb, var(--ok-ink) 8%, var(--surface)); color: var(--ok-ink); border-color: color-mix(in srgb, var(--ok-ink) 22%, transparent); }
.alert.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn-ink) 22%, transparent); }
.alert.err { background: var(--danger-bg); color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger-ink) 22%, transparent); }
.alert.err[role="alert"] { font-weight: 510; }
.alert a { color: inherit; text-decoration: underline; }

/* ---------- booking: service cards ---------- */
.svc-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.svc-card {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow);
  transition: border-color 120ms ease, transform 90ms ease;
}
.svc-card:hover { border-color: var(--line-strong); }
.svc-card:active { transform: scale(.995); }
.svc-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.svc-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.svc-top { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: baseline; }
.svc-name { font-size: 18px; font-weight: 640; letter-spacing: -0.012em; }
.svc-price { font-weight: 640; color: var(--accent-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.svc-desc { color: var(--ink-2); font-size: 14px; line-height: 1.5; margin-top: 4px; }
.svc-meta { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; margin-top: 10px; }

/* next-available panel (appears inside a selected card) */
.next-slot {
  margin-top: var(--sp-4); border-top: 1px solid var(--line); padding-top: var(--sp-4);
  animation: rise 180ms ease-out both;
}
.next-slot .when { font-size: 15px; font-weight: 610; }
.next-slot .sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.slot-cta-row { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); flex-wrap: wrap; }
@media (max-width: 460px) { .slot-cta-row .btn { flex: 1 1 100%; } }
.srv-loading { color: var(--ink-2); font-size: 14px; display: flex; align-items: center; gap: 10px; margin-top: var(--sp-3); }

/* day + time pickers (full availability) */
.day-strip { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-2); scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.day-chip {
  flex: none; min-width: 64px; min-height: 64px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: pointer; font-family: var(--font);
}
.day-chip:hover { border-color: var(--line-strong); }
.day-chip.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-tint); }
.day-chip:disabled { color: var(--ink-3); cursor: default; background: var(--surface-2); }
.day-chip .dow { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.day-chip div { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.day-chip .mo { font-size: 11px; color: var(--ink-2); }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--sp-2); }
.time-chip {
  min-height: 48px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  font: 600 16px/1 var(--font); color: var(--ink); letter-spacing: .01em; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.time-chip:hover { border-color: var(--line-strong); }
.time-chip.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-tint); color: var(--accent-ink); }
.times .none { grid-column: 1/-1; }

/* ---------- summary (collapsible) ---------- */
details.summary-box { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
details.summary-box summary {
  cursor: pointer; list-style: none; padding: 12px var(--sp-4);
  font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: space-between;
}
details.summary-box summary::-webkit-details-marker { display: none; }
details.summary-box summary::after { content: "⌄"; color: var(--ink-2); font-size: 14px; transition: transform 150ms ease; }
details.summary-box[open] summary::after { transform: rotate(180deg); }
.summary { font-size: 15px; }
.summary .row { display: flex; justify-content: space-between; gap: var(--sp-4); padding: 9px 0; border-bottom: 1px solid var(--line); }
.summary .row:last-child { border-bottom: 0; }
.summary .row .k { color: var(--ink-2); font-size: 14px; flex: none; }
.summary .row.total { font-weight: 650; }
.summary .row.total .k { color: var(--ink); }

/* ---------- policy ---------- */
.policy-banner {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px var(--sp-4); font-size: 14px; color: var(--ink-2); max-height: 180px; overflow-y: auto;
  white-space: pre-wrap;
}
#policy-banner { font-size: 13px; }

/* ---------- steps / progress ---------- */
.steps { display: flex; gap: 6px; margin: 0 0 var(--sp-4); padding: 0; list-style: none; }
.steps .seg { flex: 1; height: 3px; border-radius: 2px; background: var(--line); transition: background 200ms ease; }
.steps .seg.done { background: var(--ink); }
.steps .seg.now { background: var(--ink); }
.seg-labels { display: flex; font-size: 12px; color: var(--ink-2); margin: -34px 0 var(--sp-4); }
.seg-labels span { flex: 1; text-align: left; }
.step { animation: stepIn 180ms ease-out both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- loading ---------- */
.loading-block { display: flex; flex-direction: column; align-items: center; padding: var(--sp-7) 0; color: var(--ink-2); gap: 12px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--ink-2);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 400% 100%; animation: sh 1.4s ease infinite; border-radius: var(--r-sm); }
@keyframes sh { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- tables (admin) ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td input { min-height: 40px; padding: 8px 10px; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--ink-2); text-align: center; padding: var(--sp-5) !important; }

/* ---------- admin shell ---------- */
.admin-topbar {
  background: #1c2440; color: #e9ecf8; padding: 10px 0;
  border-bottom: 2px solid; border-image: linear-gradient(90deg, var(--ember), var(--plunge)) 1;
}
@media (prefers-color-scheme: dark) { .admin-topbar { background: #10131f; } }
.admin-topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.admin-topbar .brand .mark { background: var(--accent); color: #fff; }
.admin-topbar .brand small { color: rgba(233, 236, 248, .65); }
.admin-topbar .btn.ghost { color: #e9ecf8; border-color: rgba(233, 236, 248, .35); background: transparent; }
.admin-topbar .btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.nav-tabs {
  display: flex; gap: 2px; flex-wrap: wrap; margin-top: var(--sp-4); padding: 3px;
  background: var(--surface-2); border-radius: var(--r); width: fit-content; max-width: 100%;
}
.nav-tabs a {
  color: var(--ink-2); font-size: 14px; font-weight: 550; padding: 8px 14px; border-radius: var(--r-sm);
  transition: color 120ms ease, background 120ms ease;
}
.nav-tabs a:hover { color: var(--ink); }
.nav-tabs a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.day-hours { display: flex; align-items: center; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.day-hours:last-of-type { border-bottom: 0; }

/* ---------- sandbox banner (kept explicit) ---------- */
.sandbox-banner {
  background: repeating-linear-gradient(45deg, var(--warn-bg), var(--warn-bg) 12px, transparent 12px, transparent 24px);
  color: var(--warn-ink); border: 1px solid color-mix(in srgb, var(--warn-ink) 30%, transparent);
  border-radius: var(--r); padding: 10px var(--sp-4); font-size: 14px; font-weight: 600; text-align: center;
}

/* ---------- misc ---------- */
.empty-state { text-align: center; color: var(--ink-2); padding: var(--sp-6) var(--sp-4); }
.confirm-card { text-align: center; padding: var(--sp-6) var(--sp-4); }
.confirm-card .done-glyph { font-size: 40px; margin-bottom: 6px; }
.confirm-ref { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--accent-ink); font-variant-numeric: tabular-nums; margin: var(--sp-2) 0; }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.version-tag { position: fixed; bottom: 6px; right: 8px; font-size: 10px; color: var(--ink-3); font-family: ui-monospace, monospace; z-index: 5; }
.sig-pad { background: #fff; border: 1px solid var(--line); border-radius: var(--r); width: 100%; height: 120px; touch-action: none; }
.dob-pop { position: absolute; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; box-shadow: var(--shadow); width: 272px; }
.dob-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.dob-nav { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.dob-month, .dob-year { width: auto; min-height: 36px; font-size: 14px; }
.dob-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dob-dow { font-size: 10px; color: var(--ink-3); text-align: center; padding: 2px 0; text-transform: uppercase; letter-spacing: .05em; }
.dob-day { min-height: 34px; border: 0; background: transparent; border-radius: 8px; color: var(--ink); font: 450 15px var(--font); cursor: pointer; }
.dob-day:hover { background: var(--surface-2); }
.svc .price { color: var(--accent-ink); font-weight: 700; white-space: nowrap; }
.therapist-photo-slot { aspect-ratio: 1/1; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.side-logo { display: block; width: 100%; max-width: 300px; height: auto; border-radius: var(--r); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
@media (max-width: 720px) { .cal-grid { grid-template-columns: 1fr; } .cal-grid .dow { display: none; } }
.appt-chip { background: var(--accent-tint); color: var(--accent-ink); border-radius: 8px; padding: 4px 8px; font-size: .8rem; overflow: hidden; }
.appt-chip .n { color: var(--ink-2); font-size: .74rem; }
.legend { display: flex; gap: .9rem; font-size: .72rem; color: var(--ink-2); margin: .6rem 0; flex-wrap: wrap; }

/* ---------- waitlist "Notify me" + no-show pill (2026-11-12) ---------- */
.wl-panel {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-3);
}
.wl-head { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.wl-title { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.wl-fields { display: grid; grid-template-columns: 2fr 2fr 2fr auto; gap: var(--sp-2); }
@media (max-width: 640px) { .wl-fields { grid-template-columns: 1fr; } }
.wl-fields input {
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 15px; padding: 9px 12px; min-height: 42px; width: 100%;
}
.wl-fields input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wl-ok { color: var(--ok-ink, var(--accent-ink)); font-weight: 600; font-size: 15px; padding: var(--sp-1) 0; }
.day-chip.full { opacity: .45; }
.day-chip.full:hover { border-color: var(--warn-ink); }
.ns-pill.zero { opacity: .55; }

/* ---------- admin & manage layout rules restored (2026-11-12) ----------
 * The stylesheet rewrite never ported a batch of classes admin.html and
 * manage.html still use; they were silently unstyled. Rebuilt here on the
 * same tokens (no old stylesheet revived wholesale). */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); margin: var(--sp-4) 0; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--sp-3) var(--sp-4); box-shadow: var(--shadow);
}
.kpi .v { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

.spread { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }

.overlay { position: fixed; inset: 0; background: rgba(10, 12, 14, .55); display: grid; place-items: center; z-index: 50; padding: var(--sp-4); }
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-5); width: min(680px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow);
}

/* "btn ghost/link/danger" spellings used by the admin dashboard */
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger-bg); color: var(--danger-ink); border-color: transparent; }
.btn.link { background: none; border: 0; color: var(--accent-ink); min-height: 44px; padding: 0 var(--sp-2); font-weight: 600; }
.btn.link:hover { text-decoration: underline; }

.state-banner {
  padding: 10px var(--sp-4); border-radius: var(--r); font-size: 14px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}

.cal-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-3); flex-wrap: wrap; }
.cal-col .dow { text-align: center; color: var(--ink-2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: var(--sp-1) 0; }
.cal-col .slots { display: flex; flex-direction: column; gap: var(--sp-2); min-height: 60px; }
.appt-chip.pending_payment { background: var(--warn-bg); color: var(--warn-ink); }
.appt-chip.completed { background: color-mix(in srgb, var(--ok-ink) 10%, transparent); color: var(--ok-ink); }
.appt-chip.cancelled { opacity: .55; text-decoration: line-through; }

/* manage page's reschedule strip (alias of .day-strip) */
.days-strip { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-2); scrollbar-width: none; }
.days-strip::-webkit-scrollbar { display: none; }

.mt-muted { margin-top: var(--sp-3); color: var(--ink-2); }
.big { font-size: 38px; line-height: 1.2; }

/* ---------- month navigation in the full picker (2026-11-12) ----------
 * Clients can book up to the admin's booking window (default 90 days ≈ 3
 * months) by flipping month to month. */
.month-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.month-bar strong { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.month-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: 17px; cursor: pointer;
  display: grid; place-items: center; flex: none; font-family: var(--font);
}
.month-btn:hover { background: var(--surface-2); }
.month-btn:disabled { color: var(--ink-3); cursor: default; background: var(--surface-2); border-color: var(--line); }
.month-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- therapist intro on the booking page (2026-11-12) ----------
 * Compact by owner request: a small round avatar sits in the header's right
 * edge; the fuller "who you're with" card lives at the END of step 1 so it
 * never blocks the booking path. Photo/bio from Admin → Settings. */
.host-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  margin-left: auto; border: 1px solid var(--line); flex: none;
  background: var(--surface-2);
}
.therapist-intro {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4); margin: var(--sp-6) auto 0; max-width: 440px;
  box-shadow: var(--shadow);
}
.therapist-photo {
  width: 52px; height: 52px; object-fit: cover; border-radius: 50%; flex: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.therapist-name { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
#th-title { margin: 0; }

/* ---------- shared bubble timetable picker (2026-11-13) ----------
 * Anchored popover on wide screens (HIG popovers: tail to the trigger, sized
 * to content, non-modal — page stays visible), bottom sheet under 720px
 * (HIG sheets: compact views adapt to a sheet). One implementation shared by
 * the booking page, manage page and admin dashboard. */
.bubble {
  position: absolute; z-index: 60;
  width: min(560px, calc(100vw - 24px)); max-height: min(72vh, 640px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 2px 8px rgba(16, 20, 40, .08), 0 16px 48px rgba(16, 20, 40, .16);
  padding: var(--sp-3);
  animation: bubbleIn 160ms ease-out both; /* one quick fade/rise, like the steps */
  transform-origin: 24px 0;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bubble-tail {
  position: absolute; width: 12px; height: 12px; transform: rotate(45deg);
  background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 2px;
  z-index: -1;
}
.bubble.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto;
  width: auto; max-height: 86vh; margin: 0 auto; max-width: 720px;
  border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0;
  animation: sheetIn 220ms ease-out both;
  padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.bubble.sheet::before { /* grabber */
  content: ""; display: block; width: 36px; height: 5px; border-radius: 3px;
  background: var(--line-strong); margin: 0 auto var(--sp-2);
}
.bubble-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.bubble-head strong { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.bubble-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-2); margin-top: var(--sp-2); }
.bubble-times .none { grid-column: 1 / -1; }
.bubble-foot { padding: var(--sp-2) 2px 0; }
.bubble .day-chip { min-width: 56px; min-height: 56px; }
.bubble .day-chip.full { opacity: .45; cursor: default; }
.bubble .time-chip[data-marked] { border-color: var(--accent-ink); color: var(--accent-ink); cursor: default; }
.bubble :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .bubble, .bubble.sheet { animation: none; } /* fade handled by the global kill rule */
}
