/* DocMate in-app styles. Brand: royal navy + gold on white (chosen 2026-11-07). */
:root {
  /* Brand: navy for structure (sidebar, headings), gold for actions. --accent is a deep gold that
     passes WCAG AA as text on white; --gold is the brighter fill used for buttons (navy text). */
  --brand: #1C2541; --brand-deep: #131A30; --brand-mint: #F3F0E4; --brand-amber: #B8892B;
  --gold: #C9A227; --gold-light: #DDBB4C; --gold-deep: #9C7A12; --gold-ink: #1C2541;
  /* Surfaces and text */
  --bg: #F7F7FA; --surface: #ffffff; --surface-2: #F1F2F7; --surface-3: #E9EBF3; --border: #E1E4EE; --border-strong: #CDD2E2;
  --text: #1B1F2A; --muted: #5E6577; --accent: #8A6A0E; --accent-strong: #6E540A; --accent-ink: #ffffff; --accent-soft: #FBF3DA;
  --ring: rgba(201, 162, 39, .35); --zebra: #FAFAFC; --hover: #F3F4F9;
  /* Status tones */
  --red: #b42318; --red-soft: #fdecea; --orange: #b54708; --orange-soft: #fef0e1; --amber: #8a5a0b; --amber-soft: #fbf1dc;
  --green: #067647; --green-soft: #e3f6ec; --blue: #1d4ed8; --blue-soft: #e8eefd; --teal: #1C2541; --teal-soft: #EEF0F7;
  --grey: #4b5563; --grey-soft: #eef0f4; --sim: #6d28d9; --sim-soft: #f1eafd;
  /* Sidebar */
  --side-1: #1C2541; --side-2: #121831; --side-text: rgba(255, 255, 255, .8); --side-hover: rgba(201, 162, 39, .12); --side-active: rgba(201, 162, 39, .2);
  /* Plant */
  --leaf: #2f9e8f; --leaf-2: #0f766e; --pot: #d47c55; --pot-rim: #bd6741; --soil: #6b4a35;
  /* Illustration palette */
  --sc-wall: #F5F6FA; --sc-wall2: #EEF0F7; --sc-trim: #D3D8E6; --sc-floor: #E8EBF2; --sc-board: #DCE0EB;
  --sc-cer: #fbfdfc; --sc-cer-shade: #dbe8e5; --sc-cer-rim: #ffffff; --sc-soil: #6b4a35;
  --sc-frame: #ffffff; --sc-frame-line: #d5e5e2; --sc-sky1: #d7efe8; --sc-sky2: #e8f5ef; --sc-sky3: #f8efdc; --sc-sun: #fff6d9; --sc-out1: #b5dccd; --sc-out2: #9ccdbb;
  --sc-curtain: rgba(255, 255, 255, .62); --sc-fold: rgba(214, 226, 223, .9); --sc-beam: rgba(255, 247, 226, .55); --sc-glow-a: rgba(255, 236, 200, .45); --sc-glow-b: rgba(255, 236, 200, 0);
  --sc-far: #DADFEA; --sc-lampglow: rgba(255, 244, 214, .7); --sc-desk: #1C2541; --sc-desk-top: #efe5d4; --sc-desk-stripe: #E9D8A6; --sc-desk-shade: rgba(19, 26, 48, .35);
  --sc-shelf: #d8c6a8; --sc-book1: #e8b77e; --sc-book2: #8fc5b6; --sc-book3: #e9d9bf; --sc-clock: #e7dccb; --sc-clockface: #fffdf8; --sc-hands: #5b6b68; --sc-mug: #fffdf8; --sc-tablet: #26332f;
  --sc-pot: #c9724c; --sc-pot-dark: #a95a39; --sc-pot-light: rgba(255, 255, 255, .18); --sc-pot-rim: #d7845d; --sc-pot-deco: #f3dccb; --sc-shadow: rgba(77, 58, 35, .16); --sc-longshadow: rgba(77, 58, 35, .08);
  --lf1a: #3c9a6e; --lf1b: #2c7f59; --lf2a: #4fb183; --lf2b: #38946a; --lf3a: #2a7d5e; --lf3b: #1e6249; --sc-vein: rgba(225, 245, 232, .55); --sc-stem: #3a7f5b; --sc-vine: #4a8f63;
  /* Scales */
  --r-sm: 8px; --radius: 12px; --r-lg: 14px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 36, .06);
  --shadow: 0 1px 2px rgba(16, 40, 36, .05), 0 2px 8px -2px rgba(16, 40, 36, .07);
  --shadow-lg: 0 2px 4px rgba(16, 40, 36, .05), 0 12px 32px -8px rgba(16, 40, 36, .16);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1020; --surface: #121931; --surface-2: #18213D; --surface-3: #1F2A4A; --border: #26314F; --border-strong: #33406A;
    --text: #E8EAF2; --muted: #A3AAC2; --accent: #E5C76B; --accent-strong: #F0D78A; --accent-ink: #131A30; --accent-soft: #2A2614;
    --ring: rgba(229, 199, 107, .35); --zebra: #10172C; --hover: #1A2340;
    --red: #f97066; --red-soft: #3a1714; --orange: #f79009; --orange-soft: #3a2410; --amber: #f0b44c; --amber-soft: #33270f;
    --green: #47cd89; --green-soft: #0f2e20; --blue: #84a9ff; --blue-soft: #16223f; --teal: #B9C4E8; --teal-soft: #1A2340;
    --grey: #b6bdd0; --grey-soft: #1F2740; --sim: #b69cf8; --sim-soft: #2a1f45;
    --side-1: #0E1428; --side-2: #090D1C;
    --leaf: #3cc2b0; --leaf-2: #1f8f81; --pot: #c06a45; --pot-rim: #a5583a; --soil: #4a3426;
  --sc-wall: #1b2729; --sc-wall2: #172224; --sc-trim: #26383a; --sc-floor: #131d1f; --sc-board: #1b292b;
    --sc-cer: #d6e1df; --sc-cer-shade: #aebfbc; --sc-cer-rim: #e4ecea; --sc-soil: #4a3426;
    --sc-frame: #2a3a3b; --sc-frame-line: #33474a; --sc-sky1: #263a5a; --sc-sky2: #6b5a7a; --sc-sky3: #d98b62; --sc-sun: #f6c27a; --sc-out1: #2a4a48; --sc-out2: #1f3b39;
    --sc-curtain: rgba(190, 210, 220, .16); --sc-fold: rgba(190, 210, 220, .18); --sc-beam: rgba(246, 180, 120, .10); --sc-glow-a: rgba(246, 170, 110, .2); --sc-glow-b: rgba(246, 170, 110, 0);
    --sc-far: #24363a; --sc-lampglow: rgba(255, 214, 150, .18); --sc-desk: #1C2541; --sc-desk-top: #2c3d3c; --sc-desk-stripe: #1d4a45; --sc-desk-shade: rgba(0, 0, 0, .3);
    --sc-shelf: #3a4a48; --sc-book1: #a8774a; --sc-book2: #3f7f72; --sc-book3: #5a5446; --sc-clock: #2c3b3c; --sc-clockface: #223031; --sc-hands: #9bb0ab; --sc-mug: #c9d6d2; --sc-tablet: #0b1312;
    --sc-pot: #a65a3a; --sc-pot-dark: #84442b; --sc-pot-light: rgba(255, 255, 255, .08); --sc-pot-rim: #b4653f; --sc-pot-deco: #c99a80; --sc-shadow: rgba(0, 0, 0, .35); --sc-longshadow: rgba(0, 0, 0, .18);
    --lf1a: #2f7d5c; --lf1b: #22654a; --lf2a: #3c9470; --lf2b: #2c7958; --lf3a: #22664e; --lf3b: #19503d; --sc-vein: rgba(200, 235, 215, .3); --sc-stem: #2d6a4c; --sc-vine: #357552;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px -2px rgba(0, 0, 0, .35); --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1020; --surface: #121931; --surface-2: #18213D; --surface-3: #1F2A4A; --border: #26314F; --border-strong: #33406A;
  --text: #E8EAF2; --muted: #A3AAC2; --accent: #E5C76B; --accent-strong: #F0D78A; --accent-ink: #131A30; --accent-soft: #2A2614;
  --ring: rgba(229, 199, 107, .35); --zebra: #10172C; --hover: #1A2340;
  --red: #f97066; --red-soft: #3a1714; --orange: #f79009; --orange-soft: #3a2410; --amber: #f0b44c; --amber-soft: #33270f;
  --green: #47cd89; --green-soft: #0f2e20; --blue: #84a9ff; --blue-soft: #16223f; --teal: #B9C4E8; --teal-soft: #1A2340;
  --grey: #b6bdd0; --grey-soft: #1F2740; --sim: #b69cf8; --sim-soft: #2a1f45;
  --side-1: #0E1428; --side-2: #090D1C;
  --leaf: #3cc2b0; --leaf-2: #1f8f81; --pot: #c06a45; --pot-rim: #a5583a; --soil: #4a3426;
  --sc-wall: #1b2729; --sc-wall2: #172224; --sc-trim: #26383a; --sc-floor: #131d1f; --sc-board: #1b292b;
  --sc-cer: #d6e1df; --sc-cer-shade: #aebfbc; --sc-cer-rim: #e4ecea; --sc-soil: #4a3426;
  --sc-frame: #2a3a3b; --sc-frame-line: #33474a; --sc-sky1: #263a5a; --sc-sky2: #6b5a7a; --sc-sky3: #d98b62; --sc-sun: #f6c27a; --sc-out1: #2a4a48; --sc-out2: #1f3b39;
  --sc-curtain: rgba(190, 210, 220, .16); --sc-fold: rgba(190, 210, 220, .18); --sc-beam: rgba(246, 180, 120, .10); --sc-glow-a: rgba(246, 170, 110, .2); --sc-glow-b: rgba(246, 170, 110, 0);
  --sc-far: #24363a; --sc-lampglow: rgba(255, 214, 150, .18); --sc-desk: #1C2541; --sc-desk-top: #2c3d3c; --sc-desk-stripe: #1d4a45; --sc-desk-shade: rgba(0, 0, 0, .3);
  --sc-shelf: #3a4a48; --sc-book1: #a8774a; --sc-book2: #3f7f72; --sc-book3: #5a5446; --sc-clock: #2c3b3c; --sc-clockface: #223031; --sc-hands: #9bb0ab; --sc-mug: #c9d6d2; --sc-tablet: #0b1312;
  --sc-pot: #a65a3a; --sc-pot-dark: #84442b; --sc-pot-light: rgba(255, 255, 255, .08); --sc-pot-rim: #b4653f; --sc-pot-deco: #c99a80; --sc-shadow: rgba(0, 0, 0, .35); --sc-longshadow: rgba(0, 0, 0, .18);
  --lf1a: #2f7d5c; --lf1b: #22654a; --lf2a: #3c9470; --lf2b: #2c7958; --lf3a: #22664e; --lf3b: #19503d; --sc-vein: rgba(200, 235, 215, .3); --sc-stem: #2d6a4c; --sc-vine: #357552;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px -2px rgba(0, 0, 0, .35); --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
