/* MedConsult — built on the Venture design system tokens (tokens/*.css, served from the root) with the
   customer's own brand tokens (assets/brand.css) winning. Semantic theme tokens below adapt the system
   to the brief: corporate trust, dark navy & charcoal, switchable light/dark, WCAG AA in both. */
@import url("/assets/brand.css");
@import url("/tokens/colors.css");
@import url("/tokens/typography.css");
@import url("/tokens/spacing.css");
@import url("/tokens/effects.css");

:root {
  --font-body: var(--brand-font-body);
  --font-display: var(--brand-font-heading);
  --navy-950: #070d17;
  --navy-900: #0b1220;
  --navy-800: #111a2c;
  --navy-700: #182338;
  --charcoal-700: #263247;
  --charcoal-500: #3b4a63;
  /* light theme */
  --bg: var(--brand-background);
  --surface: var(--white);
  --surface-2: var(--slate-100);
  --text: var(--brand-text);
  --text-2: #3d4a5c;
  --muted: #55627a;
  --border: var(--slate-200);
  --primary: var(--blue-700);
  --primary-hover: var(--blue-800);
  --on-primary: var(--white);
  --secondary: var(--brand-primary);
  --on-secondary: var(--white);
  --accent: var(--brand-accent);
  --on-accent: var(--brand-text);
  --link: var(--blue-700);
  --ok-bg: #dcfce7; --ok-fg: #0f5132; --warn-bg: #fef3c7; --warn-fg: #6b3d00; --crit-bg: #ffe4e6; --crit-fg: #8f1130; --info-bg: var(--blue-100); --info-fg: var(--blue-800);
  --focus: var(--focus-ring);
  --shadow: var(--shadow-card);
  --hero-overlay: linear-gradient(100deg, rgba(7, 13, 23, 0.97) 0%, rgba(11, 18, 32, 0.94) 60%, rgba(12, 75, 135, 0.82) 100%);
}
:root[data-theme="dark"] {
  --bg: var(--navy-900);
  --surface: var(--navy-800);
  --surface-2: var(--navy-700);
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --muted: #a7b3c6;
  --border: var(--charcoal-700);
  --primary: var(--blue-600);
  --primary-hover: var(--blue-500);
  --on-primary: var(--white);
  --secondary: var(--charcoal-500);
  --on-secondary: var(--white);
  --accent: var(--brand-accent);
  --on-accent: var(--navy-950);
  --link: #8ab8ff;
  --ok-bg: #14532d; --ok-fg: #bbf7d0; --warn-bg: #4a3200; --warn-fg: #fde68a; --crit-bg: #5f1020; --crit-fg: #fecdd3; --info-bg: #10335c; --info-fg: #cfe3ff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: var(--text-body-sm); line-height: var(--line-height-normal); color: var(--text); background: var(--bg); min-height: 100vh; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); margin: 0 0 var(--space-3); line-height: var(--line-height-tight); letter-spacing: var(--letter-spacing-tight); font-weight: var(--font-weight-bold); }
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, var(--text-display-2)); }
h3 { font-size: 1.25rem; font-family: var(--font-body); }
h4 { font-size: 1rem; font-family: var(--font-body); }
p { margin: 0 0 var(--space-3); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.muted { color: var(--muted); }
.small { font-size: var(--text-caption); }
.tabular { font-variant-numeric: tabular-nums; }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: var(--font-weight-semibold); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* layout */
.wrap { width: min(var(--content-max-width), 100% - var(--space-8)); margin-inline: auto; }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.between { justify-content: space-between; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow); }
.card h3 { margin-bottom: var(--space-2); }
.card-flat { box-shadow: none; }
.section { padding-block: var(--space-16); }
.section-tight { padding-block: var(--space-10); }
.section-alt { background: var(--surface-2); }
.eyebrow { font-size: var(--text-caption); letter-spacing: 0.18em; text-transform: uppercase; color: var(--link); font-weight: var(--font-weight-semibold); margin-bottom: var(--space-2); }
.lead { font-size: var(--text-body-md); color: var(--text-2); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-5); border-radius: var(--radius-md); border: 1px solid transparent; font: inherit; font-weight: var(--font-weight-semibold); cursor: pointer; text-decoration: none; transition: transform var(--duration-fast) var(--ease-standard), background var(--duration-fast); white-space: nowrap; }
.btn:hover { text-decoration: none; transform: var(--hover-lift); }
.btn:active { transform: var(--press-scale); }
.btn:disabled, .btn[aria-busy="true"] { opacity: 0.6; cursor: progress; transform: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-button); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); color: var(--on-secondary); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--crit-bg); color: var(--crit-fg); border-color: var(--crit-fg); }
.btn-sm { min-height: 36px; padding: 0 var(--space-3); font-size: var(--text-caption); }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }

