/* components.css — reusable UI primitives.
 *
 * Captain reads HTML/CSS — so these are real, production-quality components.
 * Buttons, cards, inputs, pills, toasts. Drives all role-routed screens.
 *
 * Day 10f: brand polish pass — buttons get proper glow shadows, cards get
 * the report.html border + radius + shadow stack, voice-button rebuilt as
 * the 120px circular hero CTA Captain locked in.
 */

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hi);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, color 0.15s, box-shadow 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-card-hi);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn--primary {
  background: var(--accent);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #050505;
  border-color: transparent;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn--primary:hover {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent) 100%);
  color: #050505;
  border-color: transparent;
  box-shadow: 0 6px 24px var(--accent-glow-2);
}
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
}
.btn--ghost:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); border-color: transparent; }
.btn--danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.btn--danger:hover { color: var(--red); border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.btn--block { width: 100%; }
.btn--xl { font-size: 1rem; padding: 0.9rem 1.7rem; }

/* === BIG VOICE BUTTON — the hero CTA, circular, with pulse glow === */
.voice-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  border: none;
  color: #050505;
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
  box-shadow:
    0 0 40px var(--accent-glow),
    0 0 80px var(--accent-glow-2),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  animation: voice-pulse 3s ease-in-out infinite;
}
.voice-button:hover {
  transform: scale(1.04);
  box-shadow:
    0 0 56px var(--accent-glow-2),
    0 0 110px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.voice-button:active { transform: scale(0.98); }
.voice-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.voice-button__icon {
  width: 38px;
  height: 38px;
  stroke: #050505;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes voice-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.02); }
}

/* Legacy pulse-dot — kept so older voice-button layouts (modal etc.) still work */
.voice-button__pulse {
  position: relative;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #050505;
  flex-shrink: 0;
  opacity: 0.7;
}
.voice-button__sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0;
  margin-top: 0.15rem;
}

/* Hero block that wraps the voice button — vertical stack, accent caption */
.voice-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  padding: 2.5rem 1.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  text-align: center;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.voice-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  pointer-events: none;
}
.voice-hero > * { position: relative; z-index: 1; }
.voice-hero__caption {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.005em;
}
.voice-hero__hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 44ch;
  line-height: 1.55;
}

/* === CARDS === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--card-pad, 1.5rem);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, box-shadow 0.2s;
}
.card--accent { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.card--flush { padding: 0; }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.card--flush .card__head { padding: 1.25rem 1.5rem 0.85rem; margin-bottom: 0; }
.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.005em;
  color: var(--text);
}
.card__sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.grid {
  display: grid;
  gap: var(--gap-y, 1rem);
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* === PILLS === */
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.75rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border-hi);
  color: var(--text-dim);
}
.nav-pill--accent {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.nav-pill--live { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); background: color-mix(in srgb, var(--green) 12%, transparent); }
.nav-pill--warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.nav-pill--danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: color-mix(in srgb, var(--red) 12%, transparent); }
.nav-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border-hi);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.role-pill__role {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}
.role-pill__avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #050505;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--font-display);
}

/* === ROLE-PILL SWAP PANEL (2026-05-14 — practitioner swap moved off topbar
   into an inline panel anchored to the role-pill, gated by password). */
[x-cloak] { display: none !important; }
.role-pill-wrap {
  position: relative;
  display: inline-block;
}
.role-pill--btn {
  background: var(--bg-card);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.role-pill--btn:hover {
  border-color: var(--accent);
}
.role-pill-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 50;
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-card, 12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  padding: 0.85rem 1rem;
}
.role-pill-panel__form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.role-pill-panel__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 0.35rem;
}
.role-pill-panel__select,
.role-pill-panel__input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  font-family: inherit;
  width: 100%;
}
.role-pill-panel__input:focus,
.role-pill-panel__select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.role-pill-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.role-pill-panel__cancel,
.role-pill-panel__submit {
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid var(--border-hi);
}
.role-pill-panel__cancel {
  background: transparent;
  color: var(--text-dim);
}
.role-pill-panel__cancel:hover {
  color: var(--text);
  border-color: var(--text-dim);
}
.role-pill-panel__submit {
  background: var(--accent);
  color: #050505;
  border-color: var(--accent);
}
.role-pill-panel__submit:hover {
  filter: brightness(1.08);
}
.role-pill-panel__footer {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}
.role-pill-panel__footer-link {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
}
.role-pill-panel__footer-link:hover {
  color: var(--accent);
}
.role-pill-panel__footer-sep {
  color: var(--text-dim);
  opacity: 0.5;
}

