/* ==========================================================================
   Euler Health — clinic platform demo
   Design tokens live on :root so the brand can be re-skinned in one place.
   ========================================================================== */

:root {
  --ink: #0a1f24;
  --pine-900: #0c2a30;
  --pine-800: #11363d;
  --pine-700: #1a4850;
  --brand: #0e8577;
  --brand-600: #0a6e63;
  --brand-100: #c9e9e3;
  --brand-50: #e6f4f1;
  --accent: #f07d5c;
  --accent-600: #dc6542;
  --accent-50: #fdf0eb;
  --ai: #6b5bd6;
  --ai-50: #f0eefd;
  --success: #13965f;
  --success-50: #e5f6ee;
  --warning: #c27508;
  --warning-50: #fdf3e2;
  --danger: #d2405a;
  --danger-50: #fdecef;
  --progress: #2c6bd9;
  --progress-50: #e9f0fd;
  --neutral: #63727a;
  --neutral-50: #eef2f3;

  /* Clinician colours in calendars and avatars. */
  --t1: #0e8577;
  --t1-50: #e2f3ef;
  --t2: #2c6bd9;
  --t2-50: #e7effc;
  --t3: #8352e0;
  --t3-50: #f1ebfd;
  --t4: #d9792f;
  --t4-50: #fcefe4;

  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --line: #e0e8e6;
  --line-strong: #c9d6d3;
  --text: #102a2e;
  --muted: #5c6f72;
  --on-dark: #e4f1ee;
  --on-dark-muted: #9bbab4;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 42, 46, 0.06);
  --shadow: 0 1px 2px rgba(16, 42, 46, 0.05), 0 8px 24px -10px rgba(16, 42, 46, 0.14);
  --shadow-lg: 0 24px 60px -20px rgba(10, 31, 36, 0.5);

  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: 24px;
  --header-height: 68px;
  --side-width: 264px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

dl,
dd {
  margin: 0;
}

blockquote {
  margin: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

.icon {
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.muted {
  color: var(--muted);
}

.text-accent {
  color: var(--accent);
}

.text-success {
  color: var(--success);
}

.label-caps {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.spin {
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-main {
  flex: 1;
}

.page-frame {
  animation: page-in 260ms ease-out;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Buttons, chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms, border-color 160ms, color 160ms, transform 160ms, box-shadow 160ms;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13.5px;
  gap: 6px;
}

.btn--block {
  width: 100%;
}

.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(14, 133, 119, 0.8);
}

.btn--primary:hover:not(:disabled) {
  background: var(--brand-600);
}

.btn--accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 22px -10px rgba(240, 125, 92, 0.9);
}

.btn--accent:hover:not(:disabled) {
  background: var(--accent-600);
}

.btn--outline {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn--outline:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-600);
}

.btn--ghost-light {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.btn--ghost-light:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
}

.btn--text {
  background: transparent;
  color: var(--brand-600);
  padding: 0 8px;
}

.btn--approve {
  background: var(--success);
  color: #fff;
}

.btn--approve:hover:not(:disabled) {
  background: #0f7f50;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.button-row.is-centered {
  justify-content: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms, background-color 160ms, color 160ms;
}

.chip:hover {
  border-color: var(--brand);
}

.chip.is-selected {
  background: var(--brand-50);
  border-color: var(--brand);
  color: var(--brand-600);
}

.chip--small {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  flex: none;
}

.icon-button:hover {
  border-color: var(--brand);
  color: var(--brand-600);
}

.icon-button--light {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.icon-button--light:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand-600);
  font-weight: 700;
  font-size: 13.5px;
}

.text-link:hover {
  text-decoration: underline;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13.5px;
}

.back-link:hover {
  color: var(--brand-600);
}

/* ---------- Tags, pills, eyebrows ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--neutral-50);
  color: var(--neutral);
}

.tag__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tag--brand {
  background: var(--brand-50);
  color: var(--brand-600);
}

.tag--accent {
  background: var(--accent-50);
  color: var(--accent-600);
}

.tag--success {
  background: var(--success-50);
  color: var(--success);
}

.tag--warning {
  background: var(--warning-50);
  color: var(--warning);
}

.tag--danger {
  background: var(--danger-50);
  color: var(--danger);
}

.tag--progress {
  background: var(--progress-50);
  color: var(--progress);
}

.tag--ai {
  background: var(--ai-50);
  color: var(--ai);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--on-dark);
  font-size: 13px;
  font-weight: 600;
}

.pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5eead4;
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.18);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--brand-600);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow--light {
  color: #7fdccd;
}

.lead {
  font-size: 17px;
  color: var(--muted);
  max-width: 62ch;
}

/* ---------- Avatars, progress ---------- */

/* The badge is always a perfect circle with the initials centred on the
   capitals (not on the font's ascender/descender box), whatever the parent
   layout does: fixed square size, no flex shrink/stretch. Context rules must
   not target the avatar (no bare "… span" next to an Avatar). */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  align-self: center;
  width: 38px;
  height: 38px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: var(--neutral-50);
  color: var(--pine-700);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  text-indent: 0.02em;
  text-align: center;
  white-space: nowrap;
}

/* Trims the line to cap height and baseline, so centring the box centres the
   letters. Needs its own box: text-box has no effect on a grid container.
   Browsers without text-box fall back to line-height centring. */
.avatar__text {
  display: block;
  color: inherit;
  font: inherit;
  text-box: trim-both cap alphabetic;
}

.avatar--xs {
  width: 22px;
  height: 22px;
  font-size: 9.5px;
}

.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 11.5px;
}

.avatar--lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.avatar--xl {
  width: 72px;
  height: 72px;
  font-size: 24px;
}

.avatar--t0 {
  background: linear-gradient(135deg, #dff1ec, #cfe6f0);
}

.avatar--t1 {
  background: var(--t1-50);
  color: var(--t1);
}

.avatar--t2 {
  background: var(--t2-50);
  color: var(--t2);
}

.avatar--t3 {
  background: var(--t3-50);
  color: var(--t3);
}

.avatar--t4 {
  background: var(--t4-50);
  color: var(--t4);
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.progress__track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--neutral-50);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 400ms ease;
}

.progress--success .progress__fill {
  background: var(--success);
}

.progress--ai .progress__fill {
  background: var(--ai);
}

.progress__label {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* ---------- KPIs ---------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpis--6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kpi {
  --tone: var(--brand);
  --tone-50: var(--brand-50);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  min-width: 0;
}

.kpi.is-interactive {
  cursor: pointer;
  transition: border-color 160ms, transform 160ms, box-shadow 160ms;
}

.kpi.is-interactive:hover {
  border-color: var(--tone);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.kpi.is-selected {
  border-color: var(--tone);
  box-shadow: 0 0 0 3px var(--tone-50);
}

.kpi--accent {
  --tone: var(--accent);
  --tone-50: var(--accent-50);
}

.kpi--success {
  --tone: var(--success);
  --tone-50: var(--success-50);
}

.kpi--warning {
  --tone: var(--warning);
  --tone-50: var(--warning-50);
}

.kpi--danger {
  --tone: var(--danger);
  --tone-50: var(--danger-50);
}

.kpi--progress {
  --tone: var(--progress);
  --tone-50: var(--progress-50);
}

.kpi--ai {
  --tone: var(--ai);
  --tone-50: var(--ai-50);
}

.kpi--neutral {
  --tone: var(--neutral);
  --tone-50: var(--neutral-50);
}

.kpi__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--tone-50);
  color: var(--tone);
}