/* forms */
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field label, .field .label { font-weight: var(--font-weight-medium); font-size: var(--text-body-sm); }
.field .hint { color: var(--muted); font-size: var(--text-caption); }
.field .error { color: var(--crit-fg); font-size: var(--text-caption); min-height: 1.2em; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--crit-fg); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-3); min-height: 44px; width: 100%; }
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }
.check { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; cursor: pointer; }
.form-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.error-summary { background: var(--crit-bg); color: var(--crit-fg); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.error-summary ul { margin: var(--space-1) 0 0; padding-left: var(--space-5); }
.notice { border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); border: 1px solid transparent; }
.notice-info { background: var(--info-bg); color: var(--info-fg); }
.notice-warn { background: var(--warn-bg); color: var(--warn-fg); }
.notice-crit { background: var(--crit-bg); color: var(--crit-fg); }
.notice-ok { background: var(--ok-bg); color: var(--ok-fg); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2); border-radius: var(--radius-pill); font-size: var(--text-caption); font-weight: var(--font-weight-semibold); white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.chip-ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip-warn { background: var(--warn-bg); color: var(--warn-fg); }
.chip-crit { background: var(--crit-bg); color: var(--crit-fg); }
.chip-info { background: var(--info-bg); color: var(--info-fg); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-body-sm); }
th, td { text-align: left; padding: var(--space-3); border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { position: sticky; top: 0; background: var(--surface-2); font-weight: var(--font-weight-semibold); white-space: nowrap; cursor: pointer; user-select: none; }
thead th[aria-sort="ascending"]::after { content: " \2191"; }
thead th[aria-sort="descending"]::after { content: " \2193"; }
tbody tr:hover { background: var(--surface-2); }
.table-tools { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; padding: var(--space-3); }
.table-tools input { max-width: 320px; }
.pager { display: flex; gap: var(--space-2); align-items: center; padding: var(--space-3); justify-content: flex-end; }

/* states */
.skeleton { display: block; height: 14px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-block: var(--space-2); }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: var(--space-10) var(--space-4); color: var(--muted); }
.empty .btn { margin-top: var(--space-3); }

/* toast + dialog */
.toast-region { position: fixed; inset-inline: 0; bottom: var(--space-4); display: flex; flex-direction: column; align-items: center; gap: var(--space-2); pointer-events: none; z-index: 60; padding: 0 var(--space-4); }
.toast { pointer-events: auto; background: var(--navy-800); color: #f1f5f9; border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-card-hover); max-width: 560px; width: 100%; border-left: 4px solid var(--accent); }
.toast-error { border-left-color: #fda4af; }
.toast-ok { border-left-color: #86efac; }
dialog.dlg { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; background: var(--surface); color: var(--text); width: min(560px, 100% - var(--space-8)); box-shadow: var(--shadow-card-hover); }
dialog.dlg::backdrop { background: rgba(7, 13, 23, 0.6); }
dialog.dlg .dlg-body { padding: var(--space-5); }
dialog.dlg .dlg-actions { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border); }

/* shells */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .wrap { display: flex; align-items: center; gap: var(--space-4); min-height: 64px; }
.brand { display: flex; align-items: center; gap: var(--space-2); font-weight: var(--font-weight-bold); color: var(--text); font-family: var(--font-display); font-size: 1.15rem; }
.brand img { width: 28px; height: 28px; color: var(--primary); }
.nav { display: flex; gap: var(--space-1); margin-left: auto; align-items: center; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-sm); color: var(--text-2); font-weight: var(--font-weight-medium); }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: var(--space-3); gap: var(--space-1); }
  .nav[data-open="true"] { display: flex; }
  .nav a { min-height: 48px; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
}
main { min-height: 60vh; }
.page { padding-block: var(--space-8); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }
.page-header h1 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin: 0; }

