/* On Call — web app styles matching iOS Brand.swift + AuthView */

:root {
  --bg: #070b17;
  --auth-bg: #0a0f1e;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-high: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.08);
  --border-high: rgba(255, 255, 255, 0.14);
  --accent: #4f8ef7;
  --accent-alt: #8b5cf6;
  --accent-soft: rgba(79, 142, 247, 0.14);
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.52);
  --text-tertiary: rgba(255, 255, 255, 0.28);
  --danger: #f87171;
  --success: #34d399;
  --warning: #fbbf24;
  /* Geometry mirrors Brand.swift so the web and iOS read as one product. */
  --card-radius: 18px;
  --button-radius: 14px;
  --card-padding: 22px;
  --section-spacing: 14px;
  --tab-bar-height: 76px;
  --nav-height: 72px;
  --app-max-width: 1320px;
  --auth-max-width: 480px;
  --page-pad: clamp(16px, 3vw, 40px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  /* Stands in for SF Rounded, which iOS uses for every prominent number. */
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--accent); text-decoration: none; }

.hidden { display: none !important; }

#app {
  min-height: 100dvh;
  width: 100%;
  max-width: none;
  margin: 0;
  position: relative;
  overflow-x: clip;
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom));
}

/* Background gradients — BackgroundGradient + MeshBackground */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 50% at 10% 0%, rgba(79, 142, 247, 0.22), transparent 55%),
    radial-gradient(ellipse 55% 45% at 90% 15%, rgba(124, 58, 237, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 50% at 20% 90%, rgba(30, 64, 175, 0.28), transparent 55%),
    var(--bg);
  pointer-events: none;
}

.bg-gradient::before,
.bg-gradient::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  pointer-events: none;
}

.bg-gradient::before {
  width: min(520px, 70vw); height: 340px;
  left: -10%; top: 2%;
  background: rgba(30, 58, 138, 0.55);
}

.bg-gradient::after {
  width: min(440px, 60vw); height: 280px;
  right: -5%; top: 10%;
  background: rgba(79, 142, 247, 0.28);
}

.bg-gradient .blob-bottom {
  position: absolute;
  width: min(560px, 75vw); height: 360px;
  left: 5%; bottom: 5%;
  border-radius: 50%;
  filter: blur(100px);
  background: rgba(37, 99, 235, 0.32);
}

.auth-bg {
  background: var(--auth-bg);
}

.auth-bg .mesh-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
}

.auth-bg .mesh-blob:nth-child(1) { width: 340px; height: 340px; left: 8%; top: 6%; background: rgba(30, 58, 138, 0.72); }
.auth-bg .mesh-blob:nth-child(2) { width: 300px; height: 300px; right: 4%; top: 16%; background: rgba(79, 142, 247, 0.35); }
.auth-bg .mesh-blob:nth-child(3) { width: 380px; height: 380px; left: 28%; top: 42%; background: rgba(30, 64, 175, 0.5); }

/* Cards — CardStyle modifier (Branding.swift) */
.card {
  padding: var(--card-padding);
  border-radius: var(--card-radius);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.10);
  position: relative;
}

.auth-card-shell {
  background: rgba(255,255,255,0.04);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

/* Buttons */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: var(--button-radius);
  background: linear-gradient(90deg, #4f8ef7, #7c3aed);
  color: white;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.btn-primary:active { opacity: 0.85; transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  border-radius: var(--button-radius);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.8;
}

.btn-bordered {
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--button-radius);
  padding: 10px 16px;
  cursor: pointer;
}

/* Typography */
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.page-title {
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.subtitle { color: var(--text-secondary); font-size: 0.95rem; }
.muted { color: var(--text-secondary); }
.tertiary { color: var(--text-tertiary); }
.error-text { color: var(--danger); font-size: 13px; font-weight: 500; text-align: center; }

.section-header {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
}

.section-header .icon-wrap {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
}

/* Auth screen */
.auth-screen {
  min-height: 100dvh;
  overflow-y: auto;
  padding: clamp(24px, 4vh, 48px) var(--page-pad) calc(48px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-screen > .auth-brand,
.auth-screen > .auth-card-shell,
.auth-screen > .auth-footer,
.auth-screen > .error-text {
  width: min(100%, var(--auth-max-width));
}

.auth-brand {
  text-align: center;
  padding-top: clamp(32px, 8vh, 72px);
  padding-bottom: clamp(28px, 5vh, 48px);
}

.auth-brand-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 700;
}

.auth-brand-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.auth-brand-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-tagline {
  margin-top: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.5px;
}

.tab-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px;
  margin: 0 24px 28px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  position: relative;
}

.tab-switcher button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.4);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 0;
  border-radius: 10px;
  cursor: pointer;
  z-index: 1;
}