.dev-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
}

/* === INPUTS === */
.input, .textarea, .select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-card-deep);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-input);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card-hi);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.textarea { resize: vertical; min-height: 96px; font-family: var(--font-mono); font-size: 0.86rem; }

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.field__label {
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}
.field__hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.color-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.color-row input[type="color"] {
  width: 48px; height: 38px;
  padding: 0;
  border: 1px solid var(--border-hi);
  background: var(--bg-card);
  border-radius: var(--radius-input);
  cursor: pointer;
}
.color-row .input { flex: 1; font-family: var(--font-mono); }

.check-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--text);
}
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }

/* === LISTS === */
.list {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-mini);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-card-deep);
}
.list__row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: var(--row-py, 0.7rem) var(--row-px, 1rem);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  transition: background-color 0.12s;
}
.list__row:last-child { border-bottom: none; }
.list__row:hover { background: var(--bg-card-hi); }
.list__row__primary { flex: 1; min-width: 0; color: var(--text); font-weight: 500; }
.list__row__primary small { display: block; color: var(--text-dim); font-weight: 400; margin-top: 0.15rem; font-size: 0.8rem; }
.list__row__meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); }
.list__row__when { font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent-soft); white-space: nowrap; font-weight: 600; }

/* === SCHEDULE CARDS (Day 10f) — appointment-as-card layout for the chair === */
.appt-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.appt-card {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-mini);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.08s, box-shadow 0.15s;
  position: relative;
}
.appt-card:hover {
  border-color: var(--accent);
  transform: translateX(2px);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 12%, transparent);
}
.appt-card--allergy { border-left: 3px solid var(--amber); }
.appt-card__time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.appt-card__body { min-width: 0; }
.appt-card__patient {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.15rem;
  letter-spacing: -0.005em;
}
.appt-card__treatment {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.appt-card__meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}
.appt-card__duration {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === KPI === */
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 110px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, transform 0.08s;
}
.kpi:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); transform: translateY(-1px); }
.kpi__label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.kpi__value {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.1;
}
.kpi__delta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.kpi__delta.up { color: var(--green); }
.kpi__delta.down { color: var(--red); }

/* Compact KPI strip — used in the chair hero row */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (max-width: 900px) {
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kpi-mini {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-mini);
  padding: 0.7rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.kpi-mini__label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.kpi-mini__value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.kpi-mini__sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* === TOAST === */
.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 200;
  padding: 0.85rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-mini);
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: 0 8px 32px var(--accent-glow);
  display: none;
}
.toast.show { display: block; }

/* === AUTH === */
.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem;
  background:
    radial-gradient(ellipse 70% 45% at 15% 0%, var(--accent-glow), transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 75%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}
.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
}
.auth-card .auth-card__sub {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* === AUTH PAGE — split-screen (2026-05-13) ===
   Left = brand panel (positioning + 3 outcome bullets), right = form card.
   Stacks vertically below 900px; brand panel hides on <600px. */
.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: 100vh;
  background: var(--bg);
}
.auth-page__brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 3.25rem;
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, var(--accent-glow), transparent 65%),
    radial-gradient(ellipse 60% 50% at 100% 100%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 65%),
    linear-gradient(180deg, var(--bg-card-deep) 0%, var(--bg) 100%);
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.auth-page__brand::before {
  /* faint grid texture — reads as "clinical instrument", not "marketing" */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--accent) 5%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--accent) 5%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 70% at 30% 30%, #000 0%, transparent 75%);
  pointer-events: none;
}
.auth-page__brand > * { position: relative; z-index: 1; }
.auth-page__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.auth-page__mark-glyph {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 24px var(--accent-glow);
  color: var(--accent);
}
.auth-page__pitch { max-width: 30rem; }
.auth-page__pitch h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 2.6vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.85rem;
}
.auth-page__pitch h2 .accent { color: var(--accent); }
.auth-page__pitch p {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 2rem;
  max-width: 26rem;
}
.auth-page__outcomes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.auth-page__outcomes li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
}
.auth-page__outcomes svg {
  flex: 0 0 18px;
  width: 18px; height: 18px;
  color: var(--accent);
}
.auth-page__foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.auth-page__foot-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent), 0 0 14px var(--accent-glow-2);
}
.auth-page__form {
  display: grid;
  place-items: center;
  padding: 3rem 2rem;
}
.auth-page__form .auth-card {
  max-width: 440px;
  padding: 2.25rem;
}
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-page__brand { padding: 2rem 1.5rem; border-right: 0; border-bottom: 1px solid var(--border); }
  .auth-page__pitch h2 { font-size: 1.5rem; }
  .auth-page__pitch p { margin-bottom: 1.25rem; }
  .auth-page__outcomes { flex-direction: row; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
  .auth-page__outcomes li { font-size: 0.85rem; }
}
@media (max-width: 600px) {
  .auth-page__brand { display: none; }
  .auth-page__form { padding: 1.5rem 1rem; }
}