/* hero */
.hero { position: relative; color: #fff; background: var(--hero-overlay), url("/assets/stock-1.jpg") center / cover no-repeat; min-height: 78vh; display: flex; align-items: center; padding-block: var(--space-12); }
.hero h1 { color: #fff; font-size: clamp(2.5rem, 6vw, 4.25rem); max-width: 16ch; }
/* refine round 8: the doctor photograph IS the landing picture — shown in full beside the copy, not hidden under the overlay */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--space-10); align-items: center; }
.hero-copy { min-width: 0; }
.hero-figure { margin: 0; position: relative; min-width: 0; }
.hero-figure img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 25%; border-radius: var(--radius-lg); border: 1px solid rgba(255, 255, 255, 0.22); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.hero-figure figcaption { position: absolute; left: var(--space-4); right: var(--space-4); bottom: var(--space-4); background: var(--navy-900); color: #f1f5f9; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: var(--text-caption); border: 1px solid var(--charcoal-700); }
@media (max-width: 860px) {
  .hero { min-height: 0; padding-block: var(--space-10); }
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .hero-figure { order: 2; }
  .hero-figure img { aspect-ratio: 4 / 3; }
}
.hero .lead { color: rgba(255, 255, 255, 0.86); max-width: 56ch; }
.hero .eyebrow { color: #93c5fd; }
.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: var(--space-3); margin-top: var(--space-8); }
.hero-stat { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); backdrop-filter: blur(6px); }
.hero-stat strong { display: block; font-size: 1.5rem; font-family: var(--font-display); color: #fff; }
.hero-stat span { color: rgba(255, 255, 255, 0.82); font-size: var(--text-caption); }
.photo { border-radius: var(--radius-lg); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; box-shadow: var(--shadow-card-hover); }
.feature { display: flex; gap: var(--space-3); align-items: flex-start; }
.feature .icon-badge { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--info-bg); color: var(--info-fg); display: grid; place-items: center; flex: none; }
.price-card { display: flex; flex-direction: column; gap: var(--space-2); height: 100%; }
.price-card .price-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--border); }
.price-card .money { font-size: 1.25rem; }
/* the practice landing (refine rounds 6–7): brand text, ghost button on the photo hero, conditions, the first-visit journey, powered-by */
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-family: var(--font-body); font-weight: var(--font-weight-medium); font-size: 11px; color: var(--muted); letter-spacing: 0.02em; }
@media (max-width: 480px) { .brand-text small { display: none; } .brand { font-size: 1rem; } }
.hero .btn-ghost.hero-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.hero .btn-ghost.hero-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.condition-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--space-2); }
.condition-list li { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: var(--space-2) var(--space-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); }
.condition-list .icon { color: var(--ok-fg); }
.journey { list-style: none; margin: var(--space-6) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--space-4); counter-reset: j; }
.journey li { counter-increment: j; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: var(--space-2); }
.journey li::before { content: counter(j); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--info-bg); color: var(--info-fg); font-weight: var(--font-weight-bold); font-variant-numeric: tabular-nums; }
.journey h3 { margin: 0; }
.journey p { margin: 0; }
.team-card-flat { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3); }
.cta-band { background: var(--navy-900); color: #fff; display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; justify-content: space-between; border-color: var(--navy-900); }
.cta-band h3, .cta-band p { color: #fff; }
.cta-band p { color: #cbd5e1; }
.powered-by { background: var(--navy-950); color: #cbd5e1; padding-block: var(--space-6); border-top: 1px solid var(--charcoal-700); }
.powered-by .wrap { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.powered-by img { color: #93c5fd; flex: none; }
.powered-by div { display: flex; flex-direction: column; gap: 2px; flex: 1 1 280px; min-width: 0; }
.powered-by strong { color: #fff; }
.powered-by .small { color: #a7b3c6; }
.powered-by .powered-link { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.powered-by .powered-link:hover { background: rgba(255, 255, 255, 0.1); }
footer.site .footer-powered { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-10); padding-top: var(--space-6); border-top: 1px solid var(--charcoal-700); font-size: var(--text-caption); color: #a7b3c6; }
footer.site .footer-powered strong { color: #fff; }
footer.site .footer-powered img { color: #93c5fd; flex: none; }
footer.site { background: var(--navy-900); color: #cbd5e1; padding-block: var(--space-12); }
footer.site h4 { color: #fff; }
footer.site a { color: #8ab8ff; }
footer.site .small { color: #a7b3c6; }

/* admin shell */
.admin { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy-900); color: #e2e8f0; padding: var(--space-5) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { color: #fff; margin-bottom: var(--space-4); }
.sidebar .brand img { color: #93c5fd; }
.sidebar .group { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: #a7b3c6; margin: var(--space-3) var(--space-2) var(--space-1); }
.sidebar a { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-sm); color: #e2e8f0; font-weight: var(--font-weight-medium); }
.sidebar a:hover { background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.sidebar a[aria-current="page"] { background: var(--blue-700); color: #fff; }
.sidebar .foot { margin-top: auto; font-size: var(--text-caption); color: #a7b3c6; }
.admin-main { min-width: 0; }
.admin-top { display: flex; align-items: center; gap: var(--space-3); min-height: 64px; padding: 0 var(--space-6); border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 30; }
.admin-top .who { margin-left: auto; text-align: right; font-size: var(--text-caption); color: var(--muted); }
.admin-body { padding: var(--space-6); }
.sidebar-toggle { display: none; }
@media (max-width: 960px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 30% 0 0; z-index: 50; transform: translateX(-100%); transition: transform var(--duration-normal) var(--ease-standard); height: 100vh; }
  .sidebar[data-open="true"] { transform: none; }
  .sidebar-toggle { display: inline-flex; }
  .admin-top { padding: 0 var(--space-4); }
  .admin-body { padding: var(--space-4); }
}
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .v { font-size: 1.75rem; font-family: var(--font-display); font-weight: var(--font-weight-bold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: var(--text-caption); }
.chart { width: 100%; height: auto; }
.chart .bar { fill: var(--primary); }
.chart text { fill: var(--muted); font-size: 10px; }
.chart line { stroke: var(--border); }
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: var(--space-4); overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: var(--space-3) var(--space-4); min-height: 44px; font: inherit; font-weight: var(--font-weight-medium); color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }

/* room */
.room { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: var(--space-4); align-items: start; }
@media (max-width: 1100px) { .room { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .room { grid-template-columns: 1fr; } }
.video { background: var(--navy-950); border-radius: var(--radius-md); aspect-ratio: 16 / 10; width: 100%; object-fit: cover; }
.transcript { max-height: 220px; overflow-y: auto; background: var(--surface-2); border-radius: var(--radius-sm); padding: var(--space-3); font-size: var(--text-caption); white-space: pre-wrap; }
.bodymap { width: 100%; max-width: 320px; margin-inline: auto; }
.bodymap .zone { cursor: pointer; fill: transparent; stroke: transparent; stroke-width: 1.2; transition: fill var(--duration-fast); }
.bodymap .zone:hover, .bodymap .zone:focus { stroke: var(--accent); fill: rgba(96, 165, 250, 0.25); outline: none; }
.bodymap .zone[data-sev="ok"] { fill: rgba(34, 197, 94, 0.28); stroke: #16a34a; }
.bodymap .zone[data-sev="warning"] { fill: rgba(245, 158, 11, 0.4); stroke: #b45309; }
.bodymap .zone[data-sev="critical"] { fill: rgba(239, 68, 68, 0.45); stroke: #b91c1c; }
.bodymap .zone[data-marked="true"] { stroke: var(--text); stroke-dasharray: 2 1.5; }
.bodymap .silhouette { fill: var(--surface-2); stroke: var(--muted); stroke-width: 0.8; }
.legend { display: flex; gap: var(--space-3); flex-wrap: wrap; font-size: var(--text-caption); color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; vertical-align: -2px; }
.steps { display: flex; gap: var(--space-2); list-style: none; padding: 0; margin: 0 0 var(--space-5); flex-wrap: wrap; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-caption); color: var(--muted); padding: var(--space-1) var(--space-2); border-radius: var(--radius-pill); background: var(--surface-2); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--border); color: var(--text); font-weight: var(--font-weight-semibold); }
.steps li[aria-current="step"] { color: var(--text); background: var(--info-bg); }
.steps li[aria-current="step"]::before, .steps li[data-done="true"]::before { background: var(--primary); color: #fff; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: var(--space-2); }
.slot-grid .btn[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: var(--space-2); }
.option-grid .check { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 var(--space-3); }
.trend { width: 100%; height: auto; }
.trend path { fill: none; stroke: var(--primary); stroke-width: 2; }
.trend .band { fill: var(--ok-bg); opacity: 0.6; }
.trend circle { fill: var(--primary); }
.value-row { display: grid; grid-template-columns: 1.4fr 0.8fr 0.6fr 0.7fr 0.7fr 0.8fr; gap: var(--space-2); align-items: center; }
@media (max-width: 720px) { .value-row { grid-template-columns: 1fr 1fr; } }
.theme-toggle { display: inline-flex; }

/* telehealth room */
.video-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-2); align-items: start; }
.video-grid span { display: block; margin-top: var(--space-1); }
.video-self { aspect-ratio: 4 / 3; }
@media (max-width: 480px) { .video-grid { grid-template-columns: 1fr; } }
.seg { padding: var(--space-1) 0; border-bottom: 1px dashed var(--border); }
.seg-patient strong { color: var(--link); }
.seg-doctor strong { color: var(--text); }
.model3d-wrap { position: relative; width: 100%; height: 420px; border-radius: var(--radius-md); background: radial-gradient(ellipse at 50% 40%, var(--surface-2), var(--bg)); overflow: hidden; touch-action: none; }
.model3d { width: 100%; height: 100%; display: block; cursor: grab; }
.model3d-tip { position: absolute; pointer-events: none; background: var(--navy-800); color: #f1f5f9; font-size: var(--text-caption); padding: 2px var(--space-2); border-radius: var(--radius-sm); white-space: nowrap; }
.model3d-wrap .bodymap { padding: var(--space-3); height: 100%; }
.join-stage { display: grid; gap: var(--space-3); }
.join-stage .video { aspect-ratio: 4 / 3; }

/* billing */
.ageing { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
.ageing .bucket { background: var(--surface-2); border-radius: var(--radius-md); padding: var(--space-3); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ageing .bucket .money { font-size: 1.05rem; }
.ageing .bucket.over { background: var(--warn-bg); color: var(--warn-fg); }
.ageing .bucket.late { background: var(--crit-bg); color: var(--crit-fg); }
@media (max-width: 720px) { .ageing { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2); align-items: center; }
.bar-row .bar-track { height: 10px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--primary); }
.kit-device { display: grid; grid-template-columns: 44px 1fr; gap: var(--space-3); align-items: start; }
.kit-device .icon-badge { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--info-bg); color: var(--info-fg); display: grid; place-items: center; }
.provenance { font-size: var(--text-caption); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.conf { display: inline-block; min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.matrix-row { display: grid; grid-template-columns: 56px 1fr 150px 170px; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); align-items: start; }
@media (max-width: 860px) { .matrix-row { grid-template-columns: 1fr; } }
/* digitised forms: scales, yes/no, the MSQ symptom grid, the patient rating */
.req { color: var(--crit-fg); }
.row.wrap { flex-wrap: wrap; }
.scale-row { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.scale-opt { position: relative; }
.scale-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.scale-opt span { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-variant-numeric: tabular-nums; font-weight: var(--font-weight-medium); background: var(--surface); color: var(--text); }
.scale-opt input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.scale-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.msq-grid table { min-width: 0; }
.msq-grid th[scope="row"] { font-weight: var(--font-weight-medium); white-space: normal; }
.msq-grid thead th { text-align: center; cursor: default; }
.msq-grid td { text-align: center; padding: 0; }
.msq-cell { display: grid; place-items: center; min-width: 44px; min-height: 44px; cursor: pointer; }
.msq-cell input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.rating-chip { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2); border-radius: var(--radius-pill); font-size: var(--text-caption); font-weight: var(--font-weight-semibold); white-space: nowrap; }
.rating-priority, .band-severe { background: var(--crit-bg); color: var(--crit-fg); }
.rating-attention, .band-moderate { background: var(--warn-bg); color: var(--warn-fg); }
.rating-routine, .band-optimal { background: var(--ok-bg); color: var(--ok-fg); }
.rating-incomplete, .band-mild { background: var(--info-bg); color: var(--info-fg); }
.score-bar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 3.5em; gap: var(--space-2); align-items: center; font-size: var(--text-caption); }
.score-bar .track { height: 10px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.score-bar .fill { height: 100%; background: var(--primary); }
.score-bar .fill.hi { background: var(--crit-fg); }
.score-bar .fill.mid { background: var(--warn-fg); }
.answer-grid { display: grid; grid-template-columns: minmax(140px, 0.9fr) 1.6fr; gap: var(--space-1) var(--space-3); font-size: var(--text-caption); }
.answer-grid dt { color: var(--muted); }
.answer-grid dd { margin: 0; word-break: break-word; }
@media (max-width: 600px) { .answer-grid { grid-template-columns: 1fr; } .answer-grid dd { margin-bottom: var(--space-2); } }
.node-row { display: grid; grid-template-columns: minmax(150px, 0.8fr) 150px 1.4fr; gap: var(--space-2); align-items: start; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
@media (max-width: 760px) { .node-row { grid-template-columns: 1fr; } }
/* roles & functions v1.1: the desk, duties with live counts, the task list, the team */
.chip-crit { background: var(--crit-bg); color: var(--crit-fg); }
.duties { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); counter-reset: d; }
.duty { counter-increment: d; border-radius: var(--radius-sm); }
.duty a { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 44px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--text); }
.duty a::before { content: counter(d); flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: var(--text-caption); font-weight: var(--font-weight-semibold); }
.duty .duty-label { flex: 1; }
.duty a:hover { background: var(--surface-2); text-decoration: none; }
.duty.has-work a { background: var(--warn-bg); color: var(--warn-fg); }
.duty.has-work a::before { background: var(--warn-fg); color: var(--warn-bg); }
.duty > .small { display: block; padding: 0 var(--space-3) var(--space-2) calc(var(--space-3) + 22px + var(--space-3)); }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.task { display: grid; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.task-main { display: grid; grid-template-columns: 24px 1fr; gap: var(--space-2); align-items: start; min-width: 0; }
.task-main .icon { margin-top: 3px; color: var(--muted); }
.task-main strong { word-break: break-word; }
.task-actions { flex-wrap: wrap; justify-content: flex-end; }
.task.overdue { border-color: var(--crit-fg); }
.task.closed { opacity: 0.75; }
.team-card summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
#task-filters select { min-height: 44px; padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
@media print { .topbar, .sidebar, .admin-top, .btn, footer.site { display: none !important; } }