.kpi__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi strong {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.kpi__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.kpi__hint {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Cards & details ---------- */

.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.card__title .icon {
  color: var(--brand);
}

.card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.details {
  display: grid;
  gap: 0;
}

.details--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.details--two .detail-row {
  grid-template-columns: 1fr;
  gap: 2px;
}

.detail-row dt {
  color: var(--muted);
}

.detail-row dd {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 16px;
  text-align: center;
}

.empty-state p {
  color: var(--muted);
  max-width: 44ch;
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand);
}

.empty-state .button-row {
  margin-top: 12px;
}

/* ---------- Modal & toast ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 31, 36, 0.55);
  backdrop-filter: blur(2px);
  animation: fade-in 160ms ease-out;
}

.modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: pop-in 200ms ease-out;
}

.modal__panel.is-wide {
  width: min(820px, 100%);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 8px;
}

.modal__head h2 {
  font-size: 20px;
}

.modal__head p {
  margin-top: 4px;
  font-size: 14px;
}

.modal__body {
  padding: 12px 22px 18px;
}

.modal__actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: pop-in 220ms ease-out;
}

.toast .icon {
  color: #5eead4;
}

/* ---------- Forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  min-width: 0;
}

.field__label {
  font-size: 13px;
  font-weight: 700;
}

.field__hint {
  font-size: 12px;
  color: var(--muted);
}

.field input,
.field select,
.field textarea,
.report-section__edit textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  transition: border-color 160ms, box-shadow 160ms;
}

.field textarea,
.report-section__edit textarea {
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.report-section__edit textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
}

.choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-tile {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms, background-color 160ms;
}

.checkbox-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-tile__box {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-radius: 7px;
  color: transparent;
  transition: all 160ms;
}

.checkbox-tile.is-checked {
  border-color: var(--brand);
  background: var(--brand-50);
}

.checkbox-tile.is-checked .checkbox-tile__box {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.checkbox-tile__text {
  display: flex;
  flex-direction: column;
}

.checkbox-tile__title {
  font-size: 14px;
  font-weight: 600;
}

.checkbox-tile__subtitle {
  font-size: 12px;
  color: var(--muted);
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--neutral-50);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.segmented button.is-selected {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.segmented__count {
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(16, 42, 46, 0.08);
  font-size: 11.5px;
}

.segmented--compact button {
  padding: 6px 10px;
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 380px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

.toolbar__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  color: var(--text);
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.tabs__tab.is-selected {
  border-bottom-color: var(--brand);
  color: var(--text);
}

/* ---------- Brand & site header ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand__name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand__suffix {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.brand-mark__tile {
  fill: var(--brand);
}

.brand-mark__line {
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark__dot {
  fill: var(--accent);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 31, 36, 0.92);
  backdrop-filter: blur(12px);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-height);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.site-nav__link {
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--on-dark-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header__actions .btn {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

.site-nav__mobile {
  display: none;
}

.site-header__menu-toggle {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: none;
  color: #fff;
  cursor: pointer;
}

/* ---------- Home: hero ---------- */

.hero,
.section--dark {
  position: relative;
  color: #fff;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(14, 133, 119, 0.55), transparent 60%),
    radial-gradient(600px 400px at -10% 110%, rgba(240, 125, 92, 0.22), transparent 60%),
    linear-gradient(180deg, var(--ink), var(--pine-900));
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 56px;
  padding-top: 72px;
  padding-bottom: 88px;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero .text-accent {
  color: #7fdccd;
  font-style: italic;
}

.hero .lead {
  color: var(--on-dark-muted);
  font-size: 18px;
}

.hero__demo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--on-dark);
  font-size: 14px;
  font-weight: 600;
  opacity: 0.85;
}

.hero__demo-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.hero-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  transform: rotate(0.6deg);
  transition: transform 260ms ease;
}

.hero-card:hover {
  transform: rotate(0) translateY(-4px);
}

.hero-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero-card__head strong {
  display: block;
  font-size: 17px;
}

.hero-card__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.hero-card__agenda {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-card__agenda li {
  display: grid;
  grid-template-columns: 74px 4px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.hero-card__agenda .icon {
  color: var(--progress);
}

.hero-card__bar {
  align-self: stretch;
  border-radius: 4px;
  background: var(--t1);
}

.hero-card__bar--t2 {
  background: var(--t2);
}

.hero-card__bar--t3 {
  background: var(--t3);
}

.hero-card__bar--t4 {
  background: var(--t4);
}

.hero-card__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero-card__who span {
  color: var(--muted);
  font-size: 12px;
}

.hero-card__ai,
.hero-card__toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.hero-card__ai {
  background: var(--ai-50);
  color: #3f338f;
}

.hero-card__ai .icon {
  color: var(--ai);
}

.hero-card__toast {
  background: var(--ink);
  color: #fff;
}

.hero-card__toast .icon {
  color: #5eead4;
}

/* ---------- Home: sections ---------- */

.stats {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat strong {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--brand-600);
}

.stat span {
  color: var(--muted);
  font-size: 14px;
}

.stats__note {
  padding-bottom: 24px;
  color: var(--muted);
  font-size: 12px;
}

.section {
  padding: 88px 0;
}

.section--tight {
  padding: 48px 0;
}

.section--tinted {
  background: linear-gradient(180deg, var(--brand-50), var(--bg));
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 720px;
  margin-bottom: 40px;
}

.section-heading.is-centered {
  align-items: center;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-heading h2,
.section--dark h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 3.6vw, 42px);
  line-height: 1.1;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  --tone: var(--brand);
  --tone-50: var(--brand-50);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 180ms, transform 180ms, box-shadow 180ms;
}

.feature-card:hover {
  border-color: var(--tone);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feature-card--accent {
  --tone: var(--accent);
  --tone-50: var(--accent-50);
}

.feature-card--progress {
  --tone: var(--progress);
  --tone-50: var(--progress-50);
}

.feature-card--ai {
  --tone: var(--ai);
  --tone-50: var(--ai-50);
}

.feature-card--warning {
  --tone: var(--warning);
  --tone-50: var(--warning-50);
}

.feature-card--success {
  --tone: var(--success);
  --tone-50: var(--success-50);
}

.feature-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  border-radius: 14px;
  background: var(--tone-50);
  color: var(--tone);
}

.feature-card h3 {
  font-size: 18px;
}

.feature-card p {
  flex: 1;
  color: var(--muted);
  font-size: 14.5px;
}

.feature-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tone);
  font-size: 14px;
  font-weight: 700;
}

.journey-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  counter-reset: none;
}

.journey-flow__step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.journey-flow__step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 38px;
  right: -12px;
  width: 12px;
  height: 2px;
  background: var(--brand-100);
}

.journey-flow__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
}

