/* ========== BRAND ==========
   The app's colours are set here and only here. To rebrand, change these values;
   for the logo, replace the images in /icons (see docs/BRANDING.md).
   --brand-*  : other businesses (fitness, studios, anything else)
   --clinic-* : clinics (dentists, physios, dietitians) and the public website
   --luxe-*   : salons, beauty parlours and spas: black with gold
   Each colour has: main, soft (light backgrounds), ink (text on light), deep (pressed), light (focus rings). */
:root {
  --brand: #5B3BC4; --brand-soft: #EEEAFB; --brand-ink: #3F2596; --brand-deep: #4A2FA8; --brand-light: #9C86E8;
  --clinic: #2450E0; --clinic-soft: #EAF0FF; --clinic-ink: #1A3CB0; --clinic-deep: #1A3CB0; --clinic-light: #7EA0FF;
  --luxe: #17150F; --luxe-soft: #F4EEE3; --luxe-ink: #7A5A26; --luxe-deep: #000000; --luxe-light: #C9A45C;
  --luxe-gold: #B8913F; /* the gold itself: active tab, highlights, the glow on the Today panel */
  --desk-edge: #E9ECEB; /* the backdrop around the phone-width app on bigger screens */
}
/* ========== end of BRAND ========== */

:root {
  --bg: #F6F7F6;
  --card: #FFFFFF;
  --ink: #111A19;
  --muted: #5F6B69;
  --line: #E3E7E6;
  --line-soft: #EEF1F0;
  --tile: #F1F4F3; /* quiet backgrounds behind icons */
  --shadow-sm: 0 1px 2px rgba(17, 26, 25, .05), 0 1px 1px rgba(17, 26, 25, .03);
  --shadow-md: 0 1px 2px rgba(17, 26, 25, .05), 0 8px 24px -8px rgba(17, 26, 25, .12);
  /* The accent the screens use. It follows the brand above; clinics switch it to the clinic colours. */
  --violet: var(--brand); --violet-soft: var(--brand-soft); --violet-ink: var(--brand-ink); --violet-deep: var(--brand-deep); --violet-light: var(--brand-light);
  --orange: #FF7A2F; --orange-soft: #FFE1CF; --orange-ink: #7A2E00; --orange-text: #3D1600;
  --mint: #1FB57A; --mint-soft: #D2F4E5; --mint-ink: #05583A; --mint-text: #053D27;
  --yellow: #FFD24D; --yellow-soft: #FFF1C2; --yellow-ink: #5A4000; --yellow-text: #3D2B00;
  --sky: #3B82F6; --sky-soft: #DCEBFF; --sky-ink: #1D4F91;
  --pink: #FF5C93; --pink-soft: #FFDDEA; --pink-ink: #8A1F4B;
  --red: #B2391F; --now: #E5484D;
  /* Made from the tokens above, so they follow each theme */
  --faint: color-mix(in srgb, var(--muted) 45%, var(--card)); /* disabled text, empty counts */
  --red-soft: color-mix(in srgb, var(--red) 8%, var(--card)); --red-line: color-mix(in srgb, var(--red) 28%, var(--card));
  --switch-off: color-mix(in srgb, var(--muted) 32%, var(--card));
  /* Each person's colour in the calendar and team: soft fill, ink, line */
  --staff-1: #E3EEFB; --staff-1-ink: #1D4F91; --staff-1-line: #7FA7DA;
  --staff-2: #E2F3EC; --staff-2-ink: #145C43; --staff-2-line: #79BFA2;
  --staff-3: #F6EADF; --staff-3-ink: #7A3E12; --staff-3-line: #D9A47A;
  --staff-4: #ECE7F8; --staff-4-ink: #4A3590; --staff-4-line: #A898D8;
  --staff-5: #F7EFD6; --staff-5-ink: #5E4700; --staff-5-line: #D3B868;
  --staff-6: #F6E4EA; --staff-6-ink: #7D2546; --staff-6-line: #D49AAE;
  --display: 'Inter Tight', Inter, 'Segoe UI', system-ui, sans-serif;
  --body: Inter, 'Segoe UI', system-ui, sans-serif;
}
:root[data-theme="clinic"] {
  --violet: var(--clinic); --violet-soft: var(--clinic-soft); --violet-ink: var(--clinic-ink); --violet-deep: var(--clinic-deep); --violet-light: var(--clinic-light);
  --bg: #F6F7F6; --line: #E3E7E6;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; }
@media (min-width: 560px) { body { background: var(--desk-edge); } #shell { box-shadow: 0 0 0 1px var(--line); } }
#shell { max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--bg); position: relative; padding-top: env(safe-area-inset-top); padding-bottom: calc(164px + env(safe-area-inset-bottom)); } /* clears the tab bar and the Ask button */
a { color: var(--violet-ink); }
button, input, select, textarea { font-family: var(--body); font-size: 15px; color: var(--ink); }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--violet-light); outline-offset: 2px; }