.tab-switcher button.active {
  color: white;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
}

.role-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 24px 20px;
}

.role-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.role-pill.active {
  border-color: rgba(79,142,247,0.5);
  background: rgba(79,142,247,0.15);
  color: white;
  font-weight: 600;
}

.auth-fields { padding: 0 24px; display: grid; gap: 12px; }

.auth-field {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}

.auth-field .field-icon { color: rgba(255,255,255,0.3); width: 20px; text-align: center; }
.auth-field input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: white;
}

.auth-field input::placeholder { color: rgba(255,255,255,0.35); }

.auth-actions { padding: 20px 24px 0; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  color: rgba(255,255,255,0.25);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

.auth-footer {
  padding: 24px 40px 48px;
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.2);
}

/* Navigation bar */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-height);
  padding: 10px var(--page-pad);
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  backdrop-filter: blur(18px) saturate(140%);
  background: rgba(7, 11, 23, 0.82);
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.nav-bar h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-bar .menu-btn {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  cursor: pointer;
}

.nav-bar .menu-btn:hover { background: rgba(255,255,255,0.09); }

/* Tab bar — always full-bleed, never clipped by page content */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(var(--tab-bar-height) + var(--safe-bottom));
  padding: 0 var(--page-pad) var(--safe-bottom);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: stretch;
  border-top: 1px solid rgba(79, 142, 247, 0.18);
  backdrop-filter: blur(20px) saturate(160%);
  background: rgba(7, 11, 23, 0.94);
  box-shadow: 0 -8px 32px rgba(15, 40, 100, 0.35);
  z-index: 100;
}

.tab-bar button {
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  min-height: 56px;
  border-radius: 12px;
  margin: 6px 2px;
  transition: color 0.15s, background 0.15s;
}

.tab-bar button:hover {
  color: rgba(255,255,255,0.75);
  background: rgba(79, 142, 247, 0.08);
}

.tab-bar button.active {
  color: var(--accent);
  background: rgba(79, 142, 247, 0.16);
}

.tab-bar button .tab-icon { display: grid; place-items: center; }
.tab-bar button .tab-label { font-size: 12px; letter-spacing: 0.01em; }

.tab-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* Main scroll area */
.main-scroll {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: 18px var(--page-pad) 28px;
}

.stack { display: grid; gap: var(--section-spacing); }