.journey-flow__number {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.journey-flow h3 {
  font-size: 15px;
}

.journey-flow p {
  color: var(--muted);
  font-size: 13px;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.partner-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.partner-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.partner-card__head h3 {
  font-size: 19px;
}

.partner-card__logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--ink);
  color: #7fdccd;
}

.partner-card > p {
  color: var(--muted);
}

.partner-card__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.partner-card__stats div {
  display: flex;
  flex-direction: column;
}

.partner-card__stats strong {
  font-size: 22px;
  color: var(--brand-600);
}

.partner-card__stats span {
  font-size: 13px;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 56px;
}

.split--demo {
  align-items: start;
}

.section--dark {
  padding: 88px 0;
}

.section--dark h2 {
  margin-bottom: 24px;
}

.quote-card {
  position: relative;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.05);
}

.quote-card__mark {
  color: var(--accent);
  margin-bottom: 12px;
}

.quote-card blockquote {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.45;
  min-height: 7.5em;
}

.quote-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.quote-card__foot div:first-child {
  display: flex;
  flex-direction: column;
}

.quote-card__foot span {
  color: var(--on-dark-muted);
  font-size: 13px;
}

.quote-card__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quote-card__count {
  font-family: var(--font-mono);
}

.family-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 30px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(14, 133, 119, 0.35), rgba(14, 133, 119, 0.08));
  border: 1px solid rgba(127, 220, 205, 0.25);
}

.family-preview h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 24px;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.check-list__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand);
}

.check-list--light .check-list__icon {
  background: rgba(127, 220, 205, 0.18);
  color: #7fdccd;
}

.check-list--compact {
  gap: 8px;
  margin: 6px 0 18px;
}

.check-list--compact li {
  font-size: 14px;
  font-weight: 500;
}

.trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.trust__item {
  display: flex;
  gap: 14px;
}

.trust__item strong {
  display: block;
  margin-bottom: 2px;
}

.trust__item p {
  font-size: 13.5px;
}

.trust__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--brand);
}

.demo-form {
  padding: 28px;
  box-shadow: var(--shadow);
}

.demo-form__note {
  margin-top: 10px;
  font-size: 12px;
  text-align: center;
}

.demo-form__done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  text-align: center;
}

/* ---------- Site footer ---------- */

.site-footer {
  padding: 56px 0 28px;
  background: var(--ink);
  color: var(--on-dark-muted);
  font-size: 14px;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer .brand {
  color: #fff;
}

.site-footer__intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 420px;
}

.site-footer__column h4 {
  margin-bottom: 14px;
  color: #fff;
  font-size: 14px;
}

.site-footer__column ul {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.site-footer__column a:hover {
  color: #fff;
}

.site-footer__studio {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
}

.site-footer__studio-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer__studio-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 17px;
}

.site-footer__studio-tagline {
  font-size: 13px;
}

.site-footer__contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.site-footer__contact a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-footer__contact a:hover {
  color: #fff;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  font-size: 13px;
}

.site-footer__demo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-footer__imprint {
  padding-top: 10px;
  font-size: 12px;
  opacity: 0.7;
}

/* ==========================================================================
   Clinic workspace
   ========================================================================== */

.ws {
  display: grid;
  grid-template-columns: var(--side-width) minmax(0, 1fr);
  min-height: 100vh;
}

.ws-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: linear-gradient(180deg, var(--ink), var(--pine-900));
  color: var(--on-dark);
}

.ws-side__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 14px;
}

.ws-side__toggle {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: none;
  color: #fff;
  cursor: pointer;
}

.ws-side__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.ws-clinic {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.ws-clinic div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ws-clinic strong {
  font-size: 13px;
  line-height: 1.3;
}

.ws-clinic span {
  font-size: 11.5px;
  color: var(--on-dark-muted);
}

.ws-clinic__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(127, 220, 205, 0.14);
  color: #7fdccd !important;
}

.ws-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}

.ws-nav__group {
  padding: 14px 12px 6px;
  color: rgba(155, 186, 180, 0.7);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ws-nav__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--on-dark-muted);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 140ms, color 140ms;
}

.ws-nav__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.ws-nav__link.is-active {
  color: #fff;
  background: rgba(127, 220, 205, 0.14);
}

.ws-nav__link.is-active .icon {
  color: #7fdccd;
}

.ws-nav__label {
  flex: 1;
}

.ws-nav__count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
}

.ws-side__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
  padding: 18px 10px 10px;
}

.ws-side__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--on-dark-muted);
  font-size: 13px;
  font-weight: 600;
}

.ws-side__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.ws-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 14px 18px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.ws-user div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ws-user strong {
  font-size: 13px;
}

.ws-user div span {
  font-size: 11.5px;
  color: var(--on-dark-muted);
}

.ws-main {
  min-width: 0;
}

.ws-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--warning-50);
  color: #7a4d06;
  font-size: 12.5px;
}

.ws-page {
  max-width: 1320px;
  padding: 26px 28px 60px;
}

.ws-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.ws-heading h1 {
  font-size: 28px;
  letter-spacing: -0.025em;
}

.ws-heading p {
  max-width: 70ch;
  margin-top: 4px;
}

.ws-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.ws-grid--wide-left {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

.ws-grid--calendar {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.ws-grid--profile {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.ws-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.ws-page > .card,
.ws-page > .table-card {
  margin-bottom: 18px;
}

.ws-split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.ws-list {
  padding: 0;
  overflow: hidden;
}

.ws-list__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.ws-list__items {
  display: flex;
  flex-direction: column;
  max-height: 680px;
  overflow-y: auto;
}

.ws-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms;
}

.ws-row:hover {
  background: var(--surface-2);
}

.ws-row.is-selected {
  border-left-color: var(--brand);
  background: var(--brand-50);
}

.ws-row__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--neutral-50);
  color: var(--neutral);
}

.ws-row__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ws-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ws-row__meta {
  color: var(--muted);
  font-size: 12.5px;
}

.ws-row__warning {
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
}

.ws-row__amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
  font-size: 14px;
}

.ws-row__amount span {
  font-size: 12px;
}

.ws-detail {
  position: sticky;
  top: 16px;
}

.ws-detail__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ws-detail__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ws-detail__head > div {
  flex: 1;
  min-width: 0;
}

.ws-detail__head h2 {
  font-size: 20px;
}

.ws-detail__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--brand);
}

.patient-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.patient-chip__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.patient-chip__text strong {
  font-size: 14px;
}

.patient-chip__text .muted {
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.patient-chip:hover strong {
  color: var(--brand-600);
  text-decoration: underline;
}

/* ---------- Today ---------- */

.agenda {
  display: flex;
  flex-direction: column;
}

.agenda__row {
  display: grid;
  grid-template-columns: 76px 4px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.agenda__row:last-child {
  border-bottom: 0;
}

.agenda__row.is-now {
  margin: 0 -10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--brand-50);
}

.agenda__time {
  display: flex;
  flex-direction: column;
  font-size: 13.5px;
}

.agenda__time .muted {
  font-size: 12px;
}

.agenda__bar {
  align-self: stretch;
  border-radius: 4px;
  background: var(--t1);
}

.agenda__bar--t2 {
  background: var(--t2);
}

.agenda__bar--t3 {
  background: var(--t3);
}

.agenda__bar--t4 {
  background: var(--t4);
}

.agenda__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.agenda__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-left: 42px;
  color: var(--muted);
  font-size: 12.5px;
}

.tasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  transition: background-color 140ms;
}

.task:hover {
  background: var(--surface-2);
}

.task__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand);
}

.task__icon--accent {
  background: var(--accent-50);
  color: var(--accent-600);
}

.task__icon--ai {
  background: var(--ai-50);
  color: var(--ai);
}

.task__icon--danger {
  background: var(--danger-50);
  color: var(--danger);
}

.task__icon--warning {
  background: var(--warning-50);
  color: var(--warning);
}

.task__icon--success {
  background: var(--success-50);
  color: var(--success);
}

.task__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.35;
}

.task__body .muted {
  font-size: 12.5px;
}

.task__action {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--brand-600);
  font-size: 13px;
  font-weight: 700;
}

.automation__hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ink), var(--pine-700));
  color: var(--on-dark);
}

.automation__hero strong {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  color: #7fdccd;
  white-space: nowrap;
}

.automation__hero span {
  font-size: 13px;
}

.automation__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.automation__list li {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.35;
}

.automation__list li > span:last-child {
  display: flex;
  flex-direction: column;
}

.automation__list .muted {
  font-size: 12px;
}

.automation__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-50);
  color: var(--brand);
}

.mini-chart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}

.mini-chart__bars {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 8px;
  height: 110px;
}

.mini-chart__bar {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.mini-chart__value {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.mini-chart__fill {
  width: 100%;
  border-radius: 6px 6px 3px 3px;
  background: var(--brand-100);
}

.mini-chart__bar.is-current .mini-chart__fill {
  background: var(--brand);
}

.mini-chart__bar.is-current .mini-chart__value {
  color: var(--brand-600);
}

/* ---------- Scheduling ---------- */

.calendar-card {
  padding: 16px;
}

.week-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.week-strip__days {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.week-strip__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  line-height: 1.2;
}

.week-strip__day:hover {
  border-color: var(--brand);
}

.week-strip__day.is-selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.week-strip__day strong {
  font-size: 18px;
}

.week-strip__weekday,
.week-strip__count {
  font-size: 11.5px;
  font-weight: 700;
  opacity: 0.75;
}

.week-strip__day.is-today:not(.is-selected) .week-strip__weekday {
  color: var(--brand-600);
  opacity: 1;
}

.calendar__scroll {
  overflow-x: auto;
}

.calendar__head,
.calendar__body {
  display: grid;
  grid-template-columns: 64px repeat(4, minmax(150px, 1fr));
  min-width: 680px;
}

.calendar__head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.calendar__corner {
  align-self: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.calendar__clinician {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.calendar__clinician-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
  font-size: 13px;
}

.calendar__clinician .muted {
  font-size: 11.5px;
}

.calendar__body {
  position: relative;
}

.calendar__hours {
  position: relative;
}

.calendar__hour {
  position: absolute;
  right: 10px;
  margin-top: -8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.calendar__hour:first-child {
  margin-top: 2px;
}

.calendar__column {
  position: relative;
  border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 68px);
}

.calendar__lunch {
  position: absolute;
  left: 0;
  right: 0;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(16, 42, 46, 0.035) 8px 16px);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}

.calendar__open {
  position: absolute;
  left: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0.75;
  transition: all 140ms;
}

.calendar__open:hover {
  border-color: var(--brand);
  background: var(--brand-50);
  color: var(--brand-600);
  opacity: 1;
}

.calendar__block {
  --tone: var(--t1);
  --tone-50: var(--t1-50);
  position: absolute;
  left: 4px;
  right: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 8px;
  overflow: hidden;
  border: 0;
  border-left: 3px solid var(--tone);
  border-radius: 8px;
  background: var(--tone-50);
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 140ms, transform 140ms;
}

.calendar__block:hover,
.calendar__block.is-selected {
  box-shadow: 0 0 0 2px var(--tone), var(--shadow);
  z-index: 1;
}

.calendar__block--t2 {
  --tone: var(--t2);
  --tone-50: var(--t2-50);
}

.calendar__block--t3 {
  --tone: var(--t3);
  --tone-50: var(--t3-50);
}

.calendar__block--t4 {
  --tone: var(--t4);
  --tone-50: var(--t4-50);
}

.calendar__block--completed {
  opacity: 0.6;
}

.calendar__block--noShow {
  background: repeating-linear-gradient(135deg, var(--danger-50) 0 6px, #fff 6px 12px);
  border-left-color: var(--danger);
}

.calendar__block--checkedIn {
  box-shadow: inset 0 0 0 1.5px var(--tone);
}

.calendar__block-time {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  color: var(--tone);
  font-size: 11px;
  font-weight: 800;
}

.calendar__block strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar__block-type {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar__block.is-short {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
}

.calendar__block.is-short .calendar__block-type {
  display: none;
}

.calendar__block--busy {
  border-left-color: var(--line-strong);
  background: repeating-linear-gradient(135deg, #f2f5f4 0 8px, #eaefee 8px 16px);
  color: var(--muted);
  cursor: default;
}

.calendar__block--busy:hover {
  box-shadow: none;
}

.calendar__block--busy .calendar__block-time {
  color: var(--muted);
}

.calendar__block--busy strong {
  font-weight: 600;
}

.calendar__now {
  position: absolute;
  left: 64px;
  right: 0;
  z-index: 1;
  height: 2px;
  background: var(--accent);
  pointer-events: none;
}

.calendar__now span {
  position: absolute;
  left: -60px;
  top: -9px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--t1);
}

.calendar-legend__swatch--t2 {
  background: var(--t2);
}

.calendar-legend__swatch--t3 {
  background: var(--t3);
}

.calendar-legend__swatch--t4 {
  background: var(--t4);
}

.calendar-legend__swatch--busy {
  background: repeating-linear-gradient(135deg, #e6ecea 0 3px, #cfd9d6 3px 6px);
}

.calendar-legend__swatch--open {
  background: none;
  border: 1.5px dashed var(--line-strong);
}

.schedule-detail {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.schedule-detail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.schedule-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.waitlist-card {
  position: sticky;
  top: 16px;
}

.waitlist-card__lead {
  margin-bottom: 12px;
  font-size: 13px;
}

.waitlist {
  display: flex;
  flex-direction: column;
}

.waitlist__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.waitlist__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.waitlist__pref {
  color: var(--muted);
  font-size: 12.5px;
}

.match-list,
.slot-fill {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match {
  display: grid;
  grid-template-columns: auto minmax(0, 1.2fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 140ms, background-color 140ms;
}

.match.is-on {
  border-color: var(--brand);
  background: var(--brand-50);
}

.match input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.match__arrow {
  color: var(--muted);
}

.match__slot {
  display: flex;
  flex-direction: column;
  font-size: 13.5px;
  line-height: 1.35;
}

.match__slot .muted {
  font-size: 12.5px;
}

.slot-fill li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.slot-fill .patient-chip {
  flex: 1;
}

/* ---------- Intake (clinic) ---------- */

.intake-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.intake-steps__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--neutral-50);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.intake-steps__item.is-done {
  background: var(--success-50);
  color: var(--success);
}

.ai-callout {
  padding: 16px;
  border: 1px solid #ddd7fa;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ai-50), #fbfaff);
}

.ai-callout__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--ai);
}

.ai-callout__head strong {
  color: #3f338f;
}

.ai-callout__head .muted {
  font-size: 12px;
}

.ai-callout ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 18px;
  list-style: disc;
  font-size: 13.5px;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---------- Tables ---------- */

.table-card {
  padding: 8px 8px 4px;
}

.table-card .card__head {
  padding: 12px 12px 0;
}

.table {
  display: flex;
  flex-direction: column;
  overflow-x: auto;
}

.table__row {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  min-width: 760px;
}

.table__group:last-child .table__row,
.table > .table__row:last-child {
  border-bottom: 0;
}

a.table__row {
  border-radius: 10px;
  transition: background-color 140ms;
}

a.table__row:hover {
  background: var(--surface-2);
}

.table__row--head {
  padding-top: 6px;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table__row--sessions {
  grid-template-columns: minmax(200px, 1.5fr) 1fr 1fr 0.7fr 1fr 1fr 24px;
}

.table__row--reports {
  grid-template-columns: minmax(230px, 1.6fr) 1fr 1fr minmax(180px, 1.4fr) 150px;
}

.table__row--eligibility {
  grid-template-columns: minmax(200px, 1.5fr) 1.1fr 1fr 0.6fr 0.8fr 0.9fr minmax(190px, 1.2fr);
}

.table__row--patients {
  grid-template-columns: minmax(220px, 1.6fr) 1fr 0.8fr 0.9fr 1fr 1.2fr 24px;
}

.table__cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table__progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.table__action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  color: var(--brand-600);
  font-weight: 700;
}

.table__chevron {
  color: var(--muted);
}

.table__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  font-size: 12.5px;
}

.table__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.table__note {
  margin: -6px 12px 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--danger-50);
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
  min-width: 736px;
}

/* ---------- Telehealth ---------- */

.visit-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.visit-card {
  --tone: var(--t1);
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  grid-template-areas:
    'time patient'
    'time clinician'
    'action action';
  gap: 8px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--tone);
  border-radius: 14px;
}

.visit-card--t2 {
  --tone: var(--t2);
}

.visit-card--t3 {
  --tone: var(--t3);
}

.visit-card--t4 {
  --tone: var(--t4);
}

.visit-card__time {
  grid-area: time;
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.visit-card__time .muted {
  font-size: 12px;
}

.visit-card .patient-chip {
  grid-area: patient;
}

.visit-card__clinician {
  grid-area: clinician;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.visit-card__action {
  grid-area: action;
  display: flex;
  justify-content: flex-end;
}

.ws-page--room .back-link {
  margin-bottom: 10px;
}

.room {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #0c2228, #081a1e);
  color: var(--on-dark);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.room__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.room__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.room__live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(210, 64, 90, 0.18);
  color: #ff8fa3;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.room__live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5c7a;
  animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

.room__timer {
  color: var(--on-dark-muted);
  font-size: 13px;
}

.room__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.room__badges .tag--neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-dark-muted);
}

.room__badges .tag--ai {
  background: rgba(107, 91, 214, 0.25);
  color: #c9c1ff;
}

.room__badges .chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--on-dark);
}

.room__lobby {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 24px;
}

.room__preview .video-tile {
  aspect-ratio: 16 / 10;
}

.room__lobby-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
}

