/* Salon staff app — design system.
   Warm, high-contrast, thumb-first. Tokens on :root; dark mode follows the OS.
   Layout: bottom tab bar on phones, sidebar from 760px. Every tappable control is >= 44px. */

:root {
  color-scheme: light dark;
  --bg: #f7f3ed;
  --surface: #ffffff;
  --surface-2: #f1ebe2;
  --surface-3: #e9e1d5;
  --fg: #1d1915;
  --fg-2: #4a423b;
  --muted: #7a7066;
  --line: #e4dccf;
  --line-strong: #cdc2b2;
  --accent: #a94a2d;
  --accent-hover: #933f26;
  --accent-ink: #ffffff;
  --accent-soft: #f7e5dc;
  --accent-soft-ink: #7d3620;
  --ok: #2e7a4e;
  --ok-soft: #dff1e5;
  --warn: #8a5a00;
  --warn-soft: #fbeccc;
  --danger: #b3261e;
  --danger-soft: #f9dedc;
  --info: #2f5f9e;
  --info-soft: #e1eaf7;
  --radius: 16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(30, 25, 21, .05), 0 6px 20px rgba(30, 25, 21, .06);
  --shadow-up: 0 -2px 12px rgba(30, 25, 21, .08);
  --nav-h: 66px;
  --topbar-h: 56px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14100d; --surface: #1f1915; --surface-2: #2a221c; --surface-3: #352b24;
    --fg: #f4ede5; --fg-2: #d6cbbe; --muted: #a79d92; --line: #33291f; --line-strong: #4a3d31;
    --accent: #e8865f; --accent-hover: #f09a78; --accent-ink: #1d110b; --accent-soft: #3a2219; --accent-soft-ink: #f3b79f;
    --ok: #7fcf9c; --ok-soft: #1d3326; --warn: #f0c36a; --warn-soft: #3a2e12; --danger: #ff8a80; --danger-soft: #3f1f1c;
    --info: #8db4ec; --info-soft: #1c2b42;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
    --shadow-up: 0 -2px 12px rgba(0,0,0,.4);
  }
}

/* ---- reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 8px); }
body {
  margin: 0; min-height: 100dvh;
  font: 16px/1.5 var(--font);
  color: var(--fg); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.015em; font-weight: 700; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
p { margin: .5rem 0; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.error { color: var(--danger); margin: .35rem 0 0; font-size: .9rem; }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
dl, ul, ol { margin: 0; }
svg { flex-shrink: 0; }
.num { font-variant-numeric: tabular-nums; }
.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; }
[hidden] { display: none !important; }

/* ---- app shell ---- */
.app { display: grid; min-height: 100dvh; grid-template-rows: 1fr; grid-template-columns: minmax(0, 1fr); }
.app > main { min-width: 0; }
.shell {
  width: 100%; max-width: 46rem; margin: 0 auto;
  padding: calc(var(--gutter) + env(safe-area-inset-top)) var(--gutter) calc(var(--nav-h) + var(--gutter) + env(safe-area-inset-bottom));
}
.shell.narrow { max-width: 25rem; padding-top: max(10vh, 2rem); padding-bottom: 2rem; }
.brand { display: flex; align-items: center; justify-content: center; gap: .6rem; font-weight: 700; margin-bottom: 1.5rem; font-size: 1.1rem; }
.brand img { width: 40px; height: 40px; border-radius: 11px; }

/* Bottom tab bar (phones) */
.nav {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: stretch;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  flex: 1; min-height: 48px; padding: 4px 6px; color: var(--muted); font-size: .7rem; font-weight: 600;
  text-decoration: none; border-radius: var(--radius-sm); -webkit-tap-highlight-color: transparent;
}
.nav a svg { width: 24px; height: 24px; }
.nav a.active { color: var(--accent); }
.nav a:active { background: var(--surface-2); }
.nav a:hover { text-decoration: none; }
.nav .nav-brand, .nav .nav-foot { display: none; }