/* === BANNER / EYEBROW (report.html parity) === */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent), 0 0 14px var(--accent-glow-2);
}

/* === HERO — chair greeting block === */
.hero-greeting {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.hero-greeting__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0;
}
.hero-greeting__title .accent { color: var(--accent); }
.hero-greeting__sub {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 62ch;
}

/* === MUTED HELPERS === */
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.mono { font-family: var(--font-mono); }
.stack { display: flex; flex-direction: column; gap: var(--gap-y, 0.85rem); }
.row { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.row--right { justify-content: flex-end; }
.row--between { justify-content: space-between; }
.row--top { align-items: flex-start; }
.spacer { flex: 1; }

/* === Day 11 — POPIA + audit-log data tables === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th {
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-card-hi);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table tr:hover td { background: var(--bg-card-hi); }

/* === Day 7 — Tooth chart grid === */
.tooth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
}
.tooth-grid__quad {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.25rem;
}
.tooth {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card-hi);
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}
.tooth:hover { transform: translateY(-1px); border-color: var(--accent); }
.tooth--healthy { background: color-mix(in srgb, var(--green, #2ecc71) 8%, var(--bg-card-hi)); }
.tooth--restored { background: color-mix(in srgb, var(--accent) 25%, var(--bg-card-hi)); color: var(--accent); }
.tooth--caries { background: color-mix(in srgb, var(--red, #e74c3c) 30%, var(--bg-card-hi)); color: var(--red, #e74c3c); border-color: var(--red, #e74c3c); }
.tooth--missing { background: var(--bg-card); color: var(--text-muted); border-style: dashed; text-decoration: line-through; }
.tooth--implant { background: color-mix(in srgb, #888 25%, var(--bg-card-hi)); }
.tooth--perio-risk { background: color-mix(in srgb, var(--amber, #f39c12) 28%, var(--bg-card-hi)); color: var(--amber, #f39c12); border-color: var(--amber, #f39c12); }

/* === Day 7 — Treatment plan visits === */
.visits {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.5rem 0;
}
.visit-card {
  min-width: 280px;
  flex: 0 0 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.visit-card__head {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.visit-card__num { font-weight: 700; color: var(--accent); }
.visit-card__duration { color: var(--text-dim); font-size: 0.85rem; }
.visit-card__items { display: flex; flex-direction: column; gap: 0.5rem; }
.visit-item {
  background: var(--bg-card-hi);
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
}
.visit-item__head { display: flex; justify-content: space-between; font-weight: 600; }
.visit-item__code { color: var(--accent); }
.visit-item__desc { margin: 0.25rem 0; }
.visit-item__meta { color: var(--text-dim); font-size: 0.75rem; }
.visit-item__lab { color: var(--amber, #f39c12); font-size: 0.75rem; margin-top: 0.25rem; }

/* === Day 7 — Voice modal === */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  backdrop-filter: blur(4px);
}
.modal__panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* === CALLER OVERLAY — demo-theatre incoming-call card (matrix-dental-demo only) === */
.caller-overlay {
  position: fixed;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  pointer-events: none;
}
.caller-overlay[hidden] { display: none; }
.caller-overlay__card {
  pointer-events: auto;
  position: relative;
  min-width: 340px;
  max-width: 440px;
  padding: 1.25rem 1.5rem 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-card, 14px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 24px var(--accent-glow);
  text-align: center;
  color: var(--text);
  backdrop-filter: blur(6px);
}
.caller-overlay__dismiss {
  position: absolute;
  top: 0.4rem;
  right: 0.55rem;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}
.caller-overlay__dismiss:hover { background: var(--bg-card-hi); color: var(--text); }
.caller-overlay__dismiss:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.caller-overlay__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 0.6rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  animation: caller-ring 1.2s ease-in-out infinite;
  transform-origin: 50% 30%;
}
.caller-overlay__label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.caller-overlay__name {
  font-family: var(--font-display, var(--font-body));
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.caller-overlay__sub {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}
.caller-overlay__actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.caller-overlay__btn { flex: 1 1 auto; min-width: 6rem; }

@keyframes caller-ring {
  0%, 100% { transform: rotate(-15deg); }
  50%      { transform: rotate(15deg); }
}
@media (prefers-reduced-motion: reduce) {
  .caller-overlay__icon { animation: none; }
}
@media (max-width: 600px) {
  .caller-overlay { top: 4.25rem; left: 0.75rem; right: 0.75rem; transform: none; }
  .caller-overlay__card { min-width: 0; max-width: none; }
}

/* === Login retry banner (2026-05-13) — shown when /auth/callback bounces
   the user back due to a stale state cookie or session expiry. */
.auth-card__alert {
  background: rgba(255, 184, 0, 0.08);
  border: 1px solid rgba(255, 184, 0, 0.35);
  color: #ffd87a;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-card, 12px);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0.5rem 0 1rem;
}

/* === Patient Overview UX pass — 2026-05-13 (Captain pitch widen) ===
   Sticky in-page nav strip + section anchors with scroll offset so the
   anchor jumps land cleanly under the strip, not behind it.

   The five sections (Overview / Treatment / Money / Comms / Audit) are
   always rendered — the strip only scrolls between them. Captain wanted
   ONE page, not a tab metaphor. */

.patient-nav-strip {
  position: sticky;
  top: 0;
  z-index: 6; /* above allergy banner shadow but below modals */
  display: flex;
  gap: 0.25rem;
  padding: 0.55rem 0.85rem;
  margin: -0.25rem 0 0.85rem;
  background: var(--bg-card, #0f1620);
  border: 1px solid var(--border, #1f2937);
  border-radius: var(--radius-card, 12px);
  backdrop-filter: blur(8px);
  overflow-x: auto;
  scrollbar-width: thin;
  /* Smooth-scroll for in-page anchor jumps (Alpine just sets active state). */
  scroll-behavior: smooth;
}
html { scroll-behavior: smooth; }

.patient-nav-strip__link {
  flex: 0 0 auto;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim, #9ca3af);
  text-decoration: none;
  border-radius: 8px;
  border-bottom: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.patient-nav-strip__link:hover {
  color: var(--text, #f1f5f9);
  background: rgba(255, 255, 255, 0.03);
}
.patient-nav-strip__link.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.patient-section {
  /* Anchor jumps land under the sticky strip + page topbar. */
  scroll-margin-top: 5.5rem;
}
.patient-section__anchor {
  display: block;
  scroll-margin-top: 5.5rem;
}

/* Vertical timeline used by the Comms section. */
.timeline {
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 1.15rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--border, #1f2937),
    rgba(0, 212, 255, 0.18) 30%,
    rgba(0, 212, 255, 0.18) 70%,
    var(--border, #1f2937)
  );
  border-radius: 1px;
}
.timeline__entry:last-child {
  border-bottom: none !important;
}

/* Money summary big-number block — at top of the Money section. */
.money-summary__cell {
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.money-summary__cell:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Mobile: nav strip collapses to a horizontal scroller, sections stack. */
@media (max-width: 800px) {
  .patient-nav-strip {
    padding: 0.4rem 0.5rem;
  }
  .patient-nav-strip__link {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
  }
  .timeline::before { left: 0.85rem; }
  .timeline__entry { padding-left: 2rem !important; }
}

/* === Workstation (v1.0 wow page) ============================================
   Single-column, ~720px max-width centred. Anthropic-aesthetic — generous
   whitespace, big quiet headline, restraint everywhere. Three priority
   bands stacked vertically. Each band is a sibling section with an accent
   bar + numbered rank chip + a list of task rows. Pure CSS, no JS.
   Additive only — does not rename or override any existing class.
============================================================================ */

.workstation-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 4rem;
}

.workstation-header { margin-bottom: 1.5rem; }
.workstation-header__title {
  font-family: var(--font-display, var(--font-body));
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0.35rem 0 0.45rem;
  color: var(--text);
  line-height: 1.18;
}
.workstation-header__sub {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.96rem;
  line-height: 1.5;
}
.workstation-header__sub strong { color: var(--text); font-weight: 600; }

/* --- Top banner ---------------------------------------------------------- */
.workstation-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-card, 14px);
  border: 1px solid var(--border, color-mix(in srgb, var(--text) 12%, transparent));
  background: var(--bg-card, transparent);
  margin: 1.2rem 0 2.25rem;
}
.workstation-banner__icon {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
}
.workstation-banner__body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.4;
}
.workstation-banner__body strong { color: var(--text); font-weight: 600; font-size: 0.96rem; }
.workstation-banner__sub { color: var(--text-dim); font-size: 0.86rem; }

.workstation-banner--alert {
  background: color-mix(in srgb, var(--amber, #FBBF24) 10%, transparent);
  border-color: color-mix(in srgb, var(--amber, #FBBF24) 35%, transparent);
}
.workstation-banner--alert .workstation-banner__icon {
  background: color-mix(in srgb, var(--amber, #FBBF24) 22%, transparent);
  color: var(--amber, #FBBF24);
}
.workstation-banner--ok .workstation-banner__icon {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}

/* --- Bands --------------------------------------------------------------- */
.workstation-band {
  margin: 2.25rem 0;
  padding-left: 0.85rem;
  border-left: 2px solid color-mix(in srgb, var(--text-dim) 25%, transparent);
}
.workstation-band--income-now    { border-left-color: var(--accent); }
.workstation-band--income-future { border-left-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.workstation-band--maintenance   { border-left-color: color-mix(in srgb, var(--text-dim) 35%, transparent); }

.workstation-band__title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1rem;
  font-family: var(--font-display, var(--font-body));
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.workstation-band__rank {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text-dim) 15%, transparent);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-body);
}
.workstation-band--income-now .workstation-band__rank {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
}
.workstation-band--income-future .workstation-band__rank {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: color-mix(in srgb, var(--accent) 80%, var(--text));
}
.workstation-band__sub {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.86rem;
}

/* --- Task list / rows ---------------------------------------------------- */
.workstation-tasks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-mini, 12px);
  background: var(--bg-card, transparent);
  border: 1px solid color-mix(in srgb, var(--text-dim) 12%, transparent);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.task-row:hover {
  background: var(--bg-card-hi, color-mix(in srgb, var(--accent) 4%, var(--bg-card)));
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}
.task-row__left {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  flex: 1 1 auto;
}
.task-row__patient {
  font-weight: 600;
  color: var(--text);
  font-size: 0.96rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-row__what {
  color: var(--text-dim);
  font-size: 0.86rem;
  line-height: 1.4;
}
.task-row__right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 0 0 auto;
}
.task-row__niki {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill, 999px);
  white-space: nowrap;
}
.task-row__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-pill, 999px);
  background: var(--accent);
  color: #060606;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.task-row__cta:hover { filter: brightness(1.08); }
.task-row__cta:active { transform: translateY(1px); }
.task-row__cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.task-row__cta--ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid color-mix(in srgb, var(--text-dim) 30%, transparent);
}
.task-row__cta--ghost:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 45%, transparent);
}

/* --- Empty state --------------------------------------------------------- */
.workstation-empty {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-mini, 12px);
  border: 1px dashed color-mix(in srgb, var(--text-dim) 22%, transparent);
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}
.workstation-empty p { margin: 0.15rem 0; }
.workstation-empty p strong { color: var(--text); font-weight: 600; }
.workstation-empty .dim { color: var(--text-muted); }

/* --- Footer -------------------------------------------------------------- */
.workstation-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--text-dim) 10%, transparent);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 600px) {
  .workstation-shell { padding: 1.5rem 1rem 3rem; }
  .task-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .task-row__right { width: 100%; justify-content: space-between; }
  .task-row__cta { flex: 0 0 auto; }
}

/* === /install download buttons — single-file primary + ZIP secondary === */
.install-download__btn--primary {
  font-size: 1.1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--accent, #00D4FF), var(--accent-dark, #0099B8));
  color: #0A0F1A;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: var(--radius-card, 14px);
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(0, 212, 255, 0.28);
}
.install-download__btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(0, 212, 255, 0.42); }
.install-download__sub {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.75;
  margin-left: 0.4rem;
}
.install-download__alt {
  margin-top: 1.25rem;
  color: var(--text-dim, #9ca3af);
}
.install-download__alt summary {
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.4rem 0;
}
.install-download__alt summary:hover { color: var(--accent, #00D4FF); }
.install-download__alt-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.install-download__btn--secondary {
  font-size: 0.9rem;
  padding: 0.55rem 0.95rem;
  background: transparent;
  color: var(--text, #e6ecf6);
  border: 1px solid var(--accent-dim, #0099B8);
  border-radius: var(--radius-card, 12px);
  text-decoration: none;
}
.install-download__btn--secondary:hover { border-color: var(--accent, #00D4FF); color: var(--accent, #00D4FF); }
.install-download__alt-hint { font-size: 0.78rem; opacity: 0.7; margin-top: 0.5rem; }

/* === Real Edge logo images (2026-05-14, replaces placeholder glyphs) === */
.auth-page__mark-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 212, 255, 0.18);
}
.brand__logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
}