.room__lobby-card h2 {
  font-size: 22px;
}

.room__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  height: 640px;
}

.room__grid--solo {
  grid-template-columns: minmax(0, 1fr);
}

.room__stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.room__screen {
  position: relative;
  flex: 1;
  min-height: 380px;
  border-radius: 18px;
  overflow: hidden;
}

.room__screen > .video-tile {
  position: absolute;
  inset: 0;
}

.room__share {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: repeating-linear-gradient(135deg, #f8faf9 0 14px, #f0f4f3 14px 28px);
  color: var(--text);
}

.room__share span {
  color: var(--muted);
}

.room__self {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: min(200px, 34%);
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.14);
}

.room__self .video-tile {
  height: 100%;
}

.room__caption {
  position: absolute;
  left: 50%;
  bottom: 18px;
  max-width: min(640px, 70%);
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 15px;
  transform: translateX(-60%);
}

.room__controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.room__control {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: background-color 140ms;
}

.room__control:hover {
  background: rgba(255, 255, 255, 0.18);
}

.room__control.is-off {
  background: #fff;
  color: var(--danger);
}

.room__control--mobile {
  display: none;
}

.room__end {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.room__end-short {
  display: none;
}

.room__end:hover {
  background: #b9324b;
}

.room__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #7fdccd;
  font-size: 13px;
}

.room__side {
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  min-height: 0;
}

.room__panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.room__scroll {
  display: flex;
  flex: 1;
  flex-direction: column-reverse;
  min-height: 0;
  overflow-y: auto;
}

.room__scroll .session-note {
  max-height: none;
  overflow: visible;
}

.room__panel--transcript {
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.room__panel--notes {
  flex: 1;
  background: rgba(107, 91, 214, 0.08);
}

.room__panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 13.5px;
}

.room__panel-head .muted {
  margin-left: auto;
  color: var(--on-dark-muted);
  font-size: 12px;
}

.room__panel-head .tag {
  margin-left: auto;
  background: rgba(107, 91, 214, 0.25);
  color: #c9c1ff;
}

.room__panel--notes .room__panel-head .icon {
  color: #c9c1ff;
}

.transcript {
  display: flex;
  flex-direction: column-reverse;
  flex: 1;
  min-height: 0;
  padding: 0 16px 14px;
  overflow-y: auto;
}

.transcript__inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.transcript__line {
  animation: line-in 260ms ease-out;
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.transcript__meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}

.transcript__meta strong {
  color: #7fdccd;
}

.transcript__line--guardian .transcript__meta strong,
.transcript__line--patient .transcript__meta strong {
  color: #ffb79f;
}

.transcript__meta .mono {
  color: var(--on-dark-muted);
  font-size: 11px;
}

.transcript__line p {
  font-size: 13.5px;
  line-height: 1.5;
}

.transcript__empty {
  color: var(--on-dark-muted);
}

.transcript--static {
  max-height: 560px;
  padding: 0;
}

.card .transcript--static .transcript__meta strong {
  color: var(--brand-600);
}

.card .transcript--static .transcript__line--guardian .transcript__meta strong,
.card .transcript--static .transcript__line--patient .transcript__meta strong {
  color: var(--accent-600);
}

.card .transcript--static .transcript__meta .mono {
  color: var(--muted);
}

.session-note {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 16px;
  overflow-y: auto;
  max-height: 300px;
}

.card .session-note {
  padding: 0;
  max-height: none;
}

.session-note__section {
  animation: line-in 300ms ease-out;
}

.session-note__section h4 {
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c9c1ff;
}

.card .session-note__section h4 {
  color: var(--ai);
}

.session-note ul {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 18px;
  list-style: disc;
  font-size: 13px;
}

