/* Alice Bookings — design system
   Business = teal, Alice (AI receptionist) = violet. Mobile-first. */

:root {
  /* brand (themeable per client) */
  --brand: #0d9488;
  --brand-strong: #0f766e;
  --brand-tint: #f0fdfa;
  --brand-ink: #134e4a;

  /* Alice */
  --alice: #7c3aed;
  --alice-strong: #6d28d9;
  --alice-tint: #f5f3ff;

  /* status */
  --warn: #b45309;          /* needs your OK */
  --warn-tint: #fffbeb;
  --warn-line: #fde68a;
  --ok: #047857;
  --ok-tint: #ecfdf5;

  /* neutrals */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-2: #eef2f6;
  --surface: #ffffff;
  --bg: #f6f8fa;
  --bg-2: #eef2f6;

  /* shape */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --pad: 16px;
  --shadow-1: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --shadow-2: 0 4px 14px rgba(15,23,42,.08);
  --shadow-3: 0 18px 50px rgba(15,23,42,.18);
  --ease-premium: cubic-bezier(.16, 1, .3, 1);
  --ease-follow: cubic-bezier(.22, 1, .36, 1);

  --tap: 44px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
.icon { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 26px; height: 26px; }
.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;
}

.skip-link {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 12px;
  z-index: 200;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: var(--r);
  color: #fff;
  background: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

/* ------------------------------------------------------------------ shell */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.screen {
  flex: 1;
  padding: 16px 16px calc(84px + env(safe-area-inset-bottom));
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  outline: none;
}
.sidebar { display: none; }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
}
.topbar-row { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-dot {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; overflow: hidden;
}
.brand-dot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; color: var(--muted); }
.spacer { flex: 1; }
.page-title { display: none; font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin-top: 6px; }

.alice-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 9px; border-radius: 999px;
  background: var(--alice-tint); color: var(--alice-strong);
  border: 1px solid #e9d5ff;
  font-weight: 600; font-size: 13px; min-height: 38px;
}
.alice-pill .av { width: 22px; height: 22px; border-radius: 999px; background: var(--alice); color: #fff; display: grid; place-items: center; }
.alice-pill .count { background: var(--alice); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; font-size: 12px; }

/* calendar controls row */
.cal-controls { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.date-nav { display: flex; align-items: center; gap: 4px; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); display: grid; place-items: center;
}
.iconbtn:hover { background: var(--bg-2); }
.btn-today { height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; }
.cal-title { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.cal-title small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.talk-alice-btn { flex: none; white-space: nowrap; }
.calendar-swipe-surface { min-height: 100%; position: relative; touch-action: pan-y; }
.calendar-swipe-surface.is-range-swiping { cursor: grabbing; }
.calendar-swipe-surface.is-swipe-previewing > :not(.calendar-range-stage) { visibility: hidden; }
.calendar-range-stage {
  position: absolute; inset: 0; z-index: 10; overflow: hidden;
  background: var(--bg); pointer-events: none;
}
.calendar-range-track {
  display: flex; align-items: flex-start; width: 100%;
  transform: translate3d(calc(-100% + var(--swipe-x, 0px)), 0, 0);
  will-change: transform;
}
.calendar-swipe-surface.is-swipe-committing .calendar-range-track {
  transition: transform .56s var(--ease-premium);
}
.calendar-range-panel {
  flex: 0 0 100%; min-width: 0; max-width: 100%;
  opacity: .92; transform: scale(.992);
  transition: opacity .18s var(--ease-premium), transform .18s var(--ease-premium);
}
.calendar-range-panel.is-current { opacity: 1; transform: none; }

.cal-alice-queue {
  display: flex; align-items: stretch; gap: 10px;
  margin: 0 0 14px;
  padding: 10px;
  border: 1px solid #eadcff;
  border-radius: var(--r);
  background: linear-gradient(135deg, rgba(124, 58, 237, .09), rgba(255, 255, 255, .94) 48%, rgba(13, 148, 136, .08));
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.cal-alice-summary {
  flex: 0 0 214px;
  display: flex; align-items: center; gap: 9px;
  min-width: 0;
  color: var(--alice-strong);
}
.cal-alice-summary .av {
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--alice); color: #fff;
  display: grid; place-items: center; flex: none;
}
.cal-alice-summary strong { display: block; font-size: 14px; color: var(--ink); line-height: 1.15; }
.cal-alice-summary span { display: block; font-size: 12px; color: var(--alice-strong); margin-top: 2px; }
.cal-alice-summary em {
  margin-left: auto;
  min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: var(--alice); color: #fff;
  font-style: normal; font-size: 12px; font-weight: 800;
}
.cal-alice-items {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: stretch; gap: 8px;
}
.cal-alice-queue.is-expanded {
  align-items: flex-start;
}
.cal-alice-queue.is-expanded .cal-alice-items {
  flex-wrap: wrap;
}
.cal-alice-item {
  flex: 1 1 260px; min-width: 220px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
}
.cal-alice-item.update { flex-basis: 300px; min-width: 280px; }
.cal-alice-item.followup {
  border-color: color-mix(in srgb, var(--warn) 18%, var(--line));
  background: color-mix(in srgb, var(--warn-tint) 72%, #fff);
}
.cal-alice-item.newlead {
  border-color: color-mix(in srgb, var(--alice) 20%, var(--line));
  background: color-mix(in srgb, var(--alice-tint) 78%, #fff);
}
.cal-alice-item .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: 76px;
  padding-inline: 10px;
}
.cal-alice-item.update .btn {
  min-width: 58px;
  padding-inline: 9px;
}
.cal-alice-main {
  flex: 1 1 auto; min-width: 0;
  border: 0; background: transparent; color: inherit;
  padding: 0; display: flex; align-items: center; gap: 9px;
  text-align: left;
}
.cal-alice-copy { min-width: 0; display: block; }
.cal-alice-copy strong { display: block; font-size: 13px; line-height: 1.1; color: var(--ink); }
.cal-alice-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-alice-more,
.cal-alice-toggle {
  flex: 0 0 auto;
  display: grid; place-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(124, 58, 237, .1);
  color: var(--alice-strong);
  font-size: 12px; font-weight: 800;
  cursor: pointer;
}
.cal-alice-toggle {
  min-height: 30px;
  margin-left: 4px;
  background: rgba(255, 255, 255, .78);
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, .14);
}
.cal-alice-queue.is-highlighted { animation: aliceQueueFocus .78s var(--ease-premium) both; }
@keyframes aliceQueueFocus {
  0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .22), var(--shadow-1); transform: translateY(0); }
  45% { box-shadow: 0 0 0 8px rgba(124, 58, 237, .08), var(--shadow-2); transform: translateY(-1px); }
  100% { box-shadow: var(--shadow-1); transform: translateY(0); }
}

.segmented { display: inline-flex; background: var(--bg-2); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; border-radius: 8px; padding: 7px 11px; font-size: 13px; font-weight: 600; color: var(--muted); min-height: 34px; }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-1); }

/* ------------------------------------------------------------------ bottom nav */
.bottomnav {
  position: fixed; left: 0; right: auto; top: calc(100dvh - 60px - env(safe-area-inset-bottom)); bottom: auto; z-index: 120;
  width: 100dvw;
  max-width: 100dvw;
  display: flex; background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  min-height: calc(60px + env(safe-area-inset-bottom));
  isolation: isolate;
}
.bottomnav button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 8px; font-size: 11px; font-weight: 600; min-height: var(--tap);
  position: relative;
}
.bottomnav button[aria-current="page"] { color: var(--brand); }
.bottomnav .nav-badge {
  position: absolute; top: 6px; right: 50%; transform: translateX(16px);
  background: var(--alice); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; display: grid; place-items: center;
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--tap); padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 650; font-size: 15px; background: var(--bg-2); color: var(--ink);
  text-decoration: none; transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-alice { background: var(--alice); color: #fff; }
.btn-alice:hover { background: var(--alice-strong); }
.btn-ghost { background: #fff; border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger { background: #fff; border-color: #fecaca; color: #b91c1c; }
.btn-block { width: 100%; }
.btn-sm { height: 38px; padding: 0 13px; font-size: 14px; border-radius: 10px; }
.btn.disabled { opacity: .58; pointer-events: none; }

/* ------------------------------------------------------------------ chips / badges */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg-2); color: var(--ink-2); border: 1px solid transparent; }
.chip-alice { background: var(--alice-tint); color: var(--alice-strong); }
.chip-warn { background: var(--warn-tint); color: var(--warn); border-color: var(--warn-line); }
.chip-ok { background: var(--ok-tint); color: var(--ok); }
.chip-brand { background: var(--brand-tint); color: var(--brand-ink); }
.chip.selectable { cursor: pointer; }
.chip.selectable[aria-pressed="true"] { background: var(--brand); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--muted); flex: none; }
.dot-alice { background: var(--alice); } .dot-brand { background: var(--brand); } .dot-warn { background: var(--warn); }