h1 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -.015em; font-weight: 700; margin: 0; }
h2 { font-size: 1.08rem; line-height: 1.35; letter-spacing: -.005em; font-weight: 650; margin: 0 0 .75rem; }
h3 { font-size: .98rem; font-weight: 650; margin: 1rem 0 .5rem; }
p { margin: 0 0 .75rem; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font: .84em var(--mono); word-break: break-all; }
pre { font-family: var(--mono); }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.container { max-width: 1200px; margin: 0 auto; padding: 24px 28px 40px; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; display: block; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--surface); color: var(--accent); padding: 8px 12px; border-radius: var(--r-sm); box-shadow: var(--shadow-lg); font-weight: 600; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--text); }

.demo-banner { background: linear-gradient(90deg, #5b21b6, var(--sim)); color: #fff; text-align: center; padding: 6px 16px; font-size: .82rem; letter-spacing: .01em; }

/* ---------- Brand mark ---------- */
.logo-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto;
  background: linear-gradient(140deg, #2E3B6B 0%, #1C2541 55%, #131A30 100%); color: #E5C76B;
  font: 800 15px/1 var(--font); letter-spacing: -.05em; padding-bottom: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 2px 6px -1px rgba(19, 26, 48, .4); }
.logo-mark.xl { width: 64px; height: 64px; border-radius: 18px; font-size: 29px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 24px -8px rgba(19, 26, 48, .55); }
.brand-mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--accent-strong); font-weight: 750; letter-spacing: -.015em; flex: 0 0 auto; }
.brand-mark:hover { color: inherit; }
.brand-mark .wordmark { font-size: 1.08rem; }
.logo { font-size: 1.6rem; } .logo.big { font-size: 2.6rem; }
.auth-logo { display: block; margin: 0 auto; border-radius: 14px; }

/* ---------- App shell: sidebar + main column ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--side-2) 252px, transparent 252px); }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.main-col > .container { width: 100%; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px 14px; background: linear-gradient(180deg, var(--side-1), var(--side-2)); color: #fff; isolation: isolate; scrollbar-width: thin; }
.side-head { display: contents; }
@media (min-width: 1024px) {
  body:has(> .demo-banner) > .demo-banner { position: sticky; top: 0; z-index: 30; height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body:has(> .demo-banner) .sidebar { top: 30px; height: calc(100vh - 30px); }
  body:has(> .demo-banner) .shell { min-height: calc(100vh - 30px); }
}
.sidebar .brand-mark { order: 1; color: #fff; padding: 4px 8px 14px; }
.sidebar .logo-mark { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 1px rgba(255, 255, 255, .14); }
.sidebar .nav { order: 2; }
.sidebar .who { order: 3; margin-top: auto; }
.side-leaf { position: absolute; z-index: -1; right: -18px; bottom: 54px; width: 120px; height: 160px; fill: #fff; opacity: .05; pointer-events: none; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--side-text); white-space: nowrap; font-weight: 550; font-size: .93rem; position: relative; transition: background-color .15s, color .15s; }
.nav a .icon { width: 19px; height: 19px; opacity: .9; }
.nav a:hover { background: var(--side-hover); color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #D4AF37; }
.nav a:focus-visible { outline-color: #D4AF37; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* An item with an "Upgrade" badge may wrap so the label is never cut off. */
.nav-label:has(.nav-soon) { overflow: visible; white-space: normal; line-height: 1.3; }
.nav-soon { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 99px; font-size: .64rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; background: #f6d58e; color: #5a3a06; vertical-align: 1px; }

.who { display: flex; align-items: center; gap: 8px; margin: 0; line-height: 1.25; padding: 10px 6px 2px; border-top: 1px solid rgba(255, 255, 255, .1); }
.who-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; flex: 1; border-radius: 10px; padding: 4px; }
.who-link:hover { color: #fff; background: var(--side-hover); }
.who-text { display: flex; flex-direction: column; min-width: 0; }
.who-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text .muted { color: rgba(255, 255, 255, .62); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; background: linear-gradient(140deg, #f6d58e, var(--brand-amber)); color: #3d2604; font-weight: 750; font-size: .95rem; }
.sidebar .btn.signout { color: rgba(255, 255, 255, .85); border-color: rgba(255, 255, 255, .16); padding: 6px 8px; }
.sidebar .btn.signout:hover { background: var(--side-hover); color: #fff; }
.signout-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: color-mix(in srgb, var(--surface) 82%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); }
.brand { display: flex; flex-direction: column; min-width: 0; }
.brand .clinic { font-weight: 650; letter-spacing: -.01em; }
.brand-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px; }

/* ---------- Page structure ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section { margin: 28px 0 12px; }
.count { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 1px 9px; font-size: .8rem; font-weight: 650; vertical-align: 2px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card > h2:first-child { margin-top: 0; }
.empty { text-align: center; color: var(--muted); padding: 32px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .plant-art { width: 80px; height: 93px; }
.empty-title { color: var(--text); font-weight: 650; font-size: 1rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.wrap { align-items: flex-end; }
.grow { flex: 1; min-width: 160px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.narrow { max-width: 420px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 15px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .93rem; line-height: 1.2; cursor: pointer; text-decoration: none; min-height: 38px; box-shadow: var(--shadow-sm);
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s, filter .15s; }
.btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ring); border-color: var(--accent); }
.btn .icon { width: 17px; height: 17px; }
.btn.primary { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--gold-ink); border-color: var(--gold-deep); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(19, 26, 48, .2), 0 4px 12px -4px rgba(156, 122, 18, .45); }
.btn.primary:hover { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: var(--gold-ink); }
.btn.primary:focus-visible { box-shadow: 0 0 0 3px var(--ring), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent-strong); }
.btn.small { padding: 5px 11px; min-height: 32px; font-size: .84rem; border-radius: 8px; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { filter: brightness(.93); background: var(--red); color: #fff; }
.btn.ok, .btn.call { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ok:hover, .btn.call:hover { filter: brightness(.93); background: var(--green); color: #fff; }
.btn.warn { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.warn:hover { filter: brightness(.93); background: var(--orange); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
:root[data-theme="dark"] .btn.danger, :root[data-theme="dark"] .btn.ok, :root[data-theme="dark"] .btn.call, :root[data-theme="dark"] .btn.warn { color: #0b1312; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.danger, :root:not([data-theme="light"]) .btn.ok, :root:not([data-theme="light"]) .btn.call, :root:not([data-theme="light"]) .btn.warn { color: #0b1312; }
}

/* ---------- Forms ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .88rem; }
label.check { display: block; font-weight: 500; }
label.check > input[type="checkbox"], label.check > input[type="radio"] { display: inline-block; vertical-align: -3px; margin: 0 8px 0 0; }
input, select, textarea { font: inherit; font-size: .95rem; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 11px; min-height: 40px; width: 100%; box-shadow: inset 0 1px 1px rgba(16, 40, 36, .03); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input[disabled], select[disabled], textarea[disabled] { background: var(--surface-2); color: var(--muted); }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; height: 18px; padding: 0; flex: 0 0 auto; accent-color: var(--accent); box-shadow: none; }
input[type="file"] { padding: 6px; }
.outcome { cursor: pointer; }
.hint { font-weight: 400; font-size: .8rem; color: var(--muted); }
.field-error, .error-text { color: var(--red); font-size: .82rem; font-weight: 550; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 0; }
legend { font-weight: 650; padding: 0 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 14px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; }
.grid-form .full, .filters .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
form.inline { margin: 0; }
.tpl-lang { min-width: 70px; align-self: center; }

.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.filters .grow { grid-column: span 2; }
.filters p { margin: 0; }
.filter-actions { display: flex; gap: 6px; }

/* ---------- Flash messages ---------- */
.flash { position: relative; padding: 11px 14px 11px 40px; border-radius: 10px; margin-bottom: 14px; background: var(--green-soft); color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 22%, transparent); font-weight: 500; }
.flash::before { content: ""; position: absolute; left: 14px; top: 13px; width: 16px; height: 16px; border-radius: 50%; background: currentColor;
  opacity: .9;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm3.6 5.4-4.3 5.2-2.9-2.4 1-1.2 1.7 1.4 3.3-4z'/%3E%3C/svg%3E") center / contain no-repeat; }
.flash.error { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.flash.error::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm-.9 3.5h1.8v5.6H7.1zm0 7h1.8v1.8H7.1z'/%3E%3C/svg%3E"); }
.flash:not(.ok):not(.error) { background: var(--accent-soft); color: var(--text); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.flash:not(.ok):not(.error)::before { background: var(--accent); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm-.9 3.5h1.8v1.8H7.1zm0 3.2h1.8v5.8H7.1z'/%3E%3C/svg%3E"); }
.flash code { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.flash.stack { gap: 8px; }

/* ---------- KPI cards ---------- */
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.metrics.compact { margin-bottom: 14px; }
.metric { --tone: var(--accent); --tone-soft: var(--accent-soft); position: relative; overflow: hidden; background: linear-gradient(155deg, var(--surface) 55%, color-mix(in srgb, var(--tone-soft) 70%, var(--surface))); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; transition: box-shadow .2s, transform .2s, border-color .2s; }
.metric:hover { box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--tone) 30%, var(--border)); }
.metric:has(.metric-link:hover) { transform: translateY(-1px); }
.metric.tone-green { --tone: var(--green); --tone-soft: var(--green-soft); }
.metric.tone-amber { --tone: var(--amber); --tone-soft: var(--amber-soft); }
.metric.tone-orange { --tone: var(--orange); --tone-soft: var(--orange-soft); }
.metric.tone-red { --tone: var(--red); --tone-soft: var(--red-soft); }
.metric-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 3px; border-radius: 8px; }
.metric-link:hover { color: inherit; }
.metric-link:hover .metric-label { color: var(--text); }
.metric-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--tone-soft); color: var(--tone); margin-bottom: 8px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 14%, transparent); }
.metric-icon .icon { width: 19px; height: 19px; }
.metric-value { font-size: 1.85rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.metric-label { font-weight: 600; color: var(--muted); font-size: .87rem; }
.metric-sub { font-size: .77rem; color: var(--muted); }
.def summary { font-size: .74rem; color: var(--muted); cursor: pointer; margin-top: 4px; }
.def summary:hover { color: var(--accent); }
.def p { font-size: .8rem; margin: 4px 0 0; color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 650; line-height: 1.45; white-space: nowrap; vertical-align: 1px; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent); }
.page-head h1 .badge { font-size: .74rem; letter-spacing: .01em; }
.badge.red { background: var(--red-soft); color: var(--red); } .badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.amber { background: var(--amber-soft); color: var(--amber); } .badge.green { background: var(--green-soft); color: var(--green); }
.badge.blue { background: var(--blue-soft); color: var(--blue); } .badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.grey { background: var(--grey-soft); color: var(--grey); } .badge.sim { background: var(--sim-soft); color: var(--sim); letter-spacing: .03em; }