.session-note__writing {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.session-note__writing .muted {
  color: #c9c1ff;
  font-size: 12px;
}

.shimmer {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(201, 193, 255, 0.12), rgba(201, 193, 255, 0.35), rgba(201, 193, 255, 0.12));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.shimmer--short {
  width: 60%;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.video-tile {
  --tone: #2d6f73;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 120px;
  border-radius: inherit;
  overflow: hidden;
  /* Every tile is sized by its frame (stage, preview, self view), so the
     avatar can scale with the tile instead of the window. */
  container-type: size;
}

.video-tile__scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 120%, rgba(255, 255, 255, 0.18), transparent 55%),
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.1), transparent 40%),
    linear-gradient(160deg, color-mix(in srgb, var(--tone) 70%, #ffffff 0%), color-mix(in srgb, var(--tone) 55%, #000 45%));
}

.video-tile--t1 {
  --tone: var(--t1);
}

.video-tile--t2 {
  --tone: var(--t2);
}

.video-tile--t3 {
  --tone: var(--t3);
}

.video-tile--t4 {
  --tone: var(--t4);
}

.video-tile.is-camera-off .video-tile__scene {
  background: #1b2b2f;
}

/* Sized from the tile (container units), so the circle stays round and the
   initials stay inside it in the small self view and on any window shape. */
.video-tile__avatar {
  --avatar-size: min(30cqw, 52cqh, 140px);
  display: grid;
  place-items: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--tone);
  font-size: calc(var(--avatar-size) * 0.32);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  transition: box-shadow 200ms;
}

.video-tile.is-speaking .video-tile__avatar {
  animation: speak 1s ease-in-out infinite;
}

@keyframes speak {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(127, 220, 205, 0.7);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(127, 220, 205, 0);
  }
}

.video-tile.is-speaking {
  outline: 3px solid #7fdccd;
  outline-offset: -3px;
}

.video-tile__label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.video-tile.is-self .video-tile__label {
  left: 6px;
  bottom: 6px;
  font-size: 11px;
}

.video-tile__bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.video-tile__bars span {
  width: 3px;
  border-radius: 2px;
  background: #7fdccd;
  animation: bars 0.9s ease-in-out infinite;
}

.video-tile__bars span:nth-child(2) {
  animation-delay: 0.15s;
}

.video-tile__bars span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes bars {
  0%,
  100% {
    height: 4px;
  }
  50% {
    height: 12px;
  }
}

.room__ended {
  padding: 40px 24px;
}

.room__summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
  color: var(--text);
  text-align: center;
}

.room__summary-icon,
.intake-done__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-50);
  color: var(--success);
}

.room__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin: 8px 0;
}

.room__stat {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
}

.room__stat strong {
  font-size: 18px;
}

.room__stat span {
  color: var(--muted);
  font-size: 12px;
}

.session-record {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.session-record__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.session-record__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.session-record__stats div {
  display: flex;
  flex-direction: column;
}

/* ---------- Reports ---------- */

.report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.report-head h1 {
  font-size: 26px;
}

.report-head__side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-bar {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px 18px;
  border: 1px solid #ddd7fa;
  border-radius: var(--radius);
  background: rgba(240, 238, 253, 0.95);
  backdrop-filter: blur(8px);
}

.review-bar__progress {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  max-width: 420px;
}

.review-bar--signed {
  border-color: #c8d9f8;
  background: rgba(233, 240, 253, 0.95);
}

.review-bar--delivered {
  justify-content: flex-start;
  border-color: #bfe6d3;
  background: var(--success-50);
  color: var(--success);
}

.review-bar--delivered strong {
  color: var(--text);
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.report-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.report-aside {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.score-table td {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  vertical-align: top;
}

.score-table td:nth-child(2) {
  padding: 7px 8px;
  font-weight: 700;
  white-space: nowrap;
}

.score-table td:last-child {
  text-align: right;
}

.plain-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
}

.draft-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 28px;
  text-align: center;
  background: linear-gradient(180deg, var(--ai-50), var(--surface) 70%);
}

.draft-panel__icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--ai);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(107, 91, 214, 0.8);
}

.draft-panel p {
  max-width: 54ch;
}

.source-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.source-chips--small {
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.source-chip {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.draft-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  text-align: left;
}

.draft-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
}

.draft-steps li.is-done {
  color: var(--success);
}

.draft-steps li.is-active {
  color: var(--ai);
}

.draft-steps li.is-active .icon {
  animation: spin 1.2s linear infinite;
}

.report-section {
  border-left: 4px solid var(--ai);
}

.report-section--edited {
  border-left-color: var(--warning);
}

.report-section--approved {
  border-left-color: var(--success);
}

.report-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.report-section__head h3 {
  font-size: 16px;
}

.report-section__body {
  white-space: pre-line;
  font-size: 14.5px;
  line-height: 1.65;
}

.report-section__body.is-typing::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 16px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--ai);
  animation: blink 0.8s steps(2) infinite;
}

.report-section__edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-section__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

/* ---------- Billing ---------- */

.claim-lines th {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.claim-lines td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.claim-lines td:last-child,
.claim-lines th:last-child {
  text-align: right;
}

.claim-lines__total td {
  border-bottom: 0;
  font-weight: 800;
}

.scrub {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  font-size: 13.5px;
}

.scrub > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.scrub--ok {
  background: var(--success-50);
  color: var(--success);
}

.scrub--ok p {
  color: var(--text);
}

.scrub--issue {
  background: var(--warning-50);
  color: var(--warning);
}

.scrub--issue p {
  color: var(--text);
}

.scrub--denied {
  background: var(--danger-50);
  color: var(--danger);
}

.scrub--denied p:not(.muted) {
  color: var(--text);
}

.claim-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.claim-track li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.claim-track__dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.claim-track li.is-done {
  color: var(--text);
}

.claim-track li.is-done .claim-track__dot {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.claim-track li.is-bad .claim-track__dot {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

/* ---------- Patients & CRM ---------- */

.pipeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(224px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 8px;
  overflow-x: auto;
}

.pipeline__column {
  --tone: var(--neutral);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--tone);
}

.pipeline__column--accent {
  --tone: var(--accent);
}

.pipeline__column--progress {
  --tone: var(--progress);
}

.pipeline__column--brand {
  --tone: var(--brand);
}

.pipeline__column--ai {
  --tone: var(--ai);
}

.pipeline__column--warning {
  --tone: var(--warning);
}

.pipeline__column--success {
  --tone: var(--success);
}

.pipeline__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipeline__count {
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.pipeline__hint {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.pipeline__card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 140ms, transform 140ms;
}

.pipeline__card:hover {
  border-color: var(--tone);
  transform: translateY(-1px);
}

.pipeline__card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline__card-head > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
  font-size: 13px;
}

.pipeline__card-head strong,
.pipeline__card-head .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline__card-head .muted {
  font-size: 11.5px;
}

.pipeline__next {
  font-size: 11.5px;
  color: var(--brand-600);
  font-weight: 600;
}

.followups {
  display: flex;
  flex-direction: column;
}

.followup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.followup__check {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: transparent;
  cursor: pointer;
  transition: all 140ms;
}

.followup__check:hover {
  border-color: var(--success);
  color: var(--success);
}

.followup.is-done .followup__check {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.followup.is-done .followup__body strong {
  color: var(--muted);
  text-decoration: line-through;
}

.followup__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.35;
}

.followup__body .muted {
  font-size: 12px;
}

.followup__due {
  flex: none;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.followup.is-overdue .followup__due {
  color: var(--danger);
}

.profile-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}

.profile-head__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 260px;
}

.profile-head__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.profile-head__title h1 {
  font-size: 26px;
}

.profile-head__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 4px;
}