/* Sidebar (tablet landscape / desktop) */
@media (min-width: 760px) {
  .app { grid-template-columns: 232px minmax(0, 1fr); }
  .nav {
    position: sticky; top: 0; inset: auto; height: 100dvh; z-index: 10;
    flex-direction: column; justify-content: flex-start; gap: 2px;
    padding: 22px 14px; border-top: 0; border-right: 1px solid var(--line); background: var(--surface);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .nav .nav-brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; color: var(--fg); margin: 0 8px 18px; font-size: 1.05rem; }
  .nav .nav-brand img { width: 34px; height: 34px; border-radius: 9px; }
  .nav .nav-brand small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
  .nav a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 10px 12px; font-size: .95rem; }
  .nav a.active { background: var(--accent-soft); color: var(--accent-soft-ink); }
  .nav a:hover:not(.active) { background: var(--surface-2); }
  .nav .nav-foot { display: block; margin-top: auto; padding: 8px 12px 0; font-size: .78rem; color: var(--muted); }
  .shell { padding: 28px 32px 48px; max-width: 52rem; }
}

/* ---- page header ---- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.1rem; min-height: 44px; }
.page-head > div { min-width: 0; }
.page-head .eyebrow { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .15rem; }
.page-head h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-head h1 a { color: inherit; }
.page-head .sub { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.page-head nav, .page-head .head-actions { display: flex; gap: .4rem; align-items: center; flex-shrink: 0; }
.page-head nav a:not(.btn) { font-weight: 600; padding: .5rem .6rem; border-radius: var(--radius-sm); min-height: 44px; display: inline-flex; align-items: center; }
.page-head nav a:not(.btn):hover { background: var(--surface-2); text-decoration: none; }
.back { display: inline-flex; align-items: center; gap: .25rem; font-weight: 600; color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }
.back svg { width: 18px; height: 18px; }
.back:hover { color: var(--accent); text-decoration: none; }

/* ---- date navigation (day view) ---- */
.day-nav { display: flex; align-items: center; gap: .25rem; }
.day-nav a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--fg); background: var(--surface); border: 1px solid var(--line); }
.day-nav a:hover { background: var(--surface-2); text-decoration: none; }
.day-nav a svg { width: 20px; height: 20px; }
.day-nav .today-link { width: auto; padding: 0 .9rem; font-weight: 600; font-size: .9rem; border-radius: 999px; }

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 0 0 1rem; }
.week-strip a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .4rem;
  border-radius: var(--radius-sm); color: var(--fg); text-decoration: none; border: 1px solid transparent;
}
.week-strip a small { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.week-strip a b { font-size: 1.05rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.week-strip a i { display: block; width: 6px; height: 6px; border-radius: 50%; background: transparent; margin-top: 1px; }
.week-strip a i.has { background: var(--accent); }
.week-strip a:hover { background: var(--surface-2); }
.week-strip a.today b { color: var(--accent); }
.week-strip a.selected { background: var(--fg); color: var(--bg); }
.week-strip a.selected small, .week-strip a.selected b { color: inherit; }
.week-strip a.selected i.has { background: var(--bg); }

.day-summary { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; margin: 0 0 .9rem; color: var(--muted); font-size: .9rem; }
.day-summary strong { color: var(--fg); font-weight: 600; }

/* ---- cards ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-title { padding: .9rem 1rem 0; }
.card.flush > .list { margin: 0; padding: 0 1rem; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.card-title h2 { display: flex; align-items: center; gap: .5rem; }
.card-title h2 svg { width: 18px; height: 18px; color: var(--muted); }
.card-title .count { font-weight: 500; color: var(--muted); font-size: .85rem; }
.card-title a:not(.btn) { font-weight: 600; font-size: .9rem; }
.card.soft { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.card.accent { background: var(--accent-soft); border-color: transparent; box-shadow: none; }

/* ---- lists / rows ---- */
.list { list-style: none; padding: 0; margin: 0; }
.list > li { display: flex; gap: .75rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--line); min-height: 52px; }
.list > li:first-child { border-top: 0; }
.list .row-main { flex: 1; min-width: 0; display: grid; gap: .1rem; color: inherit; text-decoration: none; }
.list .row-main strong { font-weight: 600; }
.list .row-main small { color: var(--muted); display: block; }
.list a.row-main:hover strong { color: var(--accent); }
.list .row-aside { display: flex; align-items: center; gap: .35rem; flex-shrink: 0; }
.list .row-aside .muted { font-size: .85rem; }
.card > .list { margin: 0 -1rem; padding: 0 1rem; }
.list.empty-state > li { color: var(--muted); }

/* ---- avatar ---- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 50%; font-weight: 700; font-size: .9rem; letter-spacing: .02em;
  background: var(--accent-soft); color: var(--accent-soft-ink);
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar.sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar.t1 { background: #e4ecf7; color: #2f4f7a; }
.avatar.t2 { background: #e3f1e6; color: #2b5c3c; }
.avatar.t3 { background: #f6e7cf; color: #70470b; }
.avatar.t4 { background: #efe3f3; color: #5b3470; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar.t1 { background: #1f2d42; color: #9ebbe6; }
  :root:not([data-theme="light"]) .avatar.t2 { background: #1d3326; color: #8fd4a6; }
  :root:not([data-theme="light"]) .avatar.t3 { background: #3a2e12; color: #f0c36a; }
  :root:not([data-theme="light"]) .avatar.t4 { background: #33203c; color: #d7aee6; }
}

/* ---- timeline (day view bookings) ---- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 4.4rem 1fr; gap: 0 .75rem; align-items: stretch; padding: .45rem 0; }
.timeline .when { display: grid; align-content: start; text-align: right; padding-top: .55rem; font-variant-numeric: tabular-nums; line-height: 1.25; }
.timeline .when b { font-weight: 700; font-size: .95rem; }
.timeline .when small { color: var(--muted); font-size: .78rem; }
.timeline .slot {
  display: flex; gap: .75rem; align-items: center; min-height: 64px;
  padding: .7rem .85rem; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  box-shadow: var(--shadow); color: inherit; text-decoration: none;
}
.timeline .slot:hover { text-decoration: none; border-color: var(--line-strong); border-left-color: var(--accent); }
.timeline .slot .who { flex: 1; min-width: 0; display: grid; gap: .05rem; }
.timeline .slot .who strong { font-weight: 650; }
.timeline .slot .who small { color: var(--muted); }
.timeline .slot .slot-actions { display: flex; gap: .35rem; align-items: center; }
.timeline .status-pending .slot { border-left-color: var(--warn); }
.timeline .status-completed .slot { border-left-color: var(--ok); }
.timeline .status-cancelled .slot, .timeline .status-no_show .slot { border-left-color: var(--line-strong); opacity: .6; }
.timeline .status-cancelled .slot .who strong, .timeline .status-no_show .slot .who strong { text-decoration: line-through; }
.timeline .gap { grid-column: 2; display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .78rem; padding: .15rem .25rem; }
.timeline .gap::before, .timeline .gap::after { content: ""; flex: 1; border-top: 1px dashed var(--line-strong); }
.timeline .gap a { font-weight: 600; }

/* ---- pills & badges ---- */
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.accent { background: var(--accent-soft); color: var(--accent-soft-ink); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---- facts & stats ---- */
.facts { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; align-items: baseline; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0 0 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem .75rem; display: grid; gap: .1rem; }
.stat b { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat small { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat.accent { background: var(--accent-soft); border-color: transparent; }
.stat.accent b { color: var(--accent-soft-ink); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: .5rem; width: 100%;
  min-height: 48px; padding: .75rem 1rem; font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg);
  cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; white-space: nowrap;
  transition: background .12s var(--ease), transform .06s var(--ease), box-shadow .12s var(--ease);
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.primary { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: none; }
.btn.small { width: auto; min-height: 38px; padding: .4rem .8rem; font-size: .9rem; }
.btn.tiny { width: auto; min-height: 32px; padding: .2rem .6rem; font-size: .8rem; border-radius: var(--radius-xs); }
.btn.link { width: auto; border: 0; background: none; padding: .25rem .45rem; color: var(--accent); min-height: 40px; box-shadow: none; }
.btn.link.danger { color: var(--danger); }
.btn.link:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: default; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }
.btn.small svg { width: 18px; height: 18px; }
.btn .htmx-indicator { display: none; }
.btn.htmx-request .htmx-indicator { display: inline-block; }
.btn.htmx-request { opacity: .75; pointer-events: none; }
.actions { display: grid; gap: .6rem; margin-top: 1rem; }
.actions.row { grid-template-columns: 1fr 1fr; }
.actions.row-3 { grid-template-columns: repeat(3, 1fr); }
.inline { display: inline; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 0 0 1rem; }
@media (min-width: 480px) { .quick-actions.three { grid-template-columns: repeat(3, 1fr); } }

/* ---- forms ---- */
label { display: block; font-weight: 600; margin: 0 0 .35rem; font-size: .95rem; }
.field { margin: 0 0 1rem; }
.field:last-child { margin-bottom: 0; }
.field .help { color: var(--muted); font-size: .85rem; margin: .3rem 0 0; }
.field-row { display: grid; gap: .75rem; }
@media (min-width: 480px) { .field-row { grid-template-columns: 1fr 1fr; } .field-row.thirds { grid-template-columns: 1fr 1fr 1fr; } }
label.check { display: flex; align-items: flex-start; gap: .65rem; font-weight: 500; padding: .4rem 0; cursor: pointer; }
label.check input { width: 1.35rem; height: 1.35rem; margin: .1rem 0 0; accent-color: var(--accent); flex-shrink: 0; }
label.check span small { display: block; color: var(--muted); font-weight: 400; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; min-height: 48px; padding: .7rem .9rem; font: inherit; font-size: 1rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: inherit;
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
button:focus-visible, a:focus-visible, label.check:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }
input[type="file"] { font: inherit; width: 100%; min-width: 0; max-width: 100%; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.4rem; }
textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
.input-group { position: relative; }
.input-group .prefix { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.input-group input { padding-left: 2rem !important; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.stack { display: grid; gap: .25rem; }
.stack .btn { margin-top: .75rem; }
form.search { margin-bottom: .75rem; position: relative; }
form.search input { padding-left: 2.7rem !important; }
form.search svg { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.contact-add { display: grid; grid-template-columns: 6.6rem 1fr; gap: .5rem; margin-top: .9rem; align-items: start; }
.contact-add .btn { width: auto; }
.contact-add .full { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.product-row { display: grid; grid-template-columns: 1fr 4.5rem; gap: .5rem; margin-top: .4rem; }
.product-row input { min-height: 42px; padding: .5rem .75rem; }
.form-foot { display: flex; gap: .6rem; align-items: center; margin-top: 1.25rem; }
.form-foot .btn { width: auto; flex: 1; }
.form-foot .btn.link { flex: 0 0 auto; }
.hint-box { font-size: .9rem; color: var(--fg-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: .65rem .85rem; margin: .5rem 0 0; }

/* ---- notices & toasts ---- */
.notice { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .95rem; border-radius: var(--radius-sm); background: var(--surface-2); color: inherit; margin: 0 0 .85rem; border: 1px solid var(--line); font-size: .95rem; }
.notice svg { width: 20px; height: 20px; margin-top: .1rem; }
.notice.success { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.notice.error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.notice.warning, .notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.notice.info { background: var(--info-soft); border-color: transparent; color: var(--info); }
a.notice.active-visit { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; align-items: center; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
a.notice.active-visit:hover { text-decoration: none; background: var(--accent-hover); }
a.notice.active-visit .pill { background: rgba(255,255,255,.22); color: inherit; }
a.notice.active-visit .go { margin-left: auto; }

.toasts { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); display: grid; gap: .5rem; width: min(92vw, 28rem); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: .6rem; align-items: center; padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--fg); color: var(--bg); box-shadow: 0 8px 24px rgba(0,0,0,.25); font-weight: 500; animation: toast-in .25s var(--ease); font-size: .95rem; }
.toast.success { background: var(--ok); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.warning { background: var(--warn); color: #fff; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; font: inherit; opacity: .8; cursor: pointer; padding: .25rem; min-width: 32px; min-height: 32px; }
.toast.leaving { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@media (min-width: 760px) { .toasts { bottom: 24px; left: calc(50% + 116px); } }

/* ---- timer ---- */
.timer { text-align: center; padding: .5rem 0 .25rem; }
.timer .service-line { display: flex; justify-content: center; gap: .5rem; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin: 0; }
.timer .elapsed { font-size: clamp(3.2rem, 14vw, 4.6rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; margin: .25rem 0; line-height: 1.05; }
.timer .elapsed small { display: block; font-size: .85rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: .35rem; }
.timer.overrun .elapsed { color: var(--danger); }
.timer.paused .elapsed { color: var(--muted); }
.timer .progress { height: 6px; border-radius: 999px; background: var(--surface-3); margin: .6rem auto 1rem; max-width: 22rem; overflow: hidden; }
.timer .progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 1s linear; }
.timer.overrun .progress i { background: var(--danger); }
.timer .actions { text-align: left; }
.timer .facts { text-align: left; margin-top: .5rem; display: inline-grid; }
.timer .card-error { text-align: left; }
.finish-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: .85rem; display: grid; gap: .5rem; }
.finish-box label { margin: 0; font-size: .9rem; }
.finish-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: start; }
.finish-row .btn { width: auto; min-width: 7.5rem; }

/* ---- visits & notes ---- */
.visits .note { margin: .4rem 0 0; white-space: pre-wrap; color: var(--fg); font-size: .95rem; padding: .55rem .75rem; background: var(--surface-2); border-radius: var(--radius-sm); border-left: 3px solid var(--line-strong); }
.recorder { padding: 1rem; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); margin-top: .75rem; }
.recorder .btn.primary.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.recorder .btn.recording { background: var(--danger); border-color: var(--danger); color: #fff; animation: rec 1.6s infinite; }
@keyframes rec { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 45%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }
details { border-top: 1px solid var(--line); padding: .5rem 0 0; margin-top: .75rem; }
details summary { cursor: pointer; font-weight: 600; color: var(--muted); list-style: none; display: flex; align-items: center; gap: .4rem; min-height: 40px; }
details summary::-webkit-details-marker { display: none; }
details summary svg { width: 18px; height: 18px; }
details summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin: 0 .3rem 0 .1rem; }
details[open] summary::before { transform: rotate(45deg); }
details.plain { border: 0; padding: 0; margin: 0; }
.draft { background: var(--accent-soft); border: 0; }
.or-divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin: 1rem 0 .5rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---- empty states ---- */
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); display: grid; justify-items: center; gap: .35rem; }
.empty svg { width: 40px; height: 40px; color: var(--line-strong); }
.empty strong { color: var(--fg-2); font-weight: 600; }
.empty .btn { margin-top: .5rem; }
.list-actions { display: grid; gap: .6rem; margin-top: 1rem; }
@media (min-width: 480px) { .list-actions { grid-template-columns: 1fr 1fr; } }

/* ---- settings ---- */
.settings-grid { display: grid; gap: .6rem; }
.settings-link { display: flex; gap: .85rem; align-items: center; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; box-shadow: var(--shadow); min-height: 68px; }
.settings-link:hover { text-decoration: none; border-color: var(--line-strong); }
.settings-link .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-soft-ink); flex-shrink: 0; }
.settings-link .ico svg { width: 22px; height: 22px; }
.settings-link .ico.t1 { background: var(--info-soft); color: var(--info); }
.settings-link .ico.t2 { background: var(--ok-soft); color: var(--ok); }
.settings-link .ico.t3 { background: var(--warn-soft); color: var(--warn); }
.settings-link > div { flex: 1; min-width: 0; }
.settings-link strong { display: block; font-weight: 650; }
.settings-link small { color: var(--muted); }
.settings-link .chev { color: var(--muted); width: 20px; height: 20px; }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.segmented a, .segmented button { padding: .35rem .8rem; border-radius: 999px; font: inherit; font-weight: 600; font-size: .85rem; color: var(--muted); border: 0; background: transparent; cursor: pointer; min-height: 34px; }
.segmented .on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.hours-day { display: grid; grid-template-columns: 6.2rem 1fr; gap: .5rem; align-items: start; padding: .6rem 0; border-top: 1px solid var(--line); }
.hours-day:first-child { border-top: 0; }
.hours-day .dow { font-weight: 600; padding-top: .35rem; }
.hours-day .windows { display: flex; flex-wrap: wrap; gap: .4rem; }
.hours-day .window { display: inline-flex; align-items: center; gap: .3rem; background: var(--ok-soft); color: var(--ok); border-radius: 999px; padding: .25rem .4rem .25rem .7rem; font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums; }
.hours-day .window button { background: none; border: 0; color: inherit; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; line-height: 1; opacity: .75; }
.hours-day .window button:hover { opacity: 1; background: rgba(0,0,0,.08); }
.hours-day .closed { color: var(--muted); padding-top: .35rem; font-size: .9rem; }
.staff-switch { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; }
.staff-switch select { width: auto; min-height: 40px; padding: .35rem 2.2rem .35rem .8rem; font-size: .9rem; border-radius: 999px; }

/* ---- login ---- */
.auth-card { padding: 1.5rem 1.25rem; }
.auth-card h1 { text-align: center; margin-bottom: .25rem; }
.auth-card .lead { text-align: center; color: var(--muted); margin: 0 0 1.25rem; }
.auth-card .btn { margin-top: .4rem; }

/* ---- utilities ---- */
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .5rem; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; gap: .5rem; align-items: center; }
.row > * { min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.right { text-align: right; }
.card-error { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-xs); padding: .55rem .75rem; margin: .5rem 0; font-size: .9rem; font-weight: 500; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- public booking page (cookie-free, no app chrome) ---- */
body.public { background: var(--bg); }
.public-shell { max-width: 40rem; padding-bottom: 2rem; }
.public-brand { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.public-brand > a { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--fg); font-size: 1.05rem; }
.public-brand > a img { width: 32px; height: 32px; border-radius: 9px; }
.public-brand > a:hover { text-decoration: none; }
.steps { display: flex; gap: .25rem; list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 600; color: var(--muted); }
.steps li span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font-size: .7rem; }
.steps li.done span { background: var(--ok-soft); color: var(--ok); }
.steps li.on { color: var(--fg); }
.steps li.on span { background: var(--accent); color: var(--accent-ink); }
.steps li:not(:last-child)::after { content: ""; width: 10px; border-top: 1px solid var(--line-strong); margin-left: .1rem; }
@media (max-width: 480px) { .steps li { font-size: 0; gap: 0; } .steps li span { font-size: .7rem; } }
.public-foot { margin-top: 2rem; color: var(--muted); font-size: .8rem; text-align: center; }
.day-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 1rem; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.day-strip a { flex: 0 0 60px; scroll-snap-align: start; display: grid; justify-items: center; gap: 1px; padding: .5rem 0 .4rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--fg); text-decoration: none; }
.day-strip a small { font-size: .65rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.day-strip a b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.day-strip a em { font-style: normal; font-size: .65rem; color: var(--muted); }
.day-strip a.none { opacity: .45; }
.day-strip a.today b { color: var(--accent); }
.day-strip a.selected { background: var(--fg); color: var(--bg); border-color: var(--fg); opacity: 1; }
.day-strip a.selected small, .day-strip a.selected em, .day-strip a.selected b { color: inherit; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: .5rem; }
.slot-btn { display: grid; place-items: center; min-height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; }
.slot-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-soft-ink); text-decoration: none; }
.code-input { font-size: 1.6rem !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---- reports ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.25rem; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
.table td { padding: .5rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th, .table td { overflow-wrap: normal; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; align-items: end; height: 140px; }
.bar { display: grid; grid-template-rows: 1fr auto auto; justify-items: center; height: 100%; gap: 2px; }
.bar i { display: block; width: 70%; align-self: end; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 3px; opacity: .85; }
.bar b { font-size: .8rem; font-variant-numeric: tabular-nums; }
.bar small { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.list .row-aside svg { width: 20px; height: 20px; color: var(--muted); }

.demo-banner { background: var(--warn-soft); color: var(--warn); font-size: .85rem; font-weight: 600; text-align: center; padding: .45rem .75rem; border-bottom: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.code-inline { font-variant-numeric: tabular-nums; letter-spacing: .12em; font-size: 1.05em; }