.content-grid {
  display: grid;
  gap: var(--section-spacing);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.page-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header .muted {
  margin: 6px 0 0;
  font-size: 0.95rem;
}

.roster-grid {
  display: grid;
  gap: var(--section-spacing);
}

@media (min-width: 900px) {
  .content-grid.two-col {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }

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

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Icons — inline SVG standing in for SF Symbols */
.ic {
  flex: none;
  vertical-align: -0.14em;
}

/* Shift row — ShiftRow in ContentView.swift */
.shift-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.shift-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.shift-body { min-width: 0; flex: 1; }

.shift-row h3 {
  margin: 0 0 3px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shift-meta-line {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.shift-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}

.rate-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-rounded);
  font-size: 0.9375rem;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill-quiet {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.09);
  letter-spacing: 0;
}

.pill-solid { color: #fff; }

.date-label {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Token badge */
.token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.token-row .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 15px;
  font-weight: 600;
  opacity: 1;
}

.token-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(79,142,247,0.14);
  border: 1px solid rgba(79,142,247,0.22);
  font-size: 14px;
  font-weight: 600;
  color: rgba(191, 219, 254, 0.95);
}

.token-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.token-dot.empty { background: rgba(255,255,255,0.2); }

/* Calendar — CalendarHeatmap.swift */
.calendar-card { display: grid; gap: 10px; }

.calendar-card .cal-title h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.calendar-card .cal-title .subtitle {
  margin: 4px 0 0;
  font-size: 0.9375rem;
}

.calendar-card .cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-card .cal-nav {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s;
}

.calendar-card .cal-nav:hover { background: rgba(79, 142, 247, 0.24); }

.calendar-card .month-label {
  flex: 1;
  text-align: center;
  font-family: var(--font-rounded);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.calendar-card .cal-hint {
  display: block;
  margin-top: 2px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
}

.cal-weekdays, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-grid.compact { gap: 8px; }

.cal-weekdays {
  gap: 0;
  margin-bottom: -2px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  padding: 2px 0;
}

.cal-day {
  aspect-ratio: 1;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.cal-grid.compact .cal-day { border-radius: 10px; }

.cal-num {
  font-family: var(--font-rounded);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.1;
}

.cal-rate {
  font-family: var(--font-rounded);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.85;
}

.cal-blocked {
  position: absolute;
  top: 3px; right: 3px;
  width: 15px; height: 15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
}

.cal-day:hover:not(.empty):not(.past) {
  transform: scale(1.09);
  border-color: rgba(255, 255, 255, 0.85);
  z-index: 2;
}

.cal-day.empty { visibility: hidden; pointer-events: none; }
.cal-day.past { color: var(--text-tertiary); cursor: default; }
.cal-day.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.28);
}

.cal-empty {
  margin: 0;
  padding: 24px 0;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
}
.legend-swatch.blocked {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
}

/* "Show open days only" — the iOS focus toggle */
.focus-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.focus-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.focus-toggle .switch {
  flex: none;
  width: 50px; height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  position: relative;
  transition: background 0.2s ease;
}

.focus-toggle .switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.focus-toggle input:checked + .switch { background: var(--accent); }
.focus-toggle input:checked + .switch::after { transform: translateX(20px); }
.focus-toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

.focus-copy { display: grid; gap: 2px; }
.focus-title { font-size: 0.9375rem; font-weight: 600; }
.focus-sub { font-size: 12.5px; color: var(--text-tertiary); }

/* Switch rows — the same control outside the calendar card */
.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9375rem;
}

.switch-row.spread { display: flex; justify-content: space-between; width: 100%; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }

.switch-row .switch {
  flex: none;
  width: 44px; height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  position: relative;
  transition: background 0.2s ease;
}

.switch-row .switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Roster card — DoctorRow in ContentView.swift */
.doctor-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.doctor-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 220px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.doctor-identity .avatar {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
}

.doctor-lines { display: grid; gap: 3px; min-width: 0; justify-items: start; }

.doctor-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.0625rem;
  font-weight: 600;
}

.doctor-meta { font-size: 0.875rem; color: var(--text-secondary); }

.doctor-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.row-spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Specialty tags — FlowLayout in ContentView.swift */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* Prominent figures use the rounded face, as they do on iOS. */
.money-lg {
  font-family: var(--font-rounded);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.tag {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(79, 142, 247, 0.14);
  padding: 5px 10px;
  border-radius: 999px;
}

/* Stat badges — StatBadge in ContentView.swift */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 16px 10px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 0;
  cursor: pointer;
  color: inherit;
  transition: background 0.15s;
}

.stat-badge:hover { background: rgba(79, 142, 247, 0.22); }

.stat-value {
  font-family: var(--font-rounded);
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
}

.stat-hint {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

/* Sheets and filter rows still build stat tiles from nested divs. */
.stat-badge .value {
  font-family: var(--font-rounded);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-badge .label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-badge .stat-hint {
  font-size: 11px;
  color: var(--text-tertiary, var(--text-secondary));
  margin-top: 6px;
  opacity: 0.85;
}

.doctor-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.doctor-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.doctor-card .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: rgba(79,142,247,0.15);
  color: var(--accent);
  font-weight: 700;
}

.doctor-lines { min-width: 0; display: grid; gap: 4px; }

.doctor-name {
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.doctor-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pill-solid {
  background: var(--success);
  color: #04231a;
}

.switch-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 11px;
  cursor: pointer;
}

/* Verification */
.verify-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid rgba(251, 146, 60, 0.4);
}