.profile-head__fact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.profile-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.journey {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 18px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.journey__step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.journey__step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 13px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 2px;
  background: var(--line);
}

.journey__step.is-done:not(:last-child)::after {
  background: var(--success);
}

.journey__dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  font-size: 12px;
}

.journey__step.is-done {
  color: var(--text);
}

.journey__step.is-done .journey__dot {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.journey__step.is-current {
  color: var(--brand-600);
}

.journey__step.is-current .journey__dot {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 5px var(--brand-50);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.module-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12.5px;
  transition: border-color 140ms;
}

.module-tile:hover {
  border-color: var(--brand);
}

.module-tile .progress {
  width: 100%;
}

.module-tile__head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 800;
}

.module-tile__head .icon {
  color: var(--brand);
}

.mini-list {
  display: flex;
  flex-direction: column;
}

.mini-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.mini-list li:first-child {
  border-top: 0;
}

.mini-list__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand);
}

.mini-list__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.35;
}

.mini-list__body .muted {
  font-size: 12px;
}

.rating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.rating__stars {
  display: inline-flex;
  gap: 2px;
  color: var(--line-strong);
}

.rating__stars .is-on {
  color: #f5b301;
  fill: #f5b301;
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 15px;
  width: 2px;
  background: var(--line);
}

.timeline__item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 8px 0;
}

.timeline__icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand);
}

.timeline__item--report .timeline__icon {
  background: var(--ai-50);
  color: var(--ai);
}

.timeline__item--billing .timeline__icon {
  background: var(--warning-50);
  color: var(--warning);
}

.timeline__item--followUp .timeline__icon {
  background: var(--success-50);
  color: var(--success);
}

.timeline__item--session .timeline__icon {
  background: var(--progress-50);
  color: var(--progress);
}

.timeline__item--intake .timeline__icon {
  background: var(--accent-50);
  color: var(--accent-600);
}

.timeline__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-top: 4px;
  font-size: 13.5px;
}

.timeline__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
}

.timeline__head .muted {
  font-size: 12px;
}

.timeline__body p {
  font-size: 12.5px;
}

/* ==========================================================================
   Family portal
   ========================================================================== */

.family {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef6f4, var(--bg) 380px);
}

.demo-bar {
  background: var(--ink);
  color: var(--on-dark-muted);
  font-size: 12.5px;
}

.demo-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.demo-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: #7fdccd;
  font-weight: 700;
}

.family-bar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
}

.family-bar__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 70px;
}

.family-bar__clinic {
  display: flex;
  align-items: center;
  gap: 12px;
}

.family-bar__clinic > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.family-bar__clinic span span {
  color: var(--muted);
  font-size: 12px;
}

.family-bar__logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--ink);
  color: #7fdccd;
}

.family-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.family-nav__link {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.family-nav__link:hover {
  color: var(--text);
}

.family-nav__link.is-active {
  background: var(--brand-50);
  color: var(--brand-600);
}

.family-bar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
}

.family-main {
  flex: 1;
}

.family-footer {
  padding: 20px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

.family-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.family-footer__powered {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.family-page {
  padding-top: 28px;
  padding-bottom: 60px;
}

.family-hero {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 24px;
}

.family-hero h1,
.intake-head h1,
.intake-done h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.15;
  max-width: 24ch;
}

.family-steps {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.family-steps li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.family-steps__dot {
  display: grid;
  place-items: center;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  color: transparent;
}

.family-steps__dot .icon {
  display: none;
}

.family-steps li.is-done {
  color: var(--text);
}

.family-steps li.is-done .family-steps__dot {
  background: var(--brand);
}

.family-steps li.is-current {
  color: var(--accent-600);
}

.family-steps li.is-current .family-steps__dot {
  background: linear-gradient(90deg, var(--accent) 50%, var(--line) 50%);
}

.family-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.family-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.family-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.family-card .progress {
  width: 100%;
}

.family-card--focus {
  border: 2px solid var(--accent);
  box-shadow: 0 16px 40px -20px rgba(240, 125, 92, 0.6);
}

.family-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.family-card__head h2 {
  font-size: 20px;
}

.family-card__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-50);
  color: var(--accent-600);
}

.family-card__icon--video {
  background: var(--progress-50);
  color: var(--progress);
}

.family-visit {
  display: flex;
  align-items: center;
  gap: 14px;
}

.family-visit > div:last-child {
  display: flex;
  flex-direction: column;
}

.family-visit__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 58px;
  padding: 6px 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  line-height: 1.1;
}

.family-visit__date span {
  color: #7fdccd;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.family-visit__date strong {
  font-size: 22px;
}

.messages {
  display: flex;
  flex-direction: column;
}

.messages li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}

.messages li:first-child {
  border-top: 0;
}

.messages .muted {
  font-size: 12px;
}