.scr { padding: 20px 18px 8px; display: flex; flex-direction: column; gap: 16px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kicker { font-size: 13px; color: var(--muted); }
.title { font-family: var(--display); font-size: 30px; font-weight: 650; letter-spacing: -0.5px; line-height: 1.1; margin: 0; }
.h2 { font-family: var(--display); font-size: 19px; font-weight: 600; margin: 0; }
/* More: the heading over each group of screens */
.h2.more-head { font-size: 13px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 6px 4px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }

.icon-btn { width: 44px; height: 44px; border-radius: 10px; border: none; background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; text-decoration: none; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.avatar.sq { border-radius: 12px; }
.avatar.lg { width: 64px; height: 64px; border-radius: 12px; font-family: var(--display); font-size: 24px; font-weight: 650; }

.hero { position: relative; overflow: hidden; background: var(--violet); color: #fff; border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.hero > * { position: relative; z-index: 1; }
.hero .label { font-size: 14px; color: rgba(255, 255, 255, .82); font-weight: 500; }
.hero .soft { color: rgba(255, 255, 255, .82); }
.hero .big { font-family: var(--display); font-size: 40px; font-weight: 650; letter-spacing: -1px; line-height: 1; }
.meter { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.meter > span { display: block; height: 100%; background: #fff; border-radius: 999px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--card); color: var(--ink); border: 1px solid var(--line); white-space: nowrap; }
.chip.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.chip.white { background: #fff; color: var(--violet-ink); }
.chip.glass { background: rgba(255, 255, 255, .16); color: #fff; }
.chip.yellow { background: rgba(255, 255, 255, .16); color: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px; padding: 0 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { min-height: 40px; padding: 0 14px; }
.pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { text-decoration: none; border: 1px solid var(--line); text-align: left; border-radius: 14px; padding: 16px; min-height: 112px; background: var(--card); color: var(--ink); display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.tile .t { font-family: var(--display); font-size: 18px; font-weight: 600; line-height: 1.2; }
.tile > span[aria-hidden] { width: 42px !important; height: 42px !important; border-radius: 10px; align-items: center; justify-content: center; background: var(--tint, var(--violet-soft)); color: var(--tint-ink, var(--violet-ink)); }
.tile > span[aria-hidden] svg { width: 22px; height: 22px; }
.tile .s { font-size: 13px; color: var(--muted); }
/* Tones: only a tint on the icon (tiles) or a stripe and number (banners). */
.t-orange { --tint: var(--orange-soft); --tint-ink: var(--orange-ink); --stripe: var(--orange); }
.t-mint { --tint: var(--mint-soft); --tint-ink: var(--mint-ink); --stripe: var(--mint); }
.t-yellow { --tint: var(--yellow-soft); --tint-ink: var(--yellow-ink); --stripe: var(--yellow); }
.t-sky { --tint: var(--sky-soft); --tint-ink: var(--sky-ink); --stripe: var(--sky); }
.t-white { --stripe: transparent; }
.t-violet { --tint: var(--violet-soft); --tint-ink: var(--violet-ink); --stripe: var(--violet); }

.card { background: var(--card); border-radius: 14px; padding: 16px; border: 1px solid var(--line); }
.card.flush { padding: 4px 14px; }
.banner { text-decoration: none; border-radius: 12px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); text-align: left; width: 100%; background: var(--card); color: var(--ink); box-shadow: inset 4px 0 0 var(--stripe, transparent); }
.banner .small { color: var(--muted); }
.banner > span[aria-hidden] { color: var(--muted); }
.banner.urgent { background: var(--red-soft); border-color: var(--red-line); --stripe: var(--red); }
.banner.urgent .n, .banner.urgent b { color: var(--red); }
.banner .n { font-family: var(--display); font-size: 28px; font-weight: 650; color: var(--tint-ink, var(--ink)); min-width: 22px; text-align: center; }
.list-item { text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 12px; min-height: 66px; border-bottom: 1px solid var(--line-soft); background: none; border-left: none; border-right: none; border-top: none; width: 100%; text-align: left; padding: 8px 0; }
.list-item:last-child { border-bottom: none; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border-radius: 12px; padding: 12px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--display); font-size: 20px; font-weight: 650; }
/* Home's "Last 7 days" on a phone: the rupee amount gets the wider column and a size that fits. */
@media (max-width: 699px) { .home-side .stat-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); } .home-side .stat { padding: 12px 10px; } .home-side .stat b { font-size: 18px; white-space: nowrap; } }
.hscroll { display: flex; gap: 10px; overflow-x: auto; margin: 0 -18px; padding: 0 18px 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.next-card { flex: 0 0 210px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.next-card .time { font-family: var(--display); font-size: 18px; font-weight: 650; }

.btn { min-height: 48px; padding: 0 18px; border-radius: 999px; border: none; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; background: var(--card); color: var(--ink); }
.btn.primary { background: var(--violet); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.yellow { background: #fff; color: var(--violet-ink); }
.btn.mint { background: var(--mint-ink); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: transparent; border: 1px solid var(--red-line); color: var(--red); }
.btn.full { width: 100%; min-height: 56px; font-family: var(--display); font-size: 17px; font-weight: 600; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .field input, .field select, .field textarea { min-height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 0 14px; font-size: 15px; font-weight: 400; color: var(--ink); width: 100%; }
.field textarea { padding: 12px 14px; min-height: 90px; resize: vertical; }
.search { display: flex; align-items: center; gap: 10px; min-height: 50px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); padding: 0 16px; color: var(--muted); }
.search input { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; }
.err { color: var(--red); font-size: 13px; font-weight: 600; }

.switch { width: 58px; height: 34px; border-radius: 999px; border: none; padding: 3px; display: flex; flex-shrink: 0; }
.switch span { width: 28px; height: 28px; border-radius: 50%; background: #fff; }
.switch[aria-checked="true"] { background: var(--mint); justify-content: flex-end; }
.switch[aria-checked="false"] { background: var(--switch-off); justify-content: flex-start; }

#tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); width: min(444px, calc(100% - 36px)); height: 66px; border-radius: 999px; background: var(--ink); display: flex; align-items: center; justify-content: space-between; padding: 0 8px; z-index: 20; }
#tabbar a { width: 50px; height: 50px; white-space: nowrap; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--faint); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; gap: 8px; }
#tabbar a.on { width: auto; padding: 0 16px; background: #fff; color: var(--ink); }
#tabbar a.fab { background: var(--violet); color: #fff; }
#tabbar a:not(.on) .lbl, #tabbar a.fab .lbl { display: none; }
#tabbar a.fab.on { width: 50px; padding: 0; background: var(--violet); color: #fff; }
.side-only { display: none !important; }

.sheet-bg { position: fixed; inset: 0; background: rgba(10, 16, 15, 0.42); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
html.sheet-open, html.sheet-open body { overflow: hidden; }
.sheet-bg { overscroll-behavior: contain; }
.sheet { overscroll-behavior: contain; }
.sheet { background: var(--bg); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; border-radius: 14px 14px 0 0; padding: 10px 18px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet .grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); align-self: center; }
/* The panel's own action (Save, Move visit, Cancel booking...) stays at the bottom while the fields above it scroll.
   A solid band behind it (no blurred glow), so the button above it is never washed out. */
.sheet:has(> .btn.full:last-child), .sheet:has(> .row:last-child > .btn) { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.sheet > .btn.full:last-child { position: sticky; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 2; flex-shrink: 0;
  box-shadow: 0 14px 0 14px var(--bg), 0 -6px 0 0 var(--bg); }
.sheet > .row:last-child:has(> .btn) { position: sticky; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 2; flex-shrink: 0; background: var(--bg);
  box-shadow: 0 14px 0 14px var(--bg), 0 -6px 0 0 var(--bg); }

.cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-day { min-width: 0; padding: 9px 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cal-day .wd { font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1; }
.cal-day b { font-family: var(--display); font-size: 20px; font-weight: 650; line-height: 1; }
.cal-day .n { min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 650; line-height: 1; background: var(--violet-soft); color: var(--violet-ink); }
.cal-day .n.zero { background: transparent; color: var(--faint); }
.cal-day.today:not([aria-pressed="true"]) b, .cal-day.today:not([aria-pressed="true"]) .wd { color: var(--violet); }
.cal-day[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.cal-day[aria-pressed="true"] .wd { color: rgba(255, 255, 255, .8); }
.cal-day[aria-pressed="true"] .n { background: #fff; color: var(--violet-ink); }
.cal-day[aria-pressed="true"] .n.zero { background: transparent; color: rgba(255, 255, 255, .6); }
.cal-board { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.cal-head, .cal-body { display: grid; gap: 4px; padding: 0 8px 0 0; }
.cal-head { padding-top: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--card); z-index: 2; }
.cal-col { position: relative; background: repeating-linear-gradient(var(--card) 0 calc(var(--hour, 50px) - 1px), var(--line-soft) calc(var(--hour, 50px) - 1px) var(--hour, 50px)); }
.cal-block { position: absolute; left: 0; right: 0; border-radius: 10px; padding: 4px 6px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; gap: 2px; border: 1px solid; text-align: left; font-size: 11px; line-height: 1.25; }
.cal-block > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block { padding: 5px 9px; font-size: 12px; box-shadow: inset 3px 0 0 currentColor; }
.cal-block b { font-size: 13px; }
.cal-block .line { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.cal-block .line b, .cal-block .line .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-block .line b { flex-shrink: 0; max-width: 70%; }
.cal-block .what { font-weight: 500; opacity: .9; }
.cal-block .t { font-size: 11px; font-weight: 600; opacity: .85; flex-shrink: 0; }
.cal-block .tag { margin-left: auto; flex-shrink: 0; font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .3px; }
.cal-block.short { flex-direction: row; align-items: center; justify-content: space-between; padding-top: 0; padding-bottom: 0; gap: 8px; }
.cal-block.short .line { flex: 1; }
.cal-block.completed { opacity: .72; }
.cal-block.completed .tag::before { content: '✓ '; }
/* A narrow column (a phone with two or more doctors): shorter tags, and short visits drop their start time
   (the block sits on it), so the patient's name has room. */
.cal-col { container: calcol / inline-size; }
.cal-block .tag .ts { display: none; }
@container calcol (max-width: 190px) {
  .cal-block .tag .tl { display: none; }
  .cal-block .tag .ts { display: inline; }
  .cal-block.short .line > .t { display: none; }
}
.cal-time { position: sticky; left: 0; z-index: 3; background: var(--card); }
.cal-head > .cal-time { align-self: stretch; }
.cal-now { position: absolute; left: 0; right: 8px; display: flex; align-items: center; pointer-events: none; z-index: 4; transform: translateY(-50%); }
.cal-now span { flex: 0 0 54px; text-align: center; font-size: 10px; font-weight: 650; color: #fff; background: var(--now); padding: 3px 0; border-radius: 6px; white-space: nowrap; }
.cal-now i { flex: 1; height: 2px; background: var(--now); }

.wa { background: #EFEAE2; border-radius: 12px; padding: 12px; }
.wa-chat-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 12px; font-size: 14px; }
.wa-bubble { background: #fff; border-radius: 4px 12px 12px 12px; overflow: hidden; max-width: 300px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.wa-text { padding: 8px 10px 6px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; color: #111B21; }
.wa-time { display: block; text-align: right; font-size: 11px; color: #667781; margin-top: 2px; }
.step { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 17px; font-weight: 600; margin-top: 4px; }
.step > span { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wa-head { background: var(--orange); color: var(--orange-text); padding: 14px; }
.wa-head b { font-family: var(--display); font-size: 21px; font-weight: 650; display: block; }
.wa-btn { border-top: 1px solid #E9EDEF; min-height: 42px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: #0B6E63; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.pick-head { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 14px 0 4px; }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 0; border: none; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; color: var(--ink); }
.pick:last-child { border-bottom: none; }
.pick .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; font-weight: 650; color: #fff; }
.pick[aria-pressed="true"] .tick { background: var(--violet); border-color: var(--violet); }
.pick[aria-pressed="true"] > .grow b { color: var(--violet-ink); }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.time-grid .chip { min-height: 44px; justify-content: center; background: var(--bg); }
.time-grid .chip.on { background: var(--violet); color: #fff; }
.confirm-bar { position: fixed; z-index: 21; left: 50%; transform: translateX(-50%); width: min(444px, calc(100% - 36px)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 76px); }
.confirm-bar .btn.full { min-height: 56px; box-shadow: 0 10px 28px -8px color-mix(in srgb, var(--violet) 45%, transparent), 0 2px 6px rgba(17, 26, 25, .12); }
.who { border: none; background: none; padding: 0; text-align: left; color: var(--ink); min-width: 0; }
.who .chev { display: inline-flex; color: var(--muted); transition: transform .15s; }
.who[aria-expanded="true"] .chev { transform: rotate(90deg); }
.day-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day-row .chip { min-height: 40px; padding: 0; justify-content: center; background: var(--bg); }
.day-row .chip.on { background: var(--violet); color: #fff; }
.sit-dots { display: flex; gap: 6px; }
.sit-dots span { flex: 1; max-width: 48px; height: 8px; border-radius: 4px; background: var(--line); }
.sit-dots span.booked { background: var(--mint-soft); box-shadow: inset 0 0 0 2px var(--mint); }
.sit-dots span.done { background: var(--mint); }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); }

/* Small Android phones (360px wide and below) */
@media (max-width: 380px) {
  .scr { padding-left: 16px; padding-right: 16px; }
  .chips, .hscroll { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .title { font-size: 27px; }
  .hero { padding: 20px; }
  .hero .big { font-size: 40px; }
  .tile { padding: 14px; }
  .tile .t { font-size: 18px; }
  .tiles { gap: 10px; }
  .stat b { font-size: 20px; }
  #tabbar { padding: 0 6px; }
  #tabbar a { width: 44px; }
  #tabbar a.on { padding: 0 12px; font-size: 13px; gap: 6px; }
}

.profile-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.profile-head .icon-btn { background: var(--bg); }
.profile-head .name { font-family: var(--display); font-size: 24px; font-weight: 650; line-height: 1.15; }
.profile-head .chip { background: var(--bg); }
.next-patient { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .14); border-radius: 12px; padding: 10px 12px; text-decoration: none; color: #fff; }
.next-patient b { display: block; font-size: 16px; }
/* Booking screen: a person's day, booked times and free gaps */
.plan { padding: 0; overflow: hidden; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
.plan-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 8px 14px; border: none; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; font-size: 14px; color: var(--ink); }
.plan-row:last-child { border-bottom: none; }
.plan-row .when { flex: 0 0 auto; min-width: 116px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.plan-row.busy { background: var(--tile); color: var(--muted); }
.plan-row.busy .when { color: var(--muted); }
.plan-row.free { color: var(--violet-ink); }
.plan-row.free .grow { font-weight: 600; }
.plan-row.free:disabled { color: var(--faint); cursor: default; }
.plan-row.free.on { background: var(--violet-soft); }
.pick-pill { flex-shrink: 0; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--violet); color: var(--violet-ink); }
.plan-row.free.on .pick-pill { background: var(--violet); color: #fff; }
.time-status { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 14px; }
.time-status.ok { background: var(--mint-soft); color: var(--mint-ink); }
.time-status.bad { background: var(--red-soft); color: var(--red); }
.dayline-wrap { padding: 10px 14px 6px; border-bottom: 1px solid var(--line); }
.dayline { position: relative; height: 22px; border-radius: 7px; background: color-mix(in srgb, var(--mint) 14%, var(--card)); overflow: hidden; }
.dayline .b { position: absolute; top: 0; bottom: 0; background: var(--faint); border-left: 1px solid var(--card); border-right: 1px solid var(--card); }
.dayline .sel { position: absolute; top: 0; bottom: 0; background: var(--violet); border-radius: 4px; box-shadow: 0 0 0 2px var(--card) inset; }
.dayline-ticks { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.dayline .sel.bad { background: var(--red); }
/* Patient file: health alerts, last visit, history */
.health-strip { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border-radius: 12px; padding: 12px 14px; border: 1px solid var(--red-line); background: var(--red-soft); color: var(--red); }
.health-strip b { font-size: 15px; }
.health-strip .small { color: var(--red); opacity: .85; }
.health-strip .mark { width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 650; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.health-strip .add { font-size: 13px; font-weight: 600; flex-shrink: 0; }
.health-strip.empty { background: var(--card); border: 1px dashed var(--line); color: var(--ink); }
.health-strip.empty .small { color: var(--muted); }
.health-strip.empty .add { color: var(--violet-ink); }
.chip.alert-on { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.last-visit { box-shadow: inset 3px 0 0 var(--violet); }
.profile-body { padding: 0 18px; display: flex; flex-direction: column; gap: 12px; }
.pf-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* The patient file's tabs: one part of the file at a time. */
.file-tabs { display: flex; gap: 4px; padding: 0 18px; margin: 4px 0 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.file-tabs::-webkit-scrollbar { display: none; }
.file-tabs button { flex: none; border: 0; background: none; padding: 10px 12px 11px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.file-tabs button.on { color: var(--violet-ink); border-bottom-color: var(--violet); }
.file-tabs button:hover:not(.on) { color: var(--ink); }
.tab-off { display: none !important; }
.profile-actions .btn { gap: 6px; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.kv .k { font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 1px; }
.reading-row { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.reading-now { font-family: var(--display); font-size: 20px; font-weight: 650; }
.reading-trail { display: flex; flex-wrap: wrap; gap: 6px; }
.reading-trail span { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 3px 8px; }
.reading-trail b { color: var(--ink); }
.note-line { display: grid; grid-template-columns: 92px 1fr; gap: 8px; font-size: 14px; line-height: 1.4; }
.note-line .k { font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 1px; }
.note-line.fix { background: var(--yellow-soft); border-radius: 8px; padding: 6px 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick .chip { font-size: 12px; font-weight: 600; padding: 5px 10px; min-height: 32px; color: var(--muted); }
.quick .chip.on { color: var(--violet-ink); }
.field .quick { margin-top: 2px; }
.readings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.med { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: none; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; color: var(--ink); }
.med .n { width: 26px; height: 26px; border-radius: 50%; background: var(--violet-soft); color: var(--violet-ink); font-weight: 650; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rx-mark { font-size: 24px; font-weight: 650; color: var(--violet); line-height: 1; }
.chip.progress-better.on { background: var(--mint-ink); border-color: var(--mint-ink); color: #fff; }
.chip.progress-worse.on { background: var(--red); border-color: var(--red); color: #fff; }
.chip.progress-same.on { background: var(--muted); border-color: var(--muted); color: #fff; }
.timeline { display: flex; flex-direction: column; position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.tl-item { position: relative; display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; text-decoration: none; color: var(--ink); }
.tl-dot { position: absolute; left: -18px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--faint); }
.tl-item.has-note .tl-dot { background: var(--violet); border-color: var(--violet); }
.tl-item.faded { opacity: .6; }
.card .field textarea { min-height: 64px; }
.med-warn { color: var(--red); font-size: 12px; font-weight: 650; background: var(--red-soft); border-radius: 6px; padding: 3px 6px; align-self: flex-start; }
.closed-tag { font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .3px; color: var(--red); } .chip.on .closed-tag { color: #fff; }
/* Running late, payments, photos */
.late-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; text-align: left; }
.late-btn > span:first-child { color: var(--orange-ink); }
.pay-row { gap: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .pdf { font-weight: 650; color: var(--red); font-size: 14px; }
.thumb .src { position: absolute; left: 4px; bottom: 4px; font-size: 9px; font-weight: 650; background: var(--mint-ink); color: #fff; border-radius: 6px; padding: 1px 5px; }
.thumb.add { flex-direction: column; gap: 2px; border-style: dashed; color: var(--violet-ink); cursor: pointer; }
/* Compare two X-rays or photos side by side (pwa.js compareSheet). */
button.thumb { padding: 0; cursor: pointer; }
.thumb.cmp-on { box-shadow: 0 0 0 3px var(--violet); }
.thumb .cmp-n { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--violet); color: #fff; font-weight: 700; font-size: 13px; line-height: 22px; text-align: center; }
.cmp-overlay { position: fixed; inset: 0; z-index: 65; background: #0B0F0E; color: #fff; display: flex; flex-direction: column; }
.cmp-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.cmp-top .btn.ghost { margin-left: auto; color: #fff; border: 1px solid rgba(255, 255, 255, .45); background: transparent; }
.cmp-panes { flex: 1; display: flex; gap: 4px; min-height: 0; padding: 0 4px max(4px, env(safe-area-inset-bottom)); }
.cmp-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cmp-label { font-size: 12px; line-height: 1.35; padding: 0 4px; display: flex; flex-direction: column; opacity: .9; }
.cmp-img { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; }
.cmp-img img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.cmp-img.zoom { display: block; }
.cmp-img.zoom img { max-width: none; max-height: none; width: 220%; cursor: zoom-out; }
.lh-sign-prev { max-height: 44px; max-width: 140px; object-fit: contain; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; }
/* Plan and billing */
.plan-status.trial { box-shadow: inset 3px 0 0 var(--sky); }
.plan-status.ok { box-shadow: inset 3px 0 0 var(--mint); }
.plan-status.warn { box-shadow: inset 3px 0 0 var(--orange); }
.plan-status.bad { box-shadow: inset 3px 0 0 var(--red); background: var(--red-soft); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.seg button { min-height: 40px; border: none; border-radius: 999px; background: none; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--violet); color: #fff; }
.plan-card .price { font-family: var(--display); font-size: 24px; font-weight: 650; }
.ticks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ticks li { padding-left: 24px; position: relative; }
.ticks li::before { content: '✓'; position: absolute; left: 2px; color: var(--mint-ink); font-weight: 650; }
/* Voice notes */
.voice-card { gap: 10px; border: 1px solid var(--violet-soft); }
.mic-btn { display: flex; align-items: center; gap: 14px; width: 100%; border: none; background: none; padding: 0; color: var(--ink); text-align: left; }
.mic-btn .small { color: var(--muted); }
.mic { width: 52px; height: 52px; border-radius: 50%; background: var(--violet); color: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.mic-btn .stack { min-width: 0; overflow-wrap: anywhere; }
.voice-card.compact { padding: 10px 12px; gap: 8px; }
.talk-box { min-height: 96px; font-size: 16px; line-height: 1.45; resize: vertical; }
.voice-card.compact .mic { width: 40px; height: 40px; }
.voice-card.compact .mic svg { width: 21px; height: 21px; }
label.field.said > :not(:first-child) { box-shadow: 0 0 0 2px var(--violet-soft); border-radius: 10px; }
.consent { color: var(--muted); font-weight: 600; align-items: flex-start !important; line-height: 1.4; }
.consent input { margin-top: 1px; }
.consent input { width: 18px; height: 18px; flex-shrink: 0; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--now); animation: pulse 1.2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.8); } }
.rec-clock { font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--violet-soft); border-top-color: var(--violet); animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.heard summary { font-size: 13px; font-weight: 600; color: var(--violet-ink); cursor: pointer; }
.heard p { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
textarea.just-filled { background: var(--violet-soft); transition: background .3s; }
@media (prefers-reduced-motion: reduce) { .rec-dot, .spinner { animation: none; } }

/* Our own controls (ui.js): fields that open a panel, the time and date pickers, choices, files */
.pick-field { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; font-family: var(--body); font-size: 15px; font-weight: 400; color: var(--ink); }
.pick-field .placeholder { color: var(--faint); }
.pick-chev { width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); flex-shrink: 0; }
.pick-field:focus-visible, .input:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.choice { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 2px; border: none; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; font-size: 15px; color: var(--ink); }
.choice:last-child { border-bottom: none; }
.choice[aria-pressed="true"] { font-weight: 600; color: var(--violet-ink); }
.choice-tick { width: 24px; height: 24px; border-radius: 50%; background: var(--violet); color: #fff; font-size: 13px; font-weight: 650; display: flex; align-items: center; justify-content: center; }
.time-big { font-family: var(--display); font-size: 24px; font-weight: 650; color: var(--violet-ink); }
.time-hours { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.time-mins { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.time-hours .chip, .time-mins .chip { justify-content: center; min-height: 42px; padding: 0; background: var(--card); }
.time-hours .chip.on, .time-mins .chip.on { background: var(--violet); color: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding-bottom: 2px; }
.cal-cell { position: relative; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 0; }
.cal-cell.today { border-color: var(--violet); color: var(--violet-ink); }
.cal-cell.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.cal-mo { font-size: 9px; font-weight: 650; text-transform: uppercase; line-height: 1; opacity: .8; }
.sheet-text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.btn.danger-solid { background: var(--red); color: #fff; }
.file-row { gap: 12px; }
input[type="checkbox"] { accent-color: var(--violet); width: 20px; height: 20px; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
textarea { resize: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn, .chip, .pick, .choice, .plan-row, .cal-cell, .list-item, .tile, .banner { transition: transform .08s ease, background-color .15s ease; }
.btn:active:not(:disabled), .chip:active, .choice:active, .plan-row:active:not(:disabled), .cal-cell:active, .tile:active, .banner:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { .btn, .chip, .pick, .choice, .plan-row, .cal-cell, .list-item, .tile, .banner { transition: none; } }
.sheet-bg { animation: fade-in .15s ease; }
.sheet { animation: slide-up .2s ease; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(28px); } }
@media (prefers-reduced-motion: reduce) { .sheet-bg, .sheet { animation: none; } }
.time-big.empty { font-size: 15px; color: var(--muted); font-family: var(--body); }

/* Sign-in, setup and other single pages on wide screens: a centred card instead of a grey strip */
@media (min-width: 1024px) {
  body:not(.app) { background: var(--bg); }
  body:not(.app) #shell:not(.site) { max-width: 560px; min-height: 0; margin: 40px auto; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(17, 26, 25, .06); overflow: hidden; }
}

/* Home: two groups. On phones they flow as one column; on wide screens they sit side by side. */
.home-grid, .home-main, .home-side { display: contents; }
/* Boxes a profession's cards fill in later take no room while empty. */
.home-main > :empty, .home-side > :empty { display: none; }
/* Up next and Needs attention: lists with a slim head, one line a row. */
.card.flush.sched, .card.flush.attention { padding: 0; gap: 0; }
/* Counsellors have their own list of today's sessions (with check-in scores): no second list. */
.home-main:has(.tp-today) .sched { display: none; }
.sched-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 6px; }
.sched-head .h2 { font-size: 16px; margin: 0; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--violet-ink); text-decoration: none; cursor: pointer; }
.sched-list, .attn-list { display: flex; flex-direction: column; padding: 2px 6px 6px; }
.sched-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.sched-row + .sched-row { border-top: 1px solid var(--line-soft, var(--line)); }
.sched-row:hover { background: var(--panel, var(--bg)); }
.sched-row > svg { color: var(--muted); }
.sched-time { font-weight: 650; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.sched-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sched-who b { font-size: 14.5px; font-weight: 600; }
.sched-who .muted { font-size: 13px; }
.sched-staff { max-width: 120px; font-size: 12px; }
.sched .empty { padding: 14px 16px 18px; color: var(--muted); }
.sched-more { display: block; padding: 10px 16px 14px; font-size: 13.5px; font-weight: 600; color: var(--violet-ink); text-decoration: none; }
.attention .banner { min-height: 44px; padding: 8px 10px; gap: 10px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; font-size: 14.5px; }
.attention .banner + .banner { border-top: 1px solid var(--line-soft, var(--line)); border-radius: 0; }
.attention .banner:hover { background: var(--panel, var(--bg)); border-radius: 10px; }
.attention .banner b { font-weight: 600; font-size: 14.5px; }
.attention .banner .n { flex: none; min-width: 30px; height: 26px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px;
  font-family: var(--body); font-size: 13.5px; font-weight: 700; background: color-mix(in srgb, var(--tint-ink, var(--ink)) 10%, transparent); }
.attention .banner > svg:first-child { width: 20px; height: 20px; flex: none; color: var(--muted); }
.attention .banner > svg:last-child { width: 16px; height: 16px; flex: none; color: var(--muted); }
.attention .banner.urgent { background: var(--red-soft); }
.attention:not(.all) .attn-list > .banner:nth-child(n+5) { display: none; }
.attention .attn-more { display: block; padding: 4px 16px 14px; }
.attention .banner.urgent .n { background: color-mix(in srgb, var(--red) 14%, transparent); }

/* Tablets: a wider column, the same bottom bar */
@media (min-width: 700px) and (max-width: 1023px) {
  .app #shell { max-width: 760px; }
  #tabbar { width: min(560px, calc(100% - 36px)); }
  .confirm-bar { width: min(560px, calc(100% - 36px)); }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sheet { max-width: 640px; }
}

/* Laptops and desktops: a sidebar instead of the bottom bar, wide content, panels as centred windows */
@media (min-width: 1024px) {
  body.app { background: var(--bg); }
  .app #shell { max-width: none; margin: 0; box-shadow: none; padding: 0 0 96px 248px; } /* the Ask button sits bottom right */
  #tabbar { left: 0; top: 0; bottom: 0; transform: none; width: 248px; height: auto; border-radius: 0; background: var(--card); border-right: 1px solid var(--line);
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px; padding: 18px 12px 14px; overflow-y: auto; }
  .side-only { display: flex !important; }
  #tabbar a { width: auto; height: 42px; flex-shrink: 0; justify-content: flex-start; gap: 12px; padding: 0 12px; border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 600; }
  #tabbar a .lbl, #tabbar a:not(.on) .lbl { display: inline; }
  #tabbar a:hover { background: var(--bg); color: var(--ink); }
  #tabbar a.on { width: auto; padding: 0 12px; background: var(--violet-soft); color: var(--violet-ink); font-weight: 600; }
  #tabbar a.fab, #tabbar a.fab.on { order: -1; width: auto; height: 46px; margin: 6px 0 14px; padding: 0 16px; justify-content: center; border-radius: 999px; background: var(--violet); color: #fff; font-weight: 600; }
  #tabbar a.fab .lbl { display: inline; }
  #tabbar a.fab:hover { background: var(--violet-deep); color: #fff; }
  .side-brand { order: -2; align-items: center; gap: 10px; padding: 2px 8px 10px; }
  .side-brand img { border-radius: 9px; flex-shrink: 0; }
  .side-brand b { font-family: var(--display); font-size: 15px; display: block; }
  .side-gap { height: 1px; background: var(--line); margin: 10px 8px; flex-shrink: 0; }
  .side-fill { flex: 1; min-height: 12px; }
  #tabbar a.side-me { height: 56px; gap: 10px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
  #tabbar a.side-me b { font-size: 13px; display: block; }
  /* Sidebar groups: a heading that opens and closes its links */
  .side-group.side-only { display: block !important; flex-shrink: 0; }
  .side-group summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; border-radius: 10px;
    font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .side-group summary::-webkit-details-marker { display: none; }
  .side-group summary::after { content: ''; width: 6px; height: 6px; margin-right: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
  .side-group[open] summary::after { transform: rotate(45deg); }
  .side-group summary:hover { color: var(--ink); }
  .side-group > a { margin-top: 2px; }

  .scr { max-width: 1120px; margin: 0 auto; padding: 32px 40px 24px; gap: 18px; }
  .title { font-size: 32px; }
  .chips, .hscroll { margin: 0; padding: 0; }
  .chips { flex-wrap: wrap; overflow: visible; }
  .hscroll { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); overflow: visible; }
  .next-card { flex: none; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .tile, .banner, .list-item, .next-card, .cal-day, .chip, .btn { cursor: pointer; }
  .tile:hover, .next-card:hover, a.banner:hover, button.banner:hover { border-color: var(--panel-line); }
  a.list-item:hover, button.list-item:hover { background: color-mix(in srgb, var(--panel) 60%, transparent); }
  .profile-head { padding: 24px max(40px, calc((100% - 1120px) / 2 + 40px)); }
  #screen[data-width="narrow"] .scr { max-width: 840px; }
  #screen[data-width="narrow"] .profile-head { padding: 24px max(40px, calc((100% - 840px) / 2 + 40px)); }
  .profile-body { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 40px 24px; }
  .profile-body.two { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
  .profile-body.two[data-cols="1"] { grid-template-columns: minmax(0, 1fr); }
  .file-tabs { width: 100%; max-width: 1040px; margin: 4px auto 6px; padding: 0; }
  .plan-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); align-items: stretch; }
  .plan-grid .plan-card .btn.full { margin-top: auto; }
  .seg { max-width: 440px; }

  .home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
  .home-main, .home-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .home-side .hscroll { grid-template-columns: 1fr; }
  .home-side .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-main .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .sheet-bg { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; max-height: 88vh; border-radius: 14px; padding: 20px 24px 24px; box-shadow: 0 24px 60px rgba(17, 26, 25, .22); }
  .sheet .grip { display: none; }
  @keyframes slide-up { from { transform: translateY(12px); opacity: 0; } }

  .confirm-bar { left: calc(248px + (100% - 248px) / 2); width: min(520px, calc(100% - 248px - 80px)); bottom: 28px !important; }
  .toast { left: calc(248px + (100% - 248px) / 2); bottom: 32px; }
}
@media (min-width: 1440px) {
  .app #shell { padding-left: 272px; }
  #tabbar { width: 272px; padding-left: 16px; padding-right: 16px; }
  .confirm-bar { left: calc(272px + (100% - 272px) / 2); }
  .toast { left: calc(272px + (100% - 272px) / 2); }
}
#loadbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--violet); z-index: 70; opacity: 0; transition: opacity .2s; pointer-events: none; }
#loadbar.on { opacity: 1; animation: loading 1.2s ease-out forwards; }
@keyframes loading { from { width: 0; } to { width: 85%; } }

/* WhatsApp messages on the file, and the ready-made message chips */
.msg-row { display: flex; flex-direction: column; gap: 3px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.msg-text { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sheet .quick .chip { white-space: normal; text-align: left; line-height: 1.3; padding: 7px 11px; color: var(--ink); }

.link-btn { align-self: flex-start; border: none; background: none; padding: 0; color: var(--violet-ink); font-weight: 600; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Calendar: arrows either side of the week */
.week-nav { display: flex; align-items: center; gap: 6px; }
/* The calendar's slim bar: who's off on the left, the view switch on the right. */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.cal-note { font-size: 13px; font-weight: 600; color: var(--red); }
.seg.sm { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; }
.seg.sm button { min-height: 28px; padding: 0 12px; border-radius: 7px; font-size: 13px; white-space: nowrap; }
@media (min-width: 1024px) {
  /* Monitors: the week as one slim row of day pills. */
  .week-nav > .icon-btn { height: 40px; width: 36px; border-radius: 10px; }
  .cal-day { flex-direction: row; justify-content: center; gap: 7px; height: 40px; padding: 0 8px; }
  .cal-day b { font-size: 15px; }
  .cal-day .wd { font-size: 12px; }
}
.week-nav > .icon-btn { width: 36px; height: 56px; border-radius: 12px; border: 1px solid var(--line); flex-shrink: 0; }
.cal-day.past:not([aria-pressed="true"]) { opacity: .7; }
@media (max-width: 380px) { .week-nav > .icon-btn { width: 28px; } .week-nav { gap: 4px; } .cal-days { gap: 4px; } }
.cal-actions .btn { white-space: nowrap; }
@media (max-width: 520px) { .wide-only { display: none; } }

/* Calendar: breaks and blocked time, and the chip's remove cross */
.cal-col { cursor: copy; }
.cal-off { position: absolute; left: 0; right: 0; border-radius: 10px; border: 1px dashed var(--faint); padding: 4px 9px; text-align: left; font-size: 11px; color: var(--muted);
  background: repeating-linear-gradient(135deg, var(--tile) 0 8px, var(--line-soft) 8px 16px); display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.cal-off b { font-size: 12px; color: var(--muted); }
.chip-x { border: none; background: none; padding: 0 0 0 4px; font-size: 16px; line-height: 1; color: var(--muted); cursor: pointer; }

/* Team: seven day circles, Monday first. Coloured = working, grey = day off */
.week-dots { display: flex; gap: 8px; flex-wrap: wrap; }
.week-dots .dot { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 650; border: 1px solid var(--line); background: var(--tile); color: var(--faint); padding: 0; }
.week-dots .dot.closed { opacity: .45; }
.week-dots button.dot { cursor: pointer; }
.week-dots button.dot:hover { border-color: var(--faint); }
@media (max-width: 380px) { .week-dots { gap: 5px; } .week-dots .dot { width: 32px; height: 32px; } }
.pay-box { background: var(--bg); border-radius: 12px; padding: 4px 12px; }
.pay-box .kv:first-child { border-top: none; }
.team-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.sugg { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: -4px; }
.sugg-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: none; border-bottom: 1px solid var(--line-soft); background: var(--card); text-align: left; color: var(--ink); cursor: pointer; }
.sugg-row:last-child { border-bottom: none; }
.sugg-row:hover { background: var(--bg); }
.sugg-row .avatar { width: 34px; height: 34px; font-size: 12px; }

/* Getting started on Home */
.gs-step { display: flex; align-items: center; gap: 12px; padding: 8px 0; border: none; border-top: 1px solid var(--line-soft); background: none; text-align: left; color: var(--ink); text-decoration: none; width: 100%; cursor: pointer; }
.gs-tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 650; flex-shrink: 0; color: #fff; }
.gs-step.done .gs-tick { background: var(--mint); border-color: var(--mint); }
.gs-tick.wait { border-color: var(--yellow); color: var(--yellow-ink); background: var(--yellow-soft); }
.gs-step.done b { color: var(--muted); font-weight: 600; }

/* A place a link pointed to: a short glow so the eye finds it */
.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--violet-light); } 100% { box-shadow: 0 0 0 3px transparent; } }
/* ---------- Plans and check-ins ---------- */
.plans-box { gap: 14px; }
.pc-chart { width: 100%; }
.pc-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.pc-line { fill: none; stroke: var(--violet); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.pc-dot { fill: var(--card); stroke: var(--violet); stroke-width: 2; }
.pc-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.pc-label { fill: var(--muted); font-size: 11px; font-family: var(--body); }
.missed-pill { background: var(--orange-soft); color: var(--orange-ink); font-size: 12px; }
.plan-line { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.plan-older summary { font-size: 13px; font-weight: 600; color: var(--violet-ink); cursor: pointer; }
.meal-block { padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.meal-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 40px; gap: 6px; align-items: center; }
.meal-row .input { min-height: 44px; }
.icon-btn.sm-x { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); font-size: 20px; color: var(--muted); }
.ex-block { padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.ex-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ex-nums .field { font-size: 11px; }
.ex-nums .field input { min-height: 44px; padding: 0 8px; text-align: center; }
.series-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.series-list li { padding: 6px 10px; border-radius: 10px; background: var(--bg); }
.series-list li.ok { box-shadow: inset 3px 0 0 var(--mint); }
.series-list li.skip { color: var(--muted); box-shadow: inset 3px 0 0 var(--line); }
.series-list li.bad { color: var(--red); box-shadow: inset 3px 0 0 var(--red); }
/* ---------- Queue and bills ---------- */
/* Walk-in queue: each doctor with "Call next", then Waiting, With doctor and Done (side by side on wide screens). */
.fq-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.fq-doc { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.fq-board { display: flex; flex-direction: column; gap: 18px; }
.fq-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fq-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.fq-card.on { border-color: var(--violet); box-shadow: inset 4px 0 0 var(--violet); }
.fq-card.done { opacity: .8; }
.fq-token { min-width: 48px; height: 48px; padding: 0 8px; border-radius: 10px; background: var(--violet-soft); color: var(--violet-ink); font-family: var(--display); font-size: 22px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fq-card.on .fq-token { background: var(--violet); color: var(--card); }
.fq-actions { display: flex; gap: 8px; margin-left: auto; }
.fq-big { font-family: var(--display); font-size: 72px; font-weight: 650; line-height: 1; color: var(--violet); }
@media (max-width: 420px) { .fq-actions { width: 100%; } .fq-actions .btn { flex: 1; } }
/* Home's waiting room card: each person sits on white inside the panel, and what they're booked for (with
   the doctor) wraps to a second line instead of being cut off. */
.card .fq-card { background: var(--card); }
.fq-card .grow > .small.muted.ellipsis { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (min-width: 1024px) {
  .fq-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .fq-col .fq-actions { width: 100%; }
  .fq-col .fq-actions .btn { flex: 1; }
}
/* A bill's lines: item, quantity, price, remove. */
.fb-line { display: grid; grid-template-columns: minmax(0, 1fr) 64px 96px 40px; gap: 6px; align-items: center; }
.fb-line .input { min-height: 44px; padding: 0 10px; min-width: 0; width: 100%; }
.fb-head { font-size: 12px; font-weight: 600; color: var(--muted); }
.fb-x { width: 40px; height: 40px; font-size: 22px; border: 1px solid var(--line); }
.fb-sums { display: flex; flex-direction: column; gap: 6px; background: var(--bg); border-radius: 12px; padding: 12px 14px; }
/* Clinics: who did each bill line ("Done by"), under the line. */
.fb-doc { min-height: 36px; padding: 0 10px; font-size: 13px; color: var(--muted); width: 100%; }
@media (max-width: 380px) { .fb-line { grid-template-columns: minmax(0, 1fr) 50px 78px 36px; } .fb-x { width: 36px; height: 36px; } }
/* ---------- Dental: tooth chart, treatment plan, estimate page ---------- */
.tooth-wrap { overflow-x: auto; padding: 4px 0; scrollbar-width: thin; }
.tooth-chart { position: relative; margin: 0 auto; flex-shrink: 0; }
.tooth { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; border-radius: 10px 10px 13px 13px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-family: var(--body); font-weight: 650; line-height: 1; cursor: pointer; }
.tooth .tn { font-size: 12px; }
.tooth .tm { font-size: 9px; margin-top: 2px; }
/* On the chart the box is sized from the card's width (pwa.js archLayout sets the sizes). The number, with the
   condition code under it when there is one, is centred both ways; the ✓ (done here) and P (planned) sit in the
   bottom corners, out of the flow, so they never move the number. */
.tooth-chart .tooth { width: var(--tw); height: var(--th); justify-content: center; align-items: center; gap: 2px; padding: 0; border-radius: var(--tr); }
.tooth-chart .tooth .tn, .tooth-chart .tooth .tm { display: block; line-height: 1; margin: 0; text-align: center; }
.tooth-chart .tooth .tn { font-size: var(--tn); font-weight: 700; }
.tooth-chart .tooth .tm { font-size: var(--tc); font-weight: 700; }
.tooth:hover { border-color: var(--violet-light); }
.tooth.sel { box-shadow: inset 0 0 0 2.5px var(--violet); }
.tooth.c-caries { background: var(--orange-soft); border-color: var(--orange); color: var(--orange-ink); }
.tooth.c-filled { background: var(--sky-soft); border-color: var(--sky); color: var(--sky-ink); }
.tooth.c-root_canal { background: var(--pink-soft); border-color: var(--pink); color: var(--pink-ink); }
.tooth.c-crown { background: var(--yellow-soft); border: 2.5px solid var(--yellow); color: var(--yellow-ink); }
.tooth.c-missing { background: transparent; border-style: dashed; border-color: var(--muted); color: var(--muted); }
.tooth.c-implant { background: var(--mint-soft); border-color: var(--mint); color: var(--mint-ink); }
.tooth.c-bridge { background: var(--violet-soft); border-color: var(--violet); color: var(--violet-ink); }
.tooth.c-to_extract { background: var(--red); border-color: var(--red); color: var(--card); }
.tooth.c-mobile { background: var(--card); border: 2px dashed var(--orange); color: var(--orange-ink); }
.tooth.c-fractured { background: var(--pink); border-color: var(--pink-ink); color: var(--card); }
.tooth.c-deep_caries { background: var(--orange); border-color: var(--orange-ink); color: var(--orange-text); }
.tooth.c-abscess { background: var(--red-soft); border: 2px solid var(--red); color: var(--red); }
.tooth.c-impacted { background: var(--tile); border: 2px dotted var(--muted); color: var(--ink); }
.tooth.c-retained_root { background: var(--card); border: 2px solid var(--red); color: var(--red); }
.tooth.c-attrition { background: var(--yellow-soft); border: 1.5px dashed var(--yellow-ink); color: var(--yellow-ink); }
.tooth.c-sensitive { background: var(--sky-soft); border: 1.5px dashed var(--sky); color: var(--sky-ink); }
/* Planned treatment: a dashed orange ring and a dot; done here: a green dot (a tick on bigger screens). Never colour
   alone: the tooth's label says it too. The ring and dots stay inside the tooth's own box, so nothing touches the next tooth. */
.tooth.planned::after { content: ''; position: absolute; inset: 2px; border: 2px dashed var(--orange); border-radius: inherit; pointer-events: none; }
.tooth .tp, .tooth .td { position: absolute; top: 2px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 800; line-height: 1; z-index: 1; }
.tooth-chart .tooth .tp, .tooth-chart .tooth .td { top: auto; bottom: 1.5px; width: var(--tb); height: var(--tb); font-size: calc(var(--tb) * .64); box-shadow: 0 0 0 1.5px var(--card); } /* a white edge keeps them clear on coloured teeth */
.tooth-chart .tooth .tp { right: 1px; } .tooth-chart .tooth .td { left: 1px; }
.tooth .tp { right: 2px; background: var(--orange); color: var(--orange-text); }
.tooth .td { left: 2px; background: var(--mint-ink); color: #fff; }
.tooth.sw { position: static; width: 28px; height: 22px; border-radius: 7px; font-size: 9px; flex-shrink: 0; cursor: default; }
.tooth.sw.planned, .tooth.sw.done-here { position: relative; }
.tooth.sw .tp, .tooth.sw .td { position: static; width: 14px; height: 14px; font-size: 9px; }
.tooth.sw.planned::after { inset: 1px; border-radius: 6px; }
.tc-label { position: absolute; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
.tc-side { position: absolute; font-size: 11px; font-weight: 600; color: var(--muted); pointer-events: none; }
.tc-mid { position: absolute; left: 50%; border-left: 1.5px dashed var(--line); }
/* The legend: a table of equal cells (badge + label), 2 across on a phone, more on wider cards. */
.tooth-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); border-top: 1px solid var(--line-soft); }
.tl-head { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.tl-key { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 6px; border-bottom: 1px solid var(--line-soft); font-size: 12px; font-weight: 600; color: var(--muted); }
.tl-key > span:last-child { min-width: 0; overflow-wrap: anywhere; }
/* Tooth history: tooth | what · surfaces | date · who, in aligned columns. */
.th-list { display: flex; flex-direction: column; }
.th-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(72px, auto); align-items: start; gap: 4px 12px; padding: 9px 4px; border-top: 1px solid var(--line); font-size: 14px; }
.th-row.no-tooth { grid-template-columns: minmax(0, 1fr) minmax(72px, auto); }
.th-row .th-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.th-row .th-when { text-align: right; font-size: 12px; color: var(--muted); line-height: 1.35; }
.th-row .tooth.sw { margin-top: 1px; }
/* Picking a condition or surfaces: equal tap targets in a grid. */
.cond-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.surf-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; max-width: 320px; }
.surf-grid .chip { justify-content: center; min-height: 44px; }
.cond-btn { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-align: left; font-weight: 600; font-size: 14px; cursor: pointer; }
.cond-btn.on { border-color: var(--violet); background: var(--violet-soft); color: var(--violet-ink); }
.plan-meter { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.plan-meter > span { display: block; height: 100%; background: var(--mint); border-radius: 999px; }
.plan-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px 0; border: none; border-top: 1px solid var(--line); background: none; color: var(--ink); text-align: left; cursor: pointer; }
.plan-item:first-child { border-top: none; }
.plan-item.done b.ellipsis { color: var(--muted); }
.pi-teeth { min-width: 48px; max-width: 96px; padding: 6px 8px; border-radius: 10px; background: var(--bg); font-size: 12px; font-weight: 650; text-align: center; flex-shrink: 0; overflow-wrap: anywhere; }
.plan-item.not-chosen, .pi-opt.not-chosen { opacity: .5; }
.pi-opt { display: flex; align-items: center; gap: 8px; padding: 10px 0 4px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 650; color: var(--violet-ink); }
.pi-opt:first-child { border-top: none; }
.pi-opt.chosen { color: var(--mint-ink); }
.pi-status.s-proposed { background: var(--bg); color: var(--muted); }
.pi-status.s-accepted { background: var(--sky-soft); color: var(--sky-ink); }
.pi-status.s-in_progress { background: var(--yellow-soft); color: var(--yellow-ink); }
.pi-status.s-done { background: var(--mint-soft); color: var(--mint-ink); }
.est-status { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; background: var(--tint, var(--bg)); color: var(--tint-ink, var(--muted)); }
.price-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px 52px auto 24px; gap: 6px; align-items: center; }
.price-row .input { padding-left: 8px; padding-right: 8px; min-width: 0; }
.price-row.head { margin-bottom: -4px; }
.pr-tooth { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
@media (max-width: 380px) { .price-row { grid-template-columns: minmax(0, 1fr) 68px 44px 24px; } .price-row .pr-tooth, .price-row.head > :nth-child(4) { display: none; } }
/* The estimate page a patient opens from WhatsApp (it loads this stylesheet). */
.est-page { background: var(--bg); }
.est-wrap { max-width: 520px; margin: 0 auto; padding: 16px; }
.est-card { gap: 14px; padding: 22px 18px; }
.est-card form { margin: 0; }
.est-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.est-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; padding: 6px 4px; }
.est-table td { padding: 10px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.est-table .r { text-align: right; white-space: nowrap; }
/* Payouts, reports and lab statements (public/money.js): the same table, a little smaller. */
.mn-table { font-size: 14px; min-width: 420px; }
.mn-table td { padding: 8px 4px; }
/* A short table (the waiting times) fits a phone as it is, without scrolling sideways. */
.mn-fit .mn-table { min-width: 0; }
.mn-fit .mn-table th { white-space: normal; vertical-align: bottom; }
.est-total td { font-family: var(--display); font-size: 19px; font-weight: 650; }
.est-done { background: var(--mint-soft); color: var(--mint-ink); border-radius: 10px; padding: 14px; font-weight: 600; }
.est-note { background: var(--yellow-soft); color: var(--yellow-ink); border-radius: 10px; padding: 14px; font-weight: 600; }
/* ---------- Expenses, stock and lab work ---------- */
.bo-line { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.bo-line .bo-amt { font-weight: 600; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bo-line.total { font-weight: 650; }
.bo-line.big { font-family: var(--display); font-size: 18px; border-top: 2px solid var(--ink); }
.bo-line.neg .bo-amt, .bo-neg { color: var(--red); }
.bo-chart svg { display: block; overflow: visible; width: 100%; max-width: 420px; margin: 0 auto; }
.bo-chart .bo-bar-in { fill: var(--violet); }
.bo-chart .bo-bar-out { fill: var(--orange); }
.bo-chart .bo-base { stroke: var(--line); stroke-width: 1; }
.bo-chart .bo-hit { fill: transparent; cursor: pointer; }
.bo-chart .bo-month.on .bo-hit { fill: var(--violet-soft); }
.bo-chart text { font-family: var(--body); fill: var(--muted); }
.bo-chart .bo-chart-month { font-size: 11px; font-weight: 600; }
.bo-chart .bo-month.on .bo-chart-month { fill: var(--violet-ink); }
.bo-chart .bo-chart-profit { font-size: 10px; font-weight: 600; fill: var(--mint-ink); }
.bo-chart .bo-chart-profit.neg { fill: var(--red); }
.bo-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.bo-key.in { background: var(--violet); }
.bo-key.out { background: var(--orange); }
.pill.bo-low { background: var(--yellow-soft); color: var(--yellow-ink); flex-shrink: 0; }
.pill.bo-overdue { background: var(--red); color: var(--card); }
.bo-big-qty { font-family: var(--display); font-size: 30px; font-weight: 650; line-height: 1; }
.bo-results:empty { display: none; }
.bo-results { padding: 0; }
.bo-chosen { border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 14px; background: var(--card); }
.bo-case.overdue { box-shadow: inset 4px 0 0 var(--red); }
/* WhatsApp assistant: the Settings card, the Home tip, and Ask (the same assistant inside the app) */
.asst-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.asst-examples .chip { white-space: normal; font-weight: 600; background: var(--bg); }
.ask-fab { position: fixed; right: max(18px, calc(50% - 222px)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 78px); z-index: 19; width: 54px; height: 54px; border-radius: 50%;
  border: none; background: var(--violet); color: var(--card); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 22px color-mix(in srgb, var(--ink) 22%, transparent); }
.ask-fab:hover { background: var(--violet-deep); }
body:has(.confirm-bar) .ask-fab, html.sheet-open .ask-fab { display: none; }
@media (min-width: 1024px) { .ask-fab { right: 28px; bottom: 28px; } }
/* Room under the last thing on a screen, so scrolling to the end always clears the Ask button. */
.app #shell { padding-bottom: calc(168px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { .app #shell { padding-bottom: 100px; } }
.ask-sheet { gap: 10px; }
@media (min-width: 1024px) { .ask-sheet { height: 80vh; } }
.ask-log { display: flex; flex-direction: column; gap: 8px; min-height: 220px; max-height: 52vh; overflow-y: auto; padding: 4px 2px; flex: 1; }
.ask-empty { padding: 12px 4px; }
.ask-bubble { max-width: 88%; border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; gap: 8px; }
.ask-bubble.me { align-self: flex-end; background: var(--violet); color: var(--card); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.ask-bubble.bot { align-self: flex-start; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.ask-text { white-space: pre-wrap; word-break: break-word; }
.ask-typing { flex-direction: row; gap: 4px; padding: 14px 16px; }
.ask-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: ask-dot 1s infinite ease-in-out; }
.ask-typing span:nth-child(2) { animation-delay: .15s; } .ask-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ask-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ask-typing span { animation: none; opacity: .6; } }
.ask-card { display: flex; flex-direction: column; gap: 6px; background: var(--bg); border-radius: 10px; padding: 10px; border: none; color: var(--ink); width: 100%; }
.ask-row { display: flex; flex-direction: row; align-items: center; gap: 10px; border: none; background: var(--card); border-radius: 10px; padding: 8px 10px; text-align: left; color: var(--ink); cursor: pointer; width: 100%; font: inherit; }
.ask-card.ask-row { background: var(--bg); }
.ask-row:hover { background: var(--violet-soft); }
.ask-time { min-width: 62px; font-size: 13px; }
.ask-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ask-rx { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.ask-confirm ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; white-space: pre-wrap; }
.ask-warn { color: var(--red); font-weight: 650; font-size: 13px; background: var(--card); border-left: 4px solid var(--red); border-radius: 6px; padding: 6px 8px; }
.ask-choices, .ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
.ask-chips::-webkit-scrollbar { display: none; }
.ask-chips .chip, .ask-choices .chip { font-weight: 600; }
.ask-bar { gap: 8px; align-items: flex-end; position: sticky; bottom: 0; background: var(--bg); padding-top: 4px; }
.ask-input { flex: 1; min-height: 46px; max-height: 120px; resize: none; padding: 12px 14px; }
.ask-mic { background: var(--card); border: 1px solid var(--line); }
.ask-mic.on { background: var(--red); color: var(--card); border-color: var(--red); }
.ask-send { min-height: 46px; }
#tabbar a.ask-side { color: var(--violet-ink); font-weight: 600; }
/* ---------- Posts and growth ---------- */
.post-preview { display: flex; justify-content: center; }
.post-canvas { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.post-preview.tall .post-canvas { width: auto; max-width: 100%; max-height: 72vh; }
.post-designs { display: flex; gap: 10px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 6px; scrollbar-width: none; }
.post-designs::-webkit-scrollbar { display: none; }
.post-design { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px; border-radius: 12px; border: 2px solid transparent; background: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.post-design canvas { width: 84px; height: 84px; border-radius: 12px; display: block; border: 1px solid var(--line); }
.post-design.on { border-color: var(--violet); color: var(--violet-ink); }
.post-idea { flex: 0 0 180px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; cursor: pointer; color: var(--ink); }
.post-idea b { font-size: 14px; line-height: 1.3; }
.post-thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--violet-soft); border: 1px solid var(--line); }
.pill.gr-ok { background: var(--mint-soft); color: var(--mint-ink); }
.pill.gr-wait { background: var(--yellow-soft); color: var(--yellow-ink); }
.input.gr-amt { width: 110px; flex-shrink: 0; }
.gr-logo { width: 64px; height: 64px; border-radius: 12px; object-fit: contain; background: var(--card); border: 1px solid var(--line); }
.gift-code { font-family: ui-monospace, monospace; letter-spacing: .5px; }
.seg.seg3 { grid-template-columns: 1fr 1fr 1fr; }
.wa-img { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.post-thumb-text { display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 650; color: var(--violet-ink); }
.chips.wrap-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.gr-pick { max-height: 320px; overflow-y: auto; }
.list-item.faded { opacity: .55; }
.gr-wa-small .wa { padding: 10px; }
.gr-wa-small .wa-img { max-height: 200px; }
/* ---------- Forms, consent and contacts ----------
   The patient's form and consent pages (form.html, consent.html), the printable signed consent,
   and their cards in the dashboard. Colours come only from the variables at the top. */
.paper-body { background: var(--bg); }
.paper-page { max-width: 560px; margin: 0 auto; padding: 20px 16px calc(40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.paper-head { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px 6px; }
.paper-head .title { font-size: 26px; }
.paper-q { display: flex; flex-direction: column; gap: 10px; }
.paper-q > b { font-size: 16px; line-height: 1.35; color: var(--ink); }
.paper-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.paper-opts .chip { min-height: 44px; padding: 0 16px; font-size: 15px; font-weight: 600; white-space: normal; text-align: left; }
.paper-opts .chip.on { color: var(--card); }
.paper-scale { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.paper-scale .chip { justify-content: center; min-height: 46px; font-size: 16px; }
.paper-unit { display: flex; align-items: center; gap: 10px; }
.paper-unit .input { max-width: 160px; }
.paper-done { text-align: center; align-items: center; padding: 28px 18px; gap: 12px; }
.paper-done .paper-tick { width: 56px; height: 56px; font-size: 28px; }
.paper-tick { width: 26px; height: 26px; border-radius: 50%; background: var(--mint); color: var(--card); display: inline-flex; align-items: center; justify-content: center; font-weight: 650; flex-shrink: 0; }
.paper-private { display: flex; gap: 8px; align-items: flex-start; }
.consent-text { white-space: pre-wrap; line-height: 1.6; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; margin: 6px 0 4px; }
.paper-agree { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 16px; min-height: 48px; cursor: pointer; }
.paper-agree input[type="checkbox"] { width: 26px; height: 26px; flex-shrink: 0; }
.sig-pad { position: relative; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--card); height: 190px; touch-action: none; overflow: hidden; }
.sig-pad.signed { border-style: solid; border-color: var(--violet); }
.sig-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sig-pad .sig-hint { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; color: var(--muted); font-size: 14px; pointer-events: none; border-top: 1px solid var(--line); margin: 0 22px; padding-top: 6px; }
.sig-pad.signed .sig-hint { visibility: hidden; }
.sig-img { max-width: 280px; width: 100%; height: auto; display: block; border-bottom: 1px solid var(--ink); }
/* The printable signed copy */
.paper-bar { display: flex; justify-content: flex-end; }
.paper-doc { display: flex; flex-direction: column; gap: 8px; padding: 22px; }
.paper-doc-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--violet); padding-bottom: 12px; }
.paper-doc-meta { text-align: right; }
.paper-doc-title { font-family: var(--display); font-size: 22px; margin: 10px 0 2px; }
.paper-sign { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.paper-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--yellow-soft); color: var(--yellow-text); font-weight: 600; font-size: 14px; }
@media print { .paper-bar { display: none; } .paper-body { background: var(--card); } .paper-page { padding: 0; max-width: none; } .paper-doc { border: none; padding: 0; } }
/* In the dashboard: the card in the patient file, and the line on a booking */
.paper-card .paper-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.paper-card .paper-row.first { border-top: none; }
.paper-card .paper-row.faded { opacity: .55; }
.paper-answers { display: flex; flex-direction: column; background: var(--bg); border-radius: 12px; padding: 2px 12px; }
.paper-answers .kv:first-child { border-top: none; }
.paper-status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.paper-status.ok { background: var(--mint-soft); color: var(--mint-ink); }
.paper-status.wait { background: var(--yellow-soft); color: var(--yellow-ink); }
.paper-status.off { background: var(--bg); color: var(--muted); }
.paper-q-edit { display: flex; flex-direction: column; gap: 10px; }
.contact-list { display: flex; flex-direction: column; max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.contact-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.contact-row:last-child { border-bottom: none; }
.contact-row.existing { cursor: default; opacity: .6; }
.contact-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ---------- Clinics and branches ---------- */
/* The clinic switcher at the top of Home: small on phones, the name and a down arrow. */
.clinic-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: -4px; }
.clinic-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; max-width: 100%; min-width: 0; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; }
.clinic-switch > span[aria-hidden]:first-child { color: var(--violet); flex-shrink: 0; }
.clinic-all { flex-shrink: 0; font-size: 14px; font-weight: 600; text-decoration: none; min-height: 38px; display: inline-flex; align-items: center; }
.cl-down { display: inline-flex; flex-shrink: 0; color: var(--muted); transform: rotate(90deg); }
/* In the sidebar the clinic's name is a button that opens the list. */
.clinic-switch-side { font: inherit; color: var(--ink); text-align: left; background: none; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px !important; margin-bottom: 8px; }
.clinic-switch-side:hover { background: var(--bg); }
.clinic-pick[aria-current="true"] b { color: var(--violet-ink); }
.pill.cl-here { background: var(--violet-soft); color: var(--violet-ink); flex-shrink: 0; }
.pill.cl-warn { background: var(--yellow-soft); color: var(--yellow-ink); flex-shrink: 0; }
.pill.cl-flag { background: var(--orange-soft); color: var(--orange-ink); }
.pill.cl-in { background: var(--mint-soft); color: var(--mint-ink); white-space: normal; }
.pill.cl-off { background: var(--card); color: var(--muted); border: 1px solid var(--line); white-space: normal; }
/* All clinics: a card for each, two or three across on wide screens. */
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
button.cl-card { width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer; gap: 12px; container-type: inline-size; }
.cl-card.here { box-shadow: inset 0 0 0 1.5px var(--violet); }
.cl-name { font-size: 16px; }
/* Four figures side by side when the card is wide enough, two by two when it isn't. */
.cl-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cl-stats .stat { padding: 10px 12px; }
.cl-stats .stat b { font-size: 18px; white-space: nowrap; }
@container (min-width: 440px) { .cl-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Money this month: the clinic's name on its own line on phones, beside the numbers on wider screens. */
.cl-money { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--panel-line); font-size: 14px; }
.cl-money > :first-child { grid-column: 1 / -1; }
.cl-money.head { border-top: none; padding-bottom: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.cl-money.head > :first-child { display: none; }
.cl-money.total { font-weight: 650; }
.cl-loss { color: var(--red); }
@media (min-width: 700px) {
  .cl-money { grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); }
  .cl-money > :first-child { grid-column: auto; }
  .cl-money.head > :first-child { display: block; }
}


/* ========== LOOK AND FEEL ==========
   One place for how things look: type, surfaces, buttons, fields, the menu bar and the Today panel.
   Colours come from the tokens at the top; nothing here names a brand colour. */
html, body { font-size: 15px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: 'ss01', 'cv11'; }
body { letter-spacing: -0.005em; }
.scr { padding: 22px 16px 8px; gap: 14px; }

/* Type: confident headings, quiet labels, numbers that line up */
.title { font-weight: 650; font-size: 28px; letter-spacing: -0.035em; line-height: 1.1; }
.h2 { font-weight: 620; font-size: 17px; letter-spacing: -0.02em; }
.h2.more-head { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.kicker { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.muted { color: var(--muted); }
b, strong { font-weight: 600; }
.big, .n, .price, .amt, td.num, .tile .t { font-variant-numeric: tabular-nums; }

/* Surfaces: white cards with a hairline and a soft shadow; smaller, consistent corners */
.card { border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: 16px; }
.card.flush { padding: 2px 16px; }
.tile { border-radius: 14px; box-shadow: var(--shadow-sm); min-height: 104px; }
.tile .t { font-size: 17px; font-weight: 620; letter-spacing: -0.02em; }
.tile > span[aria-hidden] { width: 36px !important; height: 36px !important; border-radius: 10px; background: var(--tile); color: var(--ink); }
.tile > span[aria-hidden] svg { width: 19px; height: 19px; }
.banner { border-radius: 12px; box-shadow: var(--shadow-sm), inset 3px 0 0 var(--stripe, transparent); }
.banner .n { font-weight: 650; font-size: 26px; letter-spacing: -0.03em; }
.list-item { border-bottom-color: var(--line-soft); min-height: 62px; }
.list-item > .avatar.sq, .list-item > span.avatar.sq { width: 38px; height: 38px; border-radius: 11px; background: var(--tile) !important; color: var(--ink) !important; }
.avatar { font-weight: 600; letter-spacing: -0.01em; }
.avatar.lg { border-radius: 18px; font-weight: 650; }
.pill { font-weight: 600; letter-spacing: .01em; }

/* The Today panel (and the website's big panels): a deep, rich surface made from the brand colour */
.hero { border-radius: 18px; padding: 22px 20px; color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--violet-light) 38%, transparent) 0%, transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--violet) 78%, #000) 0%, color-mix(in srgb, var(--violet) 46%, #050807) 100%);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, .08); }
.hero .label { font-size: 13px; font-weight: 500; letter-spacing: .01em; color: rgba(255, 255, 255, .7); }
.hero .soft { color: rgba(255, 255, 255, .74); }
.hero .big { font-weight: 650; font-size: 42px; letter-spacing: -0.045em; }
.hero .meter { height: 6px; background: rgba(255, 255, 255, .14); }
.hero .chip, .hero .chip.glass, .hero .chip.yellow { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); color: #fff; font-weight: 500; }
.hero a, .hero button:not(.btn) { color: inherit; }
.hero [style*="rgba(255, 255, 255, 0.16)"], .hero [style*="rgba(255,255,255,.16)"] { border: 1px solid rgba(255, 255, 255, .12); }

/* Buttons: soft rectangles, not pills; the main one carries a fine highlight */
.btn { border-radius: 10px; min-height: 44px; font-weight: 600; letter-spacing: -0.01em; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--violet); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(17, 26, 25, .18); }
.btn.primary:hover { background: var(--violet-deep); }
.btn.dark { background: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 2px rgba(17, 26, 25, .2); }
.btn.ghost { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: var(--card); border: 1px solid #EBC9C2; }
.btn.yellow { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.btn.mint { background: var(--mint-ink); }
.btn.full { min-height: 52px; border-radius: 12px; font-family: var(--body); font-size: 16px; font-weight: 600; }
.btn.sm { min-height: 36px; border-radius: 8px; font-size: 13px; padding: 0 12px; }
.link-btn { font-weight: 600; }
/* Beside a button, a text button lines up with it. */
.row > .link-btn { align-self: center; min-height: 36px; display: inline-flex; align-items: center; padding: 0 8px; font-size: 14px; }

/* Fields: quiet until focused */
.field { font-size: 13px; font-weight: 550; color: var(--muted); }
.input, .field input, .field select, .field textarea { min-height: 46px; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 18%, transparent); }

/* Chips: small and neutral; the chosen one in the soft brand colour */
.chip { font-weight: 550; font-size: 13px; padding: 6px 12px; box-shadow: var(--shadow-sm); }
.chip.on { background: var(--violet-soft); border-color: color-mix(in srgb, var(--violet) 35%, transparent); color: var(--violet-ink); box-shadow: none; }

/* Sheets: white, with a firm top edge */
.sheet { background: var(--card); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(17, 26, 25, .12); }
.sheet .card { box-shadow: none; background: var(--bg); }
.sheet > .btn.full:last-child, .sheet > .row:last-child:has(> .btn) { background: var(--card); }
.sheet > .btn.primary.full:last-child:not(:hover) { background: var(--violet); } /* the sheet's Save button keeps its colour */
.sheet-bg { background: rgba(10, 16, 15, .42); backdrop-filter: blur(2px); }
.sheet .grip { background: var(--line); }

/* The menu bar on phones: a light, frosted bar with labels, like the phone's own apps */
@media (max-width: 1023px) {
  #tabbar { left: 0; right: 0; transform: none; bottom: 0; width: 100%; max-width: 480px; margin: 0 auto; height: calc(64px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
    border-radius: 0; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
    border-top: 1px solid var(--line); box-shadow: 0 -1px 0 rgba(17, 26, 25, .02); justify-content: space-around; }
  #tabbar a, #tabbar a.on { width: auto; flex: 1; height: 56px; padding: 0; flex-direction: column; gap: 3px; border-radius: 12px; background: none; color: var(--muted); font-size: 10.5px; font-weight: 550; letter-spacing: 0; }
  #tabbar a .lbl, #tabbar a:not(.on) .lbl { display: block; }
  #tabbar a.on { color: var(--violet); font-weight: 650; }
  #tabbar a.fab, #tabbar a.fab.on { flex: 0 0 auto; width: 48px; height: 48px; margin: 0 6px; border-radius: 15px; background: var(--violet); color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 4px 12px color-mix(in srgb, var(--violet) 35%, transparent); }
  #tabbar a.fab .lbl { display: none; }
  .ask-fab { width: 48px; height: 48px; border-radius: 15px; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 6px 18px rgba(17, 26, 25, .22); }
  .app #shell { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
}

/* Laptops: a calmer sidebar */
@media (min-width: 1024px) {
  #tabbar { box-shadow: none; border-right: 1px solid var(--line); }
  #tabbar a { font-weight: 550; height: 38px; border-radius: 10px; }
  #tabbar a.on { background: var(--tile); color: var(--ink); font-weight: 600; }
  #tabbar a.on svg { color: var(--violet); }
  #tabbar a.fab, #tabbar a.fab.on { border-radius: 12px; height: 42px; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(17, 26, 25, .18); }
  .side-brand b { font-weight: 650; letter-spacing: -0.02em; }
  .ask-fab { border-radius: 16px; background: var(--ink); }
}

/* Focus that is easy to see, in the brand colour */
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .btn, .input, .field input { transition: none; } }
/* Salons, beauty parlours and spas: black and gold, with an elegant serif for headings and big numbers */
:root[data-theme="luxe"] {
  --violet: var(--luxe); --violet-soft: var(--luxe-soft); --violet-ink: var(--luxe-ink); --violet-deep: var(--luxe-deep); --violet-light: var(--luxe-light);
  --bg: #F6F5F2; --line: #E6E3DC; --line-soft: #EFEDE8; --tile: #F2EFE9; --ink: #141311; --muted: #67625A;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}
:root[data-theme="luxe"] .title { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: -0.02em; font-variation-settings: "opsz" 48, "SOFT" 30; }
:root[data-theme="luxe"] .hero .big { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
/* The serif's default figures sit up and down like letters (13 reads as I3): use straight, even ones. */
:root[data-theme="luxe"] .hero .big, :root[data-theme="luxe"] .title { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: 'lnum' 1, 'tnum' 1; }
:root[data-theme="luxe"] .hero .big { font-size: 44px; }
:root[data-theme="luxe"] .hero {
  background:
    radial-gradient(110% 80% at 100% 0%, color-mix(in srgb, var(--luxe-gold) 34%, transparent) 0%, transparent 58%),
    linear-gradient(165deg, #1E1B15 0%, #0B0A08 100%);
  border: 1px solid color-mix(in srgb, var(--luxe-gold) 28%, transparent); }
:root[data-theme="luxe"] .hero .label { color: color-mix(in srgb, var(--luxe-gold) 80%, #fff); letter-spacing: .08em; text-transform: uppercase; font-size: 11.5px; font-weight: 600; }
:root[data-theme="luxe"] .hero .meter > span { background: var(--luxe-light); }
:root[data-theme="luxe"] .btn.primary { background: var(--luxe); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 -1px 0 color-mix(in srgb, var(--luxe-gold) 40%, transparent), 0 1px 2px rgba(0, 0, 0, .25); }
:root[data-theme="luxe"] .btn.primary:hover { background: #000; }
:root[data-theme="luxe"] .chip.on { background: var(--luxe); color: color-mix(in srgb, var(--luxe-gold) 70%, #fff); border-color: var(--luxe); }
@media (max-width: 1023px) {
  :root[data-theme="luxe"] #tabbar a.on { color: var(--luxe-gold); }
  :root[data-theme="luxe"] #tabbar a.fab, :root[data-theme="luxe"] #tabbar a.fab.on { background: var(--luxe); color: var(--luxe-light);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 1px color-mix(in srgb, var(--luxe-gold) 45%, transparent), 0 4px 12px rgba(0, 0, 0, .25); }
  :root[data-theme="luxe"] .ask-fab { color: var(--luxe-light); box-shadow: 0 0 0 1px color-mix(in srgb, var(--luxe-gold) 45%, transparent), 0 6px 18px rgba(0, 0, 0, .25); }
}
@media (min-width: 1024px) {
  :root[data-theme="luxe"] #tabbar a.on svg { color: var(--luxe-gold); }
  :root[data-theme="luxe"] .side-brand b { font-family: var(--serif); font-size: 18px; font-weight: 600; }
}
:root[data-theme="luxe"] :focus-visible { outline-color: var(--luxe-gold); }
/* ========== end of LOOK AND FEEL ========== */

/* ========== SURFACES ==========
   A white page with soft, borderless panels instead of white boxes with outlines. Fields and
   buttons stay white with a fine line, so they stand out on a panel. */
:root { --bg: #FFFFFF; --panel: #F4F6F5; --panel-line: #E5E9E8; }
:root[data-theme="clinic"] { --bg: #FFFFFF; }
:root[data-theme="luxe"] { --bg: #FDFCFA; --panel: #F5F2EC; --panel-line: #E8E3DA; }
.card, .tile, .banner, .stat, .next-card, .tl-item, .fq-card, .fq-doc, .cal-board, .health-strip, .meal-block, .ex-block, .fb-sums, .contact-list {
  background: var(--panel); border-color: transparent; box-shadow: none; }
.banner { box-shadow: inset 3px 0 0 var(--stripe, transparent); }
.card .list-item, .card.flush .list-item { border-bottom-color: var(--panel-line); }
.list-item > .avatar.sq, .list-item > span.avatar.sq, .tile > span[aria-hidden] { background: var(--card) !important; }
.search { background: var(--panel); border-color: transparent; box-shadow: none; }
.chip { box-shadow: none; }
.card .chip:not(.on) { background: var(--card); }
.card .input, .card .field input, .card .field select, .card .field textarea { background: var(--card); }
.sheet .card { background: var(--panel); }
.cal-board { border: 1px solid var(--panel-line); background: var(--card); }
@media (min-width: 560px) { body:not(.app) #shell:not(.site) { box-shadow: none; } }

/* ---------- Fit and finish: shared fixes for every screen ---------- */
/* Numbers line up in lists, prices and times. */
#screen, .sheet, .est-page, .paper-page { font-variant-numeric: tabular-nums; }
/* Long words and names wrap inside their box instead of running out of it. */
.title, .h2, .card b, .tile .t, .banner b, .list-item b, .pick b, .kv, .sheet-text { overflow-wrap: break-word; }
.grow, .stack { min-width: 0; }
/* A picker beside a button (Package to sell + Sell) shrinks and ends its long label with "…". */
.pick-field { min-width: 0; }
.row > .pick-field { flex: 1 1 auto; width: auto; }
/* A button beside a field is the field's height, so the two line up. */
.row:has(> .input, > .pick-field) > .btn, .row:has(> .input, > .pick-field) > .link-btn { min-height: 46px; }
.btn { line-height: 1.2; text-align: center; }
/* Strips that scroll sideways (filters, ideas, designs) line up with the page edge on phones. */
@media (max-width: 1023px) {
  .chips, .hscroll, .post-designs { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .sheet .chips, .sheet .post-designs { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
}
@media (min-width: 1024px) { .post-designs { margin: 0; padding: 2px 0 6px; } }

/* Icon squares: white on the panel with a dark icon, never a tinted blob. Initials keep their colour. */
.avatar.sq:has(> span[aria-hidden] > svg) { background: var(--card) !important; color: var(--ink) !important; }
/* A thin coloured stripe on the left marks a card's state (next visit, treatment course, usual). */
.card.striped { box-shadow: inset 3px 0 0 var(--stripe, transparent); }
/* Small figures inside a panel sit on white. */
.card .stat { background: var(--card); }
.stat.due { background: var(--red-soft); }
/* A health alert stays a soft red so it is noticed. */
.health-strip:not(.empty) { background: var(--red-soft); }
.health-strip.empty { border: 1px dashed var(--panel-line); }
/* Segmented choices: soft rectangles like the buttons, and two-word labels fit. */
.seg { border-radius: 12px; }
.seg button { border-radius: 9px; line-height: 1.15; padding: 0 8px; }
.paper-opts .chip.on { color: var(--violet-ink); }
/* Chips that can wrap onto two lines (long service names, example questions) are soft rectangles, not stretched pills. */
.sheet .quick .chip, .asst-examples .chip, .paper-opts .chip { border-radius: 12px; }
/* A panel that ends "Save" then "Remove": Remove moves above Save, so Save is the last thing and stays at the bottom. */
.sheet > .btn.primary.full:has(+ .btn.danger:last-child) { order: 2; position: sticky; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 2; flex-shrink: 0;
  box-shadow: 0 14px 0 14px var(--card); }
.sheet > .btn.primary.full + .btn.danger:last-child { order: 1; }
.sheet:has(> .btn.primary.full + .btn.danger:last-child) { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
/* Arrows and small buttons inside a white panel get a fine line, so they read as buttons. */
.sheet .icon-btn { border: 1px solid var(--line); }
.sheet .card .icon-btn { border-color: transparent; }

/* Calendar: in a short visit the name gets the room first and ends with "…"; the service fills what is left. */
.cal-block .line b { flex: 0 1 auto; min-width: 0; max-width: none; }
.cal-block .line .what { flex: 1 1 0; min-width: 0; }
.cal-block .line .tag { flex-shrink: 0; }
/* Booking screen: a person's day sits edge to edge in its panel; a long name wraps, the count stays on one line. */
.card.plan { padding: 0; }
.plan-head { gap: 10px; align-items: flex-start; }
.plan-head > b { min-width: 0; }
.plan-head > .muted { flex-shrink: 0; white-space: nowrap; padding-top: 2px; }
.plan-row .grow { line-height: 1.3; }
/* The Book / Save bar sits just above the menu bar on phones, the same gap with or without a home bar. */
@media (max-width: 1023px) {
  .confirm-bar { bottom: calc(76px + env(safe-area-inset-bottom)) !important; width: min(444px, calc(100% - 32px)); }
}
@media (min-width: 700px) and (max-width: 1023px) { .confirm-bar { width: min(560px, calc(100% - 32px)); } }

/* Long business names: a smaller title rather than four lines. */
.title.long { font-size: 22px; line-height: 1.2; letter-spacing: -0.025em; }
:root[data-theme="luxe"] .title.long { font-size: 24px; }
@media (min-width: 1024px) { .title.long { font-size: 26px; } :root[data-theme="luxe"] .title.long { font-size: 28px; } }
/* Names on team, earnings and queue cards wrap to two lines instead of being cut short. */
.card > .row > .grow.stack > b.ellipsis, .fq-doc b.ellipsis {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Team: the whole name shows; its tag (You, Doctor, No login) moves under it when there is no room. */
.person-card .grow > .row { flex-wrap: wrap; row-gap: 4px; }
.person-card .grow > .row > b.ellipsis { white-space: normal; overflow: visible; }

/* Offers: who gets it. The panel look; the chosen group gets its tone and a fine ring. */
.aud-tile { min-height: 92px; padding: 14px; }
.aud-tile .t { font-size: 24px; font-weight: 650; }
.aud-tile .s { font-weight: 600; }
.aud-tile[aria-pressed="true"] { background: var(--tint); color: var(--tint-ink); box-shadow: inset 0 0 0 1.5px var(--stripe); }
.aud-tile[aria-pressed="true"] .s { color: inherit; }

/* Ask: the mic, the box and Send are one height. */
.ask-bar { align-items: flex-end; }
.ask-bar .ask-mic, .ask-bar .ask-send { height: 46px; min-height: 46px; }
.ask-bar .ask-mic { width: 46px; border-radius: 10px; }

/* Messages that pop up sit above the menu bar and the Ask button, never on them. */
@media (max-width: 1023px) {
  .toast { bottom: calc(136px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); text-align: center; border-radius: 12px; }
}

/* Tablets: the menu bar and the Ask button follow the wider column. */
@media (min-width: 700px) and (max-width: 1023px) {
  #tabbar { max-width: 760px; }
  .ask-fab { right: max(18px, calc(50% - 362px)); }
}

/* Salons, beauty parlours and spas: the team's colours are warm neutrals that sit with black and gold. */
:root[data-theme="luxe"] {
  --staff-1: #F3EBDD; --staff-1-ink: #6B5023; --staff-1-line: #C9A45C;
  --staff-2: #E8EBE3; --staff-2-ink: #3D4F35; --staff-2-line: #9DAE8F;
  --staff-3: #F3E6E2; --staff-3-ink: #74403A; --staff-3-line: #CB9D94;
  --staff-4: #ECE9E4; --staff-4-ink: #46423C; --staff-4-line: #A9A196;
  --staff-5: #EFE6DD; --staff-5-ink: #5B4232; --staff-5-line: #BC9B81;
  --staff-6: #E6E8EB; --staff-6-ink: #3A4450; --staff-6-line: #9AA4AF;
}
/* A client's name on their file is a title too: the salon serif, with even figures. */
:root[data-theme="luxe"] .profile-head .name { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: lining-nums; }
:root[data-theme="luxe"] .gs-step.done .gs-tick { background: var(--luxe); border-color: var(--luxe); color: var(--luxe-light); }
:root[data-theme="luxe"] .hero .meter { background: rgba(255, 255, 255, .12); }
/* ========== end of SURFACES ========== */

/* ---------- Clinical extras: the gum (perio) chart, one tooth per row (public/pwa.js "Clinical extras") ---------- */
.perio-head, .perio-row { display: grid; grid-template-columns: 38px repeat(3, minmax(0, 1fr)) 4px repeat(3, minmax(0, 1fr)) 40px; gap: 4px; align-items: start; }
.perio-head { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; padding-top: 8px; }
.perio-row { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.perio-row:last-child { border-bottom: none; }
.perio-tooth { display: flex; flex-direction: column; gap: 3px; font-weight: 650; font-size: 15px; padding-top: 9px; }
.perio-site { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.perio-site input { width: 100%; min-width: 0; min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); text-align: center; font-size: 16px; font-weight: 600; padding: 0; }
.perio-site input::placeholder { color: var(--faint); font-weight: 400; }
.perio-site input.deep { color: var(--red); border-color: var(--red-line); background: var(--red-soft); }
.bop { height: 18px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); padding: 0; }
.bop.on { background: var(--red); border-color: var(--red); }
.perio-mob { min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 12px; font-weight: 650; color: var(--muted); padding: 0; }
.perio-mob.on { background: var(--orange-soft); border-color: var(--orange); color: var(--orange-ink); }
.perio-v { font-size: 10px; font-weight: 650; border-radius: 6px; padding: 1px 5px; align-self: flex-start; }
.perio-v.better { background: var(--mint-soft); color: var(--mint-ink); }
.perio-v.worse { background: var(--red-soft); color: var(--red); }
.perio-v.same { background: var(--tile); color: var(--muted); }
/* ---------- Team roles and profiles ---------- */
.pill.st-in { background: var(--mint-soft); color: var(--mint-ink); }
.pill.st-leave { background: var(--yellow-soft); color: var(--yellow-ink); }
.pill.st-absent { background: var(--red-soft); color: var(--red); }
.pill.st-off, .pill.st-none { background: var(--tile); color: var(--muted); }
.team-bars svg { display: block; overflow: visible; }
.team-bars .bar { fill: var(--violet-light); }
.team-bars .bar.now { fill: var(--violet); }
.team-bars .bar-base { stroke: var(--line); stroke-width: 1; }
.team-bars .bar-v { font-size: 10px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.team-bars .bar-m { font-size: 10px; fill: var(--muted); }

/* The demo clinic: a strip across the top that says nothing is saved, with a way to start their own. */
/* The demos: a small Demo button bottom left, across from the Ask button, and its panel of demos. */
.demo-pill { position: fixed; left: max(18px, calc(50% - 222px)); bottom: calc(81px + env(safe-area-inset-bottom)); z-index: 19; /* level with the Ask button */
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px 0 13px; border: 1px solid color-mix(in srgb, #fff 14%, transparent); border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 88%, transparent); color: #fff; font-size: 13.5px; font-weight: 600; letter-spacing: .01em; cursor: pointer;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 25%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.demo-pill:hover { background: var(--ink); }
.demo-pill:focus-visible { outline: 3px solid var(--violet-light); outline-offset: 2px; }
.demo-pill svg { transform: rotate(-90deg); opacity: .8; }
.demo-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: #F5B83D; box-shadow: 0 0 0 3px color-mix(in srgb, #F5B83D 25%, transparent); }
html.sheet-open .demo-pill { display: none; }
@media (min-width: 700px) and (max-width: 1023px) { .demo-pill { left: max(18px, calc(50% - 362px)); } }
@media (min-width: 1024px) { .demo-pill { left: 276px; bottom: 36px; } }
.demo-list { display: flex; flex-direction: column; gap: 6px; }
.demo-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.demo-row:hover:not(:disabled) { border-color: var(--violet-light); background: var(--bg); }
.demo-row:disabled { cursor: default; }
.demo-row.on { border-color: var(--violet); background: var(--violet-soft); }
.demo-row svg { color: var(--muted); flex-shrink: 0; }
.demo-row .pill { flex-shrink: 0; }
.demo-row-swatch { position: relative; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; overflow: hidden; background: linear-gradient(150deg, var(--c1), var(--c2)); }
.demo-row-swatch::after { content: ''; position: absolute; right: -10px; top: -10px; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle, var(--glow) 0%, transparent 70%); opacity: .7; }

/* ---------- Clinic computer: "Who's using this?" and the PIN pad (public/desklock.js) ---------- */
.desklock { position: fixed; inset: 0; z-index: 80; background: var(--bg); overflow-y: auto; display: flex; justify-content: center; align-items: flex-start; padding: max(32px, env(safe-area-inset-top)) 16px 32px; }
.dl-box { width: min(560px, 100%); margin: auto 0; }
.dl-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.dl-person { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; min-width: 0; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; text-align: center; cursor: pointer; }
.dl-person b, .dl-person span { max-width: 100%; }
.dl-person.off { opacity: .6; }
.dl-person:focus-visible, .dl-key:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.dl-pad { width: 100%; max-width: 300px; margin: 0 auto; }
.dl-dots { display: flex; gap: 14px; justify-content: center; }
.dl-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--violet); }
.dl-dots span.on { background: var(--violet); }
.dl-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.dl-key { min-height: 58px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-family: var(--display); font-size: 22px; font-weight: 600; cursor: pointer; }
.dl-key:active { background: var(--violet-soft); }

/* ========== COUNSELLING (public/v-therapy.js) ==========
   Psychologists and counsellors: a quiet lavender and slate, soft panels, a gentle serif for headings.
/* ========== YOGA AND FITNESS STUDIOS (public/v-yoga.js) ==========
   Energetic but calm: deep sage like a quiet studio, with a sunrise apricot for what's live, full or due.
   Only for business type 'fitness' (data-theme="studio"); the .fy- classes are only used by v-yoga.js. */
:root { --studio: #22463A; --studio-soft: #E5EFE9; --studio-ink: #1D4B3C; --studio-deep: #163329; --studio-light: #7DB59B;
  --studio-sun: #EE8455; --studio-sun-soft: #FCE8DC; --studio-sun-ink: #8F3A12; }
:root[data-theme="studio"] {
  --violet: var(--studio); --violet-soft: var(--studio-soft); --violet-ink: var(--studio-ink); --violet-deep: var(--studio-deep); --violet-light: var(--studio-light);
  --bg: #FCFBF8; --panel: #F3F1EB; --panel-line: #E6E2D8; --line: #E3DFD6; --line-soft: #EEEBE4; --tile: #F1EEE7; --ink: #12201B; --muted: #5C6863;
}
:root[data-theme="studio"] .title { letter-spacing: -0.035em; font-weight: 700; }
:root[data-theme="studio"] .hero {
  background:
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--studio-sun) 62%, transparent) 0%, transparent 60%),
    radial-gradient(70% 60% at 0% 100%, color-mix(in srgb, var(--studio-light) 30%, transparent) 0%, transparent 60%),
    linear-gradient(165deg, #275244 0%, #11241D 100%);
  border: 1px solid color-mix(in srgb, var(--studio-sun) 22%, transparent); }
:root[data-theme="studio"] .hero .label { letter-spacing: .06em; text-transform: uppercase; font-size: 11.5px; font-weight: 650; color: color-mix(in srgb, var(--studio-sun) 45%, #fff); }
:root[data-theme="studio"] .hero .meter > span { background: linear-gradient(90deg, var(--studio-light), var(--studio-sun)); }
:root[data-theme="studio"] .btn.primary { background: var(--studio); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 2px rgba(0, 0, 0, .18); }
:root[data-theme="studio"] .btn.primary:hover { background: var(--studio-deep); }
:root[data-theme="studio"] .chip.on { background: var(--studio); border-color: var(--studio); color: #fff; }
:root[data-theme="studio"] .seg button.on { background: var(--studio); }
:root[data-theme="studio"] :focus-visible { outline-color: var(--studio-sun); }
@media (max-width: 1023px) {
  :root[data-theme="studio"] #tabbar a.on { color: var(--studio-ink); }
  :root[data-theme="studio"] #tabbar a.fab, :root[data-theme="studio"] #tabbar a.fab.on { background: var(--studio-sun); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--studio-sun) 45%, transparent); }
}
@media (min-width: 1024px) { :root[data-theme="studio"] #tabbar a.on svg { color: var(--studio-sun); } }

/* Fill bars: calm green, busier darker, full in sunrise */
.fy-bar { display: block; height: 6px; border-radius: 999px; background: var(--tile); overflow: hidden; }
.fy-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--studio-light); }
.fy-bar.busy > span { background: var(--studio); }
.fy-bar.full > span { background: var(--studio-sun); }
.fy-pill { background: var(--tile); color: var(--muted); }
.fy-pill.fy-ok { background: var(--studio-soft); color: var(--studio-ink); }
.fy-pill.fy-cool { background: #E6EEF6; color: #274B6D; }
.fy-pill.fy-warn { background: var(--studio-sun-soft); color: var(--studio-sun-ink); }
.fy-pill.fy-bad { background: var(--red-soft); color: var(--red); }
.fy-pill.fy-off { background: var(--tile); color: var(--muted); }

/* The day's classes */
.fy-days { margin-top: -4px; }
.fy-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fy-summary > div { background: var(--panel); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fy-summary b { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.fy-summary span { font-size: 12px; color: var(--muted); }
.fy-list { gap: 10px; }
.fy-class { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); padding: 14px 16px; }
.fy-class.is-off { opacity: .6; }
.fy-class.is-now { box-shadow: inset 4px 0 0 var(--studio-sun); }
.fy-time { display: flex; flex-direction: column; align-items: center; min-width: 52px; line-height: 1.05; }
.fy-time b { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.fy-time span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.fy-time i { font-style: normal; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--studio-sun); border-radius: 999px; padding: 1px 7px; margin-top: 4px; }
.fy-name { font-size: 16px; }
.fy-count { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex-shrink: 0; }
.fy-count b { font-family: var(--display); font-size: 18px; font-weight: 700; }
.fy-count span { font-size: 11.5px; color: var(--muted); }

/* One class: check-in */
.fy-hero .big { font-size: 40px; }
.fy-spot { align-items: center; }
.fy-spot.came .avatar { box-shadow: 0 0 0 2px var(--studio-light); }
.fy-pos { width: 32px; height: 32px; border-radius: 50%; background: var(--studio-sun-soft); color: var(--studio-sun-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.fy-flag { font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--red-soft); color: var(--red); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fy-mark { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 3px; background: var(--card); }
.fy-mark button { border: none; background: none; min-height: 34px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.fy-mark button.on.yes { background: var(--studio); color: #fff; }
.fy-mark button.on.no { background: var(--studio-sun-soft); color: var(--studio-sun-ink); }
.fy-gone summary, .fy-new summary, .fy-history summary { cursor: pointer; font-weight: 650; color: var(--muted); }

/* Timetable */
.fy-week-grid { display: grid; gap: 14px; }
@media (min-width: 1024px) { .fy-week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fy-wday { display: flex; flex-direction: column; gap: 6px; }
.fy-tt { min-height: 58px; }
.fy-tt-time { min-width: 66px; font-family: var(--display); font-weight: 700; font-size: 14.5px; color: var(--studio-ink); }
.fy-pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.fy-pick.on { border-color: var(--studio); box-shadow: 0 0 0 2px color-mix(in srgb, var(--studio) 25%, transparent); }

/* Plans */
.fy-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.fy-plan { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--ink); border: 1px solid var(--line); cursor: pointer; position: relative; overflow: hidden; }
.fy-plan::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--studio-light), var(--studio-sun)); }
.fy-plan-kind { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--studio-sun-ink); margin-top: 4px; }
.fy-price { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }

/* Reports */
.fy-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .fy-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fy-kpi { background: var(--panel); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fy-kpi b { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.fy-kpi > span:not(.muted) { font-size: 13px; font-weight: 600; }
.fy-kpi.warn b { color: var(--studio-sun-ink); }
.fy-hbar { display: flex; flex-direction: column; gap: 5px; }
.fy-hbar .fy-bar { height: 8px; }
.fy-line { justify-content: space-between; gap: 10px; text-decoration: none; color: var(--ink); padding: 5px 0; min-width: 0; }
.fy-table tbody tr:hover { background: var(--panel); }

/* Home */
.fy-today { gap: 12px; }
.fy-strip { margin: 0 -16px; padding: 0 16px 4px; }
.fy-mini { flex: 0 0 auto; width: 148px; display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; background: var(--panel); text-decoration: none; color: var(--ink); min-width: 0; }
.fy-mini.now { background: var(--studio); color: #fff; }
.fy-mini.now .muted, .fy-mini.now .fy-mini-time { color: rgba(255, 255, 255, .8); }
.fy-mini.now .fy-bar { background: rgba(255, 255, 255, .2); }
.fy-mini.done, .fy-mini.off { opacity: .62; }
.fy-mini-time { font-size: 12px; font-weight: 700; color: var(--studio-sun-ink); }

/* The member's file */
.fy-ring { --p: 50; width: 74px; height: 74px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: radial-gradient(closest-side, var(--card) 76%, transparent 77% 100%), conic-gradient(var(--studio) calc(var(--p) * 1%), var(--tile) 0); }
.fy-ring b { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.fy-streak { font-size: 12.5px; font-weight: 700; color: var(--studio-sun-ink); background: var(--studio-sun-soft); padding: 4px 10px; border-radius: 999px; }
.fy-weeks { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; height: 44px; align-items: end; }
.fy-weeks > span { height: 100%; display: flex; align-items: flex-end; }
.fy-weeks i { display: block; width: 100%; border-radius: 4px 4px 2px 2px; background: var(--studio-light); }
.fy-weeks > span:last-child i { background: var(--studio-sun); }
.fy-weeks i.zero { background: var(--tile); }
.fy-chart svg { display: block; overflow: visible; }
.fy-chart .line { fill: none; stroke: var(--studio); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.fy-chart .area { fill: color-mix(in srgb, var(--studio-light) 18%, transparent); stroke: none; }
.fy-chart circle { fill: var(--card); stroke: var(--studio); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.fy-measures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fy-measures > div { background: var(--panel); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fy-measures b { font-size: 15px; }
.fy-delta { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.fy-delta.down { color: var(--studio-ink); }
.fy-delta.up { color: var(--studio-sun-ink); }
@media (max-width: 380px) { .fy-mark button { padding: 0 8px; } .fy-summary b { font-size: 19px; } .fy-measures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* ========== end of YOGA AND FITNESS STUDIOS ========== */
/* ========== COUNSELLING (public/v-therapy.js) ==========
   Psychologists and counsellors: a quiet lavender and slate, soft panels, a gentle serif for headings.
   Sage marks things going well; a soft rose (never alarm red) marks what needs care. */
:root {
  --calm: #565C93; --calm-soft: #EEEDF7; --calm-ink: #3C4072; --calm-deep: #474C80; --calm-light: #A9ACD8;
  --calm-sage: #5E9C8F; --calm-sage-soft: #E5F1EE; --calm-rose: #B5566B; --calm-rose-soft: #F8E9ED; --calm-amber-soft: #F8EFDC;
}
:root[data-theme="calm"] {
  --violet: var(--calm); --violet-soft: var(--calm-soft); --violet-ink: var(--calm-ink); --violet-deep: var(--calm-deep); --violet-light: var(--calm-light);
  --bg: #FCFBFE; --panel: #F5F4FA; --panel-line: #E7E5F1; --line: #E4E2EE; --line-soft: #EFEEF5; --tile: #F1F0F7;
  --ink: #1F2233; --muted: #646880; --desk-edge: #ECEAF4;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}
:root[data-theme="calm"] .title { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; font-variation-settings: "opsz" 48, "SOFT" 60; }
:root[data-theme="calm"] .hero {
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--calm-light) 45%, transparent) 0%, transparent 60%),
    linear-gradient(160deg, #5D6299 0%, #43477A 100%); }
:root[data-theme="calm"] .hero .big { font-family: var(--serif); font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }
:root[data-theme="calm"] .chip.on { background: var(--calm); border-color: var(--calm); }
:root[data-theme="calm"] :focus-visible { outline-color: var(--calm-light); }

.tp-card { gap: 12px; }
.tp-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tp-kv > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tp-sliding { color: var(--calm-ink); }
.tp-counts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.tp-counts b { color: var(--ink); font-size: 15px; }
.tp-private { gap: 8px; border: 1px dashed var(--calm-light) !important; background: color-mix(in srgb, var(--calm-soft) 60%, var(--panel)) !important; }
.tp-lock-ic { display: inline-flex; color: var(--calm-ink); }
.tp-lock-chip { gap: 6px; color: var(--calm-ink); background: var(--calm-soft); border-color: transparent; }
.tp-score { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--tile); color: var(--muted); }
.tp-score.ok { background: var(--calm-sage-soft); color: #2F6B5F; }
.tp-score.mild { background: var(--calm-soft); color: var(--calm-ink); }
.tp-score.mod { background: var(--calm-amber-soft); color: #7A5512; }
.tp-score.high { background: var(--calm-rose-soft); color: #8A3247; }
.tp-alert { font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 12px; background: var(--calm-rose-soft); color: #7A2B3E; box-shadow: inset 3px 0 0 var(--calm-rose); }
.tp-chart { margin: 0; }
.tp-chart svg { width: 100%; max-width: 460px; height: auto; display: block; }
.tp-answers summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--calm-ink); }
.tp-answer { display: flex; gap: 10px; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--panel-line); color: var(--muted); }
.tp-answer.yes { color: var(--ink); }
.tp-answer b { white-space: nowrap; font-weight: 600; }
.tp-band.ok { fill: color-mix(in srgb, var(--calm-sage) 7%, transparent); }
.tp-band.mild { fill: color-mix(in srgb, var(--calm) 6%, transparent); }
.tp-band.mod { fill: color-mix(in srgb, #C99A3B 8%, transparent); }
.tp-band.high { fill: color-mix(in srgb, var(--calm-rose) 7%, transparent); }
.tp-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tp-line.phq, .tp-dot.phq { stroke: var(--calm); } .tp-dot.phq { fill: var(--calm); }
.tp-line.gad, .tp-dot.gad { stroke: var(--calm-sage); } .tp-dot.gad { fill: var(--calm-sage); }
.tp-dot.flag { fill: var(--card); stroke: var(--calm-rose); stroke-width: 2.4; }
.tp-tick { font-size: 10px; fill: var(--muted); font-family: var(--body); }
.tp-end { font-size: 11px; font-weight: 700; font-family: var(--body); }
.tp-end.phq { fill: var(--calm-ink); } .tp-end.gad { fill: #2F6B5F; }
.tp-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin-top: 6px; }
.tp-legend .phq::before, .tp-legend .gad::before { content: ''; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--calm); }
.tp-legend .gad::before { background: var(--calm-sage); }
.tp-stages { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-stage { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; color: var(--muted); background: var(--card); border: 1px solid var(--line); }
.tp-stage.on { background: var(--calm); border-color: var(--calm); color: #fff; }
.tp-goal { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.tp-goal-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--calm-light); flex-shrink: 0; }
.tp-goal.met .tp-goal-dot { background: var(--calm-sage); border-color: var(--calm-sage); }
.tp-goal.paused { color: var(--muted); }
.tp-note-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--panel-line); color: var(--ink); text-decoration: none; }
.tp-note-row:last-of-type { border-bottom: none; }
.tp-risk { font-size: 11px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--calm-amber-soft); color: #7A5512; white-space: nowrap; }
.tp-risk.high, .tp-risk.medium { background: var(--calm-rose-soft); color: #8A3247; }
.tp-log summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.tp-today { gap: 10px; }
.tp-today-title { font-family: var(--serif, var(--display)); font-size: 18px; font-weight: 500; }
.tp-flag { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--calm-rose-soft); color: #7A2B3E; text-decoration: none; box-shadow: inset 3px 0 0 var(--calm-rose); }
.tp-today-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--panel-line); color: var(--ink); text-decoration: none; }
.tp-time { min-width: 58px; font-weight: 650; color: var(--calm-ink); font-variant-numeric: tabular-nums; }
.tp-session .field textarea { min-height: 84px; line-height: 1.5; }
.tp-prev summary { cursor: pointer; }
.tp-prose { white-space: pre-wrap; line-height: 1.5; }
.tp-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; }
.tp-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.tp-bar-v { font-size: 10px; color: var(--muted); }
.tp-bar-col { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 6px 6px 3px 3px; overflow: hidden; }
.tp-bar-col .done { background: var(--calm); display: block; }
.tp-bar-col .miss { background: var(--calm-light); display: block; }
.tp-bar-l { font-size: 10px; color: var(--muted); }
.tp-stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.tp-outcome-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tp-big { font-family: var(--serif, var(--display)); font-size: 30px; font-weight: 500; color: var(--muted); }
.tp-big.good { color: #2F6B5F; }
.tp-arrow { color: var(--calm-light); font-size: 22px; }
.tp-policy { font-family: var(--serif, var(--display)); font-size: 16px; line-height: 1.5; color: var(--calm-ink); }
@media (max-width: 380px) { .tp-kv { grid-template-columns: 1fr 1fr; } }
/* ========== end of COUNSELLING ========== */
/* ========== SKIN AND HAIR CLINICS (public/v-skin.js) ==========
   A clinical-aesthetic look of its own: deep plum with a soft rose and a champagne accent, an elegant serif
   for titles and big numbers, on a warm white. Distinct from the dental teal and the salon black and gold. */
:root {
  --skin: #6E3553; --skin-soft: #F6ECF1; --skin-ink: #55243F; --skin-deep: #5A2944; --skin-light: #C98FAD;
  --skin-champagne: #C8A97E; /* highlights: the glow on Today, the active tab, the meters */
}
:root[data-theme="skin"] {
  --violet: var(--skin); --violet-soft: var(--skin-soft); --violet-ink: var(--skin-ink); --violet-deep: var(--skin-deep); --violet-light: var(--skin-light);
  --bg: #FFFFFF; --panel: #F8F4F3; --panel-line: #ECE3E1; --line: #E9E1DF; --line-soft: #F1EBEA; --tile: #F4EEED; --ink: #1D1418; --muted: #6C5F64;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --staff-1: #F5E6EE; --staff-1-ink: #6E3553; --staff-1-line: #CF9CB6;
  --staff-2: #F3EBDF; --staff-2-ink: #6B5023; --staff-2-line: #C8A97E;
  --staff-3: #E7EEEC; --staff-3-ink: #2F5A52; --staff-3-line: #8DB5AC;
  --staff-4: #ECE8F3; --staff-4-ink: #4B3D73; --staff-4-line: #A69BC8;
  --staff-5: #F6E9E4; --staff-5-ink: #7A3E2C; --staff-5-line: #D6A291;
  --staff-6: #E8ECF1; --staff-6-ink: #34465C; --staff-6-line: #9BAABD;
}
:root[data-theme="skin"] .title, :root[data-theme="skin"] .profile-head .name { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; font-variant-numeric: lining-nums; font-variation-settings: "opsz" 48, "SOFT" 50; }
:root[data-theme="skin"] .hero, .sk-hero {
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--skin-champagne) 38%, transparent) 0%, transparent 60%),
    linear-gradient(160deg, #7C3D5E 0%, #4E2238 100%);
  border: 1px solid color-mix(in srgb, var(--skin-champagne) 30%, transparent); }
:root[data-theme="skin"] .hero .big { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: lining-nums tabular-nums; }
:root[data-theme="skin"] .hero .label { color: color-mix(in srgb, var(--skin-champagne) 75%, #fff); letter-spacing: .08em; text-transform: uppercase; font-size: 11.5px; font-weight: 600; }
:root[data-theme="skin"] .hero .meter > span { background: var(--skin-champagne); }
:root[data-theme="skin"] .btn.primary { background: var(--skin); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 2px rgba(78, 34, 56, .25); }
:root[data-theme="skin"] .btn.primary:hover { background: var(--skin-deep); }
:root[data-theme="skin"] .chip.on { background: var(--skin); color: #fff; border-color: var(--skin); }
@media (max-width: 1023px) {
  :root[data-theme="skin"] #tabbar a.fab, :root[data-theme="skin"] #tabbar a.fab.on { background: var(--skin); color: #fff; box-shadow: 0 0 0 1px color-mix(in srgb, var(--skin-champagne) 45%, transparent), 0 4px 12px rgba(78, 34, 56, .28); }
}
@media (min-width: 1024px) { :root[data-theme="skin"] .side-brand b { font-family: var(--serif); font-size: 18px; font-weight: 600; } }

/* Cards in the patient file and on the visit */
.sk-title { font-family: var(--serif, var(--display)); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.sk-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.sk-fact { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--panel-line); min-width: 0; }
.sk-fact b { font-size: 14px; overflow-wrap: anywhere; }
.pill.sk-pill { background: var(--violet-soft); color: var(--violet-ink); }
.sk-course { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--panel-line); }
.sk-meter { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--violet) 12%, var(--card)); overflow: hidden; }
.sk-meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet-light), var(--violet)); }
.sk-meter > span.hot { background: linear-gradient(90deg, var(--orange), var(--red)); }
.sk-session { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--panel-line); }
.sk-session:last-child { border-bottom: none; }
.sk-more summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--violet-ink); padding: 4px 0; }
.sk-note { font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--panel-line); color: var(--ink); }
.sk-note.warn { background: var(--orange-soft); border-color: color-mix(in srgb, var(--orange) 40%, transparent); color: var(--orange-text); }
.sk-line { padding: 9px 0; border-bottom: 1px solid var(--panel-line); gap: 10px; }
.sk-line:last-child { border-bottom: none; }
.sk-chips .chip { color: var(--ink); }
.sk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
@media (max-width: 360px) { .sk-grid { grid-template-columns: 1fr; } }
.sk-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.sk-amt { font-family: var(--serif, var(--display)); font-size: 20px; font-weight: 600; }
.sk-bar { display: flex; flex-direction: column; gap: 5px; }
.banner.sk-banner { --stripe: var(--violet); }
.banner.sk-banner .n { color: var(--violet-ink); }

/* Before and after: photo strips and the compare picker. A slot without a picture shows a calm placeholder. */
.sk-strip { display: flex; flex-direction: column; gap: 8px; padding: 12px 0 4px; border-top: 1px solid var(--panel-line); text-decoration: none; color: var(--ink); }
.sk-row-ph { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sk-ph-box { aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--card); border: 1px solid var(--panel-line); }
.sk-ph-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sk-ph { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; padding: 6px; color: var(--violet-ink);
  background: radial-gradient(60% 45% at 50% 38%, color-mix(in srgb, var(--violet-light) 38%, transparent) 0%, transparent 70%), linear-gradient(170deg, var(--violet-soft), color-mix(in srgb, var(--skin-champagne) 22%, var(--card))); }
.sk-ph-a { font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.sk-ph-d { font-size: 10px; opacity: .75; }
.sk-ph.big { min-height: 50vh; border-radius: 12px; align-items: center; justify-content: center; }
.sk-ph.big .sk-ph-a { font-size: 14px; }
.sk-tl { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.sk-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 0; border: none; background: none; text-align: left; color: var(--ink); cursor: pointer; font: inherit; }
.sk-tile.cmp-on .sk-ph-box { box-shadow: 0 0 0 3px var(--violet); }
.sk-tile[data-n]:not([data-n=""])::after { content: attr(data-n); position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--violet); color: #fff; font-weight: 700; font-size: 13px; line-height: 22px; text-align: center; }
.sk-cmp-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; }
.sk-cmp .cmp-img .sk-ph { color: #fff; background: radial-gradient(60% 45% at 50% 38%, rgba(201, 143, 173, .35) 0%, transparent 70%), linear-gradient(170deg, #3A1C2C, #1B0F15); }
/* ========== end of SKIN AND HAIR CLINICS ========== */
/* ========== SALONS AND BEAUTY PARLOURS (public/v-salon.js) ==========
   On top of the black-and-gold "luxe" theme. data-variant="salon": deeper ink, a champagne page and gold
   hairlines. data-variant="rose": a beauty parlour, softer, in blush and rose gold. */
:root[data-theme="luxe"][data-variant="salon"] {
  --bg: #FBF9F5; --panel: #F4F0E8; --panel-line: #E7E0D2; --line: #E4DDCF; --muted: #6B6355;
}
:root[data-theme="luxe"][data-variant="rose"] {
  --luxe: #3A2128; --luxe-soft: #F8ECEC; --luxe-ink: #8A4B57; --luxe-deep: #24141A; --luxe-light: #E2A9A4; --luxe-gold: #C98E86;
  --violet: var(--luxe); --violet-soft: var(--luxe-soft); --violet-ink: var(--luxe-ink); --violet-deep: var(--luxe-deep); --violet-light: var(--luxe-light);
  --bg: #FFFBFA; --panel: #FAF0EE; --panel-line: #F0DCD8; --line: #EEDCD8; --line-soft: #F5E9E6; --tile: #F9ECEA; --ink: #2A1A1E; --muted: #7A6166;
}
:root[data-theme="luxe"][data-variant="rose"] .hero {
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--luxe-gold) 45%, transparent) 0%, transparent 60%), linear-gradient(160deg, #4A2A33 0%, #24141A 100%);
  border-color: color-mix(in srgb, var(--luxe-gold) 35%, transparent); }
:root[data-theme="luxe"][data-variant="salon"] .hero {
  background: radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--luxe-gold) 40%, transparent) 0%, transparent 55%),
    radial-gradient(60% 50% at 0% 100%, color-mix(in srgb, var(--luxe-gold) 14%, transparent) 0%, transparent 70%), linear-gradient(165deg, #1C1914 0%, #070605 100%); }
/* A hairline of gold under titles and on cards, the way a salon menu card looks. */
:root[data-theme="luxe"][data-variant] .top-left .title::after, :root[data-theme="luxe"][data-variant] .top .title::after {
  content: ''; display: block; width: 36px; height: 2px; margin-top: 8px; border-radius: 2px; background: linear-gradient(90deg, var(--luxe-gold), transparent); }
:root[data-theme="luxe"][data-variant] .h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.005em; }
:root[data-theme="luxe"][data-variant] .tile .t { font-family: var(--serif); font-weight: 600; font-size: 17px; }
:root[data-theme="luxe"][data-variant] .chip.glass { border-color: color-mix(in srgb, var(--luxe-gold) 30%, transparent); }
.sl-card { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--luxe-gold, var(--violet)) 22%, transparent); }
.sl-pill { background: var(--luxe-soft, var(--violet-soft)); color: var(--luxe-ink, var(--violet-ink)); border: 1px solid color-mix(in srgb, var(--luxe-gold, var(--violet)) 30%, transparent); }
.sl-alert { border-radius: 10px; padding: 10px 12px; font-size: 14px; background: var(--orange-soft); color: var(--orange-text); }
.sl-alert.red { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-line); }
.sl-formula { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; background: var(--card); border-left: 3px solid var(--luxe-gold, var(--violet)); }
.sl-member { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; color: #fff;
  background: radial-gradient(100% 120% at 100% 0%, color-mix(in srgb, var(--luxe-gold, #B8913F) 55%, transparent), transparent 60%), linear-gradient(150deg, var(--luxe, #17150F), var(--luxe-deep, #000)); }
.sl-member .small { color: color-mix(in srgb, #fff 78%, transparent); }
.sl-plan-name { font-family: var(--serif, var(--display)); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.sl-plan { display: flex; flex-direction: column; gap: 10px; }
.sl-plan.gold { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--luxe-gold, var(--violet)) 45%, transparent); }
.sl-line { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.sl-line.row { flex-direction: row; align-items: center; }
.sl-line .input { min-height: 40px; }
.sl-mini { flex: 1; min-width: 0; font-size: 14px; }
.sl-line input[type=number] { width: 96px; flex: 0 0 96px; }
.sl-qty { width: 64px; flex: 0 0 64px; }
.sl-addon { border-style: dashed; }
.sl-picks { max-height: 220px; overflow-y: auto; margin-top: 10px; }
.sl-title { font-family: var(--serif, var(--display)); }
.sl-ba { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sl-ba-pic { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--tile); }
.sl-ba-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sl-ba-tag { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .62); color: #fff; }
.sl-split { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .12); }
.sl-split span { background: color-mix(in srgb, #fff 70%, transparent); }
.sl-split span.retail { background: var(--luxe-gold, var(--violet-light)); }
.sl-table td, .sl-table th { font-size: 14px; }
.sl-heat { display: grid; gap: 3px; align-items: center; }
.sl-heat-h { font-size: 10px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; }
.sl-heat-d { font-size: 12px; font-weight: 600; color: var(--muted); }
.sl-heat-c { height: 22px; border-radius: 4px; background: color-mix(in srgb, var(--luxe-gold, var(--violet)) calc(var(--a) * 100%), var(--card)); }
.sl-task .sl-tick { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.sl-task.done .sl-tick { background: var(--luxe, var(--violet)); border-color: var(--luxe, var(--violet)); color: var(--luxe-light, #fff); }
.sl-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sl-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink); background: var(--card); }
.sl-day.full { background: var(--luxe-gold, var(--mint)); color: #fff; }
.sl-day.part { background: color-mix(in srgb, var(--luxe-gold, var(--mint)) 30%, var(--card)); }
.sl-day.none { color: var(--muted); }
.sl-day.future { opacity: .4; }
@media (max-width: 420px) { .sl-heat-h { font-size: 9px; } .sl-line input[type=number] { width: 80px; flex-basis: 80px; } }
.sl-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sl-stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sl-stat b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-pay { font-family: var(--serif, var(--display)); font-size: 20px; font-variant-numeric: lining-nums tabular-nums; }
@media (max-width: 420px) { .sl-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* ========== end of SALONS AND BEAUTY PARLOURS ========== */
/* ========== SPA: spas and wellness centres (public/v-spa.js, src/spa.js) ==========
   Their own calm look: warm sand with a deep forest green, a soft brass highlight and the Fraunces serif
   for titles. Distinct from the salon's black and gold and the clinic's teal. */
:root { --spa: #2E4636; --spa-soft: #E7EDE5; --spa-ink: #22392B; --spa-deep: #1E3125; --spa-light: #8DAA93; --spa-sand: #C9A877; --spa-sand-soft: #F3EADB; }
:root[data-theme="spa"] {
  --violet: var(--spa); --violet-soft: var(--spa-soft); --violet-ink: var(--spa-ink); --violet-deep: var(--spa-deep); --violet-light: var(--spa-light);
  --bg: #FBF8F2; --card: #FFFEFB; --ink: #1D2520; --muted: #66665C; --line: #E6DECF; --line-soft: #EFE9DE; --tile: #F2ECE1;
  --panel: #F4EEE3; --panel-line: #E7DDCC;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --staff-1: #E6EEE4; --staff-1-ink: #2C4A35; --staff-1-line: #93B39B;
  --staff-2: #F4E9D8; --staff-2-ink: #6E4E1F; --staff-2-line: #D2B07C;
  --staff-3: #E9E6F1; --staff-3-ink: #4A4270; --staff-3-line: #A49CC6;
  --staff-4: #F3E3DE; --staff-4-ink: #7A3A2A; --staff-4-line: #D59E8E;
}
:root[data-theme="spa"] .title { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; font-variation-settings: "opsz" 48, "SOFT" 60; }
:root[data-theme="spa"] .h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.005em; }
:root[data-theme="spa"] .hero .big, :root[data-theme="spa"] .title, :root[data-theme="spa"] .spa-big { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
:root[data-theme="spa"] .hero .big { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
:root[data-theme="spa"] .hero {
  background:
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--spa-sand) 38%, transparent) 0%, transparent 60%),
    radial-gradient(70% 60% at 0% 100%, color-mix(in srgb, var(--spa-light) 30%, transparent) 0%, transparent 65%),
    linear-gradient(160deg, #34503D 0%, #1E3125 100%);
  border: 1px solid color-mix(in srgb, var(--spa-sand) 30%, transparent); }
:root[data-theme="spa"] .hero .label { color: color-mix(in srgb, var(--spa-sand) 75%, #fff); letter-spacing: .08em; text-transform: uppercase; font-size: 11.5px; font-weight: 600; }
:root[data-theme="spa"] .hero .meter > span { background: var(--spa-sand); }
:root[data-theme="spa"] .btn.primary { background: var(--spa); color: #FBF6EC; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 1px 2px rgba(30, 49, 37, .25); }
:root[data-theme="spa"] .btn.primary:hover { background: var(--spa-deep); }
:root[data-theme="spa"] .chip.on { background: var(--spa); border-color: var(--spa); color: #FBF6EC; }
:root[data-theme="spa"] :focus-visible { outline-color: var(--spa-sand); }
@media (max-width: 1023px) {
  :root[data-theme="spa"] #tabbar a.on { color: var(--spa); }
  :root[data-theme="spa"] #tabbar a.fab, :root[data-theme="spa"] #tabbar a.fab.on { background: var(--spa); color: var(--spa-sand-soft); box-shadow: 0 0 0 1px color-mix(in srgb, var(--spa-sand) 45%, transparent), 0 4px 12px rgba(30, 49, 37, .3); }
  :root[data-theme="spa"] .ask-fab { background: var(--spa); color: var(--spa-sand-soft); }
}
@media (min-width: 1024px) {
  :root[data-theme="spa"] #tabbar a.on svg { color: var(--spa); }
  :root[data-theme="spa"] .side-brand b { font-family: var(--serif); font-size: 18px; font-weight: 600; }
}

/* The spa's screens */
.spa-scr .stat-grid.spa-stats .stat b { font-size: 19px; }
.spa-big { font-family: var(--serif, var(--display)); font-size: 24px; font-weight: 600; }
.spa-bar { display: block; height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.spa-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--spa-light), var(--spa)); }
.spa-summary { margin-top: -6px; }
/* The rooms' day: a lane per room, the hours across; it scrolls sideways inside itself on a phone. */
.spa-board-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px 4px; -webkit-overflow-scrolling: touch; }
.spa-board { min-width: 680px; display: flex; flex-direction: column; gap: 8px; }
.spa-ruler, .spa-lane { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.spa-ruler .spa-track { height: 18px; background: none; border: none; }
.spa-ruler .spa-track span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.spa-lane-name { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.spa-lane-name b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spa-track { position: relative; height: 64px; border-radius: 12px; background: var(--panel); border: 1px solid var(--panel-line); overflow: hidden; }
.spa-lane.kind-couple .spa-track { background: color-mix(in srgb, var(--spa-sand-soft) 70%, var(--panel)); }
.spa-lane.kind-wet .spa-track { height: 44px; }
.spa-block { position: absolute; top: 5px; bottom: 5px; min-width: 4px; padding: 5px 7px; border-radius: 9px; border: 1px solid var(--staff-1-line); background: var(--staff-1); color: var(--staff-1-ink);
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; overflow: hidden; text-align: left; font: inherit; font-size: 11.5px; line-height: 1.25; cursor: pointer; }
.spa-block b { font-size: 12px; max-width: 100%; }
.spa-block > span { max-width: 100%; }
.spa-block-time { font-weight: 600; opacity: .8; }
.spa-block.couple { background: var(--staff-2); border-color: var(--staff-2-line); color: var(--staff-2-ink); }
.spa-block.st-completed { opacity: .62; }
.spa-block.st-no_show { opacity: .45; text-decoration: line-through; }
.spa-block.in { box-shadow: inset 3px 0 0 var(--spa); }
.spa-lane.kind-wet .spa-block { flex-direction: row; align-items: center; gap: 6px; }
.spa-lane.kind-wet .spa-block > span:not(.spa-block-time):not(.spa-dot) { display: none; }
.spa-clean { position: absolute; top: 5px; bottom: 5px; border-radius: 6px; background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--spa-light) 35%, transparent) 4px 6px); }
.spa-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--now); z-index: 2; }
.spa-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.spa-legend { gap: 16px; }
.spa-legend span { display: inline-flex; align-items: center; gap: 6px; }
.spa-legend .lg { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.spa-legend .lg.couple { background: var(--staff-2); border: 1px solid var(--staff-2-line); }
.spa-legend .lg.clean { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--spa-light) 3px 5px); }
.spa-legend .lg.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
/* The guest card: what to take care with, in a calm amber, never an alarming red. */
.spa-care { background: var(--spa-sand-soft); border: 1px solid color-mix(in srgb, var(--spa-sand) 55%, transparent); border-radius: 12px; padding: 12px 14px; color: #5A4318; font-size: 14px; }
.spa-care ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.pill.spa-alert { background: var(--red-soft); color: var(--red); }
.pill.spa-room-pill { background: var(--spa-soft); color: var(--spa-ink); }
.pill.spa-couple-pill { background: var(--spa-sand-soft); color: #6E4E1F; }
.spa-answers summary { cursor: pointer; font-weight: 600; }
/* Tables that stay inside a phone's width. */
.spa-table .spa-row { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(5, minmax(0, .8fr)); gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--panel-line); font-size: 13.5px; align-items: center; font-variant-numeric: tabular-nums; }
.spa-table .spa-row.t4 { grid-template-columns: minmax(0, 2fr) minmax(0, .6fr) minmax(0, 1fr) minmax(0, .9fr); }
.spa-table .spa-row:last-child { border-bottom: none; }
.spa-table .spa-row.head { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.spa-table .spa-row > span:not(:first-child) { text-align: right; }
.spa-table .spa-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spa-table .warn { color: var(--red); font-weight: 600; }
.spa-room-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.spa-linen { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
@media (max-width: 420px) {
  .spa-room-row { grid-template-columns: minmax(0, 1fr) auto; }
  .spa-room-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .spa-table .spa-row { font-size: 12.5px; padding: 9px 10px; gap: 4px; }
}
/* ========== end of SPA ========== */
/* ========== Dietitians and nutritionists (public/v-diet.js) ==========
   Their own look: fresh leaf green with a warm citrus accent on a soft, warm white, and the same elegant
   serif as the salons for headings and big numbers. Everything below starts with :root[data-theme="fresh"]
   or a dt- class, so no other business changes. */
:root[data-theme="fresh"] {
  --fresh: #2F6A4F; --fresh-soft: #E5F1E8; --fresh-ink: #1E4B36; --fresh-deep: #245840; --fresh-light: #8DC6A2; --fresh-citrus: #E39B33;
  --violet: var(--fresh); --violet-soft: var(--fresh-soft); --violet-ink: var(--fresh-ink); --violet-deep: var(--fresh-deep); --violet-light: var(--fresh-light);
  --bg: #FCFBF7; --panel: #F2F5EE; --panel-line: #E1E7DC; --line: #E1E6DB; --line-soft: #ECF0E7; --tile: #EDF1E8; --ink: #17211B; --muted: #5C6960;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}
:root[data-theme="fresh"] .title { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; font-variation-settings: "opsz" 48, "SOFT" 60; }
:root[data-theme="fresh"] .hero .big, :root[data-theme="fresh"] .title { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
:root[data-theme="fresh"] .hero .big { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
:root[data-theme="fresh"] .hero {
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--fresh-citrus) 30%, transparent) 0%, transparent 55%),
    radial-gradient(90% 70% at 0% 100%, color-mix(in srgb, var(--fresh-light) 35%, transparent) 0%, transparent 60%),
    linear-gradient(160deg, #2F6A4F 0%, #1D4936 100%); }
:root[data-theme="fresh"] .hero .label { letter-spacing: .06em; text-transform: uppercase; font-size: 11.5px; font-weight: 650; color: #F6E7CC; }
:root[data-theme="fresh"] .hero .meter > span { background: #F3D9A6; }
:root[data-theme="fresh"] .btn.primary { background: var(--fresh); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(23, 33, 27, .18); }
:root[data-theme="fresh"] .btn.primary:hover { background: var(--fresh-deep); }
/* The chosen chip, tab or filter: white on the deep green (contrast about 6.4 to 1, AA), its count and any small text too. */
:root[data-theme="fresh"] .chip.on:not(.progress-better):not(.progress-worse):not(.progress-same), :root[data-theme="fresh"] a.chip.on,
:root[data-theme="fresh"] .quick .chip.on, :root[data-theme="fresh"] .paper-opts .chip.on, :root[data-theme="fresh"] .seg button.on {
  background: var(--fresh); border-color: var(--fresh); color: #fff; }
:root[data-theme="fresh"] .chip.on *, :root[data-theme="fresh"] .seg button.on * { color: inherit; }
:root[data-theme="fresh"] .side-brand b { font-family: var(--serif); font-weight: 600; }
@media (max-width: 1023px) { :root[data-theme="fresh"] #tabbar a.on { color: var(--fresh-ink); } }

.dt-file { gap: 14px; }
.dt-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.dt-soft { color: var(--muted); }
.dt-link { color: var(--violet-ink); font-weight: 600; text-decoration: none; }
.dt-h3 { font-family: var(--display); font-size: 15px; font-weight: 650; margin: 8px 0 0; }
.dt-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.dt-pill { background: var(--tile); color: var(--ink); }
.dt-pill.good { background: var(--mint-soft); color: var(--mint-ink); }
.dt-pill.warn { background: color-mix(in srgb, var(--orange) 16%, var(--card)); color: var(--orange-ink); }
.dt-pill.cond { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.dt-pill.pref-jain { background: #FFF1D6; color: #6B4A00; }
.dt-pill.pref-veg { background: #E3F4E6; color: #1D5A2C; }
.dt-pill.pref-egg { background: #FDF3C9; color: #5F4C00; }
.dt-pill.pref-nonveg { background: #FBE3DE; color: #7A2617; }

/* The program: a soft green panel with the weeks done as a bar, and follow-ups as dots. */
.dt-program { background: linear-gradient(150deg, color-mix(in srgb, var(--violet-soft) 85%, var(--card)) 0%, var(--panel) 70%) !important; gap: 10px; }
.dt-program.ending { box-shadow: inset 3px 0 0 var(--orange); }
.dt-program.empty { background: var(--panel) !important; }
.dt-eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--violet-ink); }
.dt-program-name { font-family: var(--serif, var(--display)); font-size: 21px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.dt-program-name.sm { font-size: 17px; }
.dt-meter { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--violet) 14%, var(--card)); overflow: hidden; }
.dt-meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet-light), var(--violet)); }
.dt-fu { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-fu-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); }
.dt-fu-dot.done { background: var(--violet); border-color: var(--violet); }
.dt-fu-dot.booked { background: var(--violet-soft); border-color: var(--violet); }
.dt-fu-dot.due { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 25%, var(--card)); }
.dt-fu-dot.missed { border-color: var(--red-line); background: var(--red-soft); }

/* Progress and lab charts */
.dt-chips { margin: 0; padding: 0; }
.dt-big { font-family: var(--serif, var(--display)); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.dt-unit { font-size: 14px; font-weight: 600; color: var(--muted); }
.dt-chart svg { display: block; overflow: visible; }
.dt-chart .dt-grid { stroke: var(--line); stroke-width: 1; }
.dt-chart .dt-axis { font-size: 10px; fill: var(--muted); font-family: var(--body); }
.dt-chart .dt-area { fill: color-mix(in srgb, var(--violet) 10%, transparent); stroke: none; }
.dt-chart .dt-line { fill: none; stroke: var(--violet); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.dt-chart .dt-dot { fill: var(--card); stroke: var(--violet); stroke-width: 2; }
.dt-chart .dt-dot.last { fill: var(--violet); }
.dt-chart .dt-goal { stroke: var(--fresh-citrus, var(--orange)); stroke-width: 1.5; stroke-dasharray: 5 4; }
.dt-chart .dt-goal-t { font-size: 10px; font-weight: 650; fill: color-mix(in srgb, var(--fresh-citrus, var(--orange)) 70%, var(--ink)); font-family: var(--body); }
.dt-chart .dt-band { fill: color-mix(in srgb, var(--mint) 12%, transparent); }
.dt-ck { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--panel-line); }
.dt-table-wrap { overflow-x: auto; margin-top: 8px; }
.dt-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.dt-table th { text-align: left; font-size: 11px; font-weight: 650; color: var(--muted); padding: 6px 6px; border-bottom: 1px solid var(--panel-line); }
.dt-table td { padding: 6px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.dt-table .dt-fee { min-height: 40px; width: 92px; padding: 0 8px; }

/* The food diary: a bar a day for water and steps, and meals from WhatsApp */
.dt-diary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dt-bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; height: 54px; align-items: end; }
.dt-bar { height: 100%; display: flex; align-items: flex-end; }
.dt-bar i { display: block; width: 100%; border-radius: 4px 4px 2px 2px; background: var(--violet-light); }
.dt-bar.now i { background: var(--violet); }
.dt-bar.none i { background: var(--line); }
.dt-meals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dt-meal { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px; border-radius: 12px; background: var(--card); text-decoration: none; color: var(--ink); }
.dt-meal img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.dt-meal-ico { width: 44px; height: 44px; border-radius: 9px; background: var(--violet-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }

/* The plan, and the meal-plan builder */
.dt-kcal { display: grid; grid-template-columns: auto auto; gap: 0 5px; align-items: baseline; padding: 6px 10px; border-radius: 12px; background: var(--card); font-size: 11px; color: var(--muted); flex-shrink: 0; }
.dt-kcal b { font-size: 14px; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.dt-meal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dt-slot { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--card); min-width: 0; overflow-wrap: anywhere; }
.dt-slot-h { font-size: 12px; font-weight: 650; color: var(--violet-ink); }
.dt-totals { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 10px 14px; border-radius: 14px; background: var(--violet-soft); color: var(--violet-ink); font-size: 13px; }
.dt-totals b { font-size: 16px; font-variant-numeric: tabular-nums; }
.dt-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-builder .meal-row { grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr) 40px; }
.dt-qchip { min-height: 34px; padding: 0 10px; font-size: 12px; font-weight: 600; background: var(--card); color: var(--violet-ink); border-style: dashed; white-space: normal; text-align: left; }

/* Lab values: a tile per test, the flag in colour */
.dt-lab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dt-lab { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid transparent; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; min-width: 0; }
.dt-lab b { font-family: var(--serif, var(--display)); font-size: 22px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.dt-lab.high, .dt-lab.low { border-color: color-mix(in srgb, var(--orange) 35%, var(--card)); }
.dt-lab-n { font-size: 12px; font-weight: 650; color: var(--muted); }

/* Home, Programs, reports, plans */
.dt-home { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); background: linear-gradient(150deg, color-mix(in srgb, var(--violet-soft) 80%, var(--card)), var(--panel)) !important; }
.dt-home-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dt-home-stats span { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); line-height: 1.25; }
.dt-home-stats b { font-family: var(--serif, var(--display)); font-size: 24px; font-weight: 600; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.dt-home-stats .warn b { color: var(--orange-ink); }
.dt-seg3 { grid-template-columns: repeat(3, 1fr); }
.dt-hbar { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.5fr) 30px; gap: 10px; align-items: center; font-size: 14px; }
.dt-hbar-t { height: 10px; border-radius: 999px; background: var(--card); overflow: hidden; }
.dt-hbar-t i { display: block; height: 100%; border-radius: 999px; background: var(--violet); }
.dt-hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.dt-row-link { text-decoration: none; color: var(--ink); min-height: 40px; }
.dt-tpl-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dt-tpl { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--card); text-decoration: none; color: var(--ink); min-width: 0; font-size: 14px; }
.dt-food-list { display: flex; flex-direction: column; }
.dt-food { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--panel-line); font-size: 14px; }
@media (max-width: 420px) {
  .dt-grid2, .dt-diary-grid { grid-template-columns: minmax(0, 1fr); }
  .dt-meal-grid, .dt-tpl-list, .dt-meals { grid-template-columns: minmax(0, 1fr); }
  .dt-home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ========== end of Dietitians ========== */
/* ---------- Car wash and detailing (public/v-carwash.js) ----------
   Its own look: graphite like a fresh tyre, with ceramic blue. Stages each have a colour: waiting amber,
   washing blue, drying teal, ready green, delivered grey. Number plates are drawn like India's HSRP plates. */
:root {
  --auto: #12161C; --auto-2: #1E242D; --auto-blue: #1F6FEB; --auto-blue-soft: #E8F0FD; --auto-blue-ink: #0B3B8C; --auto-blue-deep: #1556C0; --auto-blue-light: #7FB0F5;
  --st-booked: #475569; --st-booked-soft: #EEF2F6;
  --st-waiting: #9A5B00; --st-waiting-soft: #FFF2D6;
  --st-washing: #1F6FEB; --st-washing-soft: #E8F0FD;
  --st-drying: #0B7C86; --st-drying-soft: #DCF4F5;
  --st-ready: #0F7A43; --st-ready-soft: #DCF4E6;
  --st-delivered: #5F6B69; --st-delivered-soft: #EEF1F0;
}
:root[data-theme="auto"] {
  --violet: var(--auto-blue); --violet-soft: var(--auto-blue-soft); --violet-ink: var(--auto-blue-ink); --violet-deep: var(--auto-blue-deep); --violet-light: var(--auto-blue-light);
  --bg: #F4F6F8; --line: #E1E5EA; --line-soft: #ECEFF3; --tile: #EEF1F5;
}
:root[data-theme="auto"] .title { font-weight: 720; letter-spacing: -0.7px; }
:root[data-theme="auto"] .kicker { text-transform: uppercase; letter-spacing: .07em; font-size: 11.5px; font-weight: 600; }
:root[data-theme="auto"] .hero { background: linear-gradient(135deg, var(--auto) 0%, var(--auto-2) 62%, #24364F 100%); box-shadow: 0 12px 30px -16px rgba(18, 22, 28, .55); }
:root[data-theme="auto"] .hero::after { content: ""; position: absolute; inset: -40% -10% auto auto; width: 70%; height: 180%; background: linear-gradient(105deg, transparent 40%, rgba(127, 176, 245, .16) 50%, transparent 60%); transform: rotate(8deg); pointer-events: none; }
:root[data-theme="auto"] .hero .label { color: #A9B6C6; letter-spacing: .06em; text-transform: uppercase; font-size: 11.5px; font-weight: 600; }
:root[data-theme="auto"] .hero .meter > span { background: var(--auto-blue-light); }
:root[data-theme="auto"] .btn.primary { background: var(--auto-blue); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(18, 22, 28, .2); }
:root[data-theme="auto"] .btn.primary:hover { background: var(--auto-blue-deep); }
:root[data-theme="auto"] .btn.dark { background: var(--auto); }
:root[data-theme="auto"] .chip.on { background: var(--auto); border-color: var(--auto); color: #fff; }
:root[data-theme="auto"] #tabbar a.fab, :root[data-theme="auto"] #tabbar a.fab.on { background: var(--auto); color: #fff; }

.cw-plate { display: inline-flex; align-items: stretch; border: 2px solid #111; border-radius: 6px; background: #fff; color: #111; overflow: hidden; line-height: 1; flex-shrink: 0; align-self: flex-start; box-shadow: 0 1px 0 rgba(0, 0, 0, .06); }
.cw-plate b { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; font-weight: 700; font-size: 15px; letter-spacing: .06em; padding: 6px 9px 5px; white-space: nowrap; }
.cw-plate-ind { background: #1A47B8; color: #fff; font-size: 8px; font-weight: 700; letter-spacing: .04em; writing-mode: vertical-rl; transform: rotate(180deg); padding: 2px; display: flex; align-items: center; justify-content: center; }
.cw-plate.lg b { font-size: 22px; padding: 9px 13px 8px; }
.cw-plate.lg .cw-plate-ind { font-size: 9.5px; padding: 3px; }
.cw-plate.sm b { font-size: 12px; padding: 4px 6px 3px; }
.cw-plate.sm .cw-plate-ind { font-size: 7px; }

.cw-stage { font-size: 11.5px; font-weight: 650; padding: 4px 10px; border-radius: 999px; white-space: nowrap; letter-spacing: .01em; }
.cw-stage.st-booked { background: var(--st-booked-soft); color: var(--st-booked); }
.cw-stage.st-waiting { background: var(--st-waiting-soft); color: var(--st-waiting); }
.cw-stage.st-washing { background: var(--st-washing-soft); color: var(--st-washing); }
.cw-stage.st-drying { background: var(--st-drying-soft); color: var(--st-drying); }
.cw-stage.st-ready { background: var(--st-ready-soft); color: var(--st-ready); }
.cw-stage.st-delivered { background: var(--st-delivered-soft); color: var(--st-delivered); }
.cw-stage.st-no_show { background: var(--red-soft); color: var(--red); }

.cw-hero .big { font-size: 46px; }
.cw-hero-n { font-family: var(--display); font-size: 28px; font-weight: 650; color: #fff; }
.cw-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cw-flow-step { display: flex; flex-direction: column; gap: 2px; padding: 10px 10px 9px; border-radius: 10px; text-decoration: none; background: rgba(255, 255, 255, .07); color: #fff; border-top: 3px solid var(--c, #fff); min-width: 0; }
.cw-flow-step b { font-family: var(--display); font-size: 22px; font-weight: 650; line-height: 1; }
.cw-flow-step span { font-size: 11.5px; color: #C2CCD8; }
.cw-flow-step.st-waiting { --c: #F2B544; }
.cw-flow-step.st-washing { --c: #5B9BFF; }
.cw-flow-step.st-drying { --c: #3CC6CF; }
.cw-flow-step.st-ready { --c: #3DD68C; }
.cw-flow.light .cw-flow-step { background: var(--tile); color: var(--ink); }
.cw-flow.light .cw-flow-step span { color: var(--muted); }
.cw-flow.light .cw-flow-step.st-waiting { --c: var(--st-waiting); }
.cw-flow.light .cw-flow-step.st-washing { --c: var(--st-washing); }
.cw-flow.light .cw-flow-step.st-drying { --c: var(--st-drying); }
.cw-flow.light .cw-flow-step.st-ready { --c: var(--st-ready); }

.cw-search { min-height: 48px; }
.cw-board { display: flex; flex-direction: column; gap: 10px; }
.cw-board.lanes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.cw-lane { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cw-lane-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 4px 6px; border-bottom: 3px solid var(--c, var(--line)); }
.cw-lane-head.st-waiting { --c: var(--st-waiting); }
.cw-lane-head.st-washing { --c: var(--st-washing); }
.cw-lane-head.st-drying { --c: var(--st-drying); }
.cw-lane-head.st-ready { --c: var(--st-ready); }
.cw-car { display: flex; flex-direction: column; gap: 10px; padding: 14px; box-shadow: inset 4px 0 0 var(--c, transparent); }
.cw-car.st-waiting { --c: var(--st-waiting); }
.cw-car.st-washing { --c: var(--st-washing); }
.cw-car.st-drying { --c: var(--st-drying); }
.cw-car.st-ready { --c: var(--st-ready); background: color-mix(in srgb, var(--st-ready-soft) 45%, var(--card)); }
.cw-car.st-delivered { --c: var(--line); opacity: .82; }
.cw-car.late { box-shadow: inset 4px 0 0 var(--red); }
.cw-car-top { display: flex; justify-content: space-between; gap: 10px; text-decoration: none; color: var(--ink); }
.cw-car-name { font-weight: 600; }
.cw-car-mid { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.cw-car-foot { display: flex; }
.cw-tag { font-size: 11px; font-weight: 650; padding: 3px 8px; border-radius: 6px; background: var(--tile); color: var(--ink); white-space: nowrap; border: none; }
.cw-tag.plan { background: var(--auto-blue-soft); color: var(--auto-blue-ink); }
.cw-tag.warn { background: var(--st-waiting-soft); color: var(--st-waiting); }
button.cw-tag { cursor: pointer; }
.cw-warn { color: var(--red) !important; }

.cw-vehicle { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--tile) 60%, var(--card))); }
.cw-vname { font-family: var(--display); font-size: 19px; }
.cw-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; position: relative; }
.cw-step { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 12px; position: relative; min-width: 0; }
.cw-step::before { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.cw-step:first-child::before { display: none; }
.cw-step.done::before { background: var(--c, var(--auto-blue)); }
.cw-step .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); position: relative; z-index: 1; }
.cw-step.done .dot { background: var(--c, var(--auto-blue)); border-color: var(--c, var(--auto-blue)); }
.cw-step.now .dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--auto-blue)) 22%, transparent); }
.cw-step b { font-size: 12px; font-weight: 650; }
.cw-step.st-waiting { --c: var(--st-waiting); }
.cw-step.st-washing { --c: var(--st-washing); }
.cw-step.st-drying { --c: var(--st-drying); }
.cw-step.st-ready { --c: var(--st-ready); }
.cw-step.st-delivered { --c: var(--st-delivered); }
.cw-total { border-top: 1px solid var(--line); padding-top: 10px; font-size: 16px; }
.cw-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.cw-photo { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.cw-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--tile); }
.cw-photo figcaption { font-size: 12px; color: var(--muted); }
.cw-chips { gap: 6px; }
.cw-chips .chip { min-height: 38px; }
.cw-svc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.cw-svc.on { border-color: var(--auto-blue); background: var(--auto-blue-soft); }
.cw-plate-in { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cw-known { display: flex; flex-direction: column; gap: 6px; border-color: var(--auto-blue-light); }
.cw-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.cw-stats .card { display: flex; flex-direction: column; gap: 4px; padding: 14px; min-width: 0; }
.cw-stats .card b { font-family: var(--display); font-size: 24px; font-weight: 650; letter-spacing: -0.4px; }
.cw-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.cw-bar { flex: 1; min-width: 2px; background: var(--auto-blue-light); border-radius: 3px 3px 0 0; }
.cw-bar.we { background: var(--auto-blue); }
.cw-price-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cw-price-grid .field { font-size: 11.5px; }
.input.cw-price { min-height: 42px; padding: 0 8px; text-align: right; }
label .input.cw-price { width: 96px; flex-shrink: 0; }
.cw-home { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.cw-bkrow { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
@media (max-width: 400px) {
  .cw-price-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cw-flow-step { padding: 8px 6px; }
  .cw-flow-step b { font-size: 19px; }
  .cw-step b { font-size: 10.5px; }
}
.cw-board.lanes .cw-car-top .cw-stage { display: none; }
.cw-car-top > div:first-child { min-width: 0; }
@media (min-width: 1024px) { .cw > .btn.full { align-self: flex-start; width: auto; padding: 0 32px; } }
/* ---------- end of Car wash and detailing ---------- */

/* ==========================================================================================
   NATIVE: the clinic look, built the way a phone or computer's own apps are.
   - The device's own font (San Francisco on Apple, Segoe UI on Windows, Roboto on Android).
   - A quiet grey page with plain white groups; hairlines instead of boxes; no gradients.
   - One accent (the clinic teal), only on what can be tapped or is selected.
   - Few sizes: 28 title, 17 headline, 15 body, 13 secondary. Red only for what is urgent.
   Everything here is under [data-theme="clinic"], after all other rules, so it wins.
   ========================================================================================== */
:root[data-theme="clinic"] {
  --display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI Variable Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bg: #F2F2F7; --card: #FFFFFF; --ink: #1C1C1E; --muted: #6C6C70; --faint: #AEAEB2;
  --line: #E3E3E8; --line-soft: #ECECF0; --tile: #F2F2F7; --panel: #F2F2F7; --panel-line: #E3E3E8;
  --fill: rgba(118, 118, 128, .12); --fill-strong: rgba(118, 118, 128, .2); /* quiet greys behind controls */
  --red: #C9342A; --now: #FF3B30; --desk-edge: #E9E9EE;
  --shadow-sm: none; --shadow-md: 0 8px 28px rgba(0, 0, 0, .12);
  --r-card: 14px; --r-ctl: 10px;
}
:root[data-theme="clinic"] body { -webkit-font-smoothing: antialiased; letter-spacing: 0; }
:root[data-theme="clinic"] :focus-visible { outline: 2px solid color-mix(in srgb, var(--violet) 55%, transparent); outline-offset: 2px; }

/* ---- Type ---- */
:root[data-theme="clinic"] .title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
:root[data-theme="clinic"] .h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
:root[data-theme="clinic"] .kicker { font-size: 13px; color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
:root[data-theme="clinic"] .h2.more-head { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
:root[data-theme="clinic"] b, :root[data-theme="clinic"] strong { font-weight: 600; }
:root[data-theme="clinic"] .muted { color: var(--muted); }

/* ---- Surfaces: white groups on the grey page, no outlines ---- */
:root[data-theme="clinic"] .card, :root[data-theme="clinic"] .stat, :root[data-theme="clinic"] .banner, :root[data-theme="clinic"] .cal-board,
:root[data-theme="clinic"] .next-card, :root[data-theme="clinic"] .tile { border: 0; box-shadow: none; border-radius: var(--r-card); background: var(--card); }
:root[data-theme="clinic"] .card .card, :root[data-theme="clinic"] .card .stat { background: var(--bg); } /* a group inside a group: grey */
:root[data-theme="clinic"] .stat b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
:root[data-theme="clinic"] .stat .muted { font-size: 13px; }
:root[data-theme="clinic"] .list-item { min-height: 56px; border-bottom-color: var(--line-soft); }
:root[data-theme="clinic"] .list-item:hover { background: transparent; }
:root[data-theme="clinic"] .kv { border-bottom-color: var(--line-soft); }

/* ---- Buttons: filled accent, quiet grey, or plain text ---- */
:root[data-theme="clinic"] .btn { min-height: 44px; padding: 0 16px; border-radius: var(--r-ctl); border: 0; box-shadow: none; font-family: var(--body); font-size: 15px; font-weight: 600; letter-spacing: 0; transition: opacity .12s, background .12s; }
:root[data-theme="clinic"] .btn:active { transform: none; opacity: .7; }
:root[data-theme="clinic"] .btn.primary { background: var(--violet); color: #fff; box-shadow: none; }
:root[data-theme="clinic"] .btn.primary:hover { background: var(--violet-deep); }
:root[data-theme="clinic"] .btn.ghost { background: var(--fill); color: var(--violet-ink); border: 0; box-shadow: none; }
:root[data-theme="clinic"] .btn.ghost:hover { background: var(--fill-strong); }
:root[data-theme="clinic"] .btn.dark { background: var(--ink); box-shadow: none; }
:root[data-theme="clinic"] .btn.danger { background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); border: 0; }
:root[data-theme="clinic"] .btn.sm { min-height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; }
:root[data-theme="clinic"] .btn.full { min-height: 50px; border-radius: 12px; font-family: var(--body); font-size: 17px; font-weight: 600; }
:root[data-theme="clinic"] .icon-btn { background: transparent; color: var(--violet-ink); border: 0; border-radius: 50%; width: 36px; height: 36px; }
:root[data-theme="clinic"] .icon-btn:hover { background: var(--fill); }
:root[data-theme="clinic"] .link-btn, :root[data-theme="clinic"] .attention .attn-more, :root[data-theme="clinic"] .sched-more { font-weight: 400; font-size: 15px; color: var(--violet); text-align: left; }

/* ---- Small labels: chips and badges, mostly grey ---- */
:root[data-theme="clinic"] .chip { border: 0; background: var(--fill); color: var(--ink); font-size: 13px; font-weight: 500; padding: 6px 12px; }
:root[data-theme="clinic"] .chip.on { background: var(--ink); color: #fff; }
:root[data-theme="clinic"] .pill { font-size: 12px; font-weight: 500; letter-spacing: 0; padding: 2px 8px; border-radius: 6px; }
:root[data-theme="clinic"] .avatar { font-weight: 600; }
:root[data-theme="clinic"] .avatar.lg { border-radius: 50%; font-family: var(--body); font-weight: 600; }

/* ---- Fields: grey filled, no outline until focused ---- */
:root[data-theme="clinic"] .field { font-size: 13px; font-weight: 500; color: var(--muted); }
:root[data-theme="clinic"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
:root[data-theme="clinic"] select, :root[data-theme="clinic"] textarea {
  background: var(--fill); border: 0; border-radius: var(--r-ctl); box-shadow: none; font-size: 16px; color: var(--ink); }
:root[data-theme="clinic"] input:focus-visible, :root[data-theme="clinic"] select:focus-visible, :root[data-theme="clinic"] textarea:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--violet) 55%, transparent); outline-offset: 0; background: var(--card); }
:root[data-theme="clinic"] ::placeholder { color: var(--faint); }

/* ---- The either/or switch: a grey track with a white thumb ---- */
:root[data-theme="clinic"] .seg, :root[data-theme="clinic"] .seg.sm { gap: 0; padding: 2px; border: 0; border-radius: 9px; background: var(--fill); }
:root[data-theme="clinic"] .seg button { min-height: 32px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--ink); }
:root[data-theme="clinic"] .seg.sm button { min-height: 28px; padding: 0 12px; }
:root[data-theme="clinic"] .seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }

/* ---- Today: a plain white summary, no coloured panel ---- */
:root[data-theme="clinic"] .hero { background: var(--card); color: var(--ink); border-radius: var(--r-card); padding: 18px; gap: 12px; box-shadow: none; }
:root[data-theme="clinic"] .hero::before, :root[data-theme="clinic"] .hero::after { display: none; }
:root[data-theme="clinic"] .hero .label { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: none; }
:root[data-theme="clinic"] .hero .big { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
:root[data-theme="clinic"] .hero .soft { color: var(--muted); }
:root[data-theme="clinic"] .hero .meter { height: 4px; background: var(--fill); }
:root[data-theme="clinic"] .hero .meter > span { background: var(--violet); }
:root[data-theme="clinic"] .hero .chip, :root[data-theme="clinic"] .hero .chip.glass, :root[data-theme="clinic"] .hero .chip.yellow { background: var(--fill); border: 0; color: var(--ink); font-weight: 500; }
:root[data-theme="clinic"] .next-patient { background: var(--bg); color: var(--ink); border: 0; border-radius: 12px; padding: 12px 14px; }
:root[data-theme="clinic"] .next-patient .soft { color: var(--muted); }
:root[data-theme="clinic"] .next-patient > :last-child { color: var(--faint); }
:root[data-theme="clinic"] .next-patient b { font-weight: 600; }

/* ---- Home lists ---- */
:root[data-theme="clinic"] .sched-head .h2 { font-size: 17px; }
:root[data-theme="clinic"] .sched-row + .sched-row, :root[data-theme="clinic"] .attention .banner + .banner { border-top-color: var(--line-soft); }
:root[data-theme="clinic"] .sched-row:hover, :root[data-theme="clinic"] .attention .banner:hover { background: var(--bg); }
:root[data-theme="clinic"] .sched-time { font-weight: 600; font-size: 15px; }
:root[data-theme="clinic"] .sched-who b { font-size: 15px; }
:root[data-theme="clinic"] .sched-row > :last-child { color: var(--faint); }
:root[data-theme="clinic"] .attention .banner { font-size: 15px; background: transparent; border-radius: 10px; }
:root[data-theme="clinic"] .attention .banner b { font-size: 15px; font-weight: 400; color: var(--ink); }
:root[data-theme="clinic"] .attention .banner .n { order: 2; min-width: 0; height: auto; padding: 0; background: none; font-family: var(--body); font-size: 15px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
:root[data-theme="clinic"] .attention .banner .grow, :root[data-theme="clinic"] .attention .banner > span.grow { order: 1; }
:root[data-theme="clinic"] .attention .banner > :last-child:not(.n):not(.grow) { order: 3; color: var(--faint); display: inline-flex; }
:root[data-theme="clinic"] .attention .banner > :first-child:not(.n):not(.grow) { display: none !important; } /* every row the same: words, number, arrow */
:root[data-theme="clinic"] .attention .banner.urgent { background: transparent; }
:root[data-theme="clinic"] .attention .banner.urgent b { color: var(--red); font-weight: 600; }
:root[data-theme="clinic"] .attention .banner.urgent .n { background: var(--red); color: #fff; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
:root[data-theme="clinic"] .banner.urgent { background: var(--card); }
:root[data-theme="clinic"] .banner .n { font-family: var(--body); }

/* ---- Calendar: quiet day strip, events with a colour edge ---- */
:root[data-theme="clinic"] .cal-day { border: 0; background: transparent; border-radius: 10px; }
:root[data-theme="clinic"] .cal-day:hover { background: var(--fill); }
:root[data-theme="clinic"] .cal-day b { font-family: var(--body); font-weight: 600; }
:root[data-theme="clinic"] .cal-day .wd { font-weight: 500; }
:root[data-theme="clinic"] .cal-day .n { background: none; color: var(--muted); font-weight: 500; min-width: 0; padding: 0; }
:root[data-theme="clinic"] .cal-day[aria-pressed="true"] { background: var(--violet); }
:root[data-theme="clinic"] .cal-day[aria-pressed="true"] .n { background: none; color: rgba(255, 255, 255, .8); }
:root[data-theme="clinic"] .cal-day.today:not([aria-pressed="true"]) b, :root[data-theme="clinic"] .cal-day.today:not([aria-pressed="true"]) .wd { color: var(--now); }
:root[data-theme="clinic"] .week-nav > .icon-btn { border: 0; border-radius: 50%; width: 36px; height: 36px; }
:root[data-theme="clinic"] .cal-note { color: var(--red); font-weight: 500; }
:root[data-theme="clinic"] .cal-head { border-bottom-color: var(--line-soft); }
:root[data-theme="clinic"] .cal-col { background: repeating-linear-gradient(var(--card) 0 calc(var(--hour, 50px) - 1px), var(--line-soft) calc(var(--hour, 50px) - 1px) var(--hour, 50px)); }
:root[data-theme="clinic"] .cal-block { border: 0 !important; border-left: 3px solid currentColor !important; border-radius: 6px; box-shadow: 0 0 0 1px var(--card); padding-left: 8px; }
:root[data-theme="clinic"] .cal-block b { font-weight: 600; }
:root[data-theme="clinic"] .cal-block .tag.quiet .tl { display: none; } /* "Confirmed" and "Done" are a small tick instead of a word; No-show, Waiting and In the chair keep their word */
:root[data-theme="clinic"] .cal-block.confirmed .tag::after { content: '✓'; font-size: 12px; font-weight: 700; opacity: .7; }

/* ---- Patient file ---- */
:root[data-theme="clinic"] .profile-head { background: var(--card); border-bottom: 0; }
:root[data-theme="clinic"] .profile-head .name { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
:root[data-theme="clinic"] .profile-head .chip { background: var(--fill); }
:root[data-theme="clinic"] .profile-head .icon-btn { background: transparent; }
:root[data-theme="clinic"] .file-tabs { display: inline-flex; gap: 0; border: 0; padding: 2px; margin: 12px 18px 4px; border-radius: 9px; background: var(--fill); align-self: flex-start; width: auto; max-width: calc(100% - 36px); }
:root[data-theme="clinic"] .file-tabs button { padding: 0 16px; min-height: 30px; margin: 0; border: 0; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--ink); }
:root[data-theme="clinic"] .file-tabs button.on { background: #fff; font-weight: 600; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
:root[data-theme="clinic"] .health-strip.empty { border: 0; background: var(--card); }
:root[data-theme="clinic"] .health-strip { border: 0; }

/* ---- Panels that slide up, and small messages ---- */
:root[data-theme="clinic"] .sheet { background: var(--bg); border-radius: 16px 16px 0 0; }
:root[data-theme="clinic"] .sheet .grip { width: 36px; height: 5px; background: var(--fill-strong); }
:root[data-theme="clinic"] .sheet .card { background: var(--card); }
:root[data-theme="clinic"] .toast { border-radius: 12px; font-weight: 500; }

/* ---- Floating buttons ---- */
:root[data-theme="clinic"] .ask-fab { width: 50px; height: 50px; border-radius: 50%; background: var(--card); color: var(--violet); box-shadow: 0 4px 16px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .06); }
:root[data-theme="clinic"] .ask-fab:hover { background: var(--card); }
:root[data-theme="clinic"] .demo-pill { background: rgba(28, 28, 30, .86); border: 0; font-weight: 500; }

/* ---- Phones and tablets: the bottom bar like the phone's own ---- */
@media (max-width: 1023px) {
  :root[data-theme="clinic"] #tabbar { height: calc(56px + env(safe-area-inset-bottom)); border-top: .5px solid rgba(0, 0, 0, .14); background: rgba(249, 249, 251, .92); box-shadow: none; }
  :root[data-theme="clinic"] #tabbar a { color: #8E8E93; background: none; font-weight: 500; }
  :root[data-theme="clinic"] #tabbar a.on { color: var(--violet); background: none; }
  :root[data-theme="clinic"] #tabbar a .lbl { font-size: 10px; font-weight: 500; letter-spacing: 0; }
  :root[data-theme="clinic"] #tabbar a.fab, :root[data-theme="clinic"] #tabbar a.fab.on { width: 44px; height: 44px; border-radius: 50%; background: var(--violet); color: #fff; box-shadow: none; }
  :root[data-theme="clinic"] .scr { gap: 14px; }
}

/* ---- Monitors: a quiet sidebar, tighter controls ---- */
@media (min-width: 1024px) {
  :root[data-theme="clinic"] body.app, :root[data-theme="clinic"] .app #shell { background: var(--bg); }
  :root[data-theme="clinic"] #tabbar { background: #F9F9FB; border-right: .5px solid rgba(0, 0, 0, .12); padding: 14px 10px 12px; gap: 1px; }
  :root[data-theme="clinic"] #tabbar a { height: 34px; border-radius: 8px; gap: 10px; padding: 0 10px; font-size: 14px; font-weight: 500; color: var(--ink); }
  :root[data-theme="clinic"] #tabbar a > span:first-child { color: var(--violet); }
  :root[data-theme="clinic"] #tabbar a:hover { background: var(--fill); color: var(--ink); }
  :root[data-theme="clinic"] #tabbar a.on { background: var(--fill-strong); color: var(--ink); font-weight: 600; padding: 0 10px; }
  :root[data-theme="clinic"] #tabbar a.fab, :root[data-theme="clinic"] #tabbar a.fab.on { height: 36px; margin: 8px 0 12px; border-radius: 10px; background: var(--violet); color: #fff; font-weight: 600; box-shadow: none; }
  :root[data-theme="clinic"] #tabbar a.fab > span:first-child { color: #fff; }
  :root[data-theme="clinic"] #tabbar a.fab:hover { background: var(--violet-deep); color: #fff; }
  :root[data-theme="clinic"] .side-group summary { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
  :root[data-theme="clinic"] .side-me { border: 0; background: transparent; }
  :root[data-theme="clinic"] .scr { padding: 28px 36px 24px; gap: 16px; }
  :root[data-theme="clinic"] .title { font-size: 26px; }
  :root[data-theme="clinic"] .btn { min-height: 36px; font-size: 14px; border-radius: 9px; }
  :root[data-theme="clinic"] .btn.sm { min-height: 30px; }
  :root[data-theme="clinic"] .btn.full { min-height: 44px; font-size: 15px; border-radius: 10px; }
  :root[data-theme="clinic"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), :root[data-theme="clinic"] select, :root[data-theme="clinic"] textarea { font-size: 14px; }
  :root[data-theme="clinic"] .sheet { border-radius: 14px; box-shadow: 0 24px 80px rgba(0, 0, 0, .22); }
  :root[data-theme="clinic"] .file-tabs { margin: 14px auto 6px; max-width: 1040px; width: fit-content; margin-left: max(40px, calc((100% - 1120px) / 2 + 40px)); }
  :root[data-theme="clinic"] .ask-fab { right: 24px; bottom: 24px; }
  :root[data-theme="clinic"] .cal-day { height: 36px; }
}

/* ==========================================================================================
   CLINIC, REIMAGINED: the day is the app (public/clinic-ui.js).
   One typeface (Inter), white surfaces on a soft grey page, one blue for what is happening now,
   amber for waiting, red only for alerts. A slim rail and a top bar; Today is the schedule plus
   "Right now". Under [data-theme="clinic"], after the native layer, so these win.
   ========================================================================================== */
:root[data-theme="clinic"] {
  --display: 'Inter Tight', Inter, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body: Inter, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --violet: #2450E0; --violet-soft: #EAF0FF; --violet-ink: #1A3CB0; --violet-deep: #1A3CB0; --violet-light: #7EA0FF;
  --bg: #F5F6F8; --card: #FFFFFF; --ink: #0F172A; --muted: #5A6475; --faint: #9AA3B2;
  --line: #E5E8EE; --line-soft: #EEF0F4; --tile: #F1F3F6; --panel: #F5F6F8; --panel-line: #E5E8EE;
  --fill: #F1F3F6; --fill-strong: #E5E8EE; --red: #A32014; --now: #D92D20; --desk-edge: #ECEEF2;
  --amber-soft: #FFF1DC; --amber-ink: #8A4B00; --r-card: 16px;
}
:root[data-theme="clinic"] .title, :root[data-theme="clinic"] .cm-title { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
:root[data-theme="clinic"] .h2 { font-family: var(--display); font-size: 18px; font-weight: 600; }
:root[data-theme="clinic"] .btn.ghost { background: var(--fill); color: var(--ink); }
:root[data-theme="clinic"] .btn.dark { background: var(--ink); }
:root[data-theme="clinic"] .chip.on { background: var(--ink); }
:root[data-theme="clinic"] .cal-day.today:not([aria-pressed="true"]) b, :root[data-theme="clinic"] .cal-day.today:not([aria-pressed="true"]) .wd { color: var(--violet); }
:root[data-theme="clinic"] .ask-fab { color: var(--violet); }

/* ---- Shared pieces ---- */
.cm-title { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: 0 !important; }
.cm-sub { margin: 0; color: var(--muted); font-size: 14px; }
.cm-btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--fill); color: var(--ink);
  font: 600 14px var(--body); text-decoration: none; white-space: nowrap; cursor: pointer; }
.cm-btn:hover { background: var(--fill-strong); }
.cm-btn.go { background: var(--violet); color: #fff; }
.cm-btn.go:hover { background: var(--violet-deep); }
.cm-mini { display: inline-flex; align-items: center; flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--fill); color: var(--ink);
  font: 600 13px var(--body); text-decoration: none; cursor: pointer; }
.cm-mini.go { background: var(--violet); color: #fff; }
.cm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line-soft); background: none;
  color: var(--ink); font: inherit; text-align: left; }
.cm-row.as-btn { cursor: pointer; }
.cm-row .who, .cm-nextrow .who { display: flex; flex-direction: column; min-width: 0; }
.cm-row .who b, .cm-nextrow .who b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-row .who span, .cm-nextrow .who span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-row .who span.amber { color: var(--amber-ink); }
.cm-time { flex: none; font-size: 12.5px; font-weight: 600; color: var(--violet); white-space: nowrap; }
.cm-none { margin: 0; padding: 8px 0 2px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; }
.cm-tot { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.cm-tot > span { display: flex; flex-direction: column; }
.cm-tot > span.r { text-align: right; }
.cm-tot span span { font-size: 12px; color: var(--muted); }
.cm-tot b { font: 600 20px var(--display); letter-spacing: -0.01em; }

/* ---- Today on a monitor ---- */
.cm-today { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.cm-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 22px 24px 24px; }
.cm-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cm-head > div:not(.cm-hrow) { display: flex; flex-direction: column; gap: 2px; }
.cm-sched { background: var(--card); border-radius: 16px; overflow: auto; max-height: calc(100vh - 172px); }
.cm-colhead, .cm-body { display: grid; grid-template-columns: 56px repeat(var(--n), minmax(150px, 1fr)); }
.cm-colhead { position: sticky; top: 0; z-index: 3; background: var(--card); border-bottom: 1px solid var(--line); }
.cm-colhead > div { display: flex; flex-direction: column; gap: 1px; padding: 12px 10px; min-width: 0; }
.cm-colhead b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-colhead span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-body { position: relative; }
.cm-hours { position: relative; }
.cm-hour { position: absolute; right: 10px; font-size: 11px; color: var(--muted); transform: translateY(-7px); white-space: nowrap; }
.cm-col { position: relative; border-left: 1px solid var(--line-soft); background-image: linear-gradient(var(--line-soft) 1px, transparent 1px); background-size: 100% var(--hour); }
.cm-blk { position: absolute; left: 6px; right: 6px; box-sizing: border-box; display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px #D9DEE7; font: inherit; text-align: left; overflow: hidden; cursor: pointer; }
.cm-blk .l { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.cm-blk b { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-blk .st { flex: none; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cm-blk .w { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-blk.short { flex-direction: row; align-items: center; gap: 8px; padding-top: 0; padding-bottom: 0; }
.cm-blk.short .l { flex: 0 1 auto; }
.cm-blk.done { background: var(--fill); box-shadow: none; color: var(--muted); }
.cm-blk.chair { background: var(--violet); box-shadow: none; color: #fff; }
.cm-blk.chair .st, .cm-blk.chair .w { color: #DCE6FF; }
.cm-blk.wait { background: var(--amber-soft); box-shadow: none; color: #5C3300; }
.cm-blk.wait .st, .cm-blk.wait .w { color: var(--amber-ink); }
.cm-blk.noshow { box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.cm-blk.noshow b { text-decoration: line-through; }
.cm-blk:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
.cm-now { position: absolute; left: 56px; right: 0; height: 0; border-top: 2px solid var(--now); z-index: 2; pointer-events: none; }
.cm-now span { position: absolute; left: -50px; top: -10px; padding: 1px 6px; border-radius: 6px; background: var(--now); color: #fff; font-size: 11px; font-weight: 600; }
.cm-side { position: sticky; top: 59px; display: flex; flex-direction: column; gap: 18px; height: calc(100vh - 59px); padding: 22px 20px; overflow-y: auto;
  background: var(--card); border-left: 1px solid var(--line); }
.cm-side h2 { margin: 0; font: 600 18px var(--display); letter-spacing: 0; }
.cm-sec { display: flex; flex-direction: column; }
.cm-sec h3, .cm-card h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cm-sec.chair h3 { color: var(--violet); }
.cm-sec.wait h3, .cm-card h3.wait { color: var(--amber-ink); }
.cm-side .cm-tot { margin-top: auto; }

/* ---- The top bar (monitors) ---- */
#cm-top { position: sticky; top: 0; z-index: 18; display: flex; align-items: center; gap: 12px; height: 59px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.cm-clinic { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; margin-left: -10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 600 14px var(--body); white-space: nowrap; }
button.cm-clinic { cursor: pointer; }
button.cm-clinic:hover { background: var(--fill); }
.cm-clinic span { color: var(--muted); display: inline-flex; transform: rotate(90deg); }
.cm-cmd { position: relative; flex: 1 1 280px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--fill); color: var(--muted); }
.cm-cmd:focus-within { background: var(--card); box-shadow: 0 0 0 2px var(--violet); }
:root[data-theme="clinic"] .cm-cmd input { flex: 1; min-width: 0; height: 36px; padding: 0; border: 0; outline: 0; background: transparent; font: 400 14px var(--body); color: var(--ink); }
.cm-cmd kbd { flex: none; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font: 500 12px var(--body); color: var(--muted); }
.cm-cmd-list { position: absolute; top: 44px; left: 0; right: 0; z-index: 30; display: flex; flex-direction: column; padding: 6px; border-radius: 12px; background: var(--card);
  box-shadow: 0 12px 36px rgba(15, 23, 42, .16), 0 0 0 1px var(--line); }
.cm-cmd-list[hidden] { display: none; }
.cm-cmd-list button { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cm-cmd-list button.on, .cm-cmd-list button:hover { background: var(--fill); }
.cm-cmd-list b { font-weight: 600; font-size: 14px; }
.cm-cmd-list span { font-size: 12.5px; color: var(--muted); }
.cm-cmd-list .cm-ask b { color: var(--violet-ink); }

/* ---- Monitors: the side menu ---- */
@media (min-width: 1024px) {
  .cm-phone-only { display: none !important; }
  :root[data-theme="clinic"] .app #shell { padding: 0 0 0 232px; }
  :root[data-theme="clinic"] #tabbar { width: 232px; padding: 12px 10px; align-items: stretch; gap: 2px; background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; }
  :root[data-theme="clinic"] #tabbar .cm-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font: 600 15px var(--display); }
  :root[data-theme="clinic"] #tabbar .cm-brand img { border-radius: 9px; }
  :root[data-theme="clinic"] #tabbar .cm-tab, :root[data-theme="clinic"] #tabbar .cm-sub { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px;
    width: auto; height: 36px; flex: none; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 500 14px var(--body); text-decoration: none; cursor: pointer; }
  :root[data-theme="clinic"] #tabbar .cm-sub { height: 34px; font-size: 13.5px; }
  :root[data-theme="clinic"] #tabbar .cm-tab > span:first-child, :root[data-theme="clinic"] #tabbar .cm-sub > span:first-child { color: var(--muted); display: inline-flex; }
  :root[data-theme="clinic"] #tabbar .cm-tab .lbl, :root[data-theme="clinic"] #tabbar .cm-sub .lbl { display: inline; font-size: inherit; }
  :root[data-theme="clinic"] #tabbar .cm-tab:hover, :root[data-theme="clinic"] #tabbar .cm-sub:hover { background: var(--fill); }
  :root[data-theme="clinic"] #tabbar .cm-tab.on, :root[data-theme="clinic"] #tabbar .cm-sub.on { background: var(--violet-soft); color: var(--violet-ink); font-weight: 600; padding: 0 10px; }
  :root[data-theme="clinic"] #tabbar .cm-tab.on > span:first-child, :root[data-theme="clinic"] #tabbar .cm-sub.on > span:first-child { color: var(--violet); }
  :root[data-theme="clinic"] #tabbar .cm-group { margin-top: 6px; }
  :root[data-theme="clinic"] #tabbar .cm-group summary { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 10px; border-radius: 8px; list-style: none;
    font: 600 12px var(--body); color: var(--muted); cursor: pointer; user-select: none; }
  :root[data-theme="clinic"] #tabbar .cm-group summary::-webkit-details-marker { display: none; }
  :root[data-theme="clinic"] #tabbar .cm-group summary:hover { background: var(--fill); color: var(--ink); }
  :root[data-theme="clinic"] #tabbar .cm-group summary > span { display: inline-flex; transition: transform .15s; }
  :root[data-theme="clinic"] #tabbar .cm-group[open] summary > span { transform: rotate(90deg); }
  :root[data-theme="clinic"] #tabbar .cm-fill { flex: 1; min-height: 12px; }
  :root[data-theme="clinic"] #tabbar .cm-me { display: flex; align-items: center; gap: 10px; height: auto; padding: 8px; border-radius: 10px; color: var(--ink); text-decoration: none; }
  :root[data-theme="clinic"] #tabbar .cm-me:hover, :root[data-theme="clinic"] #tabbar .cm-me.on { background: var(--fill); }
  :root[data-theme="clinic"] #tabbar .cm-me .who { display: flex; flex-direction: column; min-width: 0; }
  :root[data-theme="clinic"] #tabbar .cm-me .who b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  :root[data-theme="clinic"] #tabbar .cm-me .who span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  :root[data-theme="clinic"] #tabbar .ask-side { display: none !important; }
  :root[data-theme="clinic"] .scr { padding: 24px 32px 32px; }
  :root[data-theme="clinic"] .profile-head { padding-top: 18px; }
}
/* Tablets and narrow windows: the top bar stays; the menu is the bottom bar. */
@media (min-width: 700px) {
  /* The box at the top asks for anything, so the round Ask button isn't needed (it covered the totals). */
  :root[data-theme="clinic"] .ask-fab { display: none; }
  /* The Demo button sits in the top bar, off the schedule. */
  :root[data-theme="clinic"] .demo-pill { top: 11px; right: 24px; bottom: auto; left: auto; height: 36px; z-index: 19; }
  :root[data-theme="clinic"] body.is-demo #cm-top { padding-right: 132px; }
}
@media (max-width: 1099px) {
  /* Right now moves above the schedule, as three lists side by side. */
  .cm-today { grid-template-columns: minmax(0, 1fr); }
  .cm-side { position: static; height: auto; order: -1; border-left: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 24px; padding: 18px 24px; }
  .cm-side h2, .cm-side .cm-tot { grid-column: 1 / -1; }
  .cm-side .cm-tot { margin-top: 0; }
  .cm-sched { max-height: none; }
}

/* ---- Phones and tablets ---- */
@media (max-width: 1023px) {
  .cm-desk-only { display: none !important; }
  :root[data-theme="clinic"] #tabbar .cm-tab { color: var(--muted); }
  :root[data-theme="clinic"] #tabbar .cm-tab.on { color: var(--violet); }
  :root[data-theme="clinic"] #tabbar a.fab { background: var(--ink); }
  .cm-phone { display: flex; flex-direction: column; gap: 14px; padding: 22px 16px 8px; }
  .cm-phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
  .cm-phone .cm-title { font-size: 32px; line-height: 1.1; }
  .cm-pclinic { display: flex; align-items: center; gap: 6px; max-width: 170px; height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--card); color: var(--ink); font: 600 14px var(--body); }
  .cm-pclinic span:last-child { color: var(--muted); display: inline-flex; transform: rotate(90deg); }
  .cm-nowcard { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 18px; background: var(--violet); color: #fff; text-decoration: none; }
  .cm-nowcard .k { font-size: 13px; font-weight: 600; color: #DCE6FF; }
  .cm-nowcard .n { font: 600 24px var(--display); letter-spacing: -0.01em; }
  .cm-nowcard .w { color: #DCE6FF; }
  .cm-nowcard .cta { display: flex; align-items: center; justify-content: center; height: 46px; margin-top: 8px; border-radius: 12px; background: #fff; color: var(--violet-ink); font-weight: 600; }
  .cm-card { display: flex; flex-direction: column; padding: 14px 16px 6px; border-radius: 18px; background: var(--card); }
  .cm-cardhead { display: flex; align-items: baseline; justify-content: space-between; }
  .cm-cardhead a { font-size: 13px; font-weight: 600; text-decoration: none; }
  .cm-phone .cm-row { min-height: 60px; }
  .cm-phone .cm-mini { height: 44px; padding: 0 16px; border-radius: 12px; font-size: 14px; }
  .cm-nextrow { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 0; border: 0; border-top: 1px solid var(--line-soft); background: none; color: var(--ink); font: inherit; text-align: left; }
  .cm-nextrow .t { flex: none; width: 54px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .cm-phone .cm-tot { padding: 14px 4px 0; border-top: 0; }
}

/* ---- The patient: head, today's visit, and the three-column workspace (public/clinic-ui.js) ---- */
.cm-phd { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.cm-back { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--fill); color: var(--ink); display: flex; align-items: center; justify-content: center; text-decoration: none; }
.cm-ava { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--violet-soft); color: var(--violet); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; }
.cm-pname { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-pname .cm-title { font-size: 24px; }
.cm-alerts { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-alerts span { padding: 5px 10px; border-radius: 8px; background: var(--amber-soft); color: var(--amber-ink); font-size: 13px; font-weight: 600; }
.cm-alerts span.red { background: #FDECEA; color: #A32014; }
.cm-state { padding: 5px 10px; border-radius: 8px; background: var(--fill); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.cm-state.chair { background: var(--violet); color: #fff; }
.cm-state.wait { background: var(--amber-soft); color: var(--amber-ink); }
.cm-pacts { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-btn.dark { background: var(--ink); color: #fff; }
.cm-visit { display: flex; flex-direction: column; gap: 14px; }
.cm-vhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cm-vhead span { color: var(--muted); font-size: 13px; text-align: right; }
.cm-speak { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--violet-soft); color: var(--violet-ink); text-decoration: none; }
.cm-speak .mic { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--violet); color: #fff; display: flex; align-items: center; justify-content: center; }
.cm-speak > span:last-child { display: flex; flex-direction: column; }
.cm-speak b { font-weight: 600; }
.cm-speak > span:last-child span { font-size: 13px; }
.cm-vbill { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.cm-vbill > span { display: flex; flex-direction: column; }
.cm-vbill span span { font-size: 13px; color: var(--muted); }
.cm-vbill b { font: 600 22px var(--display); letter-spacing: -0.01em; }
.profile-body.cm-wsbody { display: block; width: auto; max-width: none; margin: 0; padding: 12px 24px 24px; }
/* Small laptops (1024 to 1279px): two columns, History under today's visit, so the teeth are never cut off. Three columns from 1280px (the block at the end of this file). */
.cm-ws { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 1.1fr); grid-template-rows: auto 1fr; gap: 20px; align-items: start; }
.cm-ws > .cm-wcol:nth-child(1) { grid-column: 1; grid-row: 1; }
.cm-ws > .cm-wcol:nth-child(2) { grid-column: 2; grid-row: 1 / span 2; }
.cm-ws > .cm-wcol:nth-child(3) { grid-column: 1; grid-row: 2; }
.cm-wcol, .cm-wdetails { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cm-wdetails { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; max-width: 1120px; }
.cm-ws[hidden], .cm-wdetails[hidden] { display: none; }
@media (min-width: 1024px) { :root[data-theme="clinic"] .file-tabs { margin: 16px 24px 4px; } }
@media (max-width: 1023px) { .cm-phd { padding: 14px 16px; } .cm-pacts { width: 100%; } .cm-pacts .cm-btn { flex: 1 1 auto; height: 44px; } }

/* ---- Walk-in, Team and Money (public/clinic-ui.js) ---- */
.cm-page { display: flex; flex-direction: column; gap: 20px; padding: 28px 32px 32px; }
.cm-page.narrow { max-width: 1040px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.cm-hrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cm-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #E9ECF1; }
.cm-seg > * { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 8px; color: var(--muted); font: 500 14px var(--body); text-decoration: none; white-space: nowrap; }
.cm-seg > .on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.cm-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.cm-split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.cm-q { display: flex; flex-direction: column; gap: 10px; }
.cm-q h2, .cm-wsum .k, .cm-kv .k { margin: 0; font: 600 13px var(--body); color: var(--muted); }
.cm-two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; }
:root[data-theme="clinic"] .cm-two input { height: 44px; padding: 0 14px; font-size: 16px; }
.cm-found, .cm-opts { display: flex; flex-direction: column; gap: 2px; }
.cm-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cm-opt:hover { background: var(--fill); }
.cm-opt[aria-pressed="true"] { background: var(--violet-soft); }
.cm-opt .who { display: flex; flex-direction: column; min-width: 0; }
.cm-opt .who b { font-weight: 600; }
.cm-opt .who span { font-size: 13px; color: var(--muted); }
.cm-picked { margin: 0; font-size: 13px; font-weight: 600; color: var(--violet-ink); }
.cm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-chips button { height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--fill); color: var(--ink); font: 500 14px var(--body); cursor: pointer; }
.cm-chips button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }
.cm-wsum { display: flex; flex-direction: column; gap: 14px; padding: 24px; position: sticky; top: 80px; }
.cm-token { font: 600 56px/1 var(--display); letter-spacing: -0.03em; }
.cm-token.dim { color: var(--faint); }
.cm-kv { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px 12px; font-size: 14px; }
.cm-wnote { margin: 0; padding: 12px; border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 13px; }
.cm-big { display: flex; align-items: center; justify-content: center; height: 48px; border: 0; border-radius: 12px; background: var(--violet); color: #fff; font: 600 16px var(--body); text-decoration: none; cursor: pointer; }
.cm-big:disabled { opacity: .6; cursor: progress; }
.cm-list { display: flex; flex-direction: column; }
.cm-list > .h2, .cm-list > .cm-vhead { margin-bottom: 8px; }
a.cm-row { text-decoration: none; }
a.cm-row:hover b { color: var(--violet-ink); }
.cm-row > span:last-child svg, .cm-row > svg { color: var(--faint); }
.cm-ini { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--fill); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.cm-row .grow { flex: 1; }
.cm-st { flex: none; font-size: 13px; font-weight: 600; color: var(--violet-ink); white-space: nowrap; }
.cm-st.quiet { color: var(--muted); }
.cm-st.red { color: var(--red); }
.cm-st.amber, .amber { color: var(--amber-ink); }
.cm-pay { display: flex; flex-direction: column; gap: 16px; }
.cm-rule { max-width: 60%; padding: 5px 10px; border-radius: 8px; background: var(--violet-soft); color: var(--violet-ink) !important; font-size: 13px; font-weight: 600; text-align: left !important; }
.cm-rule:empty { display: none; }
.cm-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cm-figs > div { display: flex; flex-direction: column; gap: 2px; }
.cm-figs span { font-size: 12px; color: var(--muted); }
.cm-figs b { font: 600 22px var(--display); letter-spacing: -0.01em; }
.cm-owe { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 12px; background: var(--bg); }
.cm-owe > span:first-child { display: flex; flex-direction: column; }
.cm-owe > span:first-child span { font-size: 13px; color: var(--muted); }
.cm-owe b { font: 600 24px var(--display); letter-spacing: -0.01em; }
.cm-acts { display: flex; gap: 8px; }
.cm-owe .cm-btn { background: var(--card); }
.cm-owe .cm-btn.dark { background: var(--ink); }
.cm-amt { display: flex; flex-direction: column; align-items: flex-end; }
.cm-amt b, .cm-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.cm-amt span { font-size: 12px; color: var(--muted); }
.cm-more { font-size: 13px; font-weight: 600; text-decoration: none; padding-top: 8px; }
.cm-vhead .cm-more { padding-top: 0; }
.cm-figrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.cm-fig { display: flex; flex-direction: column; gap: 6px; }
.cm-fig span { color: var(--muted); font-size: 14px; }
.cm-fig span:last-child { font-size: 13px; }
.cm-fig b { font: 600 34px/1.1 var(--display); letter-spacing: -0.02em; }
.cm-earnrow { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0 10px; }
.cm-earnrow > span { display: flex; flex-direction: column; }
.cm-earnrow > span.r { text-align: right; }
.cm-earnrow span span { font-size: 13px; color: var(--muted); }
.cm-earnrow b { font: 600 24px var(--display); letter-spacing: -0.01em; }
.cm-cardhead span { font-size: 13px; color: var(--muted); }
.cm-in { padding: 4px 16px; }
.cm-in .cm-row { border-top: 0; }
@media (max-width: 1023px) {
  .cm-page { padding: 20px 16px 8px; gap: 14px; }
  .cm-split, .cm-split.even { grid-template-columns: minmax(0, 1fr); }
  .cm-two { grid-template-columns: minmax(0, 1fr); }
  .cm-wsum { position: static; }
  .cm-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-rule { max-width: 100%; }
  .cm-page .cm-btn { height: 44px; }
  .cm-chips button { height: 44px; }
  .cm-fig b { font-size: 28px; }
}
@media (max-width: 699px) { #cm-top { display: none !important; } }
@media (min-width: 700px) and (max-width: 1023px) { .cm-main { padding: 18px 16px 24px; } #cm-top { padding: 0 16px; } }

/* CLINIC: BILLS, MONEY AND BACK OFFICE */
/* The shared page head (CU.head in public/clinic-ui.js) and the screens that start with it: Bills, Cash count,
   Payouts, Reports, Expenses and profit, Packages, Stock, Lab work, Equipment, Requests. They take the same
   spacing as Money and Team, use the whole monitor, and share one left edge. Figures, rows and switches reuse
   the cm-* pieces above (cm-figrow, cm-fig, cm-split, cm-list, cm-row, cm-num, cm-seg, cm-btn, cm-mini). */
:root[data-theme="clinic"] .cm-hmain { flex: 1 1 280px; flex-wrap: nowrap; align-items: center; min-width: 0; }
:root[data-theme="clinic"] .cm-ht { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
:root[data-theme="clinic"] .cm-hacts { justify-content: flex-end; max-width: 100%; }
:root[data-theme="clinic"] .cm-hacts .cm-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
:root[data-theme="clinic"] .cm-seg > button { border: 0; background: none; cursor: pointer; }
:root[data-theme="clinic"] .cm-seg > button.on { background: #fff; }
:root[data-theme="clinic"] .cm-btn { gap: 6px; }
:root[data-theme="clinic"] .cm-btn:disabled { opacity: .6; cursor: progress; }
:root[data-theme="clinic"] .scr:has(> .cm-head) { gap: 16px; }
:root[data-theme="clinic"] .cm-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 20px; align-items: start; }
:root[data-theme="clinic"] .cm-grid2 > *, :root[data-theme="clinic"] .cm-split > * { min-width: 0; }
@media (min-width: 1024px) {
  :root[data-theme="clinic"] #screen .scr:has(> .cm-head) { max-width: none; margin: 0; padding: 28px 32px 32px; gap: 20px; }
  /* Anything that isn't laid out for the full width (a form, a single list) keeps a comfortable line length. */
  :root[data-theme="clinic"] #screen .scr:has(> .cm-head) > :not(.cm-head, .cm-figrow, .cm-split, .cm-grid2, .cm-wide) { max-width: 880px; }
  :root[data-theme="clinic"] #screen .scr:has(> .cm-head) > .btn { align-self: flex-start; }
}
@media (max-width: 1023px) {
  :root[data-theme="clinic"] .scr .cm-head .cm-btn { height: 44px; }
  :root[data-theme="clinic"] .cm-hacts { justify-content: flex-start; }
}
/* Rows, notes and small pieces */
:root[data-theme="clinic"] a.who { color: inherit; text-decoration: none; }
:root[data-theme="clinic"] .cm-row .who.wrap { flex: 1 1 auto; }
:root[data-theme="clinic"] .cm-row .who.wrap span, :root[data-theme="clinic"] .cm-row .who.wrap b, :root[data-theme="clinic"] .cm-row .who.wrap a { white-space: normal; overflow-wrap: anywhere; }
:root[data-theme="clinic"] .cm-case .cm-state { flex: none; }
:root[data-theme="clinic"] .cm-payrow .cm-amt { flex: none; min-width: 88px; }
:root[data-theme="clinic"] .cm-go { flex: none; display: inline-flex; color: var(--faint); }
:root[data-theme="clinic"] .cm-foot { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
:root[data-theme="clinic"] .cm-list > .cm-foot { padding-top: 10px; }
:root[data-theme="clinic"] .cm-list > .cm-row:first-child, :root[data-theme="clinic"] .cm-list > .cm-none:first-child { border-top: 0; }
:root[data-theme="clinic"] .cm-crumb { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin: -10px 0 -6px; font-size: 13px; font-weight: 600; text-decoration: none; }
:root[data-theme="clinic"] .cm-ht > .cm-crumb { margin: 0 0 2px; } /* inside the page head (backLabel), above the title */
:root[data-theme="clinic"] .cm-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
:root[data-theme="clinic"] .cm-day { margin: 0; padding: 14px 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
:root[data-theme="clinic"] .cm-num.red, :root[data-theme="clinic"] .cm-amt b.red { color: var(--red); }
:root[data-theme="clinic"] .cm-num.quiet { color: var(--muted); font-weight: 500; }
:root[data-theme="clinic"] .cm-qty { flex: none; display: flex; flex-direction: column; align-items: flex-end; min-width: 64px; }
:root[data-theme="clinic"] .cm-qty b { font: 600 17px var(--display); font-variant-numeric: tabular-nums; }
:root[data-theme="clinic"] .cm-qty span { font-size: 12px; color: var(--muted); }
:root[data-theme="clinic"] .cm-tag { flex: none; width: 44px; text-align: right; font-size: 12.5px; font-weight: 600; color: var(--amber-ink); }
/* Fields that sit on the page itself (a search, a pair of dates): white, so they read as fields */
:root[data-theme="clinic"] .scr:has(> .cm-head) .search { min-height: 40px; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--card); box-shadow: none; }
:root[data-theme="clinic"] .scr:has(> .cm-head) .search input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) { height: 38px; padding: 0; border-radius: 0; background: transparent; font-size: 14px; outline: 0; }
:root[data-theme="clinic"] .cm-dates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
:root[data-theme="clinic"] .cm-dates[hidden] { display: none; }
:root[data-theme="clinic"] .cm-dates .field { flex: 1 1 150px; min-width: 150px; max-width: 220px; }
:root[data-theme="clinic"] .cm-dates input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) { height: 38px; background: var(--card); }
/* Tables (Reports, statements, Bills) */
:root[data-theme="clinic"] .mn-table th { font-size: 12px; text-transform: none; letter-spacing: 0; }
:root[data-theme="clinic"] .mn-table th + th, :root[data-theme="clinic"] .mn-table td + td { padding-left: 16px; }
:root[data-theme="clinic"] .mn-table td { border-top-color: var(--line-soft); }
:root[data-theme="clinic"] .mn-table .plan-meter > span { background: var(--violet); }
:root[data-theme="clinic"] .mn-table tr.cm-click { cursor: pointer; }
:root[data-theme="clinic"] .mn-table tr.cm-click:hover td { background: var(--fill); }
:root[data-theme="clinic"] .mn-table tr.cm-dayrow td { padding: 16px 4px 6px; border-top: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
:root[data-theme="clinic"] .mn-table tr.cm-dayrow:first-child td { padding-top: 2px; }
:root[data-theme="clinic"] .mn-table td.red { color: var(--red); font-weight: 600; }
:root[data-theme="clinic"] .mn-table td.quiet { color: var(--muted); }
/* Cash count and Expenses and profit */
:root[data-theme="clinic"] .card > .bo-line:first-child { border-top: 0; }
:root[data-theme="clinic"] .bo-line { border-top-color: var(--line-soft); }
:root[data-theme="clinic"] .bo-sub { margin: 14px 0 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
:root[data-theme="clinic"] .bo-chart svg { max-width: 440px; }
:root[data-theme="clinic"] .bo-chart .bo-bar-out { fill: #B8C0CC; }
:root[data-theme="clinic"] .bo-key.out { background: #B8C0CC; }
/* The drawing scales with its card, so its labels are set smaller on monitors (they come out near 13 px either way). */
:root[data-theme="clinic"] .bo-chart .bo-chart-month { font-size: 12.5px; }
:root[data-theme="clinic"] .bo-chart .bo-chart-profit { font-size: 12px; fill: var(--ink); }
@media (min-width: 1024px) {
  :root[data-theme="clinic"] .bo-chart .bo-chart-month { font-size: 10.5px; }
  :root[data-theme="clinic"] .bo-chart .bo-chart-profit { font-size: 10px; }
}
:root[data-theme="clinic"] .mn-table a { text-decoration: none; }
:root[data-theme="clinic"] .cm-bills a { color: inherit; font-weight: 500; }
:root[data-theme="clinic"] .bo-chart .bo-chart-profit.neg { fill: var(--red); }
/* Lab cases and the bill page: one coloured action, the rest quiet */
:root[data-theme="clinic"] .cm-case { display: flex; flex-direction: column; gap: 10px; }
:root[data-theme="clinic"] .cm-case .cm-acts { flex-wrap: wrap; }
:root[data-theme="clinic"] .cm-case.overdue { box-shadow: inset 3px 0 0 var(--now); }
:root[data-theme="clinic"] .cm-mini > span[aria-hidden] { margin-right: 6px; }
:root[data-theme="clinic"] .cm-quiet-red { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--red); font: 500 13px var(--body); cursor: pointer; }
:root[data-theme="clinic"] .cm-fig.neg b { color: var(--red); }
:root[data-theme="clinic"] .mn-table td.amber { font-weight: 600; }
:root[data-theme="clinic"] .scr .cm-seg { align-self: flex-start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
:root[data-theme="clinic"] .cm-acts { align-items: center; }
:root[data-theme="clinic"] a.cm-mini { text-decoration: none; }
/* Phones: tables fit without scrolling sideways, and a pay row puts the name on its own line above the amount and button */
@media (max-width: 699px) {
  :root[data-theme="clinic"] .mn-fit .mn-table { font-size: 13px; }
  :root[data-theme="clinic"] .mn-fit .mn-table th + th, :root[data-theme="clinic"] .mn-fit .mn-table td + td { padding-left: 8px; }
  :root[data-theme="clinic"] .cm-payrow { flex-wrap: wrap; row-gap: 6px; }
  :root[data-theme="clinic"] .cm-payrow .who { flex: 1 1 100%; }
  :root[data-theme="clinic"] .cm-payrow .who span { white-space: normal; }
  :root[data-theme="clinic"] .cm-payrow .cm-amt { align-items: flex-start; margin-right: auto; }
  :root[data-theme="clinic"] .cm-strip { flex-wrap: wrap; }
}

/* CLINIC: PATIENT FILE, BOOKING, CALENDAR */
/* ---- Calendar: every word readable (12px and up), quiet notes, labels that say what is happening ---- */
:root[data-theme="clinic"] .cal-note { color: var(--muted); }
:root[data-theme="clinic"] .cal-offtag { font-size: 12px; color: var(--muted); }
:root[data-theme="clinic"] .cal-block .tag { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
:root[data-theme="clinic"] .cal-block.confirmed .tag.loud::after { content: none; }
:root[data-theme="clinic"] .cal-block .tag.wait { color: var(--amber-ink); }
:root[data-theme="clinic"] .cal-block .tag.chair { color: var(--violet); }
:root[data-theme="clinic"] .cal-block.no_show { color: var(--muted) !important; }
:root[data-theme="clinic"] .cal-block .t { font-size: 12px; }
:root[data-theme="clinic"] .cal-now span { font-size: 12px; }
:root[data-theme="clinic"] .cal-day .wd { font-size: 12px; }
:root[data-theme="clinic"] .cal-day .n { display: block; height: auto; font-size: 12px; line-height: 1.2; white-space: nowrap; }
:root[data-theme="clinic"] .cal-day .nw { display: none; }
@media (min-width: 700px) { :root[data-theme="clinic"] .cal-day .nw { display: inline; } }
@media (min-width: 1024px) {
  /* The date on one line, "25 visits" under it, so the number is never read as part of the date. */
  :root[data-theme="clinic"] .cal-day { display: grid; grid-template-columns: auto auto; justify-content: center; align-content: center; align-items: baseline; column-gap: 6px; row-gap: 2px; height: 48px; padding: 0 8px; }
  :root[data-theme="clinic"] .cal-day .n { grid-column: 1 / -1; justify-self: center; }
}
/* ---- Calendar in Today's look: column heads with name and count; visits are Today's blocks (.cm-blk above), coloured by what is happening ---- */
:root[data-theme="clinic"] .cal-head > .cm-calhd { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 0 10px; text-align: left; }
:root[data-theme="clinic"] .cal-head > .cm-calhd b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-theme="clinic"] .cal-head > .cm-calhd span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-theme="clinic"] .cal-col .cm-blk { left: 4px; right: 4px; }
:root[data-theme="clinic"] .cal-col .cm-blk .st { font-size: 12px; }
@container calcol (max-width: 190px) {
  /* A narrow column (a phone): grey already says done, so the word makes room for the name; tighter padding. */
  :root[data-theme="clinic"] .cal-col .cm-blk.done .st { display: none; }
  :root[data-theme="clinic"] .cal-col .cm-blk { padding-left: 8px; padding-right: 8px; }
}
/* ---- Patient file: one way into today's note at a time. The head's button hides while "Today's visit" is on screen ---- */
:root[data-theme="clinic"] .cm-phd:has(~ .profile-body .cm-ws:not([hidden]) .cm-visit .cm-speak) .cm-notebtn,
:root[data-theme="clinic"] .cm-phd:has(~ .profile-body > .cm-visit:not(.tab-off) .cm-speak) .cm-notebtn { display: none; }
/* ---- Patient file: the head ---- */
:root[data-theme="clinic"] .cm-alerts button { border: 0; padding: 5px 10px; border-radius: 8px; background: var(--amber-soft); color: var(--amber-ink); font: 600 13px var(--body); cursor: pointer; }
:root[data-theme="clinic"] .cm-alerts button.red { background: #FDECEA; color: #A32014; }
:root[data-theme="clinic"] .cm-alerts .quiet { background: var(--fill); color: var(--muted); font-weight: 500; }
/* The age and alerts strip (phones and tablets): the same corners and padding as the cards around it */
:root[data-theme="clinic"] .health-strip { border-radius: var(--r-card); padding: 14px 16px; }
/* ---- Patient file: History is one white card, a hairline between visits ---- */
:root[data-theme="clinic"] .cm-history .tl-item { background: none; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; padding: 12px 0; margin: 0; }
:root[data-theme="clinic"] .cm-history .timeline > .tl-item:first-child, :root[data-theme="clinic"] .cm-history .tl-sub + .tl-item { border-top: 0; }
:root[data-theme="clinic"] .cm-history .tl-dot { top: 17px; }
:root[data-theme="clinic"] .cm-history .tl-sub { position: relative; margin: 8px 0 0 -18px; padding: 2px 0; background: var(--card); font: 600 13px var(--body); color: var(--muted); }
:root[data-theme="clinic"] .cm-history .tl-sub:first-child { margin-top: 0; }
/* ---- Patient file: nothing under 12px on the tooth chart and its key ---- */
:root[data-theme="clinic"] .tooth-chart .tooth .tm { font-size: 12px; }
:root[data-theme="clinic"] .tooth-chart .tooth .tp, :root[data-theme="clinic"] .tooth-chart .tooth .td { width: 16px; height: 16px; font-size: 12px; bottom: -5px; }
:root[data-theme="clinic"] .tooth-chart .tooth .tp { right: -5px; } /* on the corner, clear of the tooth's number */
:root[data-theme="clinic"] .tooth-chart .tooth .td { left: -5px; }
:root[data-theme="clinic"] .tooth.sw { width: 30px; height: 24px; font-size: 12px; }
:root[data-theme="clinic"] .tooth.sw .tp, :root[data-theme="clinic"] .tooth.sw .td { width: 16px; height: 16px; font-size: 12px; }
:root[data-theme="clinic"] .tc-label, :root[data-theme="clinic"] .tc-side { font-size: 12px; }
:root[data-theme="clinic"] .tl-head { font: 600 13px var(--body); letter-spacing: 0; text-transform: none; color: var(--muted); }
/* ---- Patient file on a monitor: even controls, three columns from 1280px, each scrolling by itself ---- */
@media (min-width: 1024px) {
  :root[data-theme="clinic"] .cm-wsbody .btn.sm, :root[data-theme="clinic"] .cm-wsbody .chip { min-height: 32px; }
  :root[data-theme="clinic"] .cm-wsbody .stat b { font-size: 17px; white-space: nowrap; }
}
@media (min-width: 1280px) {
  :root[data-theme="clinic"] .cm-ws { grid-template-columns: minmax(0, 1fr) minmax(380px, 1.1fr) minmax(340px, 1fr); grid-template-rows: auto; }
  :root[data-theme="clinic"] .cm-ws > .cm-wcol:nth-child(n) { grid-column: auto; grid-row: auto; }
}
@media (min-width: 1280px) and (min-height: 700px) {
  :root[data-theme="clinic"] .cm-ws { height: calc(100vh - var(--ws-top, 232px) - 24px); align-items: stretch; }
  :root[data-theme="clinic"] .cm-ws > .cm-wcol { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--fill-strong) transparent; padding: 0 4px 8px 0; }
  :root[data-theme="clinic"] .cm-ws > .cm-wcol > * { flex-shrink: 0; }
}
/* ---- Visit note and gum chart: the shared head, two columns on a monitor, Save in a bar that never covers a field ---- */
:root[data-theme="clinic"] .cm-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--line); }
:root[data-theme="clinic"] .cm-savebar .cm-big { min-width: 240px; padding: 0 24px; }
@media (max-width: 1023px) {
  :root[data-theme="clinic"] .cm-savebar { bottom: calc(56px + env(safe-area-inset-bottom)); }
  :root[data-theme="clinic"] .cm-savebar .cm-big { width: 100%; }
}
@media (min-width: 1024px) {
  :root[data-theme="clinic"] #screen[data-width="narrow"] .scr.cm-note { max-width: 1240px; }
  :root[data-theme="clinic"] .cm-notecols { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); }
  :root[data-theme="clinic"] .perio-all { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  :root[data-theme="clinic"] .perio-all .pq-2 { grid-column: 2; grid-row: 2; } /* lower left sits under upper left */
  :root[data-theme="clinic"] .perio-all .pq-3 { grid-column: 1; grid-row: 2; }
}
:root[data-theme="clinic"] .perio-head { font-size: 12px; }
:root[data-theme="clinic"] .bop:not(.on) { background: var(--fill-strong); border-color: var(--line); } /* the bleeding bar, visible before it is tapped */
/* ---- New appointment (public/clinic-ui.js, booking): three steps on the left, the summary and its one button on the right ---- */
:root[data-theme="clinic"] .cm-booking [hidden] { display: none !important; }
:root[data-theme="clinic"] .cm-booking input[type="search"] { width: 100%; box-sizing: border-box; height: 40px; padding: 0 14px; }
:root[data-theme="clinic"] .cm-booking .pick-field { min-height: 44px; border: 0; background: var(--fill); }
:root[data-theme="clinic"] .cm-bk-label { margin-top: 6px; font: 600 13px var(--body); color: var(--muted); }
:root[data-theme="clinic"] .cm-bk-picked { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--violet-soft); }
:root[data-theme="clinic"] .cm-bk-picked .cm-ini { background: var(--card); }
:root[data-theme="clinic"] .cm-bk-picked .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
:root[data-theme="clinic"] .cm-bk-picked .who b { font-weight: 600; }
:root[data-theme="clinic"] .cm-bk-picked .who span { font-size: 13px; color: var(--muted); }
:root[data-theme="clinic"] .cm-bk-picked .cm-btn { background: var(--card); }
:root[data-theme="clinic"] .cm-bk-for, :root[data-theme="clinic"] .cm-bk-svc, :root[data-theme="clinic"] .cm-bk-times, :root[data-theme="clinic"] .cm-bk-doc { display: flex; flex-direction: column; gap: 8px; }
:root[data-theme="clinic"] .cm-bk-times { gap: 14px; }
:root[data-theme="clinic"] .cm-bk-doc > b { font: 600 14px var(--body); }
:root[data-theme="clinic"] .cm-booking .cm-chips button .closed { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
:root[data-theme="clinic"] .cm-booking .cm-chips button[aria-pressed="true"] .closed { color: rgba(255, 255, 255, .75); }
:root[data-theme="clinic"] .cm-booking .cm-chips button.more { padding: 0 6px; background: none; color: var(--violet); font-weight: 600; }
:root[data-theme="clinic"] .cm-bk-link { align-self: flex-start; padding: 4px 0; border: 0; background: none; color: var(--violet); font: 600 13px var(--body); cursor: pointer; }
:root[data-theme="clinic"] .cm-bk-type { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
:root[data-theme="clinic"] .cm-bk-when { font: 600 26px/1.15 var(--display); letter-spacing: -0.01em; }
:root[data-theme="clinic"] .cm-bk-when.dim { color: var(--faint); }
:root[data-theme="clinic"] .cm-booksum .cm-wnote.bad { background: #FDECEA; color: var(--red); }
:root[data-theme="clinic"] .cm-booksum .cm-big { width: 100%; }
:root[data-theme="clinic"] .cm-booksum .cm-big:disabled { opacity: .45; cursor: default; }
:root[data-theme="clinic"] .cm-bk-need { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
:root[data-theme="clinic"] .cm-booksum > .cm-btn { align-self: flex-start; }
@media (max-width: 1023px) {
  /* Phones and tablets: the time, what is missing and the button stay in view above the bottom bar. */
  :root[data-theme="clinic"] .cm-booksum { position: sticky; top: auto; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 5; gap: 8px; padding: 12px 16px; box-shadow: 0 -8px 24px rgba(15, 23, 42, .10); }
  :root[data-theme="clinic"] .cm-booksum > .k, :root[data-theme="clinic"] .cm-booksum .cm-kv, :root[data-theme="clinic"] .cm-booksum > .cm-btn { display: none; }
  :root[data-theme="clinic"] .cm-bk-when { font-size: 18px; }
  :root[data-theme="clinic"] .cm-bk-need { margin-top: 0; }
  /* What is still missing sits above the button, so the button is the last thing in the bar. */
  :root[data-theme="clinic"] .cm-booksum .cm-wnote, :root[data-theme="clinic"] .cm-booksum .err, :root[data-theme="clinic"] .cm-booksum .cm-bk-need { order: 1; }
  :root[data-theme="clinic"] .cm-booksum .cm-big { order: 2; }
  /* The round chat button steps aside for these bars, as it does for the old floating buttons. */
  :root[data-theme="clinic"] body:has(.cm-booksum) .ask-fab, :root[data-theme="clinic"] body:has(.cm-savebar) .ask-fab { display: none; }
}
/* end of CLINIC: PATIENT FILE, BOOKING, CALENDAR */

/* CLINIC: SETTINGS AND FRONT DESK */
/* Settings as sections (clinicSettingsScreen in public/pwa.js), and the front-desk screens: Treatments and
   prices, Questions for you, Waiting room, Walk-in queue, Waitlist, Check-ups, Plan and billing. Their heads
   are the shared CU.head. The small fixes to controls every clinic screen uses (switches, pickers, links,
   corner sizes, the side menu's long names) are here too, as overrides. */

/* ---- Controls ---- */
/* The on/off switch: small, and blue when on (green is not one of the clinic's colours). */
:root[data-theme="clinic"] .switch { width: 44px; height: 26px; padding: 2px; }
:root[data-theme="clinic"] .switch span { width: 22px; height: 22px; box-shadow: 0 1px 2px rgba(15, 23, 42, .2); }
:root[data-theme="clinic"] .switch[aria-checked="true"] { background: var(--violet); }
:root[data-theme="clinic"] .switch[aria-checked="false"] { background: #C9CED8; }
/* A field you pick from looks like a field you type in: grey, no outline, the same text size. */
:root[data-theme="clinic"] .input.pick-field { background: var(--fill); border: 0; box-shadow: none; font-size: 16px; }
:root[data-theme="clinic"] .input.pick-field:focus-visible { outline: 2px solid color-mix(in srgb, var(--violet) 55%, transparent); outline-offset: 0; }
:root[data-theme="clinic"] .card .card .input.pick-field, :root[data-theme="clinic"] details.card .input.pick-field { background: var(--card); }
/* One kind of text link: the size of the words around it, never underlined. */
:root[data-theme="clinic"] .link-btn { font-size: 13px; font-weight: 500; }
/* One corner size for controls, one for surfaces. */
:root[data-theme="clinic"] .btn { border-radius: 10px; }
:root[data-theme="clinic"] .btn.sm { border-radius: 8px; }
:root[data-theme="clinic"] .day-row .chip { border-radius: 10px; }
:root[data-theme="clinic"] .fq-doc, :root[data-theme="clinic"] .fq-card { border: 0; border-radius: var(--r-card); background: var(--card); }
/* "No file chosen" beside an upload button says nothing: the name shows once a file is picked. */
:root[data-theme="clinic"] .file-row [data-empty] { display: none; }
@media (min-width: 1024px) {
  :root[data-theme="clinic"] .input.pick-field { font-size: 14px; }
  /* The side menu: a long name is cut with "…" and never makes the menu scroll sideways. */
  :root[data-theme="clinic"] #tabbar { overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--fill-strong) transparent; }
  :root[data-theme="clinic"] #tabbar .cm-tab .lbl, :root[data-theme="clinic"] #tabbar .cm-sub .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---- Settings: sections on the left, one section on the right ---- */
:root[data-theme="clinic"] .cs-side, :root[data-theme="clinic"] .cs-pane { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
:root[data-theme="clinic"] .cs-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px; }
:root[data-theme="clinic"] .cs-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; }
:root[data-theme="clinic"] .cs-item .who { display: flex; flex-direction: column; min-width: 0; }
:root[data-theme="clinic"] .cs-item .who b { font-weight: 600; font-size: 15px; }
:root[data-theme="clinic"] .cs-item .who span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-theme="clinic"] .cs-item > :last-child { flex: none; display: inline-flex; color: var(--faint); }
:root[data-theme="clinic"] .cs-item:hover { background: var(--fill); }
/* Inside a section only its Save is blue: the buttons in the cards are quiet, and as wide as their words. */
:root[data-theme="clinic"] .cs-pane .card .btn.primary { background: var(--fill); color: var(--ink); }
:root[data-theme="clinic"] .cs-pane .card .btn.primary:hover { background: var(--fill-strong); }
:root[data-theme="clinic"] .cs-pane .card.stack > .btn, :root[data-theme="clinic"] .cs-pane .card.stack > .stack > .btn { align-self: flex-start; }
:root[data-theme="clinic"] .cs-pane .card a:not(.btn):not(.list-item) { font-size: 13px; font-weight: 500; text-decoration: none; }
/* The Save bar: appears at the foot of the section once something is changed. */
:root[data-theme="clinic"] .cs-save { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 5; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px;
  border-radius: 14px; background: var(--ink); color: #fff; box-shadow: 0 12px 32px rgba(15, 23, 42, .24); }
:root[data-theme="clinic"] .cs-save[hidden] { display: none; }
:root[data-theme="clinic"] .cs-save > span { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; }
:root[data-theme="clinic"] .cs-save .cm-btn { background: rgba(255, 255, 255, .14); color: #fff; }
:root[data-theme="clinic"] .cs-save .cm-btn.go { background: var(--violet); }
/* Chairs: the column names once, then one line per chair. Not tied to the clinic look: skin clinics, counsellors
   and dietitians have chairs too, in their own look (these class names are used nowhere else). */
.cs-chairs { display: flex; flex-direction: column; gap: 8px; }
.cs-chair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 88px; gap: 8px; align-items: center; }
.cs-chairs.solo .cs-chair { grid-template-columns: minmax(0, 1fr) 88px; }
.cs-chair > .btn { justify-self: end; }
.cs-chair-head { font-size: 13px; font-weight: 500; color: var(--muted); }
@media (min-width: 1024px) {
  :root[data-theme="clinic"] #screen .scr.cs { display: grid; grid-template-columns: 248px minmax(0, 760px); gap: 28px; align-items: start; max-width: none; margin: 0; padding: 28px 32px 32px; }
  :root[data-theme="clinic"] .cs-side { position: sticky; top: 87px; }
  :root[data-theme="clinic"] .cs-side > .cm-head { display: none; } /* the side menu already says Settings */
  :root[data-theme="clinic"] .cs-pane { gap: 16px; }
  :root[data-theme="clinic"] .cs-item { min-height: 38px; padding: 0 12px; }
  :root[data-theme="clinic"] .cs-item .who b { font-size: 14px; font-weight: 500; }
  :root[data-theme="clinic"] .cs-item .who span { display: none; }
  :root[data-theme="clinic"] .cs-item > :last-child { display: none !important; } /* the icon carries its own inline display */
  :root[data-theme="clinic"] .cs-item.on { background: var(--violet-soft); }
  :root[data-theme="clinic"] .cs-item.on .who b { color: var(--violet-ink); font-weight: 600; }
  :root[data-theme="clinic"] .cs-save { bottom: 16px; }
}
@media (max-width: 1023px) {
  /* Phones and tablets: the list of sections, or one section. */
  :root[data-theme="clinic"] .cs[data-open="0"] .cs-pane, :root[data-theme="clinic"] .cs[data-open="1"] .cs-side { display: none; }
}
@media (max-width: 699px) {
  .cs-chair-head { display: none; }
  .cs-chair { grid-template-columns: minmax(0, 1fr) 88px; }
  .cs-chairs:not(.solo) .cs-chair > input { grid-column: 1 / -1; }
  .cs-chairs:not(.solo) { gap: 16px; } /* each chair's two lines read as one */
}

/* ---- Front desk ---- */
/* The two small buttons at the end of a row (Check-ups, Questions for you): side by side, never stacked. */
.ck-acts { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: none; } /* every clinic look: Check-ups is theirs too */
:root[data-theme="clinic"] .qa-text { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
/* "Add walk-in" in a screen's head only where there is no top bar with Walk-in (phones). */
@media (min-width: 700px) { :root[data-theme="clinic"] .fd-nobar { display: none; } }
@media (max-width: 699px) {
  :root[data-theme="clinic"] .qa-row { flex-wrap: wrap; }
  :root[data-theme="clinic"] .qa-row > .grow { flex: 1 1 100%; }
}
/* Plan and billing: the plans share the width, and a plan's name and price stay on one line. */
:root[data-theme="clinic"] .plan-card > .row { flex-wrap: nowrap; gap: 12px; }
:root[data-theme="clinic"] .plan-card > .row > b, :root[data-theme="clinic"] .plan-card > .row > span { white-space: nowrap; }
@media (min-width: 1024px) {
  :root[data-theme="clinic"] .plan-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  :root[data-theme="clinic"] #screen .scr:has(> .cm-head) > .cm-split > .card.stack > .btn { align-self: flex-start; min-width: 140px; }
}
/* end of CLINIC: SETTINGS AND FRONT DESK */

/* PUBLIC AND PATIENT PAGES */
/* The form a patient fills from WhatsApp (public/form.html). One answer out of a few (a check-in's "Not at all"
   to "Nearly every day"): an even grid, two across, instead of three on a row and one left over. "Tap all that
   apply" lists keep wrapping, since those are many short words. */
.paper-page .paper-opts[role="radiogroup"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.paper-page .paper-opts[role="radiogroup"] .chip { width: 100%; justify-content: flex-start; }
@media (max-width: 379.98px) { .paper-page .paper-opts[role="radiogroup"] { grid-template-columns: minmax(0, 1fr); } }
/* end of PUBLIC AND PATIENT PAGES */

/* CLINIC: TODAY, TEAM, PATIENTS AND MENU */
/* The clinic frame itself (public/clinic-ui.js: the side menu, the top bar, Today, Walk-in, Team, Money) and the
   screens rebuilt to match it in public/pwa.js (Patients, Manage people, Your account). Everything here is under
   the clinic look and comes last, so it corrects the rules above without touching them. */

/* ---- Nothing under 12px ---- */
:root[data-theme="clinic"] .cm-hour, :root[data-theme="clinic"] .cm-blk .st, :root[data-theme="clinic"] .cm-now span { font-size: 12px; }
@media (max-width: 1023px) { :root[data-theme="clinic"] #tabbar a .lbl { font-size: 12px; } }

/* ---- Today: the schedule ---- */
/* The hour lines run through the time gutter too, so each label sits under its own line instead of floating. */
:root[data-theme="clinic"] .cm-hours { background-image: linear-gradient(var(--line-soft) 1px, transparent 1px); background-size: 100% var(--hour); }
:root[data-theme="clinic"] .cm-now span { left: -52px; top: -11px; font-variant-numeric: tabular-nums; }
/* A doctor's column may be a little narrower, so three doctors fit beside "Right now" on a small laptop without the last one being cut off. */
:root[data-theme="clinic"] .cm-colhead, :root[data-theme="clinic"] .cm-body { grid-template-columns: 56px repeat(var(--n), minmax(128px, 1fr)); }
/* A short visit is one line: the name first and never squeezed out by the rest, then the time and treatment,
   then what it still needs at the right edge (the same place as on a tall visit). */
:root[data-theme="clinic"] .cm-blk.short .l { display: contents; }
:root[data-theme="clinic"] .cm-blk.short b { flex: 0 1 auto; min-width: 2.5em; max-width: 62%; }
:root[data-theme="clinic"] .cm-blk.short .w { flex: 1 1 0; min-width: 0; order: 2; }
:root[data-theme="clinic"] .cm-blk.short .st { order: 3; }
:root[data-theme="clinic"] .cm-blk .w { font-variant-numeric: tabular-nums; }
/* A tall visit in a narrow column: what it needs drops under the name, so the name is not the part cut short. */
:root[data-theme="clinic"] .cm-blk:not(.short) .l { flex-wrap: wrap; gap: 0 8px; }
:root[data-theme="clinic"] .cm-blk:not(.short) .l b { max-width: 100%; }
/* Amounts in their own column, right-aligned, figures of one width */
:root[data-theme="clinic"] .cm-num { flex: none; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
:root[data-theme="clinic"] .cm-tot b, :root[data-theme="clinic"] .cm-fig b, :root[data-theme="clinic"] .cm-figs b, :root[data-theme="clinic"] .cm-owe b { font-variant-numeric: tabular-nums; }
/* Phones: no gap for a card that is not there, and the day so far ("Seen today") in the same rows as "Next" */
:root[data-theme="clinic"] .cm-phone > div:empty { display: none; }
:root[data-theme="clinic"] .cm-nextrow .who { flex: 1; }
:root[data-theme="clinic"] .cm-nextrow .cm-st { margin-right: 2px; }
:root[data-theme="clinic"] .cm-nextrow.noshow .who b { color: var(--muted); text-decoration: line-through; }
:root[data-theme="clinic"] .cm-nextrow.done .t, :root[data-theme="clinic"] .cm-nextrow.noshow .t { color: var(--muted); font-weight: 500; }

/* ---- The top bar ---- */
/* The words typed sit straight on the box: no second grey strip inside it, with or without the cursor in it. */
:root[data-theme="clinic"] .cm-cmd input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) { background: transparent; border-radius: 0; text-overflow: ellipsis; }
:root[data-theme="clinic"] .cm-clinic b { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 700px) {
  :root[data-theme="clinic"] body.is-demo #cm-top { padding-right: 136px; } /* 12px between New appointment and Demo, like the other gaps */
}
/* Tablets and narrow windows: the app uses the whole width (it was held to a 760px strip while the Demo button
   followed the window, so the button sat on top of New appointment). */
@media (min-width: 700px) and (max-width: 1023px) {
  :root[data-theme="clinic"] .app #shell, :root[data-theme="clinic"] #tabbar { max-width: none; }
  :root[data-theme="clinic"] .demo-pill { right: 16px; }
  :root[data-theme="clinic"] body.is-demo #cm-top { padding-right: 128px; }
}

/* ---- The side menu ---- */
@media (min-width: 1024px) {
  /* The logo sits on the top bar's line; the lines under a group start where the four main lines start. */
  :root[data-theme="clinic"] #tabbar .cm-brand { padding: 2px 8px 16px; }
  :root[data-theme="clinic"] #tabbar .cm-sub { gap: 12px; }
  /* Your account: always at the foot, the same size whether it is the open screen or not, initials in ink. */
  :root[data-theme="clinic"] #tabbar .cm-mebox { position: sticky; bottom: 0; z-index: 1; margin: 0 -10px -12px; padding: 6px 10px 12px; background: var(--card); }
  :root[data-theme="clinic"] #tabbar a.cm-me, :root[data-theme="clinic"] #tabbar a.cm-me.on { display: flex; align-items: center; gap: 10px; height: auto; padding: 8px; border-radius: 10px; background: none; font-weight: 500; }
  :root[data-theme="clinic"] #tabbar a.cm-me:hover, :root[data-theme="clinic"] #tabbar a.cm-me.on { background: var(--fill); }
  :root[data-theme="clinic"] #tabbar .cm-me .cm-ini { color: var(--ink); }
}

/* ---- Walk-in ---- */
:root[data-theme="clinic"] .cm-wsum .err { margin: 0; }
:root[data-theme="clinic"] .cm-wsum .err:empty { display: none; }
:root[data-theme="clinic"] .cm-token-note { margin: -6px 0 0; font: 600 18px/1.3 var(--display); color: var(--faint); }
@media (max-width: 1023px) {
  /* Small screens: the form above already says who, what for and with whom, so until the token is given the
     summary is just its note and the button (one screen less to scroll). */
  :root[data-theme="clinic"] .cm-wsum:not(.given) > .k, :root[data-theme="clinic"] .cm-wsum:not(.given) > .cm-token-note, :root[data-theme="clinic"] .cm-wsum:not(.given) > .cm-kv { display: none; }
  :root[data-theme="clinic"] .cm-wsum:not(.given) { padding: 16px; }
}

/* ---- Team ---- */
/* Four figures across where the card is wide enough, two by two where it is not: an amount never breaks. */
:root[data-theme="clinic"] .cm-pay { container-type: inline-size; }
:root[data-theme="clinic"] .cm-figs > div { justify-content: flex-end; }
:root[data-theme="clinic"] .cm-figs b { white-space: nowrap; }
@container (max-width: 540px) { :root[data-theme="clinic"] .cm-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
:root[data-theme="clinic"] .cm-amt span.amber { color: var(--amber-ink); }
:root[data-theme="clinic"] .cm-pay .cm-vhead { flex-wrap: wrap; }
:root[data-theme="clinic"] .cm-pay .cm-vhead .h2 { white-space: nowrap; }
@media (max-width: 1023px) { :root[data-theme="clinic"] .cm-pay .cm-rule { max-width: 100%; } }

/* ---- Money ---- */
@media (min-width: 700px) { :root[data-theme="clinic"] .cm-page > .cm-figrow { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }

/* ---- Patients ---- */
:root[data-theme="clinic"] .cm-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
:root[data-theme="clinic"] .cm-tools .cm-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
:root[data-theme="clinic"] .cm-find { flex: 1 1 260px; max-width: 420px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--card); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
:root[data-theme="clinic"] .cm-find:focus-within { box-shadow: 0 0 0 2px var(--violet); }
:root[data-theme="clinic"] .cm-find input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) { flex: 1; min-width: 0; height: 36px; padding: 0; border: 0; outline: 0; border-radius: 0; background: transparent; font-size: 14px; text-overflow: ellipsis; }
:root[data-theme="clinic"] .cm-pts .cm-row { gap: 12px; min-height: 56px; }
:root[data-theme="clinic"] .cm-nm { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: inherit; color: inherit; overflow: visible; }
:root[data-theme="clinic"] .cm-nm b { min-width: 0; }
:root[data-theme="clinic"] .cm-pill { flex: none; padding: 2px 8px; border-radius: 6px; background: var(--fill); color: var(--muted); font-size: 12px; font-weight: 600; overflow: visible; }
:root[data-theme="clinic"] .cm-pill.amber { background: var(--amber-soft); color: var(--amber-ink); }
:root[data-theme="clinic"] .cm-cell, :root[data-theme="clinic"] .cm-colnames { display: none; }
:root[data-theme="clinic"] .cm-pts .cm-num { min-width: 76px; }
:root[data-theme="clinic"] .cm-showmore { align-self: center; margin: 14px 0 6px; }
:root[data-theme="clinic"] .cm-showmore[hidden] { display: none; }
@media (max-width: 1023px) { :root[data-theme="clinic"] .cm-find { max-width: none; height: 44px; } :root[data-theme="clinic"] .cm-pts .cm-colnames + .cm-row { border-top: 0; } }
@media (min-width: 1024px) {
  /* A monitor has room for a table: each thing in its own column, the amount at the right. */
  :root[data-theme="clinic"] .cm-pts .cm-row, :root[data-theme="clinic"] .cm-colnames { display: grid; grid-template-columns: 36px minmax(150px, 1.5fr) minmax(104px, .8fr) minmax(60px, .5fr) minmax(140px, 1.1fr) 44px minmax(84px, .6fr); align-items: center; column-gap: 12px; }
  :root[data-theme="clinic"] .cm-pts .cm-row { min-height: 52px; padding: 8px 0; }
  :root[data-theme="clinic"] .cm-pts .cm-two-line { display: none; }
  :root[data-theme="clinic"] .cm-pts .cm-cell { display: block; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
  :root[data-theme="clinic"] .cm-pts .cm-cell.r, :root[data-theme="clinic"] .cm-colnames .r { text-align: right; }
  :root[data-theme="clinic"] .cm-colnames { padding: 2px 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
}

/* ---- Manage people ---- */
:root[data-theme="clinic"] .cm-person { display: flex; flex-direction: column; gap: 14px; }
:root[data-theme="clinic"] .cm-person > .cm-row { padding: 0; border-top: 0; }
:root[data-theme="clinic"] .cm-person > .cm-row .who span { white-space: normal; }
:root[data-theme="clinic"] .cm-pline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
:root[data-theme="clinic"] .cm-plabel { flex: none; width: 64px; font-size: 12px; font-weight: 600; color: var(--muted); }
:root[data-theme="clinic"] .cm-pfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
:root[data-theme="clinic"] .cm-wraprow { flex-wrap: wrap; }
:root[data-theme="clinic"] .cm-wraprow > .cm-pline { width: 100%; padding-left: 46px; }
:root[data-theme="clinic"] .cm-manage .chip { min-height: 32px; height: 32px; padding: 0 12px; border-radius: 8px; background: var(--fill); color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; }
:root[data-theme="clinic"] .cm-manage .chip.on { background: var(--ink); color: #fff; font-weight: 600; }
:root[data-theme="clinic"] .cm-manage .week-dots { gap: 6px; }
:root[data-theme="clinic"] .cm-manage .week-dots .dot { width: 32px; height: 32px; border: 0; background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--faint); font: 600 12.5px var(--body); opacity: 1; }
:root[data-theme="clinic"] .cm-manage .week-dots .dot.on { background: var(--fill-strong); box-shadow: none; color: var(--ink); }
:root[data-theme="clinic"] .cm-manage .week-dots .dot.closed { text-decoration: line-through; }
:root[data-theme="clinic"] .cm-manage .week-dots button.dot:hover { box-shadow: inset 0 0 0 1px var(--faint); }
:root[data-theme="clinic"] .cm-logins .cm-acts { flex-wrap: wrap; padding-top: 12px; }
@media (max-width: 699px) { :root[data-theme="clinic"] .cm-manage .chip { min-height: 40px; height: 40px; } :root[data-theme="clinic"] .cm-manage .week-dots .dot { width: 36px; height: 36px; } }

/* ---- Your account (monitors): the person's own things in quiet rows, then Sign out ---- */
:root[data-theme="clinic"] .cm-acct .list-item { min-height: 56px; }
:root[data-theme="clinic"] .cm-acct .list-item .avatar.sq { width: 36px !important; height: 36px !important; border-radius: 50%; background: var(--fill) !important; color: var(--ink) !important; }
:root[data-theme="clinic"] .cm-acct > .btn.ghost { align-self: flex-start; min-height: 38px; background: var(--card); }

/* ---- The older home screen, where a clinic still meets it: a link marked hidden stays hidden ---- */
:root[data-theme="clinic"] .attention .attn-more[hidden] { display: none; }
/* end of CLINIC: TODAY, TEAM, PATIENTS AND MENU */

/* CLINIC: SKIN, COUNSELLING, DIETITIAN */
/* Skin and hair clinics, counselling practices and dietitians have the clinic look (themeFor in public/pwa.js).
   This block: their own card on Today and "Needs attention" (every clinic), their cards in the patient file,
   and their own screens (public/v-skin.js, v-therapy.js, v-diet.js). Counselling's own colours are the clinic's
   now: blue for the first line of a chart, a quiet green for "going well", the clinic's red only for an alert. */
:root[data-theme="clinic"] {
  --calm: var(--violet); --calm-soft: var(--violet-soft); --calm-ink: var(--violet-ink); --calm-deep: var(--violet-deep); --calm-light: var(--violet-light);
  --calm-sage: #0F766E; --calm-sage-soft: #E3F4EF; --calm-rose: #D92D20; --calm-rose-soft: #FDECEA; --calm-amber-soft: var(--amber-soft);
}

/* ---- Today: each kind's own card ---- */
.cm-kind[hidden], .cm-attnbox[hidden] { display: none; }
.cm-kind .cm-row { text-decoration: none; }
.cm-kind h3.cm-kgap { margin-top: 14px; }
.cm-kind .cm-num.amber { color: var(--amber-ink); }
.cm-flag { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: #FDECEA; color: #A32014; text-decoration: none; }
.cm-flag b { font-weight: 600; font-size: 14px; }
.cm-flag span { font-size: 12.5px; }
.cm-flag + .cm-flag { margin-top: -6px; }
.cm-row.cm-krow { align-items: flex-start; justify-content: flex-start; gap: 10px; }
.cm-ktime { flex: none; width: 50px; padding-top: 1px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cm-kwho { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cm-kwho b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-kchips { display: flex; flex-wrap: wrap; gap: 4px; }
.cm-krow .cm-st { padding-top: 1px; }
.cm-knote { margin: 0; padding: 10px 0 2px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.cm-knote a { color: var(--violet-ink); font-weight: 600; text-decoration: none; }

/* ---- Today: "Needs attention", one line with a count that opens the list ---- */
.cm-attnbox { display: block; }
.cm-attnbox > summary { display: flex; align-items: center; gap: 8px; padding: 2px 0; list-style: none; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; }
.cm-attnbox > summary::-webkit-details-marker { display: none; }
.cm-attnbox > summary > span:first-child { flex: 1; }
.cm-attnbox > summary > span:last-child { display: inline-flex; color: var(--faint); transition: transform .15s; }
.cm-attnbox[open] > summary > span:last-child { transform: rotate(90deg); }
.cm-attn-n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--fill-strong); color: var(--ink); font-size: 12px; font-weight: 600; }
.cm-attn-n.red { background: var(--now); color: #fff; }
:root[data-theme="clinic"] .cm-attnbox .attention { margin: 6px 0 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
:root[data-theme="clinic"] .cm-attnbox .attention > .sched-head { display: none; }
:root[data-theme="clinic"] .cm-attnbox .attention .banner { min-height: 40px; padding: 8px 0; font-size: 14px; text-decoration: none; }
:root[data-theme="clinic"] .cm-attnbox .attention .banner b { font-size: 14px; }
:root[data-theme="clinic"] .cm-attnbox .attention .attn-more { padding: 6px 0 4px; font-size: 13px; }
.cm-side .cm-attnbox { padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 699px) { .cm-attnbox.cm-card { padding-bottom: 12px; } .cm-kind.cm-card { padding-bottom: 10px; } }

/* ---- The patient file and the kinds' own screens, in the clinic look ---- */
/* Plain white cards, no gradients; nothing smaller than 12 px; the check-in chart uses the card's width. */
:root[data-theme="clinic"] .dt-program, :root[data-theme="clinic"] .dt-program.empty, :root[data-theme="clinic"] .dt-home { background: var(--card) !important; }
:root[data-theme="clinic"] .dt-program.ending { box-shadow: inset 3px 0 0 var(--amber-ink); }
:root[data-theme="clinic"] .dt-meter > span, :root[data-theme="clinic"] .sk-meter > span { background: var(--violet); }
:root[data-theme="clinic"] .sk-meter > span.hot { background: var(--now); }
:root[data-theme="clinic"] .dt-slot, :root[data-theme="clinic"] .dt-lab, :root[data-theme="clinic"] .dt-meal, :root[data-theme="clinic"] .dt-tpl, :root[data-theme="clinic"] .dt-kcal,
:root[data-theme="clinic"] .sk-fact, :root[data-theme="clinic"] .sk-note { background: var(--bg); border-color: transparent; }
:root[data-theme="clinic"] .dt-lab.high, :root[data-theme="clinic"] .dt-lab.low { border-color: color-mix(in srgb, var(--amber-ink) 30%, transparent); }
:root[data-theme="clinic"] .sk-pill { background: var(--violet-soft); color: var(--violet-ink); }
:root[data-theme="clinic"] .sk-ph-a, :root[data-theme="clinic"] .sk-ph-d { font-size: 12px; }
:root[data-theme="clinic"] .tp-bar-v, :root[data-theme="clinic"] .tp-bar-l { font-size: 12px; white-space: nowrap; }
:root[data-theme="clinic"] .tp-chart svg { max-width: 620px; }
:root[data-theme="clinic"] .tp-private { border: 0 !important; background: var(--card) !important; }
:root[data-theme="clinic"] .tp-policy { font-family: var(--body); font-size: 15px; color: var(--ink); }
:root[data-theme="clinic"] .tp-today-title, :root[data-theme="clinic"] .tp-big { font-family: var(--display); font-weight: 600; }
.tp-row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px 16px; align-items: end; }
.card.tp-row3 { padding: 16px; }
.tp-allnotes > .tp-note-row:first-of-type { margin-top: 6px; }
@media (max-width: 560px) { :root[data-theme="clinic"] .tp-stage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* end of CLINIC: SKIN, COUNSELLING, DIETITIAN */

/* CLINIC: A COLOUR FOR EACH DOCTOR (Today and the calendar). The column sets --doc and --doc-ink; the doctor's
   name takes the ink and each box that is not yet done, waiting or in the chair takes a coloured outline. */
:root[data-theme="clinic"] .cm-colhead > div[style*="--doc"] b, :root[data-theme="clinic"] .cal-head > .cm-calhd[style*="--doc"] b { color: var(--doc-ink); }
:root[data-theme="clinic"] .cm-colhead > div[style*="--doc"]::before, :root[data-theme="clinic"] .cal-head > .cm-calhd[style*="--doc"]::before { content: ''; display: block; width: 18px; height: 3px; margin-bottom: 5px; border-radius: 2px; background: var(--doc); }
:root[data-theme="clinic"] .cm-col[style*="--doc"] .cm-blk.next, :root[data-theme="clinic"] .cal-col[style*="--doc"] .cm-blk.next { box-shadow: inset 0 0 0 1.5px var(--doc); }
:root[data-theme="clinic"] .cm-col[style*="--doc"] .cm-blk.noshow, :root[data-theme="clinic"] .cal-col[style*="--doc"] .cm-blk.noshow { box-shadow: inset 0 0 0 1px var(--doc); }
:root[data-theme="clinic"] .cm-col[style*="--doc"] .cm-blk.done, :root[data-theme="clinic"] .cal-col[style*="--doc"] .cm-blk.done { box-shadow: inset 3px 0 0 var(--doc); }
:root[data-theme="clinic"] .cal-head > .cm-calhd, :root[data-theme="clinic"] .cm-colhead > div { padding-top: 14px; }

/* CLINIC: THE APPOINTMENT PANEL. Who and when, quiet links, one section per thing to do, one main button. */
:root[data-theme="clinic"] .sheet.cm-bk { display: flex; flex-direction: column; gap: 12px; }
:root[data-theme="clinic"] .cm-bk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
:root[data-theme="clinic"] .cm-bk-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
:root[data-theme="clinic"] .cm-bk-t .h2 { margin: 0; font-size: 20px; line-height: 1.2; }
:root[data-theme="clinic"] .cm-bk-sub { font-size: 13.5px; color: var(--muted); }
:root[data-theme="clinic"] .cm-bk-pill { flex: none; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--fill); color: var(--muted); }
:root[data-theme="clinic"] .cm-bk-pill.s-confirmed { background: #E7F8EE; color: #0B6B3A; }
:root[data-theme="clinic"] .cm-bk-pill.s-booked { background: var(--violet-soft); color: var(--violet-ink); }
:root[data-theme="clinic"] .cm-bk-pill.s-no_show, :root[data-theme="clinic"] .cm-bk-pill.s-cancelled { background: #FDECEC; color: #A61B1B; }
:root[data-theme="clinic"] .cm-bk-links { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
:root[data-theme="clinic"] .cm-bk-links a, :root[data-theme="clinic"] .cm-bk-links .link-btn { padding: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--violet-ink); text-decoration: none; }
:root[data-theme="clinic"] .cm-bk .card { margin: 0; padding: 12px 14px; border-radius: 12px; }
:root[data-theme="clinic"] .cm-bk .paper-card .paper-row { padding: 6px 0; }
:root[data-theme="clinic"] .cm-bk-pay { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
:root[data-theme="clinic"] .cm-bk-amt { display: flex; flex-direction: column; gap: 2px; }
:root[data-theme="clinic"] .cm-bk-amt b { font-size: 15px; font-variant-numeric: tabular-nums; }
:root[data-theme="clinic"] .cm-bk-amt b.ok { color: #0B6B3A; }
:root[data-theme="clinic"] .cm-bk-amt span { font-size: 12.5px; color: var(--muted); }
:root[data-theme="clinic"] .cm-bk-amt span:empty { display: none; }
:root[data-theme="clinic"] .cm-bk-btns { display: flex; gap: 8px; }
:root[data-theme="clinic"] .cm-bk-foot .cm-bk-btns > * { flex: 1 1 0; }
:root[data-theme="clinic"] .cm-bk-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
:root[data-theme="clinic"] .cm-bk-quiet { display: flex; justify-content: center; gap: 8px; }
:root[data-theme="clinic"] .cm-bk .btn.cm-bk-text { height: 36px; padding: 0 12px; background: none; box-shadow: none; color: var(--muted); font-size: 14px; font-weight: 600; }
:root[data-theme="clinic"] .cm-bk .btn.cm-bk-text:hover { background: var(--fill); }
:root[data-theme="clinic"] .cm-bk .btn.cm-bk-text.bad { color: #B42318; }

/* CLINIC: STOCK STATUS TAGS. Running low in amber, out of stock in red. */
:root[data-theme="clinic"] .cm-tag.st-low { color: #8A4B00; }
:root[data-theme="clinic"] .cm-tag.st-out { color: #B42318; }
:root[data-theme="clinic"] .cm-tag.st-low, :root[data-theme="clinic"] .cm-tag.st-out { white-space: nowrap; }

/* CLINIC: "ADD A TEAM MEMBER" CHOICES. */
:root[data-theme="clinic"] .cm-addpick { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
:root[data-theme="clinic"] .cm-addpick:hover { box-shadow: inset 0 0 0 1.5px var(--violet); }
:root[data-theme="clinic"] .cm-addpick > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
:root[data-theme="clinic"] .cm-addpick b { font-size: 15px; font-weight: 600; }
:root[data-theme="clinic"] .cm-addpick > span > span { font-size: 13px; color: var(--muted); }
/* Space between the doctor names and the first hour, on the calendar and Today. */
:root[data-theme="clinic"] .cal-body, :root[data-theme="clinic"] .cm-body { margin-top: 14px; }