.verify-banner.flagged { border-color: rgba(248, 113, 113, 0.4); }
.verify-banner-icon { color: var(--warning); }
.verify-banner.flagged .verify-banner-icon { color: var(--danger); }
.verify-banner-title { font-size: 1.0625rem; font-weight: 600; }
.verify-banner .subtitle { margin: 3px 0 0; font-size: 0.875rem; }

.cred-status {
  display: flex;
  gap: 14px;
  align-items: center;
}

.cred-status-icon.ok { color: var(--success); }
.cred-status-icon.wait { color: var(--warning); }
.cred-status-title { font-size: 1.0625rem; font-weight: 600; }

.verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.verify-badge.verified { color: var(--success); background: rgba(52,211,153,0.12); }
.verify-badge.pending { color: var(--warning); background: rgba(251,191,36,0.12); }
.verify-badge.flagged { color: var(--danger); background: rgba(248,113,113,0.12); }
.verify-badge.waitlisted { color: var(--accent-alt); background: rgba(139,92,246,0.14); }
.verify-badge.rejected { color: var(--danger); background: rgba(248,113,113,0.12); }
.verify-badge.unverified { color: var(--text-tertiary); background: rgba(255,255,255,0.06); }

/* Sheet / modal */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.sheet-panel {
  width: min(100%, 720px);
  max-height: min(92dvh, 900px);
  overflow-y: auto;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(79, 142, 247, 0.2);
  animation: slideUp 0.28s ease;
  margin: 0 auto;
  box-shadow: 0 -12px 48px rgba(30, 58, 138, 0.35);
}

@media (min-width: 720px) {
  .sheet-backdrop {
    align-items: center;
    padding: 24px;
  }

  .sheet-panel {
    border-radius: 24px;
    border: 1px solid rgba(79, 142, 247, 0.22);
    box-shadow: 0 24px 80px rgba(0,0,0,0.45), 0 0 60px rgba(79, 142, 247, 0.12);
    max-height: min(88dvh, 860px);
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(7,11,23,0.95);
  backdrop-filter: blur(12px);
  z-index: 1;
}

.sheet-header h2 { margin: 0; font-size: clamp(1.05rem, 2vw, 1.25rem); font-weight: 650; }

.menu-list {
  list-style: none;
  margin: 0;
  padding: 8px 0 24px;
}

.menu-list section {
  padding: 8px 0;
}

.menu-list .section-label {
  padding: 8px 20px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.menu-list a, .menu-list .menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.menu-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.menu-list a:hover, .menu-list .menu-item:hover { background: rgba(255, 255, 255, 0.05); }

.menu-list .menu-item > .ic { color: var(--accent); }
.menu-list .menu-item .mi { width: 28px; color: var(--accent); }
.menu-list .menu-item.danger { color: var(--danger); }

.menu-list .menu-item.toggle-row { justify-content: space-between; }

.menu-item-sub {
  display: block;
  font-size: 12.5px;
  color: var(--accent);
}

.menu-profile {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  align-items: center;
}

.avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(79,142,247,0.15);
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 700;
}

.avatar.square {
  border-radius: 12px;
  width: 56px; height: 56px;
}

/* Onboarding */
.onboarding-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: center;
}

.onboarding-screen > .progress-bar {
  width: 100%;
}

.onboarding-screen > .onboarding-body,
.onboarding-screen > .onboarding-actions {
  width: min(100%, 560px);
}

.progress-bar { height: 4px; background: rgba(255,255,255,0.12); }
.progress-bar > div {
  height: 100%;
  background: var(--accent);
  transition: width 0.35s ease;
}

.onboarding-body {
  flex: 1;
  overflow-y: auto;
  padding: clamp(28px, 5vh, 48px) var(--page-pad) 24px;
}

.onboarding-icon {
  font-size: clamp(2.4rem, 5vw, 3rem);
  color: var(--accent);
  text-align: center;
  margin-bottom: 12px;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 0 var(--page-pad) calc(40px + var(--safe-bottom));
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
}