.care-team {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.care-team li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.care-team div {
  display: flex;
  flex-direction: column;
  font-size: 13.5px;
}

.care-team .muted {
  font-size: 12px;
}

.intake-head {
  margin-bottom: 20px;
}

.intake-head p {
  margin-top: 6px;
}

.intake-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.intake-nav {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.intake-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.intake-nav__item:hover:not(:disabled) {
  background: var(--surface-2);
}

.intake-nav__item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.intake-nav__item.is-current {
  background: var(--brand-50);
  color: var(--brand-600);
}

.intake-nav__item.is-done {
  color: var(--text);
}

.intake-nav__dot {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  font-size: 11px;
}

.intake-nav__item.is-done .intake-nav__dot {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.intake-nav__item.is-current .intake-nav__dot {
  border-color: var(--brand);
}

.intake-nav__item--submit {
  margin-top: 6px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
}

.intake-nav__progress {
  padding: 10px;
}

.intake-form {
  padding: 28px;
}

.intake-form__head {
  margin-bottom: 18px;
}

.intake-form__head h2 {
  font-size: 22px;
}

.intake-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.rating-scale {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.rating-scale__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 140ms, background-color 140ms;
}

.rating-scale__item.is-answered {
  border-color: var(--brand-100);
  background: #f6fbfa;
}

.rating-scale__question {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.rating-scale__number {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--neutral-50);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
}

.rating-scale__choices {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--neutral-50);
}

.rating-scale__choices button {
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.rating-scale__choices button:hover {
  color: var(--text);
}

.rating-scale__choices button.is-selected {
  background: var(--brand);
  color: #fff;
}

.upload {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-bottom: 16px;
  padding: 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--brand);
  text-align: left;
  cursor: pointer;
}

.upload span {
  display: flex;
  flex-direction: column;
  color: var(--text);
}

.upload .muted {
  font-size: 12.5px;
}

.upload.is-done {
  border-style: solid;
  border-color: var(--success);
  background: var(--success-50);
  color: var(--success);
}

.consents {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intake-review {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.intake-review h2 {
  font-size: 24px;
}

.intake-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 680px;
  margin: 30px auto;
  padding: 44px 32px;
  text-align: center;
}

.intake-done .lead {
  margin: 0 auto;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1240px) {
  .kpis--6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .journey-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .journey-flow__step::after {
    display: none;
  }

  .ws-grid--calendar {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-detail,
  .waitlist-card {
    position: static;
  }

  .room__grid {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 1080px) {
  :root {
    --side-width: 0px;
  }

  .ws {
    grid-template-columns: minmax(0, 1fr);
  }

  .ws-side {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
  }

  .ws-side__top {
    padding: 12px 18px;
  }

  .ws-side__toggle {
    display: grid;
  }

  .ws-side__body {
    display: none;
    max-height: calc(100vh - 64px);
    padding-bottom: 8px;
  }

  .ws.is-nav-open .ws-side__body {
    display: flex;
  }

  .ws-note {
    padding: 8px 18px;
  }

  .ws-page {
    padding: 20px 18px 48px;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ws-grid,
  .ws-grid--wide-left,
  .ws-grid--profile,
  .ws-split,
  .report-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ws-detail,
  .report-aside {
    position: static;
  }

  .room__grid {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .room__side .transcript,
  .room__side .room__scroll {
    max-height: 340px;
  }

  .room__side {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
  }

  .room__control--mobile {
    display: grid;
  }

  .room__side .room__panel--notes {
    display: none;
  }

  .room__side.is-notes .room__panel--notes {
    display: flex;
  }

  .room__side.is-notes .room__panel--transcript {
    display: none;
  }

  .hero__inner,
  .split {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__intro {
    grid-column: 1 / -1;
  }

  .family-grid,
  .intake-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .intake-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .intake-nav__progress {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .site-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px var(--gutter) 18px;
    background: var(--ink);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .site-header.is-open .site-nav {
    display: flex;
  }

  .site-nav__link {
    padding: 12px;
    text-align: left;
  }

  .site-nav .site-nav__mobile {
    display: flex;
  }

  .site-nav .btn.site-nav__mobile {
    margin-top: 8px;
  }

  .site-header__actions .btn--ghost-light {
    display: none;
  }

  .site-header__menu-toggle {
    display: grid;
  }

  .site-header__inner {
    justify-content: space-between;
  }

  .stats__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .partner-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .room__lobby {
    grid-template-columns: minmax(0, 1fr);
  }

  .family-nav {
    display: none;
  }

  .family-bar__inner {
    justify-content: space-between;
  }

  .family-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 14px;
  }

  .journey {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 16px;
  }

  .journey__step::after {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  body {
    font-size: 14.5px;
  }

  .kpis,
  .kpis--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }

  .kpi strong {
    font-size: 19px;
  }

  .feature-grid,
  .trust,
  .journey-flow,
  .form-grid,
  .details--two,
  .module-grid,
  .automation__list,
  .room__stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-header__actions .btn--accent {
    display: none;
  }

  .hero__inner {
    padding-top: 44px;
    padding-bottom: 56px;
  }

  .section,
  .section--dark {
    padding: 56px 0;
  }

  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ws-heading h1 {
    font-size: 24px;
  }

  .week-strip__count {
    display: none;
  }

  .match {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .match__arrow {
    display: none;
  }

  .match__slot,
  .match .tag {
    grid-column: 2;
  }

  .agenda__row {
    grid-template-columns: 62px 3px minmax(0, 1fr);
  }

  .agenda__action {
    grid-column: 3;
  }

  .agenda__meta {
    padding-left: 0;
  }

  .rating-scale__item {
    grid-template-columns: minmax(0, 1fr);
  }

  .rating-scale__choices {
    overflow-x: auto;
  }

  .room__stage {
    padding: 10px;
  }

  .room__screen {
    min-height: 260px;
  }

  .room__caption {
    max-width: 90%;
    font-size: 13px;
    transform: translateX(-50%);
  }

  .room__self {
    width: 34%;
  }

  .room__controls {
    gap: 8px;
  }

  .room__control {
    width: 44px;
    height: 44px;
  }

  .room__end {
    height: 44px;
    padding: 0 16px;
  }

  .room__end-full {
    display: none;
  }

  .room__end-short {
    display: inline;
  }

  .claim-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .family-bar__user span {
    display: none;
  }

  .demo-bar__link {
    margin-left: 0;
  }

  .intake-form {
    padding: 20px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

/* ---------------------------------------------------------------------------
   Language switcher (DE · FR · IT · EN) and longer German/French labels
   --------------------------------------------------------------------------- */

.lang-switch {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-switch__option {
  min-width: 30px;
  height: 26px;
  padding: 0 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.lang-switch__option:hover {
  background: var(--surface-2);
  color: var(--text);
}

.lang-switch__option.is-active {
  background: var(--brand);
  color: #fff;
  cursor: default;
}

.lang-switch--on-dark {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.lang-switch--on-dark .lang-switch__option {
  color: var(--on-dark-muted);
}

.lang-switch--on-dark .lang-switch__option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.lang-switch--on-dark .lang-switch__option.is-active {
  background: var(--accent);
  color: #fff;
}

.ws-note {
  flex-wrap: wrap;
}

.ws-note > span {
  flex: 1 1 320px;
}

.ws-note .lang-switch {
  margin-left: auto;
  border-color: rgba(194, 117, 8, 0.22);
  background: rgba(255, 255, 255, 0.7);
}

.site-nav__lang {
  padding: 12px 12px 0;
}

/* German and French words run long: let headings and labels hyphenate instead of overflowing. */
h3,
h4,
.kpi span,
.tag,
.feature-card p,
.journey-flow p,
.trust p,
.ws-nav__label,
.calendar__block,
.module-tile,
.table__row span {
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

/* Large headings: no hyphenation, balanced lines instead. */
h1,
h2 {
  overflow-wrap: break-word;
  text-wrap: balance;
}

.site-nav__link {
  white-space: nowrap;
}

/* The hero has its own "Request a demo"; the header keeps the language switcher and the platform link. */
@media (max-width: 1480px) {
  .site-header__actions .btn--ghost-light {
    display: none;
  }
}

@media (max-width: 900px) {
  .site-header__actions .lang-switch {
    display: none;
  }

  .site-nav .site-nav__lang {
    display: flex;
  }
}

@media (max-width: 640px) {
  .family-bar__user .lang-switch__option {
    min-width: 26px;
    padding: 0 5px;
  }
}

.claim-lines td.mono {
  white-space: nowrap;
}

.claim-lines td:nth-child(2) {
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .claim-lines th,
  .claim-lines td {
    padding-left: 4px;
    padding-right: 4px;
    font-size: 12.5px;
  }
}

/* Six KPI tiles in a row leave little room for German and French labels:
   stack the icon above the text so each label gets the full tile width. */
@media (max-width: 1600px) and (min-width: 641px) {
  .kpis--6 .kpi {
    flex-direction: column;
    gap: 10px;
  }
}
