/* ==========================================================================
   QUEUE — Light Healthcare Flow Components & Architecture
   Aesthetic: Clean light foundation (#f7f9fc), high-contrast trustworthy typography,
              soft enterprise shadows, restrained healthcare blue & teal accents.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. LANDING PAGE & HERO TELEMETRY PREVIEW
   -------------------------------------------------------------------------- */
.landing-page {
  padding-bottom: 40px;
}

.landing-hero-section {
  padding: 48px 24px 72px;
  max-width: var(--max-width);
  margin: 0 auto;
  background:
    radial-gradient(
      circle at 80% 20%,
      rgba(25, 118, 210, 0.06),
      transparent 35%
    ),
    var(--bg-primary) !important;
}

.landing-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
  margin-bottom: 24px;
}

.hero-headline {
  color: var(--text-primary) !important;
  font-size: clamp(38px, 4.5vw, 54px);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}

.hero-supporting-text {
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--text-secondary) !important;
  margin-bottom: 32px;
  max-width: 580px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 44px;
}

.hero-stats-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.hero-stat-item {
  display: flex;
  flex-direction: column;
}

.hero-stat-val {
  font-size: 1.35rem;
  font-weight: 750;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.hero-stat-lbl {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.hero-stat-sep {
  color: var(--border);
}

/* Hero Live Telemetry Preview Card */
.live-telemetry-preview-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  padding: 28px;
  box-shadow: var(--shadow-md) !important;
  position: relative;
  overflow: hidden;
}

.live-telemetry-preview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--teal));
}

.preview-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.dept-lead {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
}

.dept-title {
  font-size: 1.3rem;
  font-weight: 750;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--success);
  background: var(--success-light);
  border: 1px solid rgba(5, 150, 105, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.preview-metric-hero {
  padding: 8px 0 18px;
}

.preview-metric-number {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary) !important;
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.preview-metric-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

.preview-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
}

.preview-detail-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cell-val {
  font-size: 0.98rem;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.preview-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.preview-footer-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Features Section */
.landing-features-section {
  padding: 68px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title-wrap {
  margin-bottom: 48px;
}

.section-headline {
  font-size: 2.2rem;
  font-weight: 750;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.section-subtext {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.6;
}

.features-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium) !important;
  transform: translateY(-2px);
}

.feature-icon {
  width: 46px;
  height: 46px;
  background: var(--primary-light);
  border: 1px solid rgba(29, 78, 216, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 20px;
}

.feature-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   2. HOSPITAL SELECTION & CARDS
   -------------------------------------------------------------------------- */
.filter-controls-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.search-field-wrap {
  position: relative;
  margin-bottom: 18px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input, .form-input.search-input {
  width: 100%;
  padding-left: 42px !important;
  height: 46px;
  background: white !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  font-size: 0.95rem;
}

.search-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12) !important;
}

.filter-pills-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

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

.filter-category-label {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 550;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: #e2e8f0;
}

.filter-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-xs);
}

.synthetic-disclaimer-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  border: 1px solid rgba(29, 78, 216, 0.2);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  color: var(--primary-dark);
  margin-bottom: 24px;
  font-weight: 500;
}

.disclaimer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* =========================================================
   LOCATION-BASED HOSPITAL DISCOVERY
   ========================================================= */

.location-discovery-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.location-discovery-card.is-active {
  border-color: rgba(29, 78, 216, 0.3);
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--surface) 120px);
}

.location-discovery-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.location-discovery-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.location-discovery-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.location-status-message {
  color: var(--text-secondary);
  max-width: 520px;
}

.location-detected-tag {
  display: inline-flex;
  align-items: center;
  font-weight: 650;
  color: var(--success);
  background: var(--success-light);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.nearby-hospitals-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.nearby-hospital-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.15s ease;
}

.nearby-hospital-row.is-nearest {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.10);
}

.nearby-hospital-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

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

.nearby-hospital-name {
  font-weight: 650;
  color: var(--text-primary);
  font-size: 0.98rem;
}

