/* QueenWait · per-salon kiosk + staff queue (forked from the Queen Bee v2 app). Brand colours below are neutral defaults; brand.js overrides them per salon at runtime. */
@font-face { font-family: "Cinzel"; src: url("/fonts/cinzel.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/fonts/outfit.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  --font-ui: Outfit, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--brand-display, Outfit, system-ui, -apple-system, "Segoe UI", sans-serif);
  --radius: 22px;
  --radius-sm: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* light (default, matches the white logo) */
  --bg: #faf8f7;
  --bg-glow: rgba(59, 47, 122, .05);
  --surface: #ffffff;
  --surface-2: #f7f3f2;
  --surface-3: #ece5e3;
  --text: #141111;
  --muted: #5c5352;
  --line: rgba(20, 17, 17, .12);
  --line-strong: rgba(20, 17, 17, .26);
  --accent-rgb: 59, 47, 122;
  --gold: #3b2f7a;        /* brand fill (overridden per salon) */
  --gold-2: #4f42a0;
  --gold-ink: #3b2f7a;
  --on-gold: #ffffff;
  --honey: #2a2058;
  --wait: #8a5a00;
  --next: #3b2f7a;
  --chair: #1d5fb0;
  --done: #2f6d2a;
  --noshow: #6e6564;
  --danger: #b42318;
  --danger-fill: #b42318;
  --focus-ring: #3b2f7a;
  --shadow: 0 18px 50px rgba(40, 10, 10, .10);
  --shadow-sm: 0 6px 18px rgba(40, 10, 10, .08);
  --pattern-op: 0;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #0e0c0c;
    --bg-glow: rgba(91, 79, 176, .14);
    --surface: #171414;
    --surface-2: #1f1b1b;
    --surface-3: #2a2424;
    --text: #f6f2f1;
    --muted: #b5abaa;
    --line: rgba(255, 255, 255, .10);
    --line-strong: rgba(255, 255, 255, .22);
    --accent-rgb: 179, 169, 240;
    --gold: #5b4fb0;
    --gold-2: #6b5fc0;
    --gold-ink: #b3a9f0;
    --on-gold: #ffffff;
    --honey: #2a2058;
    --wait: #f2b84b;
    --next: #b3a9f0;
    --chair: #7fb2ff;
    --done: #8fcf7a;
    --noshow: #a9a09f;
    --danger: #ff8a7f;
    --danger-fill: #b42318;
    --focus-ring: #b3a9f0;
    --shadow: 0 18px 50px rgba(0, 0, 0, .5);
    --shadow-sm: 0 6px 18px rgba(0, 0, 0, .35);
    --pattern-op: 0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0c0c;
  --bg-glow: rgba(91, 79, 176, .14);
  --surface: #171414;
  --surface-2: #1f1b1b;
  --surface-3: #2a2424;
  --text: #f6f2f1;
  --muted: #b5abaa;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);
  --accent-rgb: 179, 169, 240;
  --gold: #5b4fb0;
  --gold-2: #6b5fc0;
  --gold-ink: #b3a9f0;
  --on-gold: #ffffff;
  --honey: #2a2058;
  --wait: #f2b84b;
  --next: #b3a9f0;
  --chair: #7fb2ff;
  --done: #8fcf7a;
  --noshow: #a9a09f;
  --danger: #ff8a7f;
  --danger-fill: #b42318;
  --focus-ring: #b3a9f0;
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .35);
  --pattern-op: 0;
  color-scheme: dark;
}