.chip.active {
  border-color: rgba(79,142,247,0.5);
  background: var(--accent-soft);
  color: white;
}

.form-stack { display: grid; gap: 12px; }

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-field input, .form-field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  outline: none;
}

.form-field input:focus { border-color: rgba(79,142,247,0.5); }

.divider { height: 1px; background: rgba(255,255,255,0.06); margin: 8px 0; }

.spinner {
  width: 22px; height: 22px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* EmptyStateCard — Branding.swift */
.empty-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  padding: 32px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-state .empty-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
}

.empty-state .subtitle { margin: 0; max-width: 42ch; }
.empty-state .btn-primary { width: auto; min-width: 220px; }

/* Sponsored slot — AdBanner.swift */
.ad-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.ad-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  flex: none;
}

.ad-body { min-width: 0; flex: 1; display: grid; gap: 2px; }
.ad-head { display: flex; align-items: center; gap: 6px; min-width: 0; }

.ad-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 999px;
}

.ad-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-copy {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-cta {
  flex: none;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  padding: 6px 11px;
  border-radius: 999px;
}

/* ActionSuccessBanner — Branding.swift */
.success-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  color: var(--success);
  background: rgba(52, 211, 153, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.success-title { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.success-banner .subtitle { margin: 2px 0 0; font-size: 0.8125rem; }

.empty-inline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 8px 0;
}

.holiday-pill {
  display: inline-flex;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
  font-size: 12px;
  font-weight: 600;
}

.coverage-chip {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.cov-all { background: rgba(52,211,153,0.12); color: var(--success); }
.cov-partial { background: rgba(251,191,36,0.12); color: var(--warning); }
.cov-none { background: rgba(248,113,113,0.12); color: var(--danger); }

/* Long specialty lists scroll inside the card so the page stays scannable. */
.specialty-day-list {
  display: grid;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}
.specialty-day-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.specialty-day-row:first-child { border-top: 0; padding-top: 0; }

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

.factor-list { display: grid; gap: 8px; }
.factor-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}
.factor-up { font-weight: 650; color: var(--success); }
.factor-down { font-weight: 650; color: var(--danger); }
.factor-neutral { font-weight: 650; color: var(--text-secondary); }

.algo-breakdown {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  display: grid;
  gap: 6px;
}
.algo-breakdown-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.algo-cat {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.algo-cat:first-of-type { margin-top: 0; }

.alter-rate-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.alter-rate-value {
  font-size: 1.15rem;
  color: var(--accent);
}

.stepper-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  align-items: center;
}
.stepper-row input {
  text-align: center;
  font-weight: 650;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); }

.alter-editor .btn-primary { margin-top: 4px; }

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}
.search-field input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--text);
}

.schedule-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.schedule-date {
  width: 48px;
  text-align: center;
  padding: 8px 4px;
  border-radius: 12px;
  flex-shrink: 0;
}
.schedule-date .mo,
.schedule-date .wd { font-size: 10px; font-weight: 700; text-transform: uppercase; }
.schedule-date .day { font-size: 1.4rem; font-weight: 800; line-height: 1.1; }

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0 !important;
  overflow: hidden;
}
.analytics-cell {
  padding: 18px 16px;
  border-right: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.analytics-cell:nth-child(2n) { border-right: 0; }
.analytics-cell:nth-child(n+3) { border-bottom: 0; }
.analytics-cell .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.analytics-cell .value {
  font-size: 1.35rem;
  font-weight: 700;
}
.analytics-cell .value.large { font-size: 1.8rem; }
.analytics-cell .value.accent { color: var(--accent); }
.analytics-cell .value.danger { color: var(--danger); }

.bucket-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-secondary);
}