/* ---------- Action queue ---------- */
.queue { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.task { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--grey); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); transition: box-shadow .2s; }
.task:hover { box-shadow: var(--shadow); }
.task.p1 { border-left-color: var(--red); } .task.p2 { border-left-color: var(--orange); } .task.p3 { border-left-color: var(--brand-amber); }
.task-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.task-ref { text-decoration: none; }
.task-reason { margin: 4px 0; }
.task-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.task-actions label { flex-direction: row; align-items: center; gap: 6px; }
.task-actions select { width: auto; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.table thead th:first-child { border-top-left-radius: calc(var(--radius) - 1px); }
.table thead th:last-child { border-top-right-radius: calc(var(--radius) - 1px); }
.table tbody tr:nth-child(even) td { background: var(--zebra); }
.table tbody tr:hover td { background: var(--hover); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:last-child td:first-child { border-bottom-left-radius: calc(var(--radius) - 1px); }
.table tbody tr:last-child td:last-child { border-bottom-right-radius: calc(var(--radius) - 1px); }
.table tr.stale td { opacity: .6; }
.table tr.row-error td { background: var(--red-soft); }
.table select { min-width: 170px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; }

/* ---------- Detail pages ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: .87rem; } .kv dd { margin: 0; }
.mini-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.quote { border-left: 3px solid var(--accent); padding: 6px 12px; margin-top: 4px; background: var(--surface-2); border-radius: 0 8px 8px 0; }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.sim-card { border-color: color-mix(in srgb, var(--sim) 45%, var(--border)); background: linear-gradient(0deg, var(--surface), var(--surface)), var(--sim-soft); }
.sim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sim-grid form { margin: 0; display: flex; }
.sim-grid fieldset { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; flex: 1; }
.sim-grid input { min-width: 0; flex: 1; }
.danger-zone { border-color: color-mix(in srgb, var(--red) 50%, var(--border)); }
.call-row { margin-top: 8px; }
.outcomes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; }
.outcome { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; transition: border-color .15s, background-color .15s; }
.outcome:hover { border-color: var(--border-strong); }
.outcome:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.call-form .row { margin-top: 10px; }
[hidden] { display: none !important; }
.summary-text { white-space: pre-wrap; font-family: inherit; margin: 0 0 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 14px; border-radius: 10px; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.checklist li.ok span { color: var(--green); font-weight: 700; } .checklist li.no span { color: var(--red); font-weight: 700; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; counter-reset: s; }
.steps li { counter-increment: s; padding: 5px 13px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: .84rem; font-weight: 600; border: 1px solid var(--border); }
.steps li::before { content: counter(s) ". "; }
.steps li.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.steps li.done { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.big-list { display: flex; gap: 12px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 14px; font-size: 1rem; }
.big-list li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; }
.big-list strong { font-size: 1.3rem; margin-right: 4px; font-variant-numeric: tabular-nums; }
.walk li { margin-bottom: 6px; }

/* ---------- Getting started (plant grows with progress) ---------- */
.getting-started { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head head" "bar plant" "list plant"; column-gap: 18px;
  background: radial-gradient(120% 140% at 100% 100%, var(--accent-soft) 0%, transparent 55%), var(--surface); border-color: color-mix(in srgb, var(--accent) 22%, var(--border)); }
.getting-started > .page-head { grid-area: head; margin: 0 0 8px; }
.getting-started > .page-head h2 { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.getting-started .gs-progress { color: var(--muted); font-size: .86rem; font-weight: 550; }
.gs-plant { grid-area: plant; align-self: start; margin-top: -10px; }
.gs-plant .plant-art { width: 100px; height: 117px; }
.gs-bar { grid-area: bar; width: 100%; height: 8px; margin: 2px 0 14px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.gs-bar::-webkit-progress-bar { background: var(--surface-3); border-radius: 99px; }
.gs-bar::-webkit-progress-value { background: linear-gradient(90deg, var(--leaf), var(--brand)); border-radius: 99px; }
.gs-bar::-moz-progress-bar { background: linear-gradient(90deg, var(--leaf), var(--brand)); border-radius: 99px; }
.getting-started .checklist { grid-area: list; gap: 2px; margin: 0; }
.getting-started .checklist li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; }
.getting-started .checklist li:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.getting-started .checklist li > span:first-child { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: .72rem; line-height: 1; align-self: center; flex: 0 0 auto; }
.getting-started .checklist li.ok > span:first-child { background: var(--green); color: #fff; }
.getting-started .checklist li.no > span:first-child { color: transparent; box-shadow: inset 0 0 0 2px var(--border-strong); }
.getting-started .checklist li a { font-weight: 600; text-decoration: none; }
.getting-started .checklist li.ok a { color: var(--muted); }
.getting-started .checklist li .small { flex-basis: 100%; margin-left: 30px; }

/* ---------- Illustrations: clinic scene, growing monstera, empty-state vignette ---------- */
.clinic-scene, .plant-art, .empty-art { display: block; }
/* Small drawings: theme-aware palette from :root. */
.sc-wall { fill: var(--sc-wall); } .sc-floor { fill: var(--sc-floor); }
.sc-frame { fill: var(--sc-frame); stroke: var(--sc-frame-line); stroke-width: 2; }
.sc-sky1 { fill: var(--sc-sky1); } .sc-sky3 { fill: var(--sc-sky3); } .sc-out2 { fill: var(--sc-out2); }
.sc-mull { fill: none; stroke: var(--sc-frame); stroke-width: 8; } .sc-mull.thin { stroke-width: 3; }
.sc-beam { fill: var(--sc-beam); }
.sc-smallpot { fill: var(--sc-pot); } .sc-smallrim { fill: var(--sc-pot-rim); }
.sc-vine { fill: none; stroke: var(--sc-vine); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-pothos.t1 { fill: var(--lf2a); } .sc-pothos.t2 { fill: var(--lf1a); } .sc-pothos.t3 { fill: var(--lf3a); }
.sc-stem { fill: none; stroke: var(--sc-stem); stroke-width: 4; stroke-linecap: round; }
.plant-art .sc-stem { stroke-width: 2.2; } .empty-art .sc-stem { stroke-width: 1.6; }
.sc-leaf.t1 { --la: var(--lf1a); --lb: var(--lf1b); } .sc-leaf.t2 { --la: var(--lf2a); --lb: var(--lf2b); } .sc-leaf.t3 { --la: var(--lf3a); --lb: var(--lf3b); }
.sc-leaf .la, .sc-leaf .lb { fill-rule: evenodd; } .sc-leaf .la { fill: var(--la); } .sc-leaf .lb { fill: var(--lb); }
.sc-leaf .lh { fill: none; stroke: var(--sc-vein); stroke-width: 5; stroke-linecap: round; opacity: .35; }
.sc-leaf .lv { fill: none; stroke: var(--sc-vein); stroke-width: 1.4; stroke-linecap: round; opacity: .7; }
.sc-leaf .lm { fill: none; stroke: var(--lb); stroke-width: 2.6; stroke-linecap: round; }
/* Plain white ceramic pot. */
.sc-cpot .pb { fill: var(--sc-cer); stroke: var(--sc-cer-shade); stroke-width: 1.4; } .sc-cpot .pd { fill: var(--sc-cer-shade); opacity: .75; }
.sc-cpot .pl { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; opacity: .85; }
.sc-cpot .pr { fill: var(--sc-cer-rim); stroke: var(--sc-cer-shade); stroke-width: 1.4; } .sc-cpot .ps { fill: none; stroke: var(--sc-soil); stroke-width: 2.4; stroke-linecap: round; opacity: .7; }
.sc-shadow { fill: var(--sc-shadow); }
.sc-sway, .sc-sway2, .plant-leaves { transform-box: fill-box; }
.sc-sway { transform-origin: 50% 100%; animation: sc-sway 8s ease-in-out infinite; }
.sc-sway2 { transform-origin: 50% 0%; animation: sc-sway2 7s ease-in-out infinite; }
.plant-leaves { transform-origin: 50% 100%; animation: plant-grow 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sc-sway { 0%, 100% { transform: rotate(-.6deg); } 50% { transform: rotate(1.4deg); } }
@keyframes sc-sway2 { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-1.8deg); } }
@keyframes plant-grow { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.empty-art { width: 150px; height: 112px; border-radius: 14px; margin-bottom: 6px; box-shadow: inset 0 0 0 1px var(--border); }

/* Clinic scene (sign-in pages). The interior is a clean clinical palette (dimmed a little for a
   dark UI via --cs-dim); the window sky follows the real time of day in IST (ph-* classes set by
   the server and updated by app.js), never the UI theme. */
.clinic-scene {
  --cw: #F5F6FA; --cw2: #EEF0F7; --ctrim: #D3D8E6; --cfloor: #EEF0F5; --ctile: #DDE1EC; --cframe: #ffffff; --cline: #D5DAE7; --cline2: #C0C7DA;
  --cwood: #e6cda5; --cwood2: #c9a578; --cink: #2B3350; --cteal: #1C2541; --cdeep: #131A30; --cmint: #E9D8A6; --cterra: #c9724c;
  --croom: #d6e8e5; --croomfl: #c3d9d5; --cchair: #4f978d; --cchair2: #3d7d74; --cop: #8fb7b1; --cglass: rgba(236, 248, 247, .3); --cfrost: rgba(247, 252, 251, .78);
  --cs-dim: rgba(0, 0, 0, 0);
}
:root[data-theme="dark"] .clinic-scene { --cs-dim: rgba(4, 16, 18, .24); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .clinic-scene { --cs-dim: rgba(4, 16, 18, .24); } }
.clinic-scene, .clinic-scene.ph-day {
  --cs-s1: #6fbbe8; --cs-s2: #aedcf3; --cs-s3: #e2f4f6; --cs-sun: #fffbe6; --cs-halo: rgba(255, 250, 215, .45); --cs-cloud: #ffffff; --cs-cloudo: .95;
  --cs-hill: #a6d4c3; --cs-bldg: #bfd8dd; --cs-tree: #7fbfa3; --cs-lito: 0; --cs-starso: 0; --cs-moono: 0; --cs-suno: 1; --cs-sunpos: translate(530px, 122px);
  --cs-beam: rgba(255, 253, 235, .45); --cs-ga: rgba(255, 252, 235, .35); --cs-amb: rgba(0, 0, 0, 0); --cs-lamp: .12; --cs-refl: .12;
}
.clinic-scene.ph-dawn {
  --cs-s1: #93acd8; --cs-s2: #f2c3c4; --cs-s3: #ffe0bf; --cs-sun: #fff3cc; --cs-halo: rgba(255, 210, 170, .55); --cs-cloud: #ffd7d0; --cs-cloudo: .75;
  --cs-hill: #98b9b2; --cs-bldg: #aab4c8; --cs-tree: #789f96; --cs-lito: .35; --cs-starso: .2; --cs-moono: 0; --cs-suno: 1; --cs-sunpos: translate(548px, 318px);
  --cs-beam: rgba(255, 214, 196, .3); --cs-ga: rgba(255, 206, 186, .3); --cs-amb: rgba(255, 180, 160, .05); --cs-lamp: .45; --cs-refl: .18;
}
.clinic-scene.ph-golden {
  --cs-s1: #e48f8c; --cs-s2: #f5ae78; --cs-s3: #ffd892; --cs-sun: #fff0bf; --cs-halo: rgba(255, 196, 110, .6); --cs-cloud: #ffc4a0; --cs-cloudo: .7;
  --cs-hill: #c49a7d; --cs-bldg: #b08a86; --cs-tree: #9a8066; --cs-lito: .25; --cs-starso: 0; --cs-moono: 0; --cs-suno: 1; --cs-sunpos: translate(470px, 296px);
  --cs-beam: rgba(255, 190, 120, .36); --cs-ga: rgba(255, 186, 116, .32); --cs-amb: rgba(255, 150, 80, .06); --cs-lamp: .5; --cs-refl: .14;
}
.clinic-scene.ph-dusk {
  --cs-s1: #262f62; --cs-s2: #66558f; --cs-s3: #cf86a0; --cs-sun: #ffd9a0; --cs-halo: rgba(0, 0, 0, 0); --cs-cloud: #8a78a6; --cs-cloudo: .4;
  --cs-hill: #3a4866; --cs-bldg: #454b70; --cs-tree: #313f58; --cs-lito: .85; --cs-starso: .55; --cs-moono: .65; --cs-suno: 0; --cs-sunpos: translate(480px, 430px);
  --cs-beam: rgba(170, 150, 230, .07); --cs-ga: rgba(150, 130, 220, .14); --cs-amb: rgba(110, 64, 92, .09); --cs-lamp: .85; --cs-refl: .38;
}
.clinic-scene.ph-night {
  --cs-s1: #0b1534; --cs-s2: #162657; --cs-s3: #283b70; --cs-sun: #ffd9a0; --cs-halo: rgba(0, 0, 0, 0); --cs-cloud: #2c3a64; --cs-cloudo: .35;
  --cs-hill: #1b2944; --cs-bldg: #212d4b; --cs-tree: #16253a; --cs-lito: 1; --cs-starso: 1; --cs-moono: 1; --cs-suno: 0; --cs-sunpos: translate(500px, 440px);
  --cs-beam: rgba(255, 220, 160, .03); --cs-ga: rgba(255, 200, 130, .14); --cs-amb: rgba(122, 82, 40, .13); --cs-lamp: 1; --cs-refl: .5;
}
.cs-wall { fill: var(--cw); } .cs-wall2 { fill: var(--cw2); } .cs-trim { fill: none; stroke: var(--ctrim); stroke-width: 3; }
.cs-floor { fill: var(--cfloor); } .cs-tile { fill: none; stroke: var(--ctile); stroke-width: 1.6; }
.cs-clock { fill: var(--cteal); } .cs-face { fill: #fff; } .cs-ticks { fill: none; stroke: #9fc2bc; stroke-width: 2; stroke-linecap: round; }
.cs-hh, .cs-mh { fill: none; stroke: var(--cink); stroke-linecap: round; } .cs-hh { stroke-width: 3.4; } .cs-mh { stroke-width: 2.2; } .cs-pin { fill: var(--cterra); }
.cs-cord { stroke: var(--cink); stroke-width: 1.5; opacity: .55; } .cs-shade { fill: var(--cteal); } .cs-shrim { fill: var(--cdeep); }
.cs-wood { fill: var(--cwood); } .cs-bracket { fill: none; stroke: var(--cwood2); stroke-width: 4; } .cs-leg { fill: none; stroke: var(--cwood2); stroke-width: 5; stroke-linecap: round; }
.cs-book1 { fill: #7fc4b8; } .cs-book2 { fill: #e6d6bf; } .cs-book3 { fill: var(--cterra); opacity: .8; }
.cs-vase { fill: #fff; stroke: #c3dad6; stroke-width: 1.4; } .cs-sprig { fill: none; stroke: #6a9f86; stroke-width: 1.5; stroke-linecap: round; } .cs-sprigl { fill: #8fc2a6; }
.cs-pic { fill: var(--cframe); stroke: var(--cline); stroke-width: 2; } .cs-mat { fill: var(--cmint); } .cs-mat2 { fill: #fbfdfd; }
.cs-psun { fill: var(--cterra); opacity: .55; } .cs-pleaf { fill: #6fae9c; } .cs-pleaf2 { fill: #a5d2c2; } .cs-prib { fill: none; stroke: #EEF0F7; stroke-width: 1.4; stroke-linecap: round; }
.cs-heart { fill: #f2b7a3; } .cs-pulse { fill: none; stroke: var(--cteal); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cs-cert { fill: #fbfdfd; stroke: var(--cwood2); stroke-width: 2; } .cs-certl { fill: none; stroke: #c9dcd8; stroke-width: 2; stroke-linecap: round; } .cs-seal { fill: #e0a64a; }
.cs-hook { fill: var(--cwood2); } .cs-tube { fill: none; stroke: #23423e; stroke-width: 3.2; stroke-linecap: round; }
.cs-ear { fill: none; stroke: #b9c6c9; stroke-width: 2; stroke-linecap: round; } .cs-tip, .cs-yj { fill: #2e4441; }
.cs-chest { fill: #cfd9dc; stroke: #8fa2a6; stroke-width: 1.2; } .cs-chesti { fill: #f3f7f8; }
.cs-plaque { fill: var(--cteal); } .cs-plus { fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; }
.cs-curtrail { stroke: var(--cop); stroke-width: 3; stroke-linecap: round; } .cs-curt { fill: #eef7f5; opacity: .85; } .cs-paper { fill: #fbfdfd; }
.cs-room { fill: var(--croom); } .cs-roomfloor { fill: var(--croomfl); } .cs-cab, .cs-ophead { fill: var(--cop); } .cs-oplight { fill: #fff; opacity: .55; }
.cs-arm { fill: none; stroke: var(--cop); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.cs-chair { fill: var(--cchair); } .cs-seat { fill: none; stroke: var(--cchair); stroke-width: 15; stroke-linecap: round; stroke-linejoin: round; }.cs-glass { fill: var(--cglass); } .cs-frost { fill: var(--cfrost); } .cs-sheen { fill: #fff; opacity: .4; }
.cs-pframe { fill: none; stroke: var(--cline2); stroke-width: 4; } .cs-pmull { stroke: var(--cline2); stroke-width: 3; } .cs-handle { fill: var(--cteal); }
.cs-wframe, .cs-sill { fill: var(--cframe); stroke: var(--cline); stroke-width: 2; } .cs-mull { fill: none; stroke: var(--cframe); stroke-width: 7; }
.cs-s1 { stop-color: var(--cs-s1); } .cs-s2 { stop-color: var(--cs-s2); } .cs-s3 { stop-color: var(--cs-s3); }
.cs-stars { fill: #fff; opacity: var(--cs-starso); } .cs-moon { fill: #f5f1d8; opacity: var(--cs-moono); }
.cs-sun { transform: var(--cs-sunpos); opacity: var(--cs-suno); } .cs-halo { fill: var(--cs-halo); } .cs-disc { fill: var(--cs-sun); }
.cs-clouds { fill: var(--cs-cloud); opacity: var(--cs-cloudo); }
.cs-hill { fill: var(--cs-hill); } .cs-bldg { fill: var(--cs-bldg); } .cs-trees { fill: var(--cs-tree); } .cs-lit { fill: #ffd98a; opacity: var(--cs-lito); }
.cs-refl { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; opacity: calc(var(--cs-refl) * .6); }
.cs-beam { fill: var(--cs-beam); } .cs-ga { stop-color: var(--cs-ga); } .cs-gb { stop-color: var(--cs-ga); stop-opacity: 0; }
.cs-lshadow { fill: rgba(15, 60, 56, .07); }
.cs-dtop { fill: #f8fbfb; } .cs-desk { fill: var(--cteal); } .cs-dstripe { fill: var(--cmint); } .cs-dshade { fill: rgba(19, 26, 48, .35); }
.cs-sign { fill: var(--cteal); stroke: #fff; stroke-width: 2.5; } .cs-signbase { fill: var(--cdeep); } .cs-signtext { fill: #fff; font: 800 17px var(--font); letter-spacing: -1px; }
.cs-tstand { fill: none; stroke: var(--cink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; } .cs-tab { fill: #26332f; } .cs-tscr { fill: #f4fbfa; }
.cs-thead { fill: var(--cteal); } .cs-tcell { fill: #cfe3df; } .cs-tday { fill: var(--cterra); }
.cs-pen, .cs-pen2, .cs-pen3 { stroke: var(--cink); stroke-width: 2.4; stroke-linecap: round; } .cs-pen2 { stroke: var(--cterra); } .cs-pen3 { stroke: var(--cteal); }
.cs-pcup { fill: var(--cmint); stroke: #b9d8d2; stroke-width: 1.2; }
.cs-bottle { fill: #f4fbfa; stroke: #b9d8d2; stroke-width: 1.2; } .cs-gel { fill: #bfe6df; } .cs-pump { fill: none; stroke: var(--cink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cs-bell { fill: #d6a54e; } .cs-bellhi { fill: none; stroke: #fff3d4; stroke-width: 1.6; stroke-linecap: round; opacity: .8; } .cs-bellbase { fill: #9b7a3a; }
.cs-amb { fill: var(--cs-amb); } .cs-dim { fill: var(--cs-dim); }
.cs-cone { opacity: var(--cs-lamp); } .cs-la { stop-color: #ffe6b0; stop-opacity: .55; } .cs-lb { stop-color: #ffe6b0; stop-opacity: 0; } .cs-bulb { fill: #fff4d6; opacity: calc(.35 + .65 * var(--cs-lamp)); }
.cs-s1, .cs-s2, .cs-s3, .cs-ga, .cs-gb, .cs-sun, .cs-halo, .cs-disc, .cs-moon, .cs-stars, .cs-clouds, .cs-hill, .cs-bldg, .cs-trees, .cs-lit, .cs-refl, .cs-beam, .cs-amb, .cs-cone, .cs-bulb {
  transition: fill 6s ease, opacity 6s ease, transform 6s ease, stop-color 6s ease; }

/* ---------- Coming soon ---------- */
.soon-card { text-align: left; position: relative; overflow: hidden; padding: 24px; background: radial-gradient(90% 120% at 100% 0%, var(--accent-soft) 0%, transparent 60%), var(--surface); }
.soon-card h2 { font-size: 1.2rem; }
.soon-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; margin-bottom: 14px; background: linear-gradient(140deg, #2E3B6B, var(--brand-deep)); color: #fff; box-shadow: 0 8px 20px -8px rgba(19, 26, 48, .6); }
.soon-icon .icon { width: 24px; height: 24px; }
.soon-card .soon-list { margin: 10px 0 16px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.soon-card .soon-list li { position: relative; padding-left: 28px; }
.soon-card .soon-list li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.soon-card .soon-list li::after { content: ""; position: absolute; left: 6px; top: 7px; width: 5px; height: 8px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ---------- AI receptionist ---------- */
.subnav { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 16px; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.subnav a { padding: 9px 12px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.subnav a:hover { color: var(--text); border-bottom-color: var(--border-strong); }
.subnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
fieldset.plain > .card { margin-bottom: 0; }
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.mode-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; font-weight: 400; gap: 8px; box-shadow: var(--shadow-sm); transition: border-color .15s; }
.mode-card:hover { border-color: var(--border-strong); }
.mode-card:has(input:checked), .mode-card.selected { border-color: var(--accent); background: linear-gradient(0deg, var(--surface), var(--surface)), var(--accent-soft); }
.mode-card .kv { grid-template-columns: 150px 1fr; margin-top: 4px; }
.status-detail { margin-top: 4px; color: var(--muted); }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 12px 0; border-top: 1px solid var(--border); z-index: 2; }
.table.hours input { min-width: 0; }
.chat { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; max-height: 460px; overflow: auto; }
.bubble { max-width: 85%; padding: 8px 12px; border-radius: 14px; font-size: .92rem; }
.bubble.ai { background: var(--sim-soft); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.caller { background: var(--accent-soft); align-self: flex-end; border-bottom-right-radius: 4px; }

/* ---------- Auth pages: illustrated clinic scene + centred card ---------- */
body.auth-body { min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(60% 50% at 0% 0%, color-mix(in srgb, var(--brand) 16%, transparent) 0%, transparent 70%),
    radial-gradient(55% 45% at 100% 100%, color-mix(in srgb, var(--brand-amber) 10%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 60%); background-attachment: fixed; }
.auth-shell { flex: 1; display: flex; flex-direction: column; }
/* Phones and tablets: a cropped band of the scene above the card. */
.auth-art { height: 220px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.auth-art .clinic-scene { width: 100%; height: 100%; }
.auth-col { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 16px 20px; margin-top: -84px; position: relative; }
.auth-shell:not(:has(.auth-card)) > .auth-art { display: none; }
.auth-shell:not(:has(.auth-card)) > .auth-col { margin-top: 0; padding-top: 28px; }
.auth-top { margin: 0 auto; padding: 6px 14px 6px 8px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: var(--shadow); }
.auth-shell:has(.auth-brand) .auth-top { display: none; }
.auth-main { width: 100%; padding: 0; flex: 1; }
.auth-foot { color: var(--muted); padding-top: 24px; text-align: center; }
.auth-stage { max-width: 560px; margin: 0 auto; }
.auth-stage:has(> .auth-card:not(.wide)) { max-width: 420px; }
.auth-stage:not(:has(> .auth-card)) { max-width: none; }
.auth-card { max-width: 420px; margin: 18px auto 24px; padding: 32px 28px; border-radius: 18px; box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 14%, var(--border)); }
.auth-card.wide { max-width: 560px; }
.auth-card > h1 { margin-bottom: 8px; }
.auth-card .btn.primary { min-height: 44px; font-size: 1rem; }
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-brand h1 { margin-top: 12px; font-size: 1.6rem; }
.auth-brand .tagline { margin: 2px 0 6px; color: var(--accent); font-weight: 600; }
/* Desktop: split layout, scene on the left. */
@media (min-width: 1024px) {
  .auth-shell:has(.auth-card) { display: grid; grid-template-columns: 55fr 45fr; }
  .auth-shell:has(.auth-card) > .auth-art { height: auto; position: relative; -webkit-mask-image: none; mask-image: none; }
  .auth-shell:has(.auth-card) > .auth-art .clinic-scene { position: absolute; inset: 0; }
  .auth-shell:has(.auth-card) > .auth-art::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 48px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bg) 55%, transparent)); }
  .auth-shell:has(.auth-card) > .auth-col { margin-top: 0; justify-content: center; padding: 36px 32px 20px; }
  .auth-shell:has(.auth-card) .auth-main { flex: 0 1 auto; }
  .auth-card { margin: 20px auto; }
}

/* ---------- System page (monitoring) ---------- */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.sys-card { margin-bottom: 0; border-left: 4px solid var(--border); }
.sys-card.sys-ok { border-left-color: var(--green); }
.sys-card.sys-warn { border-left-color: var(--brand-amber); }
.sys-card.sys-bad { border-left-color: var(--red); background: var(--red-soft); }
.sys-card-title { font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sys-card-value { font-size: 1.15rem; font-weight: 700; margin: 2px 0; overflow-wrap: anywhere; }
.sys-alert { margin-bottom: 14px; }
.sys-errors tr.sys-unseen td:first-child { font-weight: 650; }
.sys-errors td { overflow-wrap: anywhere; }
.sys-checklist { margin: 0; padding-left: 1.2rem; }
.sys-checklist li { margin: 4px 0; }

/* ---------- Live AI calls readiness (System page + Call Settings) ---------- */
.live-ai { border-left: 4px solid var(--brand-amber); }
.live-ai.live-ai-ready { border-left-color: var(--green); }
.live-ai-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 4px; }
.live-ai-head h2 { margin: 0; }
.live-ai-list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; }
.live-ai-list > li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.live-ai-list > li:first-child { border-top: 0; }
.live-ai-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: .8rem; font-weight: 700; line-height: 1; margin-top: 1px; }
.live-ai-list li.ok .live-ai-mark { background: var(--green-soft); color: var(--green); }
.live-ai-list li.no .live-ai-mark { background: var(--red-soft); color: var(--red); }
.live-ai-label { font-weight: 650; overflow-wrap: anywhere; }
.live-ai-label code { font-size: .86em; }
.live-ai-fix { margin: 3px 0 0; }
.live-ai-warn { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--amber-soft); color: var(--text, inherit); font-size: .86rem; }
.live-ai-warn strong { color: var(--amber); }
.live-ai-voice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.live-ai-voice code { overflow-wrap: anywhere; }
.live-ai-flow { margin: 8px 0 0; padding-left: 1.2rem; }
.live-ai-flow li { margin: 6px 0; overflow-wrap: anywhere; }

/* ---------- AI receptionist: call-forwarding wizard (mobile first) ---------- */
.fw-wizard { max-width: 720px; }
.fw-intro h2 { margin-bottom: 2px; }
.fw-intro p { margin: 0 0 12px; }
.fw-steps li { padding: 0; display: inline-flex; align-items: center; }
.fw-steps li::before { padding-left: 12px; margin-right: 4px; }
.fw-steps li a { display: inline-block; padding: 9px 12px 9px 0; color: inherit; text-decoration: none; }
.fw-step h2 { font-size: 1.15rem; }
.fw-numbers { display: grid; gap: 10px; margin: 0 0 12px; }
.fw-num { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.fw-num dt { font-size: .85rem; color: var(--muted); font-weight: 600; }
.fw-num dd { margin: 2px 0 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.fw-target { border: 2px solid var(--accent); background: var(--accent-soft); }
.fw-ok { color: var(--green); font-weight: 600; }
.fw-options { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.fw-options legend { padding: 0 0 6px; }
.fw-option { border: 2px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-height: 52px; cursor: pointer; font-weight: 400; background: var(--surface); justify-content: center; }
.fw-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.fw-option input[type="radio"] { width: 22px; height: 22px; min-height: 22px; }
.fw-check { min-height: 40px; }
.btn.fw-big { min-height: 48px; padding: 10px 18px; font-size: 1rem; }
.fw-howto { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.fw-actions { display: flex; flex-direction: column; gap: 14px; margin: 12px 0; }
.fw-action { display: flex; flex-direction: column; gap: 6px; }
.btn.fw-tel { width: 100%; min-height: 58px; font-size: 1.08rem; border-radius: 12px; text-align: center; }
.fw-code-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fw-code { font-size: 1rem; padding: 4px 8px; user-select: all; -webkit-user-select: all; }
.btn.fw-copy { min-height: 40px; min-width: 72px; }
.fw-source { border-left: 3px solid var(--brand-amber); padding-left: 8px; }
.fw-simwarn { background: var(--sim-soft); color: var(--text); border: 1px solid var(--sim); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: .9rem; }
.fw-unverified { border: 2px dashed var(--brand-amber); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.fw-unverified p { margin: 0; }
.fw-off { margin-top: 8px; }
.fw-status { border: 2px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.fw-status[data-state="active"] { border-color: var(--green); background: var(--green-soft); }
.fw-status[data-state="failed"] { border-color: var(--red); }
.fw-status[data-state="pending_verification"] { border-color: var(--blue); }
.fw-status-head { font-weight: 650; font-size: 1.05rem; }
.fw-status-head .badge { font-size: .9rem; padding: 3px 10px; }
.fw-status p { margin: 6px 0; }
.fw-timeout { background: var(--amber-soft); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.fw-timeout ul { margin: 6px 0; padding-left: 1.2rem; }
.fw-buttons { gap: 10px; }
.fw-buttons form { flex: 1 1 220px; }
.fw-buttons .btn { width: 100%; }
.fw-simbtn { border-color: var(--sim); }
.fw-nav { margin: 4px 0 18px; }
.fw-cta { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 2px solid var(--accent); background: linear-gradient(0deg, var(--surface), var(--surface)), var(--accent-soft); }
.fw-cta h2 { margin-bottom: 4px; }
.fw-cta p { margin: 0; }
.fw-offscreen { position: fixed; top: 0; left: -9999px; opacity: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 2-step login and password reset links ---------- */
.totp-secret, .reset-link code { font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.recovery-codes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 16px; }
.recovery-codes code { font-size: 1rem; }

/* ---------- Quick add, upload nudge, toast ---------- */
.topbar-add { margin-left: auto; }
.topbar-add span { font-size: 1.15rem; line-height: 1; margin-top: -2px; }
.quick-add-fab { display: none; }
.dash-add { display: none; }
.upload-nudge { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--r-lg);
  background: linear-gradient(100deg, var(--amber-soft), color-mix(in srgb, var(--amber-soft) 40%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--brand-amber) 30%, transparent); box-shadow: var(--shadow); }
.nudge-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; background: var(--surface); color: var(--amber); box-shadow: var(--shadow-sm); }
.nudge-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; color: var(--text); }
.nudge-text span { color: var(--muted); font-size: .9rem; }
.upload-nudge .btn { flex: 0 0 auto; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(92vw, 520px);
  padding: 12px 16px; border-radius: 12px; background: var(--brand-deep); color: #fff; font-weight: 550; box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease-out, toast-out .4s ease-in 5s forwards; }
.toast .icon { width: 18px; height: 18px; flex: 0 0 auto; color: #D4AF37; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { to { opacity: 0; visibility: hidden; } }
.quick-wrap { max-width: 520px; margin: 0 auto; }
.quick-head { margin-bottom: 12px; }
.quick-form { display: flex; flex-direction: column; gap: 16px; }
.quick-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.quick-form input, .quick-form select { min-height: 52px; font-size: 1.08rem; padding: 10px 14px; border-radius: 12px; }
.quick-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-pair label { min-width: 0; }
.quick-more { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 10px 14px; }
.quick-more summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 28px; display: flex; align-items: center; }
.quick-more[open] { display: flex; flex-direction: column; gap: 14px; padding-bottom: 14px; }
.quick-save { min-height: 54px; font-size: 1.08rem; border-radius: 12px; width: 100%; }
.quick-note { margin: -4px 0 0; }
.num-short { width: 90px; }
.kind-pick { display: flex; flex-direction: column; gap: 8px; }
.saved-mapping strong { font-weight: 700; }

/* ---------- Responsive ---------- */
/* Wide tables scroll inside themselves on smaller screens (sticky headers on large screens). */
/* Add appointment: patient search and date/time shortcuts */
.pt-fields { display: flex; flex-direction: column; gap: 16px; }
.pt-suggest { display: flex; flex-direction: column; margin-top: -8px; border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: var(--surface); }
.pt-option { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: none; border: 0; border-bottom: 1px solid var(--border); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pt-option:last-child { border-bottom: 0; }
.pt-option:hover, .pt-option:focus-visible { background: var(--surface-2); }
.pt-option span { color: var(--muted); font-size: .86rem; white-space: nowrap; }
.pt-picked { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--gold); border-radius: 12px; font-weight: 600; }
.quick-group { display: flex; flex-direction: column; gap: 8px; }
.quick-label { font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.chip { min-height: 42px; padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip-grid .chip { padding: 6px 2px; }
.chip:hover:not(:disabled) { border-color: var(--gold); }
.chip.on { background: var(--gold); border-color: var(--gold); color: #1C2541; }
.chip:disabled { opacity: .38; cursor: not-allowed; }
.quick-more a { font-weight: 600; }

/* Connect WhatsApp */
.wa-connect { border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.wa-status { color: var(--muted); }
.wa-status.error { color: var(--red); }

/* Appointments day list */
.subnav { overflow-y: hidden; }
.appt-date label { flex-direction: row; align-items: center; gap: 8px; }
.appt-date input { width: auto; }
.appt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.appt-day { font-size: .98rem; margin: 18px 0 8px; }
.appt-list { list-style: none; margin: 0 0 12px; padding: 4px 20px; }
.appt { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto 64px; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.appt:last-child { border-bottom: 0; }
.appt-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.appt-who { display: flex; flex-direction: column; min-width: 0; }
.appt-who a { text-decoration: none; }
.appt-status { justify-self: end; }
.appt-call { justify-self: end; }
.appt.is-cancelled .appt-time, .appt.is-cancelled .appt-who { opacity: .55; text-decoration: line-through; }
@media (max-width: 640px) {
  .appt-list { padding: 2px 14px; }
  .appt { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .appt-status { grid-column: 2; grid-row: 2; justify-self: start; }
  .appt-call { grid-column: 3; grid-row: 1 / span 2; }
  .chip-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Calmer pages: menu groups, fold-away panels and settings sections (native <details>, no script). */
.nav-group > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding: 7px 10px; border-radius: 10px; color: var(--side-text); opacity: .72; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.nav-group > summary:hover { background: var(--side-hover); opacity: 1; }
.nav-group > summary:focus-visible { outline-color: #D4AF37; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; }
.nav-group > summary::-webkit-details-marker, .panel > summary::-webkit-details-marker, .set-sec > summary::-webkit-details-marker, .task-more > summary::-webkit-details-marker, .more-filters > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after, .panel > summary::after, .set-sec > summary::after { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; opacity: .7; }
.nav-group[open] > summary::after, .panel[open] > summary::after, .set-sec[open] > summary::after { transform: rotate(-135deg); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 10px; box-shadow: var(--shadow); }
.panel > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 15px 20px; cursor: pointer; border-radius: var(--r-lg); }
.panel > summary::after { margin-left: auto; }
.panel > summary:hover strong { color: var(--accent); }
.panel-body { padding: 2px 20px 20px; }
.panel-body.metrics { padding-top: 2px; }
.panel .metric { box-shadow: none; }
.def-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px 24px; margin: 0; }
.def-list dt { font-weight: 650; font-size: .88rem; }
.def-list dd { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }

.metrics-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 28px; }
.dash-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dash-sec-head h2, .dash-queue-head h2 { margin: 0; }
.dash-queue-head { margin-bottom: 10px; }
.dash-more { margin: 32px 0 10px; }

.gs-fold { margin-bottom: 22px; }
.gs-fold > summary .gs-bar { flex: 1 1 auto; max-width: 260px; margin: 0; }
.gs-fold .gs-progress { color: var(--muted); font-size: .86rem; }
.getting-started.gs-inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "list plant" "hide plant"; padding: 0 20px 18px; }
.gs-hide { grid-area: hide; margin-top: 8px; }

.task-actions { align-items: flex-start; justify-content: space-between; }
.task-more { flex: 1 1 240px; min-width: 0; }
.task-more > summary { list-style: none; display: inline-block; padding: 5px 0; color: var(--muted); font-size: .84rem; cursor: pointer; }
.task-more > summary:hover { color: var(--accent); }
.task-more-body { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

.more-filters > summary { list-style: none; display: inline-block; color: var(--accent); font-size: .88rem; font-weight: 600; cursor: pointer; }
.more-filters > .filters { margin-top: 12px; }

.set-group { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 -2px; }
.set-group:first-of-type { margin-top: 0; }
.set-sec { border: 1px solid var(--border); border-radius: var(--radius); }
.set-sec > summary { list-style: none; display: flex; align-items: baseline; gap: 12px; padding: 13px 16px; cursor: pointer; }
.set-sec > summary > span { color: var(--muted); font-size: .84rem; }
.set-sec > summary::after { margin-left: auto; align-self: center; }
.set-sec > summary:hover strong { color: var(--accent); }
.set-body { padding: 2px 16px 16px; }

@media (max-width: 1023px) {
  .nav-group { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
  .nav-group > summary { margin: 0; padding: 7px 11px; border-radius: 99px; gap: 8px; font-size: .72rem; }
  .nav-sub { flex-direction: row; gap: 4px; }
  .metrics-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print { .panel > summary::after, .set-sec > summary::after { display: none; } }

@media (max-width: 1279px) {
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th { position: static; }
}
@media (max-width: 1023px) {
  .shell { display: block; background: none; }
  .sidebar { position: relative; height: auto; overflow: visible; padding: 10px 16px 0; gap: 0; }
  .side-leaf { display: none; }
  .side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .sidebar .brand-mark { padding: 4px 0; }
  .sidebar .who { margin: 0; padding: 0; border: 0; }
  .who-text { display: none; }
  .who-link { flex: 0 0 auto; padding: 2px; }
  .avatar { width: 32px; height: 32px; }
  .nav { flex-direction: row; gap: 4px; overflow-x: auto; margin: 10px -16px 0; padding: 0 16px 10px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: 16px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 11px; font-size: .88rem; gap: 7px; border-radius: 99px; scroll-snap-align: start; }
  .nav a .icon { width: 17px; height: 17px; }
  .nav a.active { background: #fff; color: var(--brand-deep); }
  .nav a.active::before { display: none; }
  .topbar { padding: 10px 16px; }
  .container { padding: 18px 16px 32px; }
  .topbar-add { display: none; }
  .dash-add { display: inline-flex; }
  .side-head .brand-mark { flex: 1 1 auto; min-width: 0; }
  .side-head .quick-add-fab { order: 2; display: inline-grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
    background: #fff; color: var(--brand-deep); font-weight: 700; text-decoration: none; box-shadow: 0 2px 10px -2px rgba(0, 0, 0, .35); }
  .side-head .who { order: 3; }
  .side-head .quick-add-fab > span[aria-hidden] { font-size: 1.6rem; line-height: 1; margin-top: -3px; }
  .side-head .fab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .side-head .quick-add-fab:focus-visible { outline: 2px solid #D4AF37; outline-offset: 2px; }
}
@media (max-width: 640px) {
  .upload-nudge { flex-wrap: wrap; }
  .upload-nudge .btn { width: 100%; }
  .quick-wrap .card { padding: 16px; }
  /* Keep Save reachable with the keyboard open / on short screens. */
  .quick-save { position: sticky; bottom: 10px; z-index: 2; }
  .toast { bottom: 16px; }
}
@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 1.3rem; }
  .card { padding: 16px; border-radius: var(--radius); }
  .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 8px; }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .filters .grow { grid-column: 1 / -1; }
  .filters > label, .filters input, .filters select { min-width: 0; }
  .demo-banner { font-size: .74rem; padding: 5px 16px; line-height: 1.4; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 12px; }
  .metric-icon { width: 30px; height: 30px; border-radius: 9px; margin-bottom: 4px; }
  .metric-icon .icon { width: 16px; height: 16px; }
  .metric-value { font-size: 1.45rem; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive { border: 0; background: transparent; box-shadow: none; }
  .table.responsive thead { display: none; }
  .table.responsive tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; padding: 6px 0; box-shadow: var(--shadow-sm); }
  .table.responsive tbody tr:nth-child(even) td, .table.responsive tbody tr:hover td { background: transparent; }
  .table.responsive td { border: 0; padding: 4px 12px; display: flex; gap: 10px; }
  .table.responsive td::before { content: attr(data-label); flex: 0 0 100px; color: var(--muted); font-size: .78rem; font-weight: 600; }
  .task-actions input.grow { flex-basis: 100%; }
  .getting-started { grid-template-areas: "head head" "bar plant" "list list"; }
  .gs-plant { margin-top: -30px; }
  .gs-plant .plant-art { width: 60px; height: 70px; }
  .auth-card { padding: 26px 20px; }
  .fw-cta .btn { width: 100%; }
  .fw-steps { gap: 4px; }
  .fw-steps li a { font-size: .8rem; }
}

/* ---------- Motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  :root { color-scheme: light; }
  body, body.auth-body { background: #fff !important; color: #000; font-size: 12px; }
  .shell { display: block; }
  .sidebar, .topbar, .skip-link, .demo-banner, .filters, .task-actions, .def, .btn, form.inline, .auth-art, .gs-plant, .plant-art, .empty-art, .pager { display: none !important; }
  .container { max-width: none; padding: 0; }
  .card, .metric, .task, .table { box-shadow: none !important; background: #fff !important; border-color: #bbb !important; break-inside: avoid; }
  .table th { position: static; background: #f0f0f0 !important; color: #333; }
  .table tbody tr td { background: #fff !important; }
  a { color: #000; text-decoration: none; }
}

/* ---------- Per-clinic branding (src/branding.js; colours come from /branding/theme.css) ---------- */
.clinic-logo { width: 38px; height: 38px; object-fit: contain; flex: 0 0 auto; border-radius: 10px; background: #fff; padding: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 2px 6px -2px rgba(0, 0, 0, .35); }
.sidebar .clinic-brand { min-width: 0; padding: 2px 6px 14px; gap: 11px; }
.clinic-wordmark { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.2; font-size: .98rem; letter-spacing: -.01em; overflow-wrap: anywhere; }
.powered-by { margin: 0; font-size: .72rem; letter-spacing: .02em; }
.pb-mark { font-weight: 750; }
.sidebar .powered-by { order: 4; padding: 8px 8px 0; color: rgba(255, 255, 255, .5); }
.sidebar .powered-by .pb-mark { color: rgba(255, 255, 255, .78); }
.app-foot { display: none; }
.print-head { display: none; }
.auth-clinic { display: inline-flex; align-items: center; gap: 12px; padding: 6px 18px 6px 6px; color: var(--text); font-weight: 750; font-size: 1.05rem; max-width: calc(100% - 32px); }
.auth-clinic .clinic-logo { width: 44px; height: 44px; box-shadow: 0 0 0 1px var(--border); }
@media (max-width: 1023px) {
  .sidebar .clinic-brand { padding: 4px 0; }
  .sidebar .clinic-logo { width: 34px; height: 34px; }
  .clinic-wordmark { -webkit-line-clamp: 1; font-size: .95rem; }
  .sidebar .powered-by { display: none; }
  .app-foot { display: block; text-align: center; color: var(--muted); padding: 0 16px 22px; }
}
@media print {
  .print-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid #bbb; font-size: 15px; }
  .print-head .clinic-logo { box-shadow: none; padding: 0; width: 40px; height: 40px; }
  .app-foot { display: none !important; }
}

/* Settings > Branding */
.logo-preview-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.logo-preview { width: 120px; height: 120px; display: grid; place-items: center; padding: 12px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }
.logo-preview img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.logo-preview.dark { border: 0; background: linear-gradient(180deg, var(--side-1), var(--side-2)); color: rgba(255, 255, 255, .72); }
.logo-preview.dark img { max-width: 64px; max-height: 64px; background: #fff; border-radius: 12px; padding: 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 12px 6px; border: 0; padding: 0; min-width: 0; }
.swatches legend { padding: 0; margin-bottom: 8px; color: var(--muted); font-weight: 600; }
.swatch { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 74px; cursor: pointer; font-size: .74rem; font-weight: 550; color: var(--muted); text-align: center; }
.swatch input[type="radio"] { position: absolute; top: 0; left: 50%; width: 1px; height: 1px; min-height: 0; opacity: 0; margin: 0; }
.swatch svg, .swatch input[type="color"] { display: block; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border-strong); transition: box-shadow .15s, transform .15s; }
.swatch:hover svg, .swatch:hover input[type="color"] { transform: scale(1.06); }
.swatch input[type="radio"]:checked ~ svg, .swatch input[type="radio"]:checked ~ input[type="color"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text); }
.swatch input[type="radio"]:focus-visible ~ svg, .swatch input[type="radio"]:focus-visible ~ input[type="color"] { outline: 2px solid var(--accent); outline-offset: 5px; }
.swatch input[type="radio"]:checked ~ .swatch-name { color: var(--text); font-weight: 700; }
.swatch input[type="color"] { width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; background: none; cursor: pointer; }
.swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatch input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }
.swatches[disabled] .swatch { cursor: not-allowed; opacity: .7; }
.brand-sample { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.brand-sample-side { display: inline-grid; place-items: center; width: 52px; height: 44px; border-radius: 10px; background: linear-gradient(180deg, var(--side-1), var(--side-2)); }
.brand-sample .btn { pointer-events: none; }


/* ---------- WhatsApp inbox + message templates (src/routes/inbox.js, src/routes/messaging.js) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.inbox-sub { margin: 4px 0 0; }
.policy-chips { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.policy-chips li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .8rem; font-weight: 550; box-shadow: var(--shadow-sm); }
.policy-chips .icon { width: 15px; height: 15px; color: var(--accent); }
.inbox-sim summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inbox-sim form { margin-top: 14px; }
.sample-row { gap: 6px; }
.sample-row .btn.ghost { border: 1px dashed color-mix(in srgb, var(--sim) 40%, var(--border)); color: var(--sim); font-weight: 550; }
.convo-list { display: flex; flex-direction: column; gap: 0; }
.convo { padding: 0; overflow: hidden; }
.convo.needs-reply { border-left: 3px solid var(--amber); }
.convo.is-medical { border-left-color: var(--red); }
.convo-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface), var(--surface-2)); flex-wrap: wrap; }
.convo-avatar { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-weight: 700; color: var(--brand-deep); background: var(--brand-mint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 22%, transparent); }
.convo-who { flex: 1; min-width: 150px; }
.convo-who a { color: var(--text); text-decoration: none; }
.convo-who a:hover { color: var(--accent); text-decoration: underline; }
.convo-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.window-badge .icon { width: 13px; height: 13px; }
.thread { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.bubble { max-width: min(78%, 560px); padding: 9px 13px; border-radius: 14px; box-shadow: var(--shadow-sm); }
.bubble.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--brand-mint); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); border-bottom-right-radius: 4px; }
.bubble.failed { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.bubble-text { white-space: pre-line; overflow-wrap: anywhere; }
.bubble-meta { margin-top: 4px; font-size: .74rem; color: var(--muted); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.bubble.out .bubble-meta { justify-content: flex-end; }
.reply-form { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 18px; border-top: 1px solid var(--border); }
.reply-form textarea { width: 100%; resize: vertical; min-height: 96px; line-height: 1.5; }
.reply-form .flash { margin: 0; }
.reply-form > p { margin: 0; }
.suggest-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.suggest-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: .88rem; color: var(--accent-strong); margin-right: 4px; }
.suggest-label .icon { width: 16px; height: 16px; }
.window-closed { padding: 14px 18px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--grey-soft); }
.window-closed p { margin: 0; flex: 1; min-width: 220px; }
.convo-note { margin: 0; padding: 12px 18px; border-top: 1px solid var(--border); color: var(--muted); background: var(--grey-soft); }
.tpl-name { font-family: var(--mono); font-size: .78rem; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
@media (min-width: 641px) { .tpl-table td:first-child { min-width: 290px; } }
.tpl-text { white-space: pre-line; }
.tpl-body summary { cursor: pointer; color: var(--accent); margin-top: 4px; }
.tpl-actions .row { gap: 6px; }
.tpl-table tr.row-new td { background: var(--accent-soft) !important; }
.add-variant summary { cursor: pointer; }
.add-variant form { margin-top: 12px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.ai-draft-card h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.ai-draft-card h2 .icon { color: var(--brand-amber); }
.draft-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.draft-grid fieldset { display: flex; flex-direction: column; gap: 6px; }
.draft-note { margin: 0; font-weight: 500; }
.msg-two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-two-col > .card { margin-bottom: 16px; }
.why-list li { padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.why-list li:last-child { border-bottom: 0; }
@media (max-width: 860px) {
  .draft-grid, .msg-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .convo-head, .thread, .reply-form, .window-closed, .convo-note { padding-left: 14px; padding-right: 14px; }
  .convo-badges { justify-content: flex-start; width: 100%; }
  .bubble { max-width: 92%; }
  .reply-form .btn.primary { width: 100%; }
  .policy-chips li { font-size: .76rem; }
}

/* ---------- Weekly results & referral programme (src/routes/growth.js) ---------- */
.wr-card, .wr-stat { --tone: var(--accent); --tone-soft: var(--accent-soft); }
.wr-stat.tone-green { --tone: var(--green); --tone-soft: var(--green-soft); }
.wr-stat.tone-amber { --tone: var(--amber); --tone-soft: var(--amber-soft); }
.wr-stat.tone-orange { --tone: var(--orange); --tone-soft: var(--orange-soft); }
.wr-stat.tone-red { --tone: var(--red); --tone-soft: var(--red-soft); }
.wr-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, var(--surface) 55%, color-mix(in srgb, var(--accent-soft) 80%, var(--surface))); }
.wr-card-main { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.wr-card-main .metric-icon { flex: none; margin: 0; }
.wr-card-value { font-size: 1.5rem; font-weight: 700; color: var(--accent-strong); line-height: 1.25; margin: 2px 0; }
.wr-hero { background: linear-gradient(150deg, var(--surface) 50%, color-mix(in srgb, var(--accent-soft) 85%, var(--surface))); }
.wr-hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.wr-hero-head h2 { margin: 2px 0 0; }
.wr-value { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; }
.wr-value-num { font-size: 2.6rem; font-weight: 750; letter-spacing: -.02em; color: var(--accent-strong); line-height: 1.1; }
.wr-good { font-size: .85rem; }
.wr-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 8px; }
.wr-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); }
.wr-stat .metric-icon { width: 30px; height: 30px; margin-bottom: 6px; }
.wr-stat .metric-icon .icon { width: 16px; height: 16px; }
.wr-stat-num { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.wr-stat-lbl { font-size: .82rem; color: var(--muted); line-height: 1.3; }
.wr-bars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; align-items: end; margin: 12px 0 6px; }
.wr-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--text); min-width: 0; }
.wr-bar-val { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wr-bar-track { position: relative; width: 100%; max-width: 46px; height: 140px; background: var(--surface-2); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.wr-bar-fill { display: block; width: 100%; min-height: 3px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 70%, white), var(--accent)); border-radius: 8px 8px 0 0; }
.wr-bar.sel .wr-bar-fill { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); }
.wr-bar.sel .wr-bar-lbl { font-weight: 700; color: var(--accent-strong); }
.wr-bar:hover .wr-bar-track { box-shadow: 0 0 0 2px var(--ring); }
.wr-bar-lbl { font-size: .75rem; white-space: nowrap; }
.wr-h-0 { height: 0%; } .wr-h-1 { height: 5%; } .wr-h-2 { height: 10%; } .wr-h-3 { height: 15%; } .wr-h-4 { height: 20%; } .wr-h-5 { height: 25%; } .wr-h-6 { height: 30%; } .wr-h-7 { height: 35%; } .wr-h-8 { height: 40%; } .wr-h-9 { height: 45%; } .wr-h-10 { height: 50%; } .wr-h-11 { height: 55%; } .wr-h-12 { height: 60%; } .wr-h-13 { height: 65%; } .wr-h-14 { height: 70%; } .wr-h-15 { height: 75%; } .wr-h-16 { height: 80%; } .wr-h-17 { height: 85%; } .wr-h-18 { height: 90%; } .wr-h-19 { height: 95%; } .wr-h-20 { height: 100%; }
.wr-how summary { cursor: pointer; }
.wr-how ul { padding-left: 18px; }
.wa-phone { max-width: 420px; background: #e5ddd5; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }
.wa-head { display: flex; align-items: center; gap: 8px; background: #075e54; color: #fff; padding: 10px 14px; font-weight: 600; }
.wa-head .icon { width: 18px; height: 18px; }
.wa-bubble { position: relative; margin: 14px; background: #fff; color: #111b21; border-radius: 0 10px 10px 10px; padding: 10px 12px 18px; box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.wa-text { white-space: pre-wrap; font-family: inherit; font-size: .9rem; margin: 0; line-height: 1.45; }
.wa-time { position: absolute; right: 10px; bottom: 4px; font-size: .68rem; color: #667781; }
.ref-cta { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.ref-cta-text { display: flex; flex-direction: column; gap: 2px; }
.ref-share { gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.wa { background: #1f8f5a; border-color: #1f8f5a; color: #fff; }
.btn.wa:hover { background: #18774a; }
.btn.wa .icon { width: 18px; height: 18px; }
.btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.ref-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: center; background: linear-gradient(140deg, var(--surface) 45%, color-mix(in srgb, var(--accent-soft) 85%, var(--surface))); }
.ref-hero-text h2 { margin-top: 0; }
.ref-link-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ref-link { overflow-wrap: anywhere; font-size: .9rem; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; }
.ref-code { font-family: var(--mono); letter-spacing: .04em; color: var(--accent-strong); }
.ref-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ref-credit { font-size: 1.05rem; } .ref-credit-num { font-size: 2.2rem; font-weight: 750; color: var(--accent-strong); margin-right: 4px; }
.ref-steps { padding-left: 18px; } .ref-steps li { margin-bottom: 6px; }
@media (max-width: 760px) {
  .ref-hero, .ref-grid { grid-template-columns: 1fr; }
  .wr-bars { gap: 4px; } .wr-bar-track { height: 110px; } .wr-bar-val { font-size: .62rem; } .wr-bar-lbl { font-size: .66rem; }
  .wr-value-num { font-size: 2.1rem; }
  .wr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