/* logo variants: dark-ink logo on light surfaces, white-ink logo on dark */
.lg-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lg-light { display: none !important; }
  :root:not([data-theme="light"]) .lg-dark { display: block !important; }
}
:root[data-theme="dark"] .lg-light { display: none !important; }
:root[data-theme="dark"] .lg-dark { display: block !important; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: radial-gradient(900px 520px at 50% -12%, var(--bg-glow), transparent 62%), var(--bg);
  background-attachment: fixed;
  padding: calc(10px + var(--safe-top)) 16px calc(28px + var(--safe-bottom));
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
body:not(.kiosk-mode) { padding-bottom: calc(104px + var(--safe-bottom)); }
body::before { content: none; }
.app { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; }
a { color: var(--gold-ink); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.sr, .visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 10px; }
.print-only { display: none; }

/* ---- top bar ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px 14px; }
.brandmark { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: auto; height: 40px; flex: none; object-fit: contain; }
.brandtext { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; }
.brand-sub { font-family: var(--font-display); font-size: 10.5px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-ink); margin-top: 4px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color .2s, color .2s, transform .15s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.96); }
body.kiosk-mode .staff-only { display: none !important; }
body:not(.kiosk-mode) .kiosk-only { display: none !important; }

.sync-pill {
  display: inline-flex; align-items: center; gap: 7px; max-width: 52vw; padding: 6px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line); color: var(--muted); background: var(--surface);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sync-pill::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync-pill.live { color: var(--done); }
.sync-pill.live::before { background: var(--done); box-shadow: 0 0 0 0 var(--done); animation: pulse 2.4s infinite; }
.sync-pill.offline { color: var(--noshow); }
.sync-pill.offline::before { background: var(--noshow); }
.sync-pill.connecting::before { background: var(--gold); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(156, 194, 122, .55); } 70% { box-shadow: 0 0 0 7px rgba(156, 194, 122, 0); } 100% { box-shadow: 0 0 0 0 rgba(156, 194, 122, 0); } }

/* ---- views ---- */
.view { animation: viewIn .38s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 8px; }
.step-title, .page-title { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: .005em; }
.step-title { font-size: clamp(28px, 7.6vw, 40px); margin-bottom: 10px; }
.step-title em, .page-title em { font-style: normal; color: var(--gold-ink); }
.page-title { font-size: 30px; margin-bottom: 4px; }
.step-sub, .sub { color: var(--muted); font-size: 16px; }
.step-sub { margin-bottom: 22px; }

/* ---- kiosk card ---- */
.kiosk-card {
  --kiosk-pad-x: 20px;
  --kiosk-pad-y: 22px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow);
  padding: var(--kiosk-pad-y) var(--kiosk-pad-x); position: relative; overflow: visible;
}
.kiosk-card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .7; border-radius: 28px 28px 0 0; pointer-events: none; }
.kiosk-card.narrow { max-width: 460px; margin: 0 auto; }
.kiosk-head { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-bottom: 18px; }
.back-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center; cursor: pointer; color: var(--text); transition: transform .15s var(--ease), border-color .2s;
}
.back-btn svg { width: 22px; height: 22px; }
.back-btn:active { transform: scale(.92); }
.dots { list-style: none; display: flex; gap: 8px; flex: 1; align-items: center; }
.dots li { height: 8px; width: 8px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); transition: all .35s var(--ease); }
.dots li.done { background: var(--honey); border-color: transparent; }
.dots li.active { width: 30px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); border-color: transparent; }
.step-count { font-size: 13px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }

.step { display: none; }
.step.active { display: block; animation: stepIn .4s var(--ease) both; }
.step.active.from-left { animation-name: stepInLeft; }
@keyframes stepIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes stepInLeft { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { margin-bottom: 16px; }
label, .label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 7px; letter-spacing: .01em; }
.opt { font-weight: 400; }
input[type=text], input[type=tel], input[type=time], input[type=number], input[type=password], input[type=search], textarea, select {
  width: 100%; min-height: 56px; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit; font-size: 18px; transition: border-color .2s, box-shadow .2s, background .2s; -webkit-appearance: none; appearance: none;
}
textarea { min-height: 76px; resize: vertical; font-size: 17px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .18); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-color: var(--focus-ring); }
input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(239, 138, 120, .15); }
.big-input { font-size: 24px; min-height: 64px; letter-spacing: .02em; }
.pin-input { letter-spacing: .4em; text-align: center; }

/* tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  min-height: 64px; padding: 14px; border-radius: 16px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--bg); font-size: 17px; font-weight: 500; line-height: 1.2;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  transition: border-color .2s, background .2s, transform .15s var(--ease), box-shadow .2s;
}
.tile::after { content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); transition: all .2s; }
.tile:active { transform: scale(.97); }
.tile[aria-checked="true"] { border-color: var(--gold); background: linear-gradient(180deg, rgba(var(--accent-rgb), .16), rgba(var(--accent-rgb), .06)); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .14); }
.tile[aria-checked="true"]::after { border-color: var(--gold); background: var(--gold) radial-gradient(circle, var(--on-gold) 0 3px, transparent 3.5px); }
.chips-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt {
  min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg);
  cursor: pointer; font-size: 16px; font-weight: 500; transition: all .2s var(--ease);
}
.chip-opt[aria-checked="true"] { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 600; }

/* segmented */
.segmented { display: grid; gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented.two { grid-template-columns: 1fr 1fr; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.segmented.four { grid-template-columns: repeat(4, 1fr); }
.seg {
  min-height: 46px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; font-size: 15px; font-weight: 600;
  color: var(--muted); transition: background .25s var(--ease), color .2s, box-shadow .25s; padding: 0 6px; white-space: nowrap;
}
.seg i { font-style: normal; font-size: 12px; opacity: .8; margin-left: 2px; font-variant-numeric: tabular-nums; }
.seg.active { background: var(--gold); color: var(--on-gold); box-shadow: var(--shadow-sm); }

/* review */
.review { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 18px; }
.review div { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.review div:last-child { border-bottom: 0; }
.review dt { color: var(--muted); font-size: 14px; }
.review dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.review .edit { font-size: 13px; background: none; border: 0; color: var(--gold-ink); text-decoration: underline; cursor: pointer; margin-left: 8px; font-weight: 500; min-height: 32px; }

/* consent checkbox */
.check { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 400; color: var(--text); font-size: 14.5px; line-height: 1.45; margin: 0; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line-strong); display: grid; place-items: center; transition: all .2s var(--ease); margin-top: 1px; }
.check input:checked + .box { background: var(--gold); border-color: var(--gold); }
.check input:checked + .box::after { content: ""; width: 12px; height: 7px; border-left: 3px solid var(--on-gold); border-bottom: 3px solid var(--on-gold); transform: rotate(-45deg) translate(1px, -2px); }
.check input:focus-visible + .box { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.check-text a { font-weight: 600; }

.step-error { min-height: 22px; color: var(--danger); font-size: 15px; font-weight: 500; margin: 4px 0 8px; }
.kiosk-footer-sticky {
  position: sticky;
  bottom: 0;
  z-index: 6;
  margin: 12px calc(-1 * var(--kiosk-pad-x)) calc(-1 * var(--kiosk-pad-y));
  padding: 10px var(--kiosk-pad-x) calc(14px + var(--safe-bottom));
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  border-radius: 0 0 28px 28px;
}
.kiosk-actions { display: flex; gap: 10px; align-items: stretch; }
.kiosk-actions .btn { flex: 1; }
#btnStepBackBottom { flex: 0 0 34%; }

/* service search (kiosk step 3) */
.service-search-sticky {
  position: sticky;
  top: 0;
  z-index: 6;
  margin: 0 calc(-1 * var(--kiosk-pad-x)) 14px;
  padding: 8px var(--kiosk-pad-x) 12px;
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.service-search { position: relative; display: block; margin: 0; }
.service-search svg { position: absolute; left: 16px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.service-search input {
  min-height: 56px; padding: 14px 52px 14px 48px; font-size: 17px; border-radius: 16px; background: var(--bg);
}
.service-search input[type="search"]::-webkit-search-decoration,
.service-search input[type="search"]::-webkit-search-cancel-button,
.service-search input[type="search"]::-webkit-search-results-button,
.service-search input[type="search"]::-webkit-search-results-decoration { -webkit-appearance: none; appearance: none; }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.search-clear:hover { color: var(--text); background: var(--surface-3); }
.service-search-empty {
  text-align: center; color: var(--muted); font-size: 16px; font-weight: 500;
  padding: 6px 8px 14px;
}
.wait-note { margin-top: 6px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.wait-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.wait-note:empty { display: none; }
.kiosk-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 4px; font-size: 13px; color: var(--muted); text-align: center; }
.kiosk-footer a { color: var(--muted); font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px;
  border-radius: 16px; border: 1.5px solid transparent; font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--on-gold); box-shadow: 0 8px 22px rgba(var(--accent-rgb), .28); }
.btn-soft { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-danger { color: var(--danger); }
.btn-xl { min-height: 62px; font-size: 19px; border-radius: 18px; width: 100%; }
.btn-block { width: 100%; margin: 6px 0; }
.text-btn { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 15px; min-height: 44px; cursor: pointer; }
.error-text { color: var(--danger); min-height: 22px; font-size: 15px; margin-bottom: 8px; }
.fineprint { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }

/* ---- success ---- */
.success-card { text-align: center; padding-top: 34px; }
.success-mark { width: 120px; height: 120px; margin: 0 auto 16px; }
.success-mark svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.success-mark .ring-bg { fill: rgba(var(--accent-rgb), .1); stroke: var(--line); stroke-width: 5; }
.success-mark .ring { fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 0; }
.success-mark .ring.run { animation: ringDown var(--reset-ms, 8000ms) linear forwards; }
@keyframes ringDown { to { stroke-dashoffset: 339.3; } }
.success-mark .tick { fill: none; stroke: var(--gold-ink); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 70; stroke-dashoffset: 70; transform: rotate(90deg); transform-origin: 60px 60px; animation: tick .6s .15s var(--ease) forwards; }
@keyframes tick { to { stroke-dashoffset: 0; } }
.confirm-time { display: inline-block; margin: 6px 0 12px; padding: 8px 18px; border-radius: 999px; background: rgba(var(--accent-rgb), .14); border: 1px solid var(--line-strong); color: var(--gold-ink); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.confirm-time:empty { display: none; }
.success-card .step-sub { margin-bottom: 24px; }
.reset-note { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ---- staff: queue ---- */
.queue-head { margin: 2px 0 14px; }
.queue-head .eyebrow { margin-bottom: 4px; letter-spacing: .14em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 10px; text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--gold-ink); font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 4px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.now-serving { display: grid; gap: 10px; margin-bottom: 12px; }
.now-serving:empty { display: none; }
.ns-card {
  border-radius: 20px; padding: 16px 18px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .22), rgba(var(--accent-rgb), .08) 60%, transparent), var(--surface);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm);
}
.ns-label { font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-ink); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ns-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--chair); }
.ns-names { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.15; margin-top: 4px; }
.ns-meta { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.ns-next { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; }
.ns-next b { color: var(--next); font-weight: 700; }

.toolbar { position: sticky; top: calc(var(--safe-top) + 0px); z-index: 5; margin: 8px -16px 10px; padding: 10px 16px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.search-row { display: flex; gap: 8px; margin-top: 8px; }
.search { flex: 1; position: relative; margin: 0; }
.search svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); }
.search input { min-height: 48px; padding-left: 44px; font-size: 16px; border-radius: 14px; background: var(--surface); }
.toggle-btn { min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.toggle-btn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-ink); background: rgba(var(--accent-rgb), .12); }
.swipe-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.group-head { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 4px 8px; font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: .02em; }
.group-head span { font-family: var(--font-ui); font-size: 13px; color: var(--muted); font-weight: 500; }

.card-wrap { position: relative; margin-bottom: 10px; border-radius: 20px; overflow: hidden; }
.card-wrap .swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; font-weight: 700; font-size: 14px; border-radius: 20px; }
.card-wrap .swipe-bg .r { color: var(--on-gold); }
.card-wrap.sw-right .swipe-bg { background: var(--gold); }
.card-wrap.sw-left .swipe-bg { background: var(--surface-3); justify-content: flex-end; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 14px 12px 16px;
  touch-action: pan-y; transition: transform .28s var(--ease), border-color .2s, opacity .3s; will-change: transform;
}
.card.dragging { transition: none; }
.card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--line-strong); }
.card.st-waiting::before { background: var(--wait); }
.card.st-up-next::before { background: var(--next); }
.card.st-in-chair::before { background: var(--chair); }
.card.st-done::before { background: var(--done); }
.card.st-no-show::before { background: var(--noshow); }
.card.st-done, .card.st-no-show { opacity: .72; }
.card.st-up-next { border-color: rgba(var(--accent-rgb), .5); }
.card.flash { animation: flash 1s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .7); } 100% { box-shadow: 0 0 0 14px rgba(var(--accent-rgb), 0); } }
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.client-name { font-size: 19px; font-weight: 600; line-height: 1.25; }
.meta { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.meta-line { display: block; }
.meta a { color: var(--muted); }
.notes { margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14.5px; border-left: 3px solid var(--line-strong); }
.wait-line { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tag.late { color: var(--noshow); border-color: currentColor; }
.tag.soon { color: var(--next); border-color: currentColor; }
.chip { flex: none; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; border: 1px solid currentColor; white-space: nowrap; }
.chip.waiting { color: var(--wait); }
.chip.up-next { color: var(--next); }
.chip.in-chair { color: var(--chair); }
.chip.done { color: var(--done); }
.chip.no-show { color: var(--noshow); }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.card-actions .btn { min-height: 48px; flex: 1; font-size: 15px; border-radius: 14px; }
.card-actions .btn-more { flex: 0 0 52px; padding: 0; font-size: 22px; letter-spacing: .05em; }
.empty { text-align: center; padding: 34px 18px; color: var(--muted); border: 1.5px dashed var(--line-strong); border-radius: 20px; }
.empty b { display: block; font-family: var(--font-display); font-size: 20px; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.action-grid .btn { padding: 0 8px; font-size: 14.5px; }

/* banners */
.banner-stack { display: grid; gap: 8px; margin-bottom: 10px; }
.banner-stack:empty { display: none; }
.banner { border-radius: 16px; padding: 12px 16px; font-size: 15px; border: 1px solid var(--line-strong); background: var(--surface); animation: viewIn .35s var(--ease); }
.banner b { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 2px; }
.banner.due { background: linear-gradient(90deg, var(--gold-2), var(--gold)); color: var(--on-gold); border-color: transparent; box-shadow: 0 10px 30px rgba(var(--accent-rgb), .35); }
.banner.due b { color: var(--on-gold); }
.banner.lead { border-color: var(--next); }

/* settings */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; margin: 14px 0; }
.panel h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 15px; }
.pill button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.pill button:hover { background: var(--surface-3); color: var(--danger); }
.add-row { display: flex; gap: 8px; }
.add-row input { min-height: 52px; font-size: 16px; }
.add-row .btn { flex: none; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 12px; font-size: 16px; color: var(--text); font-weight: 500; cursor: pointer; }
.switch { position: relative; width: 54px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-strong); transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--text); transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--gold); border-color: var(--gold); }
.switch input:checked + span::after { transform: translateX(22px); background: var(--on-gold); }
.switch input:focus-visible + span { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.help { margin: 18px 4px 10px; color: var(--muted); font-size: 14.5px; }
.help h3 { color: var(--text); font-size: 15px; margin: 14px 0 4px; }
.help p { margin-bottom: 6px; }

/* nav */
.nav {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-bottom));
  width: min(440px, calc(100% - 24px)); display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px;
  border-radius: 24px; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.nav button { position: relative; min-height: 56px; border: 0; border-radius: 18px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; transition: background .25s var(--ease), color .2s; }