.bracket-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.stat-badge.selected {
  outline: 2px solid var(--accent);
  background: rgba(79,142,247,0.16);
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.row-actions {
  display: flex;
  gap: 6px;
}
.row-actions .approve,
.row-actions .deny,
.token-mini .approve,
.token-mini .deny {
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.row-actions .approve,
.token-mini .approve { background: rgba(52,211,153,0.15); color: var(--success); }
.row-actions .deny,
.token-mini .deny { background: rgba(248,113,113,0.15); color: var(--danger); }

.trade-card { display: grid; gap: 10px; }

.trade-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.trade-actions button {
  flex: 1;
  min-width: 96px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 0;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.trade-actions .approve { background: rgba(52,211,153,0.18); color: var(--success); }
.trade-actions .deny { background: rgba(248,113,113,0.18); color: var(--danger); }
.trade-actions .counter {
  background: rgba(79,142,247,0.18);
  color: var(--accent);
  border: 1px solid rgba(79,142,247,0.35);
}

.trade-counter-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(79,142,247,0.08);
  border: 1px solid rgba(79,142,247,0.2);
}

.trade-counter-panel .counter-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.trade-counter-panel input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.9375rem;
  cursor: pointer;
}

/* A native checkbox reads as a form, not a setting. Draw it as an iOS switch. */
.toggle-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  margin: 0;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.toggle-row input[type="checkbox"]:checked { background: var(--accent); }
.toggle-row input[type="checkbox"]:checked::after { transform: translateX(18px); }
.toggle-row input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-ghost {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 15px;
  border-radius: 10px;
}

.btn-ghost:hover { background: rgba(79,142,247,0.1); }

/* Full-viewport responsive layout */
@media (min-width: 720px) {
  .auth-screen {
    justify-content: center;
  }

  .auth-card-shell {
    box-shadow: 0 24px 80px rgba(0,0,0,0.35), 0 0 80px rgba(79, 142, 247, 0.12);
  }

  .main-scroll {
    padding-top: 24px;
  }

  .tab-bar button {
    font-size: 13px;
    gap: 6px;
  }

  .cal-day {
    min-height: 56px;
  }
}

@media (min-width: 1100px) {
  .nav-bar {
    padding-left: max(var(--page-pad), calc((100vw - var(--app-max-width)) / 2 + var(--page-pad)));
    padding-right: max(var(--page-pad), calc((100vw - var(--app-max-width)) / 2 + var(--page-pad)));
  }

  .tab-bar {
    padding-left: max(var(--page-pad), calc((100vw - var(--app-max-width)) / 2 + var(--page-pad)));
    padding-right: max(var(--page-pad), calc((100vw - var(--app-max-width)) / 2 + var(--page-pad)));
  }
}

@media (max-width: 480px) {
  .stat-row {
    gap: 8px;
  }

  .stat-badge {
    padding: 14px 8px;
  }
}

.menu-signout {
  flex-shrink: 0;
  align-self: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(248,113,113,0.32);
  border-radius: 10px;
  background: rgba(248,113,113,0.10);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease;
}

.menu-signout:hover { background: rgba(248,113,113,0.18); }

/* Per-doctor daily token allowance */
.token-allowance {
  display: grid;
  justify-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.token-allowance > .tertiary { font-size: 11.5px; font-weight: 600; }

.token-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.token-stepper button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-high);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease;
}

.token-stepper button:hover:not(:disabled) { background: var(--accent); }
.token-stepper button:disabled { opacity: 0.32; cursor: not-allowed; }

.token-stepper strong {
  min-width: 20px;
  text-align: center;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.token-allowance.custom .token-stepper {
  border-color: rgba(79, 142, 247, 0.5);
  background: var(--accent-soft);
}

.token-default { font-size: 10.5px; }

.token-reset {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 10.5px;
  cursor: pointer;
}

.token-reset:hover { text-decoration: underline; }

/* ══ Marketing site ═══════════════════════════════════════════════════
   Scoped to .site so restyling the public pages cannot disturb the
   signed-in app, which still runs on the tokens declared in :root.      */
.site {
  --ink: #0b1220;
  --ink-raised: #0f1729;
  --ink-card: #111c33;
  --line: rgba(255, 255, 255, 0.07);
  --line-high: rgba(255, 255, 255, 0.13);
  --blue: #2563eb;
  --blue-bright: #3b82f6;
  --body: #94a3b8;
  --body-dim: #64748b;

  position: relative;
  min-height: 100dvh;
  background: var(--ink);
  color: #fff;
  font-family: var(--font);
}

/* Dot grid over the opening screen only, fading out before the stat band.
   Canvas draws a quiet grid and a bright trail radius around the pointer
   (see bindDotField) — clearer than CSS mask composites. */
.site-dotfield {
  position: absolute;
  inset: 0 0 auto 0;
  height: 760px;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
}

.site-dotfield-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .site-dotfield { opacity: 0.55; }
}