/* ------------------------------------------------------------------ sections / cards */
.section-h { display: flex; align-items: center; gap: 8px; margin: 22px 2px 10px; }
.section-h:first-child { margin-top: 6px; }
.section-h h2 { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.section-h .count-tag { font-size: 12px; color: var(--faint); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.stack > * + * { margin-top: 10px; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .icon { margin: 0 auto 10px; width: 30px; height: 30px; color: var(--faint); }
.empty p { font-size: 14px; }

/* ------------------------------------------------------------------ agenda (mobile day list) */
.agenda { display: flex; flex-direction: column; gap: 8px; }
.slot { display: flex; gap: 12px; }
.slot-time { width: 58px; flex: none; text-align: right; padding-top: 14px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.slot-body { flex: 1; min-width: 0; }

.appt {
  border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: var(--r); background: #fff; padding: 12px 14px; box-shadow: var(--shadow-1);
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 60px;
}
.appt:hover { box-shadow: var(--shadow-2); }
.appt .who { font-weight: 650; }
.appt .meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.appt .meta .icon-sm { width: 14px; height: 14px; color: var(--faint); }
.appt-lead { border-left-color: var(--alice); background: linear-gradient(0deg, #fff, #fff), var(--alice-tint); }
.appt-lead .src { color: var(--alice-strong); font-weight: 700; }
.booking-card { cursor: default; }
.booking-main {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent; padding: 0; margin: 0;
  display: flex; align-items: center; gap: 12px; text-align: left; color: inherit;
}
.booking-main:focus-visible, .staff-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 12px; }
.booking-right {
  margin-left: auto; flex: 0 0 auto; min-width: 260px;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
}

.staff-tray {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 14px 70px; padding: 10px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1);
}
.staff-tray-label { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.staff-tray-hint { margin-left: auto; font-size: 12px; color: var(--faint); font-weight: 600; }
.staff-chip {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  min-height: 32px; max-width: 138px; padding: 3px 9px 3px 3px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px;
  box-shadow: var(--shadow-1); cursor: grab; user-select: none;
  transition: background .14s var(--ease-premium), border-color .14s var(--ease-premium), box-shadow .14s var(--ease-premium), opacity .12s var(--ease-premium), transform .12s var(--ease-premium);
  touch-action: pan-y;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.staff-chip.assigned { border-color: #dbeafe; background: #f8fbff; }
body.is-pointer-dragging,
body.is-pointer-dragging * { cursor: grabbing !important; user-select: none; }
[data-drag-type] {
  touch-action: pan-y;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.staff-chip.dragging, [data-drag-type].dragging {
  opacity: .44; transform: scale(.985); transform-origin: center;
  transition: opacity .12s var(--ease-premium), transform .12s var(--ease-premium), filter .12s var(--ease-premium);
  filter: saturate(.88);
}
.drag-ghost {
  border-radius: 10px !important; opacity: .92 !important; overflow: hidden !important;
  box-shadow: 0 18px 45px rgba(15,23,42,.22) !important;
}
.pointer-drag-ghost {
  opacity: .97 !important;
  border: 1px solid rgba(255,255,255,.72) !important;
  box-shadow: 0 22px 54px rgba(15,23,42,.24), 0 2px 10px rgba(15,23,42,.12) !important;
  transition: opacity .16s var(--ease-premium), box-shadow .16s var(--ease-premium), filter .16s var(--ease-premium) !important;
  will-change: transform, opacity;
  contain: layout style paint;
  backface-visibility: hidden;
  transform-origin: 0 0;
}
.pointer-drag-ghost.snap-ready {
  opacity: 1 !important;
  filter: saturate(1.06);
  box-shadow: 0 26px 60px rgba(15,23,42,.24), 0 0 0 5px rgba(13,148,136,.13) !important;
}
.pointer-drag-ghost.staff-drag-ghost {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.pointer-drag-ghost.snap-blocked {
  opacity: .88 !important;
  filter: saturate(.9);
  box-shadow: 0 18px 44px rgba(15,23,42,.2), 0 0 0 5px rgba(185,28,28,.12) !important;
}
.staff-chip:active { cursor: grabbing; }
.staff-face {
  width: 26px; height: 26px; border-radius: 999px; flex: none;
  display: grid; place-items: center; color: #fff; background: var(--staff, var(--brand));
  font-size: 11px; font-weight: 800;
}
.staff-face img,
.settings-staff-face img {
  width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}
.staff-name { min-width: 0; max-width: 78px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-dropzone {
  min-width: 142px; min-height: 38px; padding: 3px;
  display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap;
  border: 1.5px dashed transparent; border-radius: 999px;
  transition: background .14s var(--ease-premium), border-color .14s var(--ease-premium), box-shadow .14s var(--ease-premium);
}
.staff-dropzone,
[data-dropzone="staff"] { position: relative; }
.staff-dropzone.drag-over { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px rgba(13,148,136,.12); }
[data-dropzone="staff"].drag-over {
  outline: 2px solid rgba(13,148,136,.28);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(13,148,136,.08), var(--shadow-1);
}
[data-dropzone="staff"].drag-over::after {
  content: attr(data-staff-drop-label);
  position: absolute;
  left: 8px; right: 8px; top: 8px; z-index: 6;
  display: block; padding: 4px 8px; border-radius: 999px;
  background: rgba(15,23,42,.88); color: #fff;
  font-size: 11px; font-weight: 850; line-height: 1.1;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.staff-empty { color: var(--faint); font-size: 12px; font-weight: 700; padding: 0 6px; }
.crew-count {
  height: 28px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center;
  background: var(--ok-tint); color: var(--ok); border: 1px solid #bbf7d0;
  font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.crew-count.short { background: var(--warn-tint); color: var(--warn); border-color: var(--warn-line); }
.now-slot { align-items: center; }
.now-time { color: #dc2626; font-weight: 800; padding-top: 0; }
.now-line {
  position: relative; height: 18px; display: flex; align-items: center; color: #dc2626; font-size: 12px; font-weight: 800;
}
.now-line::before {
  content: ""; height: 2px; flex: 1; background: #dc2626; border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(220,38,38,.08);
}
.now-line span {
  order: -1; margin-right: 8px; padding: 2px 7px; border-radius: 999px; background: #dc2626; color: #fff;
}

.free {
  width: 100%; border: 1.5px dashed var(--line); color: var(--muted);
  background: #fff; border-radius: var(--r); padding: 11px 14px; min-height: 52px;
  display: flex; align-items: center; gap: 10px; font-size: 14px; text-align: left;
  position: relative; overflow: hidden;
}
.free:hover { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-tint); }
.free.drag-over, .wg-cell.drag-over {
  border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 2px rgba(13,148,136,.14);
}
.wg-cell.drag-invalid,
.sd-cell.drag-invalid {
  border-color: #fecaca;
  background: #fef2f2;
  box-shadow: inset 0 0 0 2px rgba(185,28,28,.16);
}
.wg-cell.drag-reassign,
.sd-cell.drag-reassign {
  border-color: #bfdbfe;
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px rgba(37,99,235,.14);
}
.wg-cell,
.sd-cell { position: relative; }
[data-dropzone="time"].drag-over,
[data-dropzone="time"].drop-landed {
  z-index: 12;
}
[data-dropzone="time"].drag-over::after,
[data-dropzone="time"].drop-landed::after {
  content: attr(data-snap-label);
  position: absolute;
  left: 8px; right: 8px; top: 50%;
  min-height: 24px; padding: 3px 8px;
  display: flex; align-items: center; justify-content: center;
  transform: translateY(-50%) scale(.98);
  border-radius: 999px;
  background: rgba(15,23,42,.88);
  color: #fff;
  box-shadow: 0 8px 22px rgba(15,23,42,.18);
  font-size: 11px; font-weight: 850; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
  animation: snapLabelIn .18s var(--ease-premium) forwards;
}
[data-dropzone="time"].drag-invalid::after {
  background: rgba(185,28,28,.94);
  box-shadow: 0 8px 22px rgba(185,28,28,.18);
}
[data-dropzone="time"].drag-reassign::after {
  background: rgba(29,78,216,.92);
  box-shadow: 0 8px 22px rgba(29,78,216,.16);
}
[data-dropzone="time"].drop-landed {
  background: #f8fafc;
  box-shadow: inset 0 0 0 2px rgba(124,58,237,.16), 0 0 0 4px rgba(124,58,237,.06);
  animation: snapLanding .28s var(--ease-premium);
}
[data-dropzone="time"].drop-landed::after {
  background: rgba(88,28,135,.88);
}
.free .plus { margin-left: auto; opacity: .65; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }

.blocked {
  width: 100%; border-radius: var(--r); padding: 10px 14px; min-height: 46px;
  display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted);
  background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 9px, #eaeff5 9px, #eaeff5 18px);
  border: 1px solid var(--line);
}

/* ------------------------------------------------------------------ staff day grid */
.day-subnav {
  display: flex; justify-content: flex-end; margin: 0 0 12px;
}
.staff-focusbar {
  display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 0 14px; padding: 2px 0 4px;
}
.staff-focusbar::-webkit-scrollbar { display: none; }
.staff-focus-chip {
  flex: none; min-height: 36px; border: 1px solid #cbd5e1; background: #fff; color: #0f172a;
  border-radius: 999px; padding: 3px 11px 3px 4px; display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 800; box-shadow: var(--shadow-1);
}
.staff-focus-chip:first-child {
  padding: 0 14px; border-color: #0f172a; background: #0f172a; color: #fff;
  box-shadow: 0 8px 22px rgba(15,23,42,.16);
}
.staff-focus-chip:first-child[aria-pressed="false"] {
  background: #fff; color: #0f172a; border-color: #0f172a;
}
.staff-focus-chip:first-child[aria-pressed="true"] {
  background: #0f172a; color: #fff; border-color: #0f172a;
}
.staff-focus-chip[aria-pressed="true"] { border-color: #0f172a; background: #0f172a; color: #fff; }
.staffday-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-1); }
.staffday {
  position: relative; display: grid;
  grid-template-columns: 58px repeat(var(--staffcols, 1), minmax(170px, 1fr));
  min-width: calc(58px + (var(--staffcols, 1) * 170px));
}
.sd-corner { position: sticky; top: 0; left: 0; z-index: 5; background: #fff; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sd-head {
  position: sticky; top: 0; z-index: 4; min-height: 88px; border: 0; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96); display: grid; place-items: center; align-content: center; gap: 4px;
  text-align: center; padding: 10px 8px;
}
.sd-head:hover { background: var(--brand-tint); }
.sd-head .staff-face { width: 42px; height: 42px; font-size: 13px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--staff, var(--brand)) 20%, transparent); }
.sd-head strong { font-size: 13px; line-height: 1.1; }
.sd-head span:last-child { font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-head.alice .staff-face { background: var(--alice); }
.sd-timecol { position: sticky; left: 0; z-index: 3; background: #fff; border-right: 1px solid var(--line); }
.sd-timecell { height: 36px; border-bottom: 1px solid var(--line-2); text-align: right; padding: 2px 7px 0 0; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.sd-timecell.half { color: #b6c2d1; font-size: 10px; }
.sd-col { position: relative; min-height: var(--dayheight); border-right: 1px solid var(--line-2); }
.sd-col:last-child { border-right: 0; }
.sd-cell { height: 36px; border-bottom: 1px solid var(--line-2); }
.sd-cell.half { border-bottom-color: #f5f7fa; }
.sd-cell:hover { background: var(--brand-tint); }
.sd-cell.drag-over { background: var(--brand-tint); box-shadow: inset 0 0 0 2px rgba(13,148,136,.14); }
.sd-cell.muted { background: #fafafa; }
.drag-slot-preview {
  position: absolute; left: 6px; right: 6px; top: 0; z-index: 17;
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 6px 8px; border-radius: 9px;
  border: 1.5px solid rgba(13,148,136,.44);
  background: linear-gradient(180deg, rgba(240,253,250,.96), rgba(204,251,241,.68));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 12px 28px rgba(13,148,136,.14);
  color: var(--brand-ink); pointer-events: none;
  transform: translate3d(0, var(--preview-y, 0px), 0);
  will-change: transform, height;
  animation: placementPreviewIn .14s var(--ease-premium);
}
.wg-col .drag-slot-preview { left: 4px; right: 4px; }
.drag-slot-preview.lead {
  border-color: rgba(124,58,237,.44);
  background: linear-gradient(180deg, rgba(245,243,255,.98), rgba(221,214,254,.74));
  color: var(--alice-strong);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.74), 0 12px 28px rgba(124,58,237,.13);
}
.drag-slot-preview.blocked {
  border-color: rgba(185,28,28,.44);
  background: linear-gradient(180deg, rgba(254,242,242,.98), rgba(254,226,226,.76));
  color: #991b1b;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.74), 0 12px 28px rgba(185,28,28,.12);
}
.drag-slot-preview.reassign {
  border-color: rgba(37,99,235,.42);
  background: linear-gradient(180deg, rgba(239,246,255,.98), rgba(219,234,254,.76));
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.74), 0 12px 28px rgba(37,99,235,.12);
}
.drag-slot-preview span {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.78);
  font-size: 11px; font-weight: 850; line-height: 1.25;
  box-shadow: 0 1px 2px rgba(15,23,42,.08);
}
.sd-event {
  position: absolute; left: 6px; right: 6px; border: 0; border-radius: 8px; background: var(--brand); color: #fff;
  display: block; text-align: left; padding: 8px 9px 17px; box-shadow: var(--shadow-1); overflow: hidden;
  transition: height .08s ease-out, box-shadow .12s ease, transform .12s ease;
}
.sd-event:hover { box-shadow: var(--shadow-2); }
.sd-event .sd-time { display: block; font-size: 12px; font-weight: 750; margin-bottom: 4px; }
.sd-event strong { display: block; font-size: 14px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-event .sd-service { display: block; font-size: 12px; line-height: 1.25; opacity: .94; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-event .resize-grip { display: block; opacity: .85; }
.sd-event.lead { background: var(--alice-tint); color: var(--alice-strong); border: 1.5px dashed var(--alice); }
.sd-block {
  position: absolute; left: 6px; right: 6px; border-radius: 8px; padding: 6px 8px; font-size: 12px; color: var(--muted);
  background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 9px, #eaeff5 9px, #eaeff5 18px);
  border: 1px solid var(--line); overflow: hidden;
}
.staffday-now {
  position: absolute; left: 58px; right: 0; z-index: 8; height: 2px; background: #dc2626; border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(220,38,38,.08);
}
.staffday-now span {
  position: sticky; left: 62px; display: inline-block; transform: translateY(-10px);
  padding: 1px 6px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 800;
}

/* ------------------------------------------------------------------ week grid (desktop) */
.weekgrid-wrap { overflow-x: auto; position: relative; border-radius: var(--r-lg); }
.weekgrid-wrap.edge-left,
.weekgrid-wrap.edge-right { box-shadow: none; }
.weekgrid {
  display: grid; grid-template-columns: 56px repeat(var(--cols, 7), minmax(120px, 1fr));
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #fff;
  min-width: 680px;
  transition: box-shadow .42s cubic-bezier(.16, 1, .3, 1), filter .42s cubic-bezier(.16, 1, .3, 1);
}
.weekgrid-wrap.edge-left .weekgrid {
  box-shadow: inset 24px 0 34px -26px rgba(124,58,237,.36);
}
.weekgrid-wrap.edge-right .weekgrid {
  box-shadow: inset -24px 0 34px -26px rgba(124,58,237,.36);
}
.weekgrid.is-three { grid-template-columns: 56px repeat(var(--cols, 3), minmax(230px, 1fr)); min-width: 760px; }
.wg-head {
  position: sticky; top: 0; background: #fff; z-index: 2; border: 0; border-bottom: 1px solid var(--line);
  padding: 10px 8px; text-align: center; display: grid; place-items: center; gap: 2px;
}
.wg-head:hover { background: var(--bg); }
.wg-head:focus-visible { outline: 3px solid rgba(249,115,22,.28); outline-offset: -3px; }
.wg-head .dow { font-size: 12px; color: var(--muted); font-weight: 600; }
.wg-head .dnum { font-weight: 700; font-size: 16px; margin-top: 2px; }
.wg-head.today .dow { color: #ea580c; }
.wg-head.today .dnum {
  color: #fff; background: #f97316; box-shadow: 0 0 0 4px rgba(249,115,22,.16);
  width: 32px; height: 32px; border-radius: 999px; display: inline-grid; place-items: center;
}
.wg-corner { border-bottom: 1px solid var(--line); }
.wg-timecol { border-right: 1px solid var(--line); }
.wg-time { height: 36px; font-size: 11px; color: var(--faint); text-align: right; padding: 2px 6px 0 0; font-variant-numeric: tabular-nums; }
.wg-time.half { color: #b6c2d1; font-size: 10px; }
.wg-col { position: relative; border-right: 1px solid var(--line-2); }
.wg-col:last-child { border-right: 0; }
.wg-cell { height: 36px; border-bottom: 1px solid var(--line-2); }
.wg-cell.half { border-bottom-color: #f5f7fa; }
.wg-cell:hover { background: var(--brand-tint); cursor: pointer; }
.wg-col.closed { background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 9px, #f1f5f9 9px, #f1f5f9 18px); }
.wg-event {
  position: absolute; left: 4px; right: 4px; border-radius: 9px; padding: 5px 8px; overflow: hidden;
  min-height: 46px;
  font-size: 12px; line-height: 1.25; box-shadow: var(--shadow-1); border: 1px solid transparent; text-align: left;
}
.wg-event .t { font-weight: 700; }
.wg-service { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.wg-event.booking {
  background: var(--brand); color: #fff; padding-right: 72px; padding-bottom: 14px; cursor: grab;
  transition: height .08s ease-out, box-shadow .12s ease, transform .12s ease;
}
.wg-event.booking.density-compact {
  padding: 4px 5px 13px; font-size: 11px; line-height: 1.12;
}
.wg-event.booking.density-compact .booking-status {
  width: 9px; height: 9px; padding: 0; top: 5px; right: 5px;
  color: transparent; background: rgba(255,255,255,.82);
}
.wg-event.booking.density-compact .wg-service {
  display: block; max-height: 13px; font-size: 10px; opacity: .95;
}
.wg-event.booking.density-compact .week-staff { right: 5px; bottom: 4px; gap: 2px; }
.wg-event.booking.density-compact .week-staff-face { width: 14px; height: 14px; font-size: 6px; border-width: 1px; }
.wg-event.booking.density-micro {
  padding: 0; min-height: 30px; border-radius: 7px; box-shadow: none;
  color: transparent;
}
.wg-event.booking.density-micro .t,
.wg-event.booking.density-micro .wg-name,
.wg-event.booking.density-micro .wg-service,
.wg-event.booking.density-micro .booking-status,
.wg-event.booking.density-micro .week-staff {
  display: none;
}
.wg-event.booking.density-micro .resize-grip { left: 3px; right: 3px; height: 100%; bottom: 0; opacity: 0; }
.wg-event.booking.state-draft, .sd-event.state-draft {
  background: linear-gradient(135deg, var(--alice), var(--brand));
  border-color: rgba(255,255,255,.42);
}
.wg-event.booking.state-draft {
  outline: 1.5px dashed color-mix(in srgb, var(--alice) 55%, #fff);
  outline-offset: 2px;
}
.wg-event.booking.state-booked, .sd-event.state-booked { background: var(--brand); }
.wg-event.booking.state-quoted, .sd-event.state-quoted { background: #d97706; }
.wg-event.booking.state-paid, .sd-event.state-paid { background: #2563eb; }
.wg-event.booking.state-review-ready, .sd-event.state-review-ready { background: #7c3aed; }
.wg-event.booking.state-reviewed, .sd-event.state-reviewed { background: #047857; }
.wg-event.booking.state-workapp, .sd-event.state-workapp { background: #334155; }
.wg-event.booking.state-cancelled, .sd-event.state-cancelled {
  background: #94a3b8; color: #f8fafc; text-decoration: line-through; opacity: .82;
}
.wg-event.booking.group { padding-right: 8px; padding-bottom: 26px; }
.wg-event.booking.drag-over {
  outline: 2px solid rgba(13,148,136,.45); outline-offset: 2px;
  box-shadow: var(--shadow-2), inset 0 0 0 999px rgba(240,253,250,.14);
}
.wg-event.lead { background: var(--alice-tint); color: var(--alice-strong); border: 1.5px dashed var(--alice); }
.wg-event.block { background: rgba(148,163,184,.18); color: var(--muted); }
.booking-status {
  display: inline-flex; align-items: center; width: fit-content; margin-top: 3px;
  border-radius: 999px; padding: 1px 5px; background: rgba(255,255,255,.16);
  color: inherit; font-size: 9px; font-style: normal; font-weight: 800; text-decoration: none;
}
.wg-event .booking-status {
  position: absolute; top: 5px; right: 6px; margin: 0; max-width: 58px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.resize-grip {
  position: absolute; left: 10px; right: 10px; bottom: 0; height: 14px;
  cursor: ns-resize; border-radius: 999px; opacity: .78; touch-action: none;
}
.resize-grip::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 34px; height: 4px;
  transform: translateX(-50%); border-radius: 999px; background: rgba(255,255,255,.72);
}
.resize-grip:hover::after, .resize-grip.dragging::after { background: #fff; width: 44px; }
.is-resizing-booking, .is-resizing-booking * { cursor: ns-resize !important; user-select: none; }
.wg-event.booking.resizing, .sd-event.resizing {
  z-index: 20; box-shadow: var(--shadow-3); transform: translateZ(0);
  outline: 2px solid rgba(255,255,255,.68); outline-offset: 1px;
}
.wg-event.booking.resizing::after, .sd-event.resizing::after {
  content: attr(data-resize-range) " · " attr(data-resize-mins);
  position: absolute; left: 8px; right: 8px; bottom: 15px; z-index: 2;
  display: block; padding: 4px 7px; border-radius: 8px;
  background: rgba(15,23,42,.76); color: #fff; font-size: 11px; font-weight: 850;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wg-event.booking.resize-invalid::after, .sd-event.resize-invalid::after {
  background: rgba(185,28,28,.9);
}
@keyframes snapLabelIn {
  from { opacity: 0; transform: translateY(-50%) scale(.94); }
  to { opacity: 1; transform: translateY(-50%) scale(1); }
}
@keyframes snapLanding {
  0% { filter: saturate(1); }
  35% { filter: saturate(1.08); }
  100% { filter: saturate(1); }
}
@keyframes placementPreviewIn {
  from { opacity: 0; transform: translate3d(0, 2px, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
.week-legend {
  display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: -4px 0 12px 70px; padding-bottom: 2px;
}
.week-legend::-webkit-scrollbar { display: none; }
.legend-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 26px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 2px 9px;
  font-size: 11px; font-weight: 800; color: var(--ink-2);
}
.legend-pill i { width: 9px; height: 9px; border-radius: 999px; display: inline-block; background: var(--brand); }
.legend-pill.state-quoted i { background: #d97706; }
.legend-pill.state-paid i { background: #2563eb; }
.legend-pill.state-review-ready i { background: #7c3aed; }
.legend-pill.state-reviewed i { background: #047857; }
.legend-pill.state-workapp i { background: #334155; }
.legend-pill.state-cancelled i { background: #94a3b8; }
.week-now-line {
  position: absolute; left: 2px; right: 2px; z-index: 4; height: 2px; background: #dc2626; border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(220,38,38,.08);
}
.week-now-line span {
  position: absolute; right: 4px; top: -10px; padding: 1px 6px; border-radius: 999px;
  background: #dc2626; color: #fff; font-size: 10px; font-weight: 800; white-space: nowrap;
}
.week-staff {
  position: absolute; right: 6px; bottom: 6px; max-width: calc(100% - 12px);
  display: flex; gap: 3px; flex-wrap: wrap; align-items: center; justify-content: flex-end;
}
.wg-event.group .week-staff { left: 8px; right: 8px; justify-content: flex-start; }
.week-staff-face {
  width: 18px; height: 18px; border-radius: 999px; display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--staff, #fff) 70%, transparent); color: #fff;
  border: 1.5px solid color-mix(in srgb, var(--staff, #fff) 70%, #fff);
  backdrop-filter: blur(2px);
  font-size: 8px; font-weight: 800; cursor: grab; box-shadow: 0 1px 2px rgba(15,23,42,.12);
}
.week-staff-face:active { cursor: grabbing; }
.week-staff-face.dragging { opacity: .45; }

/* ------------------------------------------------------------------ month + year */
.month { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.month-dow { display: grid; grid-template-columns: repeat(7,1fr); border-bottom: 1px solid var(--line); }
.month-dow span { padding: 8px 0; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.month-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.mcell { min-height: clamp(96px, calc((100dvh - 280px) / 6), 138px); border: 0; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 10px; text-align: left; background: #fff; }
.mcell:nth-child(7n) { border-right: 0; }
.mcell.out { background: var(--bg); color: var(--faint); }
.mcell.today .mnum { background: var(--brand); color: #fff; }
.mnum { font-size: 13px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; }
.mdots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 6px; }
.mcount { margin-top: 4px; font-size: 11px; color: var(--muted); }

.year { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 14px; }
.ymini { background:#fff; border:1px solid var(--line); border-radius: var(--r); padding: 10px; text-align: left; }
.ymini h4 { font-size: 13px; margin-bottom: 6px; }
.ymini .yg { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.ymini .yd { font-size: 9px; text-align: center; color: var(--faint); aspect-ratio: 1; display: grid; place-items: center; border-radius: 4px; }
.ymini .yd.has { background: var(--brand-tint); color: var(--brand-ink); font-weight: 700; }
.ymini .yd.today { background: var(--brand); color: #fff; }

/* ------------------------------------------------------------------ list items (clients / activity) */
.searchbar { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; height: 46px; box-shadow: var(--shadow-1); }
.searchbar input { border: 0; outline: none; flex: 1; background: transparent; height: 100%; font-size: 15px; }
.searchbar .icon { color: var(--faint); }

.row {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1); min-height: 64px;
}
.row:hover { box-shadow: var(--shadow-2); }
.avatar { width: 42px; height: 42px; border-radius: 999px; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--brand); }
.avatar.alice { background: var(--alice); }
.avatar.followup { background: var(--warn); }
.avatar.needs-time { background: var(--alice-strong); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .subtitle { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .trail { color: var(--faint); display: flex; align-items: center; gap: 8px; flex: none; font-size: 13px; }

.feed-card { padding: 14px; }
.feed-card .head { display: flex; align-items: center; gap: 10px; }
.feed-card .summary { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.feed-card .draftbox { margin-top: 10px; background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--ink-2); }
.feed-card .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.feed-card .actions .btn { flex: 1; min-width: 120px; }

/* ------------------------------------------------------------------ profile */
.profile-head { display: flex; align-items: center; gap: 14px; padding: 18px; }
.profile-head .avatar { width: 56px; height: 56px; font-size: 20px; }
.profile-head h1 { font-size: 20px; }
.contact-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 18px; }
.profile-form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.profile-field {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px;
  min-width: 0; box-shadow: var(--shadow-1);
}
.profile-field .icon-sm { color: var(--faint); }
.profile-field span { grid-column: 2; color: var(--muted); font-size: 12px; font-weight: 700; }
.profile-field input, .profile-field textarea {
  grid-column: 2; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent;
  font-weight: 650; padding: 1px 0 0;
}
.profile-field input:focus, .profile-field textarea:focus { box-shadow: inset 0 -2px 0 var(--brand); }
.profile-field textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
.profile-field-full { grid-column: 1 / -1; align-items: start; }
.kv { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.kv .item { background: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.kv .item .icon { color: var(--faint); }
.kv .item .lbl { font-size: 12px; color: var(--muted); }
.kv .item .val { font-weight: 600; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content:""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 8px 0; }
.tl-item::before { content:""; position: absolute; left: -19px; top: 14px; width: 10px; height: 10px; border-radius: 999px; background: var(--brand); border: 2px solid #fff; }
.tl-item.req::before { background: var(--alice); }
.tl-item .when { font-size: 12px; color: var(--muted); }
.tl-item .what { font-weight: 600; font-size: 14px; }
.booking-link {
  display: block; width: 100%; border: 0; background: transparent; color: inherit;
  text-align: left; border-radius: 10px; padding: 9px 8px;
}
.booking-link:hover { background: var(--brand-tint); }
.booking-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent); outline-offset: 2px; }

/* ------------------------------------------------------------------ settings */
.set-group { margin-top: 18px; }
.set-group > .gh { display:flex; align-items:center; gap:10px; padding: 0 4px 8px; }
.set-group > .gh .icon { color: var(--brand); }
.set-group > .gh h3 { font-size: 15px; }
.set-list { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line-2); min-height: 56px; }
.set-row:last-child { border-bottom: 0; }
.set-row .grow { flex: 1; min-width: 0; }
.set-row .lbl { font-weight: 600; }
.set-row .hint { font-size: 13px; color: var(--muted); margin-top: 2px; }
.set-row .val { color: var(--muted); font-weight: 600; }
.set-row input[type="text"], .set-row input[type="url"], .set-row input[type="time"], .set-row input[type="number"], .set-row select { border:1px solid var(--line); border-radius: 9px; padding: 8px 10px; min-height: 38px; max-width: 160px; }
.set-row .lbl { display: flex; align-items: center; gap: 8px; }
.set-row textarea.alice-instruction-field {
  flex: 0 1 520px;
  width: min(520px, 100%);
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  line-height: 1.45;
  background: #fff;
  resize: vertical;
}
.set-row textarea.alice-instruction-field:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}
.connect-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.calendar-import-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  width: min(720px, 100%);
}
.calendar-import-controls input[type="url"] {
  width: 100%;
  max-width: none;
}
.connect-state {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--alice-tint);
  color: var(--alice-strong);
  border: 1px solid #e9d5ff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.connect-state[data-connected="true"] {
  background: var(--ok-tint);
  color: var(--ok);
  border-color: #bbf7d0;
}
.connect-state[data-status="setup_requested"] {
  background: var(--warn-tint);
  color: var(--warn);
  border-color: var(--warn-line);
}
.brand-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.brand-colour-picker { position: relative; width: 44px; height: 44px; flex: none; cursor: pointer; }
.brand-colour-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.brand-colour-picker span {
  display: block; width: 44px; height: 44px; border-radius: 999px;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow-1);
}
.brand-logo-upload { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.brand-logo-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.brand-logo-preview {
  width: 44px; height: 44px; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--brand);
}
.brand-logo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.settings-staff-face {
  width: 28px; height: 28px; border-radius: 999px; display: inline-grid; place-items: center;
  color: #fff; background: var(--staff, var(--brand)); font-size: 11px; font-weight: 800;
}
.photo-upload { position: relative; overflow: hidden; }
.photo-upload input {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.inline-fields { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.inline-fields input[type="text"] { width: 120px; }

.staff-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.staff-check {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 4px 10px 4px 5px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 700; color: var(--ink-2);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.staff-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.staff-check::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}
.staff-check:has(input:checked)::before {
  content: "\2713";
  border-color: var(--brand);
  background: var(--brand);
}
.staff-check:has(input:checked) { border-color: #99f6e4; background: var(--brand-tint); color: var(--brand-ink); }
.field-hint { margin-top: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.field-hint.warn { color: var(--warn); }

.toggle { width: 46px; height: 28px; border-radius: 999px; background: var(--bg-2); border: 0; position: relative; flex: none; transition: background .15s; }
.toggle::after { content:""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-1); transition: left .15s; }
.toggle[aria-pressed="true"] { background: var(--brand); }
.toggle[aria-pressed="true"]::after { left: 21px; }

.days { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.day-pill { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--muted); }
.day-pill[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }

.advanced-toggle { margin: 16px 4px 0; }
details.advanced { margin-top: 8px; }
details.advanced > summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; padding: 10px 4px; display: flex; align-items: center; gap: 8px; }
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced[open] > summary .chev { transform: rotate(90deg); }

/* ------------------------------------------------------------------ modal / sheet */
.scrim { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 130; opacity: 0; animation: fade .18s forwards; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 131;
  background: #fff; border-radius: 22px 22px 0 0; box-shadow: var(--shadow-3);
  max-height: 92dvh; display: flex; flex-direction: column;
  transform: translateY(100%); animation: slideup .26s cubic-bezier(.22,1,.36,1) forwards;
  padding-bottom: env(safe-area-inset-bottom);
  will-change: transform;
}
.sheet.sheet-dragging { animation: none; transition: none; }
.sheet-grab {
  width: 56px; height: 5px; border-radius: 999px; background: #cbd5e1;
  margin: 10px auto 4px; cursor: grab; touch-action: none;
}
.sheet-grab:active { cursor: grabbing; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 8px 16px 12px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 18px; flex: 1; }
.sheet-head[data-sheet-drag] { touch-action: none; }
.sheet-close {
  width: 42px; height: 42px; border-radius: 12px;
  background: #f8fafc; color: var(--ink); border-color: #cbd5e1;
}
.sheet-close:hover { background: #eef2f6; }
.sheet-close .icon { stroke-width: 2.4; }
.sheet-body { padding: 16px; overflow-y: auto; }
.sheet-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }

.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 14px; align-items: flex-start; }
.notice .icon { flex: none; margin-top: 1px; }
.notice-alice { background: var(--alice-tint); color: var(--alice-strong); }
.notice-warn { background: var(--warn-tint); color: var(--warn); border: 1px solid var(--warn-line); }

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; min-height: var(--tap); background: #fff;
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.address-control { display: grid; gap: 8px; }
.address-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 650; }
.address-tools span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.address-tools .maps-link { flex: none; min-width: 118px; }
.address-confirm { margin: 12px 0; font-weight: 700; color: var(--ink); }
.alice-voice-panel {
  display: grid; justify-items: center; gap: 14px;
  padding: 18px 14px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--alice) 12%, transparent), transparent 56%), var(--alice-tint);
  border: 1px solid #e9d5ff;
}
.alice-question { display: grid; justify-items: center; gap: 5px; text-align: center; color: var(--alice-strong); }
.alice-question .av {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 999px; color: #fff; background: var(--alice);
  box-shadow: 0 6px 16px rgba(124,58,237,.22);
}
.alice-question strong { color: var(--ink); font-size: 18px; }
.alice-question span:last-child { font-size: 13px; font-weight: 700; color: var(--alice-strong); }
.alice-mic-button {
  position: relative;
  width: 104px; height: 104px; border: 0; border-radius: 999px;
  display: grid; place-items: center; color: #fff;
  background: transparent; isolation: isolate;
}
.alice-mic-button .mic-rings,
.alice-mic-button .mic-rings::before,
.alice-mic-button .mic-rings::after {
  content: ""; position: absolute; inset: 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--alice) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--alice) 24%, transparent);
  z-index: -2;
}
.alice-mic-button .mic-rings::before { inset: -8px; opacity: .72; }
.alice-mic-button .mic-rings::after { inset: -22px; opacity: .38; }
.alice-mic-button .mic-core {
  width: 72px; height: 72px; display: grid; place-items: center;
  border-radius: 999px; background: linear-gradient(135deg, var(--alice), var(--brand));
  box-shadow: 0 18px 36px rgba(124,58,237,.28), inset 0 1px 0 rgba(255,255,255,.28);
}
.alice-mic-button.listening .mic-rings { animation: aliceRing 1.45s var(--ease-premium) infinite; }
.alice-mic-button.listening .mic-rings::before { animation: aliceRing 1.45s var(--ease-premium) .18s infinite; }
.alice-mic-button.listening .mic-rings::after { animation: aliceRing 1.45s var(--ease-premium) .36s infinite; }
.alice-mic-button.listening .mic-core { animation: aliceMicPulse .76s var(--ease-premium) infinite alternate; }
.alice-wave { position: absolute; bottom: 4px; display: flex; align-items: end; gap: 3px; height: 20px; opacity: 0; }
.alice-wave i { width: 4px; height: 8px; border-radius: 999px; background: var(--alice); transform-origin: bottom; }
.alice-mic-button.listening .alice-wave { opacity: 1; }
.alice-mic-button.listening .alice-wave i:nth-child(1) { animation: aliceBar .5s ease-in-out infinite alternate; }
.alice-mic-button.listening .alice-wave i:nth-child(2) { animation: aliceBar .62s ease-in-out .08s infinite alternate; }
.alice-mic-button.listening .alice-wave i:nth-child(3) { animation: aliceBar .54s ease-in-out .14s infinite alternate; }
.alice-mic-button.listening .alice-wave i:nth-child(4) { animation: aliceBar .66s ease-in-out .04s infinite alternate; }
.alice-listening-copy { min-height: 20px; color: var(--alice-strong); font-size: 13px; font-weight: 750; text-align: center; }
.alice-examples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: -4px; }
.alice-raw-request { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.alice-raw-request .icon-sm { color: var(--alice-strong); flex: none; }
.alice-draft-note { margin-top: 14px; }
.sheet.sheet-alice-voice {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.sheet-alice-voice .sheet-body,
.sheet-alice-voice .sheet-foot {
  width: 100%;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}
.sheet-alice-voice .sheet-body { padding-top: 18px; }
.sheet-alice-voice .sheet-foot { border-top: 0; }
.sheet-alice-voice .alice-voice-panel {
  min-height: 320px;
  padding: 26px 18px;
  gap: 16px;
  overflow: hidden;
}
.alice-voice-button.alice-mic-button {
  width: 138px;
  height: 138px;
  cursor: pointer;
}
.alice-voice-button .voice-orbit {
  position: absolute;
  inset: 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--alice) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--alice) 18%, transparent);
  z-index: -2;
}
.alice-voice-button .voice-orbit.outer {
  inset: 4px;
  opacity: .55;
}
.alice-voice-core {
  position: relative;
  width: 94px;
  height: 94px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #5b6472;
  box-shadow: 0 22px 44px rgba(124,58,237,.22), 0 0 0 9px color-mix(in srgb, var(--alice) 18%, transparent), inset 0 1px 0 rgba(255,255,255,.92);
}
.voice-bars {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.voice-bars i {
  width: 7px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: 50% 50%;
}
.voice-bars i:nth-child(1) { height: 22px; }
.voice-bars i:nth-child(2) { height: 36px; }
.voice-bars i:nth-child(3) { height: 50px; }
.voice-bars i:nth-child(4) { height: 34px; }
.voice-bars i:nth-child(5) { height: 24px; }
.voice-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}
.voice-dot.d1 { left: 16px; top: 28px; }
.voice-dot.d2 { right: 17px; top: 22px; width: 6px; height: 6px; }
.voice-dot.d3 { left: 18px; bottom: 25px; width: 6px; height: 6px; }
.voice-dot.d4 { right: 12px; bottom: 17px; width: 14px; height: 14px; }
.alice-voice-button.speaking .voice-orbit,
.alice-voice-button.listening .voice-orbit {
  animation: aliceVoiceRing 1.45s var(--ease-premium) infinite;
}
.alice-voice-button.speaking .voice-orbit.outer,
.alice-voice-button.listening .voice-orbit.outer {
  animation-delay: .22s;
}
.alice-voice-button.speaking .voice-bars i {
  animation: aliceVoiceSpeak .9s ease-in-out infinite alternate;
}
.alice-voice-button.listening .voice-bars i {
  animation: aliceVoiceListen .5s ease-in-out infinite alternate;
}
.alice-voice-button.processing .alice-voice-core {
  animation: aliceVoiceProcess .72s var(--ease-premium) infinite alternate;
}
.alice-voice-button .voice-bars i:nth-child(2) { animation-delay: .08s; }
.alice-voice-button .voice-bars i:nth-child(3) { animation-delay: .16s; }
.alice-voice-button .voice-bars i:nth-child(4) { animation-delay: .04s; }
.alice-voice-button .voice-bars i:nth-child(5) { animation-delay: .12s; }
.alice-type-link {
  min-height: 34px;
  padding-inline: 14px;
  color: var(--alice-strong);
}
.alice-type-panel {
  display: none;
  margin-top: 14px;
}
.alice-type-panel.is-open {
  display: block;
}
.alice-draft-preview {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #ddd6fe;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-1);
}
.alice-draft-preview.is-error {
  border-color: var(--warn-line);
  background: var(--warn-tint);
  color: var(--warn);
}
.alice-draft-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--alice-strong);
  font-weight: 800;
}
.alice-draft-preview.is-error .alice-draft-title { color: var(--warn); }
.alice-draft-grid {
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr;
  gap: 9px 14px;
  margin-top: 12px;
  font-size: 14px;
}
.alice-draft-grid span {
  color: var(--muted);
  font-weight: 700;
}
.alice-draft-grid strong {
  color: var(--ink);
  min-width: 0;
}
.alice-draft-preview p {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
}
.alice-context-note {
  align-items: flex-start;
  margin-top: 12px;
}
.alice-context-note strong,
.alice-context-note span,
.alice-context-note em {
  display: block;
}
.alice-context-note span,
.alice-context-note em {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.35;
}
.alice-context-note em {
  color: var(--ink-2);
  font-style: normal;
}
.alice-draft-preview.is-error p { color: var(--warn); }
.sheet-alice-voice .sheet-foot { flex-wrap: wrap; }
.sheet-alice-voice .sheet-foot .btn-primary { flex-basis: 220px; }
@keyframes aliceRing {
  from { transform: scale(.86); opacity: .88; }
  to { transform: scale(1.16); opacity: .14; }
}
@keyframes aliceMicPulse {
  from { transform: scale(.985); filter: saturate(1); }
  to { transform: scale(1.04); filter: saturate(1.12); }
}
@keyframes aliceBar {
  from { transform: scaleY(.45); }
  to { transform: scaleY(1.7); }
}
@keyframes aliceVoiceRing {
  from { transform: scale(.9); opacity: .82; }
  to { transform: scale(1.16); opacity: .16; }
}
@keyframes aliceVoiceSpeak {
  from { transform: scaleY(.72); opacity: .78; }
  to { transform: scaleY(1.08); opacity: 1; }
}
@keyframes aliceVoiceListen {
  from { transform: scaleY(.48); opacity: .72; }
  to { transform: scaleY(1.28); opacity: 1; }
}
@keyframes aliceVoiceProcess {
  from { transform: scale(.985); filter: saturate(1); }
  to { transform: scale(1.035); filter: saturate(1.16); }
}
.time-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-toggle { display: inline-flex; background: var(--bg-2); border-radius: 10px; padding: 3px; }
.seg-toggle button { border: 0; background: transparent; border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg-toggle button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-1); }

.quick-actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px;
}
.quick-actions .btn { flex: 1 1 145px; }
.quick-actions .btn-review-action {
  min-height: 42px;
  height: auto;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.12;
  white-space: normal;
}
.quick-actions .btn-review-action .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.status-preview,
.mini-status {
  display: inline-flex; align-items: center; width: fit-content;
  border-radius: 999px; padding: 3px 8px; color: #fff;
  font-size: 11px; font-weight: 800; line-height: 1.1;
}
.status-preview { margin-top: 8px; }
.mini-status { margin-left: 6px; vertical-align: 1px; }
.status-preview.state-draft, .mini-status.state-draft { background: var(--alice); }
.status-preview.state-booked, .mini-status.state-booked { background: var(--brand); }
.status-preview.state-quoted, .mini-status.state-quoted { background: #d97706; }
.status-preview.state-paid, .mini-status.state-paid { background: #2563eb; }
.status-preview.state-review-ready, .mini-status.state-review-ready { background: #7c3aed; }
.status-preview.state-reviewed, .mini-status.state-reviewed { background: #047857; }
.status-preview.state-workapp, .mini-status.state-workapp { background: #334155; }
.status-preview.state-cancelled, .mini-status.state-cancelled { background: #94a3b8; text-decoration: line-through; }

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; z-index: 60;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-3); display: flex; align-items: center; gap: 8px;
  animation: pop .2s ease;
}
.toast .icon { color: #5eead4; }
.toast[hidden] { display: none; }

@keyframes fade { to { opacity: 1; } }
@keyframes slideup { to { transform: translateY(0); } }
@keyframes pop { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%,0); opacity: 1; } }

/* ------------------------------------------------------------------ desktop */
@media (min-width: 1024px) {
  .app { flex-direction: row; }
  .bottomnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; width: 248px; flex: none;
    background: #fff; border-right: 1px solid var(--line); padding: 18px 14px;
    position: sticky; top: 0; height: 100dvh;
  }
  .sidebar .brand { padding: 6px 8px 18px; }
  .sidebar .brand-dot { width: 36px; height: 36px; }
  .sidebar nav { display: flex; flex-direction: column; gap: 4px; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 15px; width: 100%; text-align: left; position: relative; }
  .side-link:hover { background: var(--bg-2); }
  .side-link[aria-current="page"] { background: var(--brand-tint); color: var(--brand-strong); }
  .side-link .nav-badge { margin-left: auto; background: var(--alice); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; position: static; transform: none; }
  .sidebar .side-foot { margin-top: auto; }
  .alice-card { background: var(--alice-tint); border-radius: 14px; padding: 12px; }
  .alice-card .top { display: flex; align-items: center; gap: 9px; color: var(--alice-strong); font-weight: 700; }
  .alice-card .av { width: 26px; height: 26px; border-radius: 999px; background: var(--alice); color:#fff; display:grid; place-items:center; }
  .alice-card p { font-size: 12.5px; color: var(--alice-strong); margin-top: 8px; opacity: .9; }

  .main { min-height: 100dvh; }
  .screen { max-width: 1080px; padding: 22px 28px 40px; }
  .app[data-route="calendar"] .screen { max-width: none; padding: 22px 44px 40px; }
  .topbar { padding: 16px 28px; }
  .topbar .alice-pill { display: none; }      /* Alice lives in sidebar on desktop */
  .topbar .topbar-row { display: none; }      /* brand lives in sidebar on desktop */
  .page-title { display: block; }
  .cal-controls { margin-top: 14px; }
  .free { min-height: 44px; }

  /* two-column screens on desktop */
  .cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
  .agenda { display: none; }                   /* mobile day list hidden; week grid is primary */
  .app[data-calview="day"] .agenda { display: flex; }
  .app[data-calview="day"] .weekgrid-wrap { display: none; }
  .app[data-route="calendar"][data-calview="day"] .screen { max-width: none; }
  .weekgrid { width: 100%; min-width: 980px; grid-template-columns: 58px repeat(var(--cols, 7), minmax(150px, 1fr)); }
  .weekgrid.is-three { min-width: 0; grid-template-columns: 58px repeat(var(--cols, 3), minmax(260px, 1fr)); }
}
@media (max-width: 1023px) {
  .weekgrid-wrap.week-desktop-only { }          /* week grid still available on mobile via scroll */
  .cols { display: block; }
  .cols > * + * { margin-top: 16px; }
  .cal-controls {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  }
  .cal-controls .spacer { display: none; }
  .cal-controls .segmented {
    grid-column: 1 / -1; width: 100%; justify-content: stretch;
  }
  .cal-controls .segmented button { flex: 1; }
  .staff-tray {
    margin-left: 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none;
  }
  .staff-tray::-webkit-scrollbar { display: none; }
  .staff-tray-hint { display: none; }
  .booking-card { align-items: flex-start; flex-wrap: wrap; }
  .booking-main { flex-basis: 100%; }
  .booking-right {
    width: calc(100% - 54px); min-width: 0; margin-left: 54px;
    justify-content: flex-start;
  }
  .staff-dropzone { min-width: 0; max-width: 100%; justify-content: flex-start; border-radius: 14px; }
  .staff-name { max-width: 64px; }
  .profile-form { grid-template-columns: 1fr; }
  .contact-actions .btn { flex: 1 1 96px; }
  .inline-fields { justify-content: flex-start; width: 100%; margin-top: 10px; }
  .inline-fields input[type="text"] { width: 100%; max-width: none; }
  .staff-picker { gap: 6px; }

  /* settings rows that carry a wide control stack on mobile so the
     label + hint keep full width instead of crushing to one word per line */
  .set-row:has(.seg-toggle),
  .set-row:has(.inline-fields),
  .set-row:has(.brand-tools),
  .set-row:has(.connect-controls),
  .set-row:has(.calendar-import-controls),
  .set-row:has(.days),
  .set-row:has(textarea),
  .set-row:has(select),
  .set-row:has(input[type="text"]),
  .set-row:has(input[type="url"]),
  .set-row:has(input[type="color"]),
  .set-row:has(input[type="time"]),
  .set-row:has(input[type="number"]) { flex-wrap: wrap; align-items: flex-start; }
  .set-row:has(.seg-toggle) .grow,
  .set-row:has(.inline-fields) .grow,
  .set-row:has(.brand-tools) .grow,
  .set-row:has(.connect-controls) .grow,
  .set-row:has(.calendar-import-controls) .grow,
  .set-row:has(.days) .grow,
  .set-row:has(textarea) .grow,
  .set-row:has(select) .grow,
  .set-row:has(input[type="text"]) .grow,
  .set-row:has(input[type="url"]) .grow,
  .set-row:has(input[type="color"]) .grow,
  .set-row:has(input[type="time"]) .grow,
  .set-row:has(input[type="number"]) .grow { flex: 1 1 100%; }
  .set-row .seg-toggle { flex: 1 1 100%; margin-top: 10px; }
  .set-row .seg-toggle button { flex: 1; }
  .set-row .brand-tools,
  .set-row .connect-controls,
  .set-row .calendar-import-controls,
  .set-row .days { flex: 1 1 100%; justify-content: flex-start; margin-top: 10px; }
  .set-row > select,
  .set-row > textarea,
  .set-row > input[type="text"],
  .set-row > input[type="url"],
  .set-row > input[type="time"],
  .set-row > input[type="number"] { flex: 1 1 100%; max-width: none; margin-top: 10px; }
  .calendar-import-controls { grid-template-columns: 1fr; }

  /* comfier thumb targets on the calendar control toggles */
  .segmented button, .seg-toggle button { min-height: 40px; }
  .cal-controls .talk-alice-btn {
    grid-column: 1 / -1;
    width: 100%;
    justify-self: stretch;
    margin-top: 2px;
  }
  .cal-alice-queue {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    margin-bottom: 12px;
    overflow: hidden;
  }
  .cal-alice-summary {
    flex: none;
    width: 100%;
  }
  .cal-alice-items {
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .cal-alice-queue.is-expanded .cal-alice-items {
    overflow-x: visible;
  }
  .cal-alice-items::-webkit-scrollbar { display: none; }
  .cal-alice-item {
    flex: 0 0 min(82vw, 326px);
    min-width: 0;
  }
  .cal-alice-item.update { flex-basis: min(88vw, 346px); }
  .cal-alice-item .btn {
    flex: 0 0 auto;
    padding-inline: 10px;
    font-size: 12px;
  }
}

/* iPad / tablet fit mode: keep 3-day, week, month, and year visible
   without forcing the owner into horizontal scrolling. Day view can still
   grow with staff count. */
@media (min-width: 1024px) and (max-width: 1366px) {
  .sidebar {
    width: 210px;
    padding: 16px 10px;
  }
  .sidebar .brand { padding: 6px 8px 14px; }
  .sidebar .brand-name { font-size: 15px; }
  .side-link { font-size: 14px; padding: 10px 11px; }
  .app[data-route="calendar"] .screen { padding: 18px 24px 30px; }
  .topbar { padding: 14px 24px; }
  .cal-controls { gap: 7px; margin-top: 10px; }
  .cal-title { font-size: 15px; }
  .cal-title small { font-size: 11px; }
  .iconbtn, .btn-today, .talk-alice-btn { height: 36px; }
  .iconbtn { width: 36px; }
  .btn-today, .talk-alice-btn { padding-inline: 11px; font-size: 13px; }
  .segmented button { min-height: 32px; padding: 6px 8px; font-size: 12px; }
  .staff-tray { margin-bottom: 10px; padding: 8px 10px; gap: 6px; }
  .staff-chip { max-width: 112px; font-size: 12px; }
  .staff-name { max-width: 56px; }
  .week-legend { margin-bottom: 8px; gap: 6px; }
  .legend-pill { font-size: 10px; min-height: 24px; padding-inline: 7px; }
  .weekgrid-wrap { overflow-x: hidden; }
  .weekgrid,
  .weekgrid.is-three {
    min-width: 0;
    width: 100%;
    grid-template-columns: 48px repeat(var(--cols, 7), minmax(0, 1fr));
  }
  .weekgrid.is-three { grid-template-columns: 48px repeat(var(--cols, 3), minmax(0, 1fr)); }
  .wg-head { padding: 8px 4px; }
  .wg-head .dow { font-size: 10px; }
  .wg-head .dnum { font-size: 14px; }
  .wg-head.today .dnum { width: 28px; height: 28px; }
  .wg-time, .wg-cell { height: 34px; }
  .wg-time { font-size: 10px; padding-right: 4px; }
  .wg-event { min-height: 38px; font-size: 10.5px; border-radius: 8px; }
  .wg-event.booking { padding: 4px 5px 12px; padding-right: 34px; line-height: 1.14; }
  .wg-event.booking .booking-status { top: 3px; right: 3px; max-width: 28px; padding: 0 3px; font-size: 8px; }
  .wg-event .week-staff { right: 3px; bottom: 3px; gap: 2px; }
  .wg-event .week-staff-face { width: 12px; height: 12px; font-size: 6px; border-width: 1px; }
  .month .mcell {
    min-height: clamp(58px, calc((100dvh - 288px) / 6), 104px);
    padding: 7px;
  }
  .mnum { width: 22px; height: 22px; font-size: 12px; }
  .mcount { display: none; }
  .year {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
  }
  .ymini { padding: 8px; }
  .ymini h4 { margin-bottom: 4px; font-size: 12px; }
  .ymini .yg { gap: 1px; }
  .ymini .yd { font-size: 8px; }
}

@media (min-width: 1200px) and (max-width: 1366px) {
  .year { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* tablet week grid scroll affordance kept; large desktop wider columns */
@media (min-width: 1280px) {
  .weekgrid { min-width: 0; }
}

/* ============================================================
   Claude motion spike — premium micro-interactions
   Motion/transform/opacity only. No logic, data, or layout changes.
   Layered on top of Codex V2 to compare premium feel.
   ============================================================ */

/* Smooth, quiet transitions on every interactive surface that
   previously snapped state instantly. */
.btn, .iconbtn, .btn-today, .segmented button, .seg-toggle button,
.chip.selectable, .side-link, .bottomnav button, .row, .appt, .card,
.wg-head, .sd-head, .staff-chip, .staff-focus-chip, .day-pill,
.sheet-close, .booking-link, .legend-pill, .alice-pill, .avatar,
.brand-dot {
  transition:
    transform .14s var(--ease-premium),
    box-shadow .2s var(--ease-premium),
    background-color .2s var(--ease-premium),
    border-color .2s var(--ease-premium),
    color .2s var(--ease-premium);
}

/* calendar cells / free slots: smooth hover wash instead of a hard flip */
.wg-cell, .sd-cell, .free, .mcell, .wg-head, .sd-head {
  transition:
    background-color .16s var(--ease-premium),
    border-color .16s var(--ease-premium),
    color .16s var(--ease-premium),
    box-shadow .16s var(--ease-premium);
}

/* Press feedback — transform-only, interruptible */
.btn:active, .iconbtn:active, .btn-today:active, .segmented button:active,
.seg-toggle button:active, .chip.selectable:active, .side-link:active,
.staff-focus-chip:active, .day-pill:active, .sheet-close:active,
.legend-pill:active, .alice-pill:active {
  transform: scale(.97);
}
.bottomnav button:active { transform: scale(.93); }
.row:active, .appt:active, .booking-link:active { transform: scale(.992); }

/* Hover lift on pointer devices only (no sticky hover on touch) */
@media (hover: hover) {
  .row:hover, .appt:hover, .card:hover { transform: translateY(-1px); }
  .btn-primary:hover, .btn-alice:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
  .iconbtn:hover, .btn-today:hover { transform: translateY(-1px); }
  .brand-dot:hover { transform: scale(1.05); }
}

/* Bottom-nav: active icon lifts and grows slightly */
.bottomnav button .icon { transition: transform .18s var(--ease-premium); }
.bottomnav button[aria-current="page"] .icon { transform: translateY(-2px) scale(1.06); }

/* Sidebar link: animated accent bar slides in on the active item */
.side-link::before {
  content: ""; position: absolute; left: 3px; top: 50%;
  width: 3px; height: 0; border-radius: 999px; background: var(--brand);
  transform: translateY(-50%);
  transition: height .24s var(--ease-premium);
}
.side-link[aria-current="page"]::before { height: 54%; }

/* Search bar focus glow */
.searchbar { transition: box-shadow .2s var(--ease-premium), border-color .2s var(--ease-premium); }
.searchbar:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent);
}

/* Consistent, animated keyboard focus ring (accessibility + polish) */
.btn:focus-visible, .iconbtn:focus-visible, .btn-today:focus-visible,
.segmented button:focus-visible, .seg-toggle button:focus-visible,
.side-link:focus-visible, .bottomnav button:focus-visible,
.chip.selectable:focus-visible, .day-pill:focus-visible,
.staff-focus-chip:focus-visible, .sheet-close:focus-visible,
.toggle:focus-visible, .row:focus-visible, .legend-pill:focus-visible,
.alice-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 38%, transparent);
}

/* Toast uses the premium curve */
.toast { animation: pop .22s var(--ease-premium); }

/* Screen + calendar-range entrance transitions (driven by app.js).
   .main clips the small horizontal overshoot so no scrollbar flashes. */
.main { overflow-x: clip; }
.screen.screen-enter { animation: spikeScreenIn .34s var(--ease-premium) both; }
.screen.cal-enter-fade { animation: spikeScreenIn .30s var(--ease-premium) both; }
.screen.cal-enter-next { animation: spikeCalNext .56s var(--ease-premium) both; }
.screen.cal-enter-prev { animation: spikeCalPrev .56s var(--ease-premium) both; }
@keyframes spikeScreenIn {
  from { opacity: 0; transform: translateY(8px) scale(.995); }
  to   { opacity: 1; transform: none; }
}
@keyframes spikeCalNext {
  from { opacity: .35; transform: translateX(22px); }
  to   { opacity: 1; transform: none; }
}
@keyframes spikeCalPrev {
  from { opacity: .35; transform: translateX(-22px); }
  to   { opacity: 1; transform: none; }
}

/* Cloudflare unified Alice test */
.phone-sim-wrap { position: fixed; inset: 0; z-index: 80; }
.phone-sim-wrap .scrim { position: absolute; inset: 0; background: rgba(15, 23, 42, .48); backdrop-filter: blur(2px); }
.phone-sim {
  position: absolute;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(680px, calc(100vw - 28px));
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .22);
  padding: 22px;
  animation: slideup .26s var(--ease-premium);
}
.phone-sim-head { display: flex; gap: 12px; align-items: center; padding-right: 44px; }
.phone-sim-head h2 { margin: 0; font-size: 24px; letter-spacing: 0; }
.phone-sim-head p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.phone-sim-call {
  margin: 18px 0;
  border: 1px solid color-mix(in srgb, var(--brand, #0d9488) 22%, #e2e8f0);
  border-radius: 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand, #0d9488) 8%, #fff), #f8fafc);
  min-height: 178px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
  padding: 18px;
}
.phone-sim-call strong { color: var(--ink); font-size: 17px; }
.phone-sim-call span { color: var(--muted); font-size: 13px; max-width: 360px; }
.voice-mark {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #8b5cf6, var(--brand, #0d9488));
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--brand, #0d9488) 12%, transparent);
}
.voice-mark span {
  display: block;
  width: 6px;
  height: 22px;
  border-radius: 999px;
  background: currentColor;
  animation: voiceBar 1.1s ease-in-out infinite;
}
.voice-mark span:nth-child(2) { height: 38px; animation-delay: -.12s; }
.voice-mark span:nth-child(3) { height: 52px; animation-delay: -.24s; }
.voice-mark span:nth-child(4) { height: 34px; animation-delay: -.36s; }
.voice-mark span:nth-child(5) { height: 18px; animation-delay: -.48s; }
@keyframes voiceBar {
  0%, 100% { transform: scaleY(.62); opacity: .72; }
  50% { transform: scaleY(1); opacity: 1; }
}
.phone-sim textarea { resize: vertical; min-height: 110px; }
.phone-sim .sheet-foot { position: static; margin: 18px -22px -22px; border-radius: 0 0 26px 26px; }

@media (max-width: 700px) {
  .phone-sim {
    width: 100%;
    left: 0;
    bottom: 0;
    transform: none;
    border-radius: 26px 26px 0 0;
    padding: 20px 16px;
  }
  .phone-sim .sheet-foot { margin: 18px -16px -20px; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  /* Entrances and lifts collapse to their resting state, no movement. */
  .screen.screen-enter, .screen.cal-enter-fade,
  .screen.cal-enter-next, .screen.cal-enter-prev { animation: none !important; }
  .cal-alice-queue.is-highlighted { animation: none !important; }
  .bottomnav button[aria-current="page"] .icon { transform: none !important; }
}

/* ============================================================
   Mobile + touch hardening (2026-05-23 mobile QA)
   No logic/data/nav change.
   ============================================================ */

/* Mobile drags are deliberate long-press gestures; quick movement stays scroll/swipe. */
.sd-event, .wg-event.booking, .staff-chip, .week-staff-face {
  touch-action: pan-y;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  user-select: none;
}

/* Sheet footer stays pinned above the home indicator; body won't rubber-band the page */
.sheet-foot { flex: none; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.sheet-body { overscroll-behavior: contain; }

@media (max-width: 1023px) {
  /* keep the calendar title from being clipped by the nav row */
  .cal-title { min-width: 0; }
  .cal-title small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* fade the right edge of the staff focus bar so it reads as scrollable
     (borderless element, safe to mask; the bordered .staff-tray is left alone) */
  .staff-focusbar {
    -webkit-mask: linear-gradient(90deg, #000 calc(100% - 22px), transparent);
            mask: linear-gradient(90deg, #000 calc(100% - 22px), transparent);
  }
  .staff-focus-chip { scroll-snap-align: start; }

  /* bigger finger target on the resize grip */
  .resize-grip { height: 20px; }

  /* in-sheet action buttons wrap cleanly on the narrowest phones */
  .quick-actions .btn { flex: 1 1 120px; }
}

/* ============================================================
   Mobile chrome auto-hide on scroll + full-week fit (2026-05-23)
   ============================================================ */

/* Top chrome slides away on scroll-down so the calendar gets full height.
   JS toggles #app.chrome-collapsed (calendar route only). */
@media (max-width: 1023px) {
  .topbar { transition: transform .32s var(--ease-premium); will-change: transform; }
  #app.chrome-collapsed .topbar { transform: translateY(-100%); }
}

/* Fit the whole week (all 7 days) in the viewport on EVERY phone size, so
   Saturday and Sunday are never clipped or stuck behind a finicky horizontal
   scroll. Columns share the width; cards go compact so they still read. */
@media (max-width: 1023px) {
  .weekgrid, .weekgrid.is-three { min-width: 0; width: 100%; }
  .weekgrid { grid-template-columns: 48px repeat(var(--cols, 7), minmax(0, 1fr)); }
  .weekgrid.is-three { grid-template-columns: 48px repeat(var(--cols, 3), minmax(0, 1fr)); }
  .wg-time { font-size: 10px; padding-right: 4px; }
  .wg-head .dow { font-size: 11px; }
  .wg-head .dnum { font-size: 14px; }
  /* compact booking cards for the narrower week columns */
  .weekgrid .wg-event.booking { padding: 3px 4px 12px; font-size: 10px; line-height: 1.15; }
  .weekgrid .wg-event.booking .booking-status { top: 3px; right: 3px; max-width: 26px; font-size: 8px; padding: 0 3px; }
  .weekgrid .wg-event .week-staff { right: 2px; bottom: 2px; gap: 2px; }
  .weekgrid .wg-event .week-staff-face { width: 12px; height: 12px; font-size: 6px; border-width: 1px; }
}