.nav button svg { width: 23px; height: 23px; }
.nav button.active { background: rgba(var(--accent-rgb), .16); color: var(--gold-ink); }
.count { position: absolute; top: 6px; right: calc(50% - 26px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--gold); color: var(--on-gold); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }

/* action sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .45); animation: fadeIn .2s; }
.sheet {
  position: fixed; z-index: 41; left: 50%; bottom: 0; transform: translateX(-50%); width: min(560px, 100%);
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(18px + var(--safe-bottom)); box-shadow: var(--shadow); animation: sheetUp .32s var(--ease);
}
.sheet-grip { width: 42px; height: 5px; border-radius: 9px; background: var(--line-strong); margin: 0 auto 12px; }
.sheet h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 6px; }
.sheet-actions .btn { min-height: 56px; }
.sheet-actions .btn.current { border-color: var(--gold); color: var(--gold-ink); }
@keyframes sheetUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes fadeIn { from { opacity: 0; } }

/* doc dialog */
.doc-dialog { border: 0; padding: 0; width: min(680px, 100%); height: min(92vh, 900px); max-height: 100%; margin: auto; border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow: hidden; }
.doc-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.doc-dialog[open] { display: flex; flex-direction: column; }
.doc-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); font-size: 17px; }
.doc-bar .btn { min-height: 44px; }
.doc-dialog iframe { flex: 1; border: 0; width: 100%; background: var(--bg); }