.site .hero,
.site .stat-band { position: relative; z-index: 1; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 32px;
  border-bottom: 1px solid transparent;
  transition: background 200ms ease, border-color 200ms ease;
}

.site-header.scrolled {
  background: rgba(11, 18, 32, 0.9);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}

.site-brand { text-decoration: none; color: inherit; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.logo svg { width: 27px; height: 27px; }

.site-nav { display: flex; gap: 26px; }

.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  transition: color 150ms ease;
}

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

.site-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Buttons */
.site .btn-quiet,
.site .btn-solid,
.site .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.site .btn-quiet { border: 0; background: transparent; color: var(--body); }
.site .btn-quiet:hover { color: #fff; }

.site .btn-solid { border: 0; background: var(--blue); color: #fff; }
.site .btn-solid:hover { background: var(--blue-bright); transform: translateY(-1px); }

.site .btn-outline {
  border: 1px solid var(--line-high);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
}

.site .btn-outline:hover { background: rgba(255, 255, 255, 0.07); }

.site .btn-solid.lg,
.site .btn-outline.lg { height: 46px; padding: 0 22px; font-size: 15px; }

.arrow { width: 15px; height: 15px; flex-shrink: 0; }

/* Hero */
.hero {
  max-width: 880px;
  margin: 0 auto;
  padding: 92px 28px 84px;
  text-align: center;
}

.pill {
  display: inline-block;
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(37, 99, 235, 0.12);
  color: var(--blue-bright);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.hero-title {
  margin: 26px 0 0;
  font-size: clamp(44px, 6.6vw, 74px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.hero-title .accent { color: var(--blue-bright); }

.hero-sub {
  max-width: 560px;
  margin: 22px auto 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--body);
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.hero-note { margin: 16px 0 0; font-size: 13px; color: var(--body-dim); }

/* Rolling stat band */
.stat-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink-raised);
}

.stat-band-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 28px;
}

.stat { text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }

.stat-value {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-value .plus { color: var(--blue-bright); }
.stat-label { margin-top: 5px; font-size: 13.5px; color: var(--body); }

/* Sections */
.section { max-width: 1080px; margin: 0 auto; padding: 92px 28px; }
.section.narrow { max-width: 820px; padding-top: 40px; }

.section.alt {
  max-width: none;
  border-top: 1px solid var(--line);
  background: var(--ink-raised);
}

.section.alt > * { max-width: 1080px; margin-left: auto; margin-right: auto; }

.section-head { max-width: 640px; }
.section-head.center { margin: 0 auto; text-align: center; }

.eyebrow {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--blue-bright);
}

.section-head h2 {
  margin: 14px 0 12px;
  font-size: clamp(30px, 4vw, 43px);
  line-height: 1.12;
  letter-spacing: -0.032em;
}

.section-head p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--body); }

/* Two-sided cards */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 20px;
  margin-top: 46px;
}

.split-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ink-card);
}

.split-card h3 {
  margin: 13px 0 10px;
  font-size: 23px;
  letter-spacing: -0.02em;
}

.split-card > p { margin: 0; font-size: 14.5px; line-height: 1.62; color: var(--body); }

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  width: 100%;
  margin: 24px 0 12px;
}

.week-day { display: grid; gap: 6px; justify-items: center; }
.week-label { font-size: 11px; color: var(--body-dim); }

.week-cell {
  display: grid;
  place-items: center;
  width: 100%;
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--body-dim);
  font-size: 12px;
  font-weight: 600;
}