.nearest-badge {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.nearby-hospital-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nearby-hospital-distance {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 550;
}

.hospitals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.hospital-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hospital-card:hover {
  border-color: var(--border-medium) !important;
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-2px);
}

.hospital-card.is-featured {
  border: 1.5px solid var(--primary) !important;
}

.facility-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.facility-type-tag, .facility-district-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.facility-status-tag {
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.facility-status-tag.status-open {
  color: var(--success);
  background: var(--success-light);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.facility-status-tag .dot-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.facility-name {
  font-size: 1.3rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.015em;
}

.facility-address {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.hospital-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 18px;
}

.telemetry-cell {
  display: flex;
  flex-direction: column;
}

.telemetry-cell .cell-value {
  font-size: 1.25rem;
  font-weight: 750;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin: 2px 0;
  color: var(--text-primary);
}

.telemetry-cell .unit {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.cell-footnote {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.crowd-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.crowd-low {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.crowd-moderate {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.crowd-high {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.trend-decreasing { color: var(--success); }
.trend-increasing { color: var(--danger); }
.trend-stable { color: var(--text-secondary); }

.hospital-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.total-checkedin-indicator {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.total-checkedin-indicator span {
  color: var(--text-primary);
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   3. HOSPITAL OVERVIEW & KPI BAR
   -------------------------------------------------------------------------- */
.facility-overview-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 28px;
}

.facility-meta-line {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.kpi-telemetry-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 28px;
  margin-bottom: 36px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.kpi-item {
  display: flex;
  flex-direction: column;
}

.kpi-val {
  font-size: 2rem;
  font-weight: 750;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.kpi-val-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}

.kpi-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.kpi-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
}

.overview-section {
  margin-bottom: 36px;
}

.section-subhead-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
}

.subhead-title {
  font-size: 1.35rem;
  font-weight: 750;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.subhead-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.subhead-badge {
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--success);
  background: var(--success-light);
  border: 1px solid rgba(5, 150, 105, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.important-distinction-tag {
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(29, 78, 216, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.departments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.department-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.department-card:hover {
  border-color: var(--border-medium) !important;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.department-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.dept-prefix-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 4px;
}

.dept-name {
  font-size: 1.25rem;
  font-weight: 750;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.dept-sub-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.dept-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
}

.dept-metric-box {
  display: flex;
  flex-direction: column;
}

.dept-metric-value {
  font-size: 1.2rem;
  font-weight: 750;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin: 3px 0;
  color: var(--text-primary);
}

.dept-metric-note {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.department-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.dept-roster-footnote {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   4. QUEUE ACCESS TYPE (OPTION A: PRE-REGISTER VS OPTION B: PHYSICAL CHECK-IN)
   -------------------------------------------------------------------------- */
.access-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 36px 0;
}

.access-choice-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.access-choice-card:hover {
  border-color: var(--border-medium) !important;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.access-choice-card.is-checkin {
  border: 1.5px solid var(--primary) !important;
  background: var(--surface) !important;
  box-shadow: 0 4px 20px -2px rgba(29, 78, 216, 0.12), var(--shadow-sm) !important;
}

.card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.card-tag.highlight-tag {
  color: var(--primary);
}

.choice-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 20px;
}

.access-choice-card.is-checkin .choice-icon-wrap {
  background: var(--primary-light);
  border-color: rgba(29, 78, 216, 0.2);
  color: var(--primary);
}

.choice-heading {
  font-size: 1.5rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.choice-description {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.choice-important-note {
  background: var(--warning-light);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 28px;
}

.choice-important-note.on-site-note {
  background: var(--success-light);
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-left: 3px solid var(--success);
}

.note-icon {
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 1px;
}

.choice-important-note.on-site-note .note-icon {
  color: var(--success);
}

.note-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.choice-card-footer {
  margin-top: auto;
}

.distinction-explainer-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 28px;
  box-shadow: var(--shadow-xs);
}

.explainer-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.explainer-row:last-child {
  border-bottom: none;
}

.explainer-row.header-row {
  background: var(--bg-secondary);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.col-feature {
  color: var(--text-secondary);
  font-weight: 500;
}

.col-option {
  color: var(--text-primary);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   5. PATIENT REGISTRATION (NON-CLINICAL MULTI-STEP)
   -------------------------------------------------------------------------- */
.registration-form-container {
  max-width: 680px;
  margin: 0 auto;
}

.registration-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.form-progress-tracker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.progress-step.active, .progress-step.completed {
  opacity: 1;
}

.step-num {
  font-size: 0.82rem;
  font-weight: 700;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.progress-step.active .step-num {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.25);
}

.progress-step.completed .step-num {
  background: var(--success);
  color: #ffffff;
  border-color: var(--success);
}

.step-label {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text-primary);
}

.step-line {
  flex-grow: 1;
  height: 2px;
  background: var(--border);
  margin: 0 16px;
}

.section-intro {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Radio Choices */
.option-selection-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.choice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.choice-card:hover {
  border-color: #cbd5e1;
  background: var(--surface-hover);
}

.choice-card.selected {
  border: 2px solid var(--primary);
  background: var(--primary-light);
}

.choice-card input[type="radio"] {
  display: none;
}

.choice-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.choice-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.choice-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.choice-radio-custom {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  background: white;
}

.choice-card.selected .choice-radio-custom {
  border-color: var(--primary);
}

.choice-card.selected .choice-radio-custom::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

/* Form Fields */
.fields-group {
  margin-bottom: 28px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
}

.form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text-primary);
}

.field-label .req {
  color: var(--danger);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.otp-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.otp-verified-pill {
  font-size: 0.78rem;
  color: var(--success);
  background: var(--success-light);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #cdeee2;
}

.system-privacy-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 28px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.system-privacy-banner .banner-icon {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.form-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

/* Visit Type Cards */
.visit-type-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.visit-type-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.visit-type-card:hover {
  border-color: #cbd5e1;
  background: var(--surface-hover);
}

.visit-type-card.selected {
  border: 2px solid var(--primary);
  background: var(--primary-light);
}

.visit-type-card input[type="radio"] {
  display: none;
}

.visit-icon {
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.visit-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.visit-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.clinical-priority-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 24px;
}

/* --------------------------------------------------------------------------
   6. PRE-REGISTRATION REVIEW & CONFIRMATION
   -------------------------------------------------------------------------- */
.flow-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 0 48px;
}

.flow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.flow-card-title {
  font-size: 1.75rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.flow-card-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 26px;
}

.review-details-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 26px;
  overflow: hidden;
}

.review-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-light);
}

.review-row:last-child {
  border-bottom: none;
}

.review-row.highlight-row {
  background: var(--primary-light);
}

.review-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 550;
}

.review-value {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.review-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.critical-warning-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--warning-light);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 28px;
}

.warning-icon-col {
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 2px;
}

.warning-heading {
  font-size: 0.95rem;
  font-weight: 750;
  color: #855304;
  margin-bottom: 4px;
}

.warning-text {
  font-size: 0.88rem;
  color: #6d4202;
  line-height: 1.55;
}

.flow-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.flex-center {
  justify-content: center;
}

.mt-6 {
  margin-top: 24px;
}

/* Confirmation View */
.confirmation-card {
  text-align: center;
}

.confirmation-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.holding-pool-tag {
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.confirmation-hero-block {
  margin-bottom: 24px;
}

.check-success-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-light);
  border: 2px solid var(--success);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.token-id-display-box {
  background: var(--primary-light);
  border: 1px solid rgba(29, 78, 216, 0.2);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 28px;
}

.token-id-value {
  font-size: 3.2rem;
  font-weight: 800;
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
  color: var(--primary) !important;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.token-id-window {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Separation Telemetry Panel */
.separation-telemetry-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 28px;
  text-align: left;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-size: 0.85rem;
  font-weight: 750;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel-badge-live {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--success);
  background: var(--success-light);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.panel-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-stat-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.panel-stat-item.is-highlighted {
  border: 1.5px solid var(--primary);
  background: #fbfdff;
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stat-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 650;
}

.stat-indicator {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.stat-indicator.in-queue {
  background: var(--warning-light);
  color: var(--warning);
}

.stat-indicator.in-pool {
  background: var(--primary-light);
  color: var(--primary);
}

.stat-count {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin-bottom: 2px;
  letter-spacing: -0.03em;
}

.stat-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stat-status-line {
  font-size: 0.8rem;
  font-weight: 650;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.panel-callout-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  background: var(--surface);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

.arrival-handoff-box {
  text-align: left;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.handoff-title {
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.handoff-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.55;
}

.handoff-actions {
  display: flex;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   7. PHYSICAL CHECK-IN FLOW & TOKEN ISSUANCE
   -------------------------------------------------------------------------- */
.geofence-status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--success-light);
  border: 1px solid rgba(5, 150, 105, 0.2);
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--success);
  margin-bottom: 24px;
  font-weight: 550;
}

.geofence-icon {
  flex-shrink: 0;
}

.checkin-instruction-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.checkin-success-card {
  text-align: center;
}

.checkin-success-header {
  margin-bottom: 24px;
}

.status-badge-mount {
  margin: 12px 0 16px;
}

.token-hero-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background: var(--surface);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  align-items: center;
  box-shadow: 0 4px 20px -2px rgba(29, 78, 216, 0.12), var(--shadow-sm);
}

.token-hero-left {
  text-align: left;
  border-right: 1px solid var(--border);
  padding-right: 24px;
}

.token-hero-value {
  font-size: 3.6rem;
  font-weight: 800;
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--primary) !important;
  letter-spacing: -0.02em;
}

.token-hero-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.token-hero-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 24px;
}

.token-hero-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.token-hero-stat .stat-lbl {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.token-hero-stat .stat-val {
  font-size: 1.25rem;
  font-weight: 750;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.queue-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.snapshot-cell {
  display: flex;
  flex-direction: column;
}

.snapshot-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.snapshot-val {
  font-size: 1.1rem;
  font-weight: 750;
  margin: 3px 0;
  color: var(--text-primary);
}

.snapshot-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   8. LIVE QUEUE SCREEN & TELEMETRY
   -------------------------------------------------------------------------- */
.live-queue-page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.live-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.dept-breadcrumbs {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.crumb-hospital { color: var(--text-secondary); font-weight: 500; }
.crumb-dept { color: var(--text-primary); font-weight: 600; }
.crumb-floor { color: var(--text-muted); }

.live-dept-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.live-dept-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.live-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--success);
  margin-bottom: 8px;
}

.radar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

/* High Priority State Banners */
.high-priority-alert-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.alert-called {
  background: var(--success-light);
  border: 1.5px solid rgba(5, 150, 105, 0.3);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.12);
}

.alert-called .alert-headline {
  color: #065f46;
}

.bell-ring {
  color: var(--success);
}

.alert-approaching {
  background: var(--warning-light);
  border: 1.5px solid rgba(217, 119, 6, 0.3);
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.1);
}

.alert-approaching .alert-headline {
  color: #92400e;
}

.alert-consultation {
  background: #f5f3ff;
  border: 1.5px solid rgba(124, 58, 237, 0.3);
}

.alert-consultation .alert-headline {
  color: #5b21b6;
}

.alert-completed {
  background: #f1f5f9;
  border: 1px solid var(--border);
}

.alert-completed .alert-headline {
  color: var(--text-primary);
}

.alert-noshow {
  background: var(--danger-light);
  border: 1.5px solid rgba(220, 38, 38, 0.3);
}

.alert-noshow .alert-headline {
  color: var(--danger);
}

.alert-left {
  background: #f8fafc;
  border: 1px solid var(--border);
}

.alert-headline {
  font-size: 1.15rem;
  font-weight: 750;
  margin-bottom: 4px;
}

.alert-message {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.alert-action {
  margin-left: auto;
  flex-shrink: 0;
}

/* 4 Giant KPI Cards */
.live-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.live-kpi-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-kpi-card:hover {
  border-color: var(--border-medium) !important;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.live-kpi-card.is-token {
  border: 1.5px solid var(--primary) !important;
  background: var(--surface) !important;
  box-shadow: 0 4px 20px -2px rgba(29, 78, 216, 0.12), var(--shadow-sm) !important;
}

.kpi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.kpi-icon-pill {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kpi-giant-value {
  font-size: 3.2rem;
  font-weight: 800;
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.kpi-footer-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* Serving Spotlight Bar */
.serving-spotlight-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.spotlight-badge {
  font-size: 0.75rem;
  font-weight: 750;
  color: var(--primary);
  letter-spacing: 0.05em;
  background: var(--primary-light);
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.spotlight-token {
  font-size: 1.7rem;
  font-weight: 800;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.spotlight-room {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.room-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.spotlight-refresh {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-queue-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.disclaimer-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 700px;
}

/* --------------------------------------------------------------------------
   9. QUEUE SEQUENCE TIMELINE TRACK
   -------------------------------------------------------------------------- */
.queue-timeline-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.timeline-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.timeline-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.timeline-legend {
  display: flex;
  align-items: center;
  gap: 16px;
}

.legend-item {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.serving { background: var(--success); }
.legend-dot.next { background: var(--warning); }
.legend-dot.you { background: var(--primary); }
.legend-dot.in-line { background: #cbd5e1; }

.timeline-track-scroll {
  overflow-x: auto;
  padding: 10px 0 20px;
}

.timeline-track {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: max-content;
}

.queue-token-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-right: 24px;
}

.queue-token-node:last-child {
  margin-right: 0;
}

.token-node-bubble {
  width: 80px;
  height: 68px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s ease;
}

.token-code {
  font-size: 1.05rem;
  font-weight: 750;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.token-label-badge {
  font-size: 0.62rem;
  font-weight: 750;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  margin-top: 3px;
  text-transform: uppercase;
}

.queue-token-node.serving .token-node-bubble {
  border: 1.5px solid var(--success);
  background: var(--success-light);
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.12);
}

.queue-token-node.serving .token-code {
  color: var(--success);
}

.queue-token-node.serving .token-label-badge {
  background: var(--success);
  color: #ffffff;
}

.queue-token-node.next .token-node-bubble {
  border: 1.5px solid var(--warning);
  background: var(--warning-light);
}

.queue-token-node.next .token-code {
  color: #92400e;
}

.queue-token-node.next .token-label-badge {
  background: var(--warning);
  color: #ffffff;
}

.queue-token-node.is-self .token-node-bubble {
  border: 1.5px solid var(--primary);
  background: var(--primary-light);
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.18);
}

.queue-token-node.is-self .token-code {
  color: var(--primary);
}

.queue-token-node.is-self .token-label-badge {
  background: var(--primary);
  color: #ffffff;
}

.token-connector {
  position: absolute;
  top: 34px;
  right: -24px;
  width: 24px;
  height: 2px;
  background: var(--border);
  z-index: 1;
}

.queue-token-node:last-child .token-connector {
  display: none;
}

.token-order-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.timeline-progress-bar-wrap {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.progress-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.progress-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.progress-pct {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.progress-track-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--teal));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* --------------------------------------------------------------------------
   10. SYSTEM STATUS BADGES (9 CANONICAL STATES)
   -------------------------------------------------------------------------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

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

.status-badge.badge-lg {
  font-size: 0.85rem;
  padding: 6px 14px;
}

.status-badge.has-pulse .badge-dot {
  animation: none;
}

.badge-preregistered {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-checkedin {
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

.badge-waiting {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.badge-approaching {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-called {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-consultation {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.badge-completed {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-noshow {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-left {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* --------------------------------------------------------------------------
   11. PUBLIC HOSPITAL CROWD RADAR TABLE
   -------------------------------------------------------------------------- */
.crowd-page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 24px 60px;
}

.crowd-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.crowd-title {
  font-size: 2rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.crowd-subtitle {
  font-size: 0.98rem;
  color: var(--text-secondary);
}

.privacy-guarantee-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--success);
  background: var(--success-light);
  border: 1px solid #cdeee2;
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.crowd-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 550;
}

.filter-select {
  height: 40px;
  padding: 0 12px;
}

.crowd-table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.crowd-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.crowd-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.crowd-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.crowd-table tr:last-child td {
  border-bottom: none;
}

.crowd-table tbody tr:hover {
  background: #f8fbff;
}

.table-hospital-cell {
  display: flex;
  flex-direction: column;
}

.cell-primary-title {
  font-weight: 700;
  color: var(--text-primary);
}

.cell-sub-title {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.table-dept-pill {
  font-size: 0.82rem;
  font-weight: 550;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.table-metric-mono {
  font-weight: 750;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.table-sub-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

/* --------------------------------------------------------------------------
   12. HOW IT WORKS & FOR HOSPITALS
   -------------------------------------------------------------------------- */
.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 32px 0;
}

.how-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.how-step-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}

.how-card h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 750;
}

.how-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   13. SIMULATION CONSOLE DOCK (BOTTOM FLOATING)
   -------------------------------------------------------------------------- */
.simulation-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(25, 45, 75, 0.08);
}

.sim-toggle-handle {
  width: 100%;
  padding: 10px 24px;
  background: #f8fafc;
  border: none;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 650;
}

.sim-toggle-handle:hover {
  background: #f1f5f9;
}

.sim-title {
  color: var(--primary);
  font-weight: 750;
  letter-spacing: 0.02em;
  margin-left: 8px;
}

.current-state-pill {
  font-size: 0.72rem;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--success-light);
  border: 1px solid #cdeee2;
  color: var(--success);
}

.sim-drawer-content {
  display: none;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  background: white;
}

.sim-drawer-content.open {
  display: block;
}

.sim-controls-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.1fr 2.2fr 1fr;
  gap: 20px;
  align-items: flex-start;
}

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

.sim-section.is-highlight {
  background: var(--success-light);
  border: 1px solid #cdeee2;
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.sim-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sim-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sim-btn-group {
  display: flex;
  gap: 6px;
}

.sim-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sim-state-btn {
  background: white;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sim-state-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--surface-hover);
}

.sim-state-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* --------------------------------------------------------------------------
   14. MODALS & TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  padding: 26px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 750;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  margin-bottom: 24px;
}

.modal-subtext {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-message {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 550;
  box-shadow: var(--shadow-md);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-message.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-info .toast-dot { background: var(--primary); }
.toast-success .toast-dot { background: var(--success); }
.toast-warning .toast-dot { background: var(--warning); }
.toast-danger .toast-dot { background: var(--danger); }

/* --------------------------------------------------------------------------
   15. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .landing-hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .features-grid-3, .how-it-works-grid {
    grid-template-columns: 1fr;
  }

  .kpi-telemetry-bar {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .kpi-divider {
    display: none;
  }

  .live-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sim-controls-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .app-header .header-container {
    padding: 0 16px;
  }

  .nav-links {
    gap: 16px;
    overflow-x: auto;
  }

  .nav-link {
    font-size: 0.85rem;
  }

  .hero-headline {
    font-size: 34px !important;
  }

  .access-choice-grid {
    grid-template-columns: 1fr;
  }

  .token-hero-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .token-hero-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 16px;
  }

  .token-hero-right {
    padding-left: 0;
  }

  .live-kpi-grid {
    grid-template-columns: 1fr;
  }

  .serving-spotlight-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .spotlight-refresh {
    margin-left: 0;
  }

  .sim-controls-grid {
    grid-template-columns: 1fr;
  }

  .crowd-controls-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --------------------------------------------------------------------------
   Requested consultation time (registration step 3) + availability result
   Reuses the existing design tokens only.
   -------------------------------------------------------------------------- */
.slot-section {
  margin-top: 24px;
  padding: 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.slot-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 10px 0 14px;
}

.slot-fields .form-group {
  margin: 0;
}

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

.slot-hint {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.arrival-plan-card {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.arrival-plan-card.is-loading {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.arrival-plan-card.is-available {
  border-left-color: var(--success);
  background: var(--success-light);
}

.arrival-plan-card.is-unavailable {
  border-left-color: var(--warning);
  background: var(--warning-light);
}

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

.arrival-plan-badge {
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.arrival-plan-congestion {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 650;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.arrival-plan-congestion.level-low { color: var(--success); border-color: var(--success); }
.arrival-plan-congestion.level-medium { color: var(--warning); border-color: var(--warning); }
.arrival-plan-congestion.level-high,
.arrival-plan-congestion.level-critical { color: var(--danger); border-color: var(--danger); }

.arrival-plan-window {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}

.arrival-plan-label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.arrival-plan-time {
  font-size: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.arrival-plan-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.arrival-plan-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.arrival-plan-meta div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.arrival-plan-meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.arrival-plan-meta strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.arrival-plan-message {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.arrival-plan-note {
  margin: 12px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-actions-bar .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .slot-fields,
  .arrival-plan-meta {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   HISTORICAL CROWD PATTERNS & TODAY'S ML FORECAST STYLES
   -------------------------------------------------------------------------- */
.historical-crowd-section {
  margin-top: 24px;
  margin-bottom: 32px;
}

.historical-crowd-section .section-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.historical-crowd-section .section-title {
  font-size: 1.5rem;
  font-weight: 750;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 8px 0 6px;
}

.historical-crowd-section .section-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0;
  line-height: 1.5;
}

/* Filters Bar */
.historical-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.historical-filters-bar .filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  flex: 1;
}

.historical-filters-bar .filter-field.metric-field {
  min-width: 260px;
  flex: 1.3;
}

.historical-filters-bar .filter-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.historical-filters-bar .select-wrapper {
  position: relative;
}

.historical-filters-bar .filter-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.historical-filters-bar .filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--surface);
}

.metric-toggle-group {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 4px;
}

.metric-toggle-btn {
  flex: 1;
  padding: 7px 12px;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-align: center;
}

.metric-toggle-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(25, 45, 75, 0.08);
  font-weight: 700;
}

/* Main Chart Card */
.historical-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  position: relative;
}

.historical-chart-card .chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

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

.chart-metric-badge {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--text-primary);
}

.chart-dept-indicator {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-line {
  width: 16px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: #ffffff;
}

.svg-chart-container {
  width: 100%;
  overflow-x: auto;
  padding: 8px 0;
}

.responsive-svg-chart {
  width: 100%;
  height: auto;
  min-height: 220px;
  display: block;
}

.chart-point-group:hover .chart-point-circle {
  r: 7;
  fill: var(--primary);
  stroke: #ffffff;
  cursor: pointer;
  transition: r 0.15s ease;
}

/* Interpretation Insights Grid */
.historical-insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.insight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.insight-card.peak .insight-icon {
  background: #fff3e0;
  color: #e65100;
}

.insight-card.duration .insight-icon {
  background: var(--primary-light);
  color: var(--primary);
}

.insight-card.trough .insight-icon {
  background: var(--teal-light);
  color: var(--teal);
}

.insight-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-content {
  display: flex;
  flex-direction: column;
}

.insight-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.insight-value {
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--text-primary);
  line-height: 1.2;
}

.insight-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.historical-disclaimer-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Intelligence Dual Grid: Forecast + Live Queue */
.intelligence-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.intelligence-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.intel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.source-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
}

.source-tag.ml-tag {
  background: #ede7f6;
  color: #512da8;
}

.source-tag.live-tag {
  background: #e0f2f1;
  color: #00695c;
}

.model-name-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.intel-card-title {
  font-size: 1.2rem;
  font-weight: 750;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.intel-card-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0;
}

.congestion-badge {
  font-size: 0.72rem;
  font-weight: 750;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
}

.congestion-badge.badge-low {
  background: #e8f5e9;
  color: #2e7d32;
}

.congestion-badge.badge-medium {
  background: #fff8e1;
  color: #f57f17;
}

.congestion-badge.badge-high {
  background: #ffebee;
  color: #c62828;
}

.congestion-badge.badge-critical {
  background: #b71c1c;
  color: #ffffff;
}

.live-status-dot-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--teal);
  background: var(--teal-light);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.live-pulse {
  background: var(--teal);
  box-shadow: 0 0 0 rgba(0, 137, 123, 0.4);
  animation: pulse-ring 1.8s infinite;
}

/* Forecast Milestones */
.forecast-milestones-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-primary);
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.milestone-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.milestone-box.highlight .milestone-val {
  color: var(--primary);
  font-weight: 800;
}

.milestone-time {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.milestone-val {
  font-size: 1.4rem;
  font-weight: 750;
  color: var(--text-primary);
  line-height: 1;
}

.milestone-unit {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.milestone-arrow {
  color: var(--border);
  font-weight: bold;
  font-size: 1.1rem;
}

.forecast-narrative,
.live-narrative {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
  padding: 8px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

.intel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}

.intel-dot.teal {
  background: var(--teal);
}

/* Live Stats Row */
.live-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--bg-primary);
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.live-stat-box {
  display: flex;
  flex-direction: column;
}

.live-stat-label {
  font-size: 0.68rem;
  font-weight: 750;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.live-stat-num {
  font-size: 1.35rem;
  font-weight: 750;
  color: var(--text-primary);
  line-height: 1.1;
}

.live-stat-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.highlight-teal {
  color: var(--teal) !important;
}

@media (max-width: 960px) {
  .intelligence-dual-grid {
    grid-template-columns: 1fr;
  }

  .historical-insights-grid {
    grid-template-columns: 1fr;
  }
}

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

  .forecast-milestones-row {
    flex-wrap: wrap;
    gap: 12px;
  }

  .milestone-arrow {
    display: none;
  }

  .live-stats-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* --------------------------------------------------------------------------
   16. MOUSE-REACTIVE SURFACES (card spotlight)
   cursor.js writes --mx / --my (pointer position inside the card) while the
   pointer is over it. Without the script the glow simply sits centered and
   only shows on hover. Keep this selector list in sync with SPOTLIGHT in
   cursor.js.
   -------------------------------------------------------------------------- */
:is(
  .card, .panel, .dashboard-card, .hospital-card, .queue-card,
  .feature-card, .how-card, .live-kpi-card, .department-card,
  .access-choice-card, .intelligence-card, .insight-card,
  .live-telemetry-preview-card, .historical-chart-card, .kpi-telemetry-bar
) {
  position: relative;
}

:is(
  .card, .panel, .dashboard-card, .hospital-card, .queue-card,
  .feature-card, .how-card, .live-kpi-card, .department-card,
  .access-choice-card, .intelligence-card, .insight-card,
  .live-telemetry-preview-card, .historical-chart-card, .kpi-telemetry-bar
)::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: radial-gradient(
    circle var(--spotlight-radius) at var(--mx, 50%) var(--my, 50%),
    rgba(var(--cursor-rgb), var(--spotlight-alpha)),
    transparent 70%
  );
}

:is(
  .card, .panel, .dashboard-card, .hospital-card, .queue-card,
  .feature-card, .how-card, .live-kpi-card, .department-card,
  .access-choice-card, .intelligence-card, .insight-card,
  .live-telemetry-preview-card, .historical-chart-card, .kpi-telemetry-bar
):hover::after {
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  :is(
    .card, .panel, .dashboard-card, .hospital-card, .queue-card,
    .feature-card, .how-card, .live-kpi-card, .department-card,
    .access-choice-card, .intelligence-card, .insight-card,
    .live-telemetry-preview-card, .historical-chart-card, .kpi-telemetry-bar
  )::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(
    .card, .panel, .dashboard-card, .hospital-card, .queue-card,
    .feature-card, .how-card, .live-kpi-card, .department-card,
    .access-choice-card, .intelligence-card, .insight-card,
    .live-telemetry-preview-card, .historical-chart-card, .kpi-telemetry-bar
  )::after {
    transition: none;
  }
}