/* toast */
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translate(-50%, 24px);
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 28px); padding: 12px 12px 12px 18px; border-radius: 16px;
  background: #141111; color: #ffffff; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 16px 40px rgba(0, 0, 0, .4);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--ease); font-size: 15px;
}
body.kiosk-mode .toast { bottom: calc(24px + var(--safe-bottom)); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-undo { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--gold); color: var(--on-gold); font-weight: 700; cursor: pointer; }

@media (min-width: 720px) {
  body { padding-left: 24px; padding-right: 24px; }
  .kiosk-card { --kiosk-pad-x: 32px; --kiosk-pad-y: 30px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 360px) {
  .row { grid-template-columns: 1fr; }
  .segmented.four .seg { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .success-mark .ring.run { animation: none; }
}

@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; color: #111 !important; padding: 0 !important; font-size: 12px; }
  body::before, .app, .nav, .toast, .sheet, .sheet-backdrop, .doc-dialog, .qb-confirm { display: none !important; }
  .print-only { display: block !important; }
  .print-only h1 { font-family: var(--font-display); font-size: 22px; margin-bottom: 2px; }
  .print-only p { color: #444; margin-bottom: 10px; }
  .print-only table { width: 100%; border-collapse: collapse; }
  .print-only th, .print-only td { border: 1px solid #bbb; padding: 5px 6px; text-align: left; vertical-align: top; }
  .print-only th { background: #f3eeee; }
}

/* v2 polish: top bar fit + lining numerals */
.brandmark { flex: none; }
.brand-name { white-space: nowrap; }
.brand-sub { white-space: nowrap; }
.topbar-right { flex: 1; min-width: 0; justify-content: flex-end; }
.sync-pill { min-width: 0; max-width: 100%; flex: 0 1 auto; }
.stat b { font-family: var(--font-ui); font-weight: 600; font-size: 26px; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; }
.stat span { font-size: 10.5px; letter-spacing: .06em; white-space: nowrap; }
@media (max-width: 400px) {
  body:not(.kiosk-mode) .brand-sub { display: none; }
  body:not(.kiosk-mode) .brand-name { font-size: 17px; }
  body:not(.kiosk-mode) .logo { height: 30px; }
  .icon-btn { padding: 0 12px; }
}

/* ---------- Text reminders (sms.js) ---------- */
.sms-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.sms-head h2 { margin-bottom: 0; }
.sms-state { padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; border: 1px solid currentColor; }
.sms-state.off { color: var(--muted); }
.sms-state.on { color: var(--done); }
.toggle.is-disabled { opacity: .55; cursor: not-allowed; }
.toggle.is-disabled .switch input { cursor: not-allowed; }
.sms-note { font-size: 14.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.45; }
.sms-note.warn { padding: 10px 12px; border-radius: 14px; background: rgba(var(--accent-rgb), .1); border: 1px dashed var(--line-strong); color: var(--text); }
.sms-note.warn b { color: var(--gold-ink); }
.sms-tabs { margin: 6px 0 8px; }
.sms-tabs .seg { font-size: 14px; }
.sms-hint { font-size: 13.5px; color: var(--muted); margin: 6px 0 10px; line-height: 1.4; }
.sms-hint code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; padding: 1px 5px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.sms-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.sms-reset { font-size: 13px; padding: 4px 0; margin: 0; }
.sms-preview { border-radius: 18px; padding: 12px 12px 14px; background: var(--surface-2); border: 1px solid var(--line); margin: 4px 0 12px; }
.sms-preview-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.sms-preview .bubble { max-width: 88%; padding: 10px 13px; border-radius: 18px 18px 18px 6px; background: var(--surface-3); color: var(--text); font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.sms-log-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.sms-log-item { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.sms-log-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sms-kind { font-weight: 600; font-size: 14.5px; }
.sms-status { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; }
.sms-status.st-sent, .sms-status.st-received { color: var(--done); }
.sms-status.st-dryrun { color: var(--gold-ink); }
.sms-status.st-skipped { color: var(--muted); }
.sms-status.st-failed { color: var(--danger); }
.sms-log-meta { font-size: 13px; color: var(--muted); margin: 3px 0 5px; }
.sms-err { color: var(--danger); }
.sms-log-body { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tag.sms { color: var(--done); border-color: currentColor; }
.sms-head .text-btn, .sms-meta .text-btn { display: inline-block; margin: 0; min-height: 36px; font-size: 13.5px; }

/* ---------- v3 brand: splash, hero logo, success logo ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; cursor: pointer;
  background: var(--bg); transition: opacity .45s var(--ease), visibility .45s;
}
.splash.out { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 24px; }
.splash-logo { width: min(86vw, 460px); height: auto; animation: splashIn .8s var(--ease) both; }
.splash-rule { display: block; width: 72px; height: 2px; border-radius: 2px; background: var(--gold); transform-origin: center; animation: ruleIn .9s .25s var(--ease) both; }
@keyframes splashIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes ruleIn { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

.kiosk-hero { display: flex; justify-content: center; margin: -8px 0 16px; }
.hero-logo { width: min(80%, 310px); height: auto; }
/* on the welcome step the big logo is the hero, so the small top-bar copy steps aside */
body.kiosk-mode:has(#view-signin:not(.hidden) .step[data-step="1"].active) .topbar .brandmark { visibility: hidden; }
.success-logo { display: flex; justify-content: center; margin: -10px 0 14px; }
.success-logo img { height: 66px; width: auto; }
.success-card { padding-top: 26px; }

/* buttons + selections on the red brand */
.btn-gold { box-shadow: 0 8px 22px rgba(var(--accent-rgb), .22); }
.kiosk-card::after { opacity: .9; height: 3px; }
@media (min-width: 720px) {
  .hero-logo { width: 340px; }
}
@media (prefers-reduced-motion: reduce) {
  .splash, .splash-logo, .splash-rule { animation: none !important; transition: none !important; }
}

/* ---------- in-app confirm dialog (replaces window.confirm) ---------- */
.qb-confirm {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  padding-bottom: calc(20px + var(--safe-bottom)); background: rgba(0, 0, 0, .55); animation: fadeIn .18s;
  touch-action: manipulation;
}
.qb-confirm-card {
  width: min(420px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 22px; padding: 22px 20px 18px; box-shadow: var(--shadow);
}
.qb-confirm-card h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.qb-confirm-card p { color: var(--muted); font-size: 15.5px; line-height: 1.45; margin-bottom: 18px; }
.qb-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qb-confirm-actions .btn { min-height: 54px; touch-action: manipulation; }
.btn-danger-solid { background: var(--danger-fill); border-color: var(--danger-fill); color: var(--on-gold); font-weight: 700; }
.btn-danger, .action-grid .btn { touch-action: manipulation; }

/* ---------- QueenWait multi-salon additions ---------- */
.tenant-logo { display: block; object-fit: contain; }
.mono { display: inline-grid; place-items: center; border-radius: 28%; background: var(--gold); color: var(--on-gold); font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; flex: none; }
.splash .mono { width: 132px; height: 132px; font-size: 52px; animation: splashIn .8s var(--ease) both; }
.splash-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 7vw, 40px); letter-spacing: .04em; text-align: center; line-height: 1.1; }
.splash .tenant-logo { width: min(80vw, 420px); max-height: 46vh; animation: splashIn .8s var(--ease) both; }
.kiosk-hero .tenant-logo { width: min(78%, 300px); max-height: 190px; }
.kiosk-hero .mono { width: 92px; height: 92px; font-size: 36px; }
.kiosk-hero .hero-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin-top: 10px; text-align: center; }
.kiosk-hero { flex-direction: column; align-items: center; }
.brandmark .mono { width: 36px; height: 36px; font-size: 15px; }
.brandmark .tenant-logo { height: 40px; width: auto; max-width: 120px; }
.success-logo .tenant-logo { height: 66px; width: auto; max-width: 220px; }
.success-logo .mono { width: 60px; height: 60px; font-size: 24px; }
/* uploaded logos are usually dark-on-white: give them a light plate in dark mode */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tenant-logo.plate { background: #fff; border-radius: 16px; padding: 8px 12px; } }
:root[data-theme="dark"] .tenant-logo.plate { background: #fff; border-radius: 16px; padding: 8px 12px; }
.hours-note { font-size: 14.5px; color: var(--muted); margin-top: 6px; }
.hours-note.closed { color: var(--danger); font-weight: 600; }
.powered { display: block; text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.powered a { color: var(--muted); }
.demo-ribbon { display: block; width: fit-content; margin: 14px auto 0; position: relative; z-index: 1; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px dashed var(--line-strong); color: var(--muted); }
body:not(.kiosk-mode) .demo-ribbon { display: none; }
.notfound { max-width: 460px; margin: 18vh auto 0; text-align: center; }
.notfound h1 { font-family: var(--font-display); font-size: 30px; margin-bottom: 10px; }
.plan-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