.week-cell.on { background: var(--blue); color: #fff; }
.week-cell.swap { background: var(--warning); color: #3a2a00; }
.week-cell.gap { background: #dc2626; color: #fff; }

.week-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 22px;
  font-size: 12.5px;
  color: var(--body-dim);
}

.week-note.gap { color: #fca5a5; }

.gap-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #dc2626;
}

/* Feature cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
  margin-top: 42px;
}

.feature {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-card);
  transition: border-color 180ms ease, transform 180ms ease;
}

.feature:hover { border-color: var(--line-high); transform: translateY(-2px); }

.dash {
  display: block;
  width: 22px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--blue-bright);
}

.feature h3 { margin: 15px 0 8px; font-size: 16.5px; font-weight: 650; }
.feature p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--body); }

/* Closing band */
.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--ink-card);
}

.cta-band h2 {
  margin: 0 0 10px;
  font-size: clamp(27px, 3.4vw, 37px);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.cta-band p { margin: 0; font-size: 15px; color: var(--body); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink-raised);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 32px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 52px 28px 40px;
}

.footer-brand p {
  margin: 14px 0 0;
  max-width: 230px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--body-dim);
}

.footer-col { display: grid; align-content: start; gap: 11px; }

.footer-col h4 {
  margin: 0 0 3px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--body);
}

.footer-col span { font-size: 13.5px; color: var(--body-dim); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 28px 30px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--body-dim);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 640ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
              transform 640ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
}

.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .site .btn-solid:hover, .feature:hover { transform: none; }
}

@media (max-width: 900px) {
  .footer-top { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .site-nav { display: none; }
  .hero { padding: 64px 22px 56px; }
  .section { padding: 62px 22px; }
  .stat-band-inner { grid-template-columns: 1fr; gap: 26px; }
  .stat + .stat { border-left: 0; }
  .cta-band { padding: 30px; }
}

.auth-back {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 5;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}

.auth-back:hover {
  color: var(--text);
  background: var(--surface-high);
}

.trade-from {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.trade-swap {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.trade-swap strong {
  color: var(--text);
  font-weight: 600;
}

.trade-pay {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
}

/* Demo entry */
.demo-entry {
  display: grid;
  gap: 10px;
  padding: 0 24px 28px;
}

.demo-entry .btn-secondary {
  height: 48px;
  color: var(--text);
  border-color: rgba(79,142,247,0.28);
  background: rgba(79,142,247,0.10);
}

.demo-entry .btn-secondary:hover {
  background: rgba(79,142,247,0.16);
}

.demo-note {
  margin: 2px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

.demo-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(79,142,247,0.12);
  border-bottom: 1px solid rgba(79,142,247,0.22);
}

.demo-ribbon button {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Admin approvals */
.approvals-stats {
  grid-template-columns: repeat(4, 1fr);
}

.approval-loading {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 48px 0;
}

.approval-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  color: var(--success);
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.25);
}

.approval-card {
  display: grid;
  gap: 14px;
}

.approval-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.approval-kind {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  font-size: 1.1rem;
  background: var(--accent-soft);
}

.approval-identity {
  flex: 1;
  min-width: 0;
}

.approval-identity h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.approval-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
}

.approval-facts dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.approval-facts dd {
  margin: 4px 0 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.approval-flags {
  margin: 0;
  padding: 10px 14px 10px 28px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--warning);
  background: rgba(251,191,36,0.08);
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.approval-actions button {
  flex: 1;
  min-width: 120px;
  padding: 11px;
  border-radius: 10px;
  border: 0;
  font-weight: 600;
  cursor: pointer;
}

.approval-actions button:disabled {
  opacity: 0.55;
  cursor: default;
}

.approval-actions .approve { background: var(--success); color: #04231a; }
.approval-actions .waitlist { background: rgba(139,92,246,0.16); color: var(--accent-alt); }
.approval-actions .reject { background: rgba(248,113,113,0.18); color: var(--danger); }
.approval-actions .quiet {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.approval-confirm {
  padding: 14px;
  border-radius: 12px;
  background: rgba(248,113,113,0.07);
  border: 1px solid rgba(248,113,113,0.25);
}

.approval-confirm p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .approvals-stats { grid-template-columns: repeat(2, 1fr); }
  .approval-facts { grid-template-columns: 1fr 1fr; }
}
