/* ClinLoop AI - Professional Medical Workstation Cockpit Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-deep: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  
  --border-subtle: #e2e8f0;
  --border-card: #cbd5e1;
  --border-cyan: #0284c7;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  
  --cyan-neon: #0284c7;
  --cyan-glow: rgba(2, 132, 199, 0.12);
  --violet-neuro: #7c3aed;
  --violet-glow: rgba(124, 58, 237, 0.12);
  --crimson-danger: #e11d48;
  --crimson-glow: rgba(225, 29, 72, 0.15);
  --amber-warning: #d97706;
  --amber-glow: rgba(217, 119, 6, 0.15);
  --emerald-safe: #059669;
  --emerald-glow: rgba(5, 150, 105, 0.15);
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
}

body.dark-theme {
  --bg-deep: #03060c;
  --bg-surface: #070c18;
  --bg-card: rgba(11, 18, 34, 0.85);
  --bg-card-hover: rgba(18, 28, 52, 0.95);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-cyan: rgba(0, 240, 255, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --cyan-neon: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.25);
  --violet-neuro: #a855f7;
  --violet-glow: rgba(168, 85, 247, 0.25);
  --crimson-danger: #ff2a5f;
  --crimson-glow: rgba(255, 42, 95, 0.35);
  --amber-warning: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.25);
  --emerald-safe: #05df72;
  --emerald-glow: rgba(5, 223, 114, 0.3);
}

body.dark-theme {
  --bg-deep: #03060c;
  --bg-surface: #070c18;
  --bg-card: rgba(11, 18, 34, 0.88);
  --bg-card-hover: rgba(18, 28, 52, 0.95);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-cyan: rgba(0, 240, 255, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --cyan-neon: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.25);
  --violet-neuro: #a855f7;
  --violet-glow: rgba(168, 85, 247, 0.25);
  --crimson-danger: #ff2a5f;
  --crimson-glow: rgba(255, 42, 95, 0.35);
  --amber-warning: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.25);
  --emerald-safe: #05df72;
  --emerald-glow: rgba(5, 223, 114, 0.3);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Global Impact Bar ──────────────────────────────────────────────────────── */
.impact-stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
}
.impact-stat-val {
  font-family: var(--font-mono);
  font-size: 1.0rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}
.impact-stat-lbl {
  font-size: 0.56rem;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.impact-stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(0, 240, 255, 0.15);
  flex-shrink: 0;
}

/* ── Animated Survival Chart Canvas ─────────────────────────────────────────── */
#survival-canvas-container {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  overflow: hidden;
  padding: 1rem;
  margin-top: 1rem;
}
#survival-chart-canvas {
  width: 100%;
  display: block;
}
.survival-chart-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.6rem;
  justify-content: center;
}
.survival-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}
.survival-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Case card live badge ────────────────────────────────────────────────────── */
.case-card-overdue-badge {
  font-size: 0.58rem;
  font-weight: 700;
  background: rgba(225, 29, 72, 0.15);
  color: var(--crimson-danger);
  border: 1px solid rgba(225, 29, 72, 0.3);
  border-radius: 10px;
  padding: 0.1rem 0.45rem;
  font-family: var(--font-mono);
}
.case-card-safe-badge {
  font-size: 0.58rem;
  font-weight: 700;
  background: rgba(5, 150, 105, 0.15);
  color: var(--emerald-safe);
  border: 1px solid rgba(5, 150, 105, 0.3);
  border-radius: 10px;
  padding: 0.1rem 0.45rem;
  font-family: var(--font-mono);
}


html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  background-image: none;
}

body.dark-theme {
  background-image: 
    radial-gradient(circle at 12% 15%, rgba(0, 240, 255, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 88% 85%, rgba(168, 85, 247, 0.05) 0%, transparent 45%),
    linear-gradient(180deg, #03060c 0%, #060a15 100%);
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-neon);
}

/* App Header (Full Width Cockpit Bar) */
.prototype-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 34px;
  padding: 0.35rem 1.5rem;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--amber-warning) 6%, var(--bg-surface));
  border-bottom: 1px solid color-mix(in srgb, var(--amber-warning) 24%, var(--border-subtle));
  font-size: 0.72rem;
  line-height: 1.35;
}

.prototype-status-label {
  flex: 0 0 auto;
  color: var(--amber-warning);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
}

.prototype-status-copy {
  min-width: 0;
}

.app-header {
  min-height: 64px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.75rem;
  flex-shrink: 0;
  z-index: 100;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid var(--border-cyan);
  box-shadow: 0 0 15px var(--cyan-glow);
}

.brand-logo svg {
  width: 22px;
  height: 22px;
  color: var(--cyan-neon);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #0f172a 40%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.dark-theme .brand-title {
  background: linear-gradient(90deg, #ffffff 40%, var(--cyan-neon) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  letter-spacing: 0.03em;
}

.badge-live {
  border-color: rgba(5, 223, 114, 0.4);
  color: var(--emerald-safe);
  background: rgba(5, 223, 114, 0.08);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-safe);
  box-shadow: 0 0 8px var(--emerald-safe);
  animation: pulse-green 1.8s infinite;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.45rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--cyan-neon);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

/* ==========================================================================
   Full Viewport Clinical Cockpit Layout (3-Column Architecture)
   ========================================================================== */
.cockpit-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr 380px;
  gap: 1.1rem;
  padding: 1.1rem 1.5rem;
  min-height: 0; /* Important for flex/grid child overflow */
  height: auto;
  width: 100%;
}

@media (max-width: 1400px) {
  .cockpit-workspace {
    grid-template-columns: 320px 1fr 340px;
    padding: 0.85rem 1rem;
    gap: 0.85rem;
  }
}

@media (max-width: 1150px) {
  html, body {
    height: auto;
    overflow-y: auto;
  }
  .cockpit-workspace {
    display: flex;
    flex-direction: column;
    height: auto;
  }
}

@media (max-width: 560px) {
  .prototype-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 1rem;
  }
}

/* --------------------------------------------------------------------------
   COLUMN 1: Left Clinical Triage Worklist
   -------------------------------------------------------------------------- */
.cockpit-triage-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.panel-header-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.clock-panel-header {
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
}

.clock-panel-header .panel-title-sm {
  flex: 1 1 220px;
  min-width: 0;
}

.clock-panel-header .panel-title-sm span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.clock-panel-header .badge {
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 480px) {
  .clock-panel-header .panel-title-sm {
    flex: 0 0 100%;
  }

  .clock-panel-header .badge {
    margin-left: 0;
  }
}

.panel-title-sm {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem 0.45rem 2rem;
  color: var(--text-main);
  font-size: 0.78rem;
  font-family: var(--font-body);
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--cyan-neon);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.search-icon {
  position: absolute;
  left: 0.65rem;
  width: 13px;
  height: 13px;
  color: var(--text-dim);
  pointer-events: none;
}

.filter-pills-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn.active {
  background: #e0f2fe;
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Vertical Patient Queue List */
.case-queue-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.25rem;
}

.case-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
  overflow: hidden;
}

.case-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(2px);
}

.case-card.active {
  background: #f0fdfa;
  border-color: var(--cyan-neon);
  box-shadow: 0 0 20px var(--cyan-glow);
}

.case-card.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3.5px;
  background: linear-gradient(180deg, var(--cyan-neon), var(--violet-neuro));
}

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

.patient-id {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cyan-neon);
}

.case-status-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.status-open {
  background: rgba(255, 42, 95, 0.18);
  color: var(--crimson-danger);
  border: 1px solid rgba(255, 42, 95, 0.4);
}

.status-closed {
  background: rgba(5, 223, 114, 0.18);
  color: var(--emerald-safe);
  border: 1px solid rgba(5, 223, 114, 0.4);
}

.status-delayed {
  background: rgba(245, 158, 11, 0.18);
  color: var(--amber-warning);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.case-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.case-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   COLUMN 2: Center Stage - Hypergraph Engine & Primary Visuals
   -------------------------------------------------------------------------- */
.cockpit-center-stage {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
}

.hypergraph-panel {
  flex: 1;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 0;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.panel-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.panel-heading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.panel-heading svg {
  color: var(--cyan-neon);
}

/* Timeline Simulator Bar */
.scrubber-control-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.scrubber-label-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.scrubber-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.preset-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.preset-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-pill:hover {
  background: rgba(0, 240, 255, 0.1);
  color: var(--cyan-neon);
  border-color: rgba(0, 240, 255, 0.35);
}

.preset-pill.active {
  background: rgba(0, 240, 255, 0.16);
  color: var(--cyan-neon);
  border-color: var(--cyan-neon);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.preset-pill.danger:hover {
  background: rgba(255, 42, 95, 0.12);
  color: var(--crimson-danger);
  border-color: rgba(255, 42, 95, 0.35);
}

.preset-pill.danger.active {
  background: rgba(255, 42, 95, 0.2);
  color: #ff4d79;
  border-color: var(--crimson-danger);
  box-shadow: 0 0 12px rgba(255, 42, 95, 0.3);
}

.scrubber-slider-group {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.timeline-slider {
  flex: 1;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, #05df72, #f59e0b 50%, #ff2a5f 100%);
  outline: none;
  cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--cyan-neon);
  box-shadow: 0 0 12px var(--cyan-neon);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.scrubber-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cyan-neon);
  min-width: 70px;
  text-align: right;
}

/* Hypergraph Canvas Container */
.hypergraph-canvas-container {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  min-height: 0;
}

body.dark-theme .hypergraph-canvas-container {
  background: radial-gradient(circle at 50% 50%, rgba(13, 22, 45, 0.45) 0%, rgba(2, 5, 10, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hypergraph-canvas-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: 36px 36px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  pointer-events: none;
}

#hypergraph-svg {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

/* KPI Strip across bottom of center stage */
.kpi-ribbon-compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  flex-shrink: 0;
}

.kpi-card-compact {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.kpi-val-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.kpi-number {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--cyan-neon);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

.kpi-delta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--emerald-safe);
}

.kpi-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   COLUMN 3: Right Telemetry & Action Hub
   -------------------------------------------------------------------------- */
.cockpit-sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.card-widget.fill-remaining {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-widget.fill-remaining .evidence-chain {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.card-widget {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.clock-display {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  padding: 0.25rem 0;
}

.clock-gauge-canvas {
  width: 220px;
  height: 125px;
}

.clock-metric {
  position: relative;
  padding: 0.5rem 0;
  text-align: center;
}

.risk-number {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
}

.risk-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.clock-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

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

.stat-val {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
}

.sigmoid-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sigmoid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

#sigmoid-canvas {
  width: 100%;
  height: 80px;
}

/* Action Box */
.action-box {
  background: linear-gradient(135deg, rgba(255, 42, 95, 0.12), rgba(245, 158, 11, 0.07));
  border: 1px solid rgba(255, 42, 95, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(255, 42, 95, 0.15);
}

.action-box.resolved {
  background: linear-gradient(135deg, rgba(5, 223, 114, 0.12), rgba(0, 240, 255, 0.07));
  border-color: rgba(5, 223, 114, 0.4);
  box-shadow: 0 0 20px rgba(5, 223, 114, 0.15);
}

.action-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--crimson-danger);
}

.action-box.resolved .action-header {
  color: var(--emerald-safe);
}

.action-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-close-loop {
  background: linear-gradient(90deg, #ff2a5f, #ff6b8b);
  border: none;
  color: white;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(255, 42, 95, 0.4);
  transition: all 0.2s ease;
}

.btn-close-loop:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 42, 95, 0.6);
}

.btn-close-loop.resolved {
  background: linear-gradient(90deg, #05df72, #00f0ff);
  box-shadow: 0 3px 12px rgba(5, 223, 114, 0.3);
  cursor: default;
  transform: none;
}

/* Audit Chain */
.evidence-chain {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.evidence-step {
  display: flex;
  gap: 0.7rem;
  position: relative;
  padding-left: 0.4rem;
}

.evidence-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 17px;
  top: 22px;
  bottom: -8px;
  width: 2px;
  background: var(--border-subtle);
}

.step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  z-index: 2;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.step-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}

.step-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.comparison-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 900px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.2);
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.comp-column {
  background: rgba(13, 20, 38, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comp-column.clinloop {
  border-color: rgba(0, 240, 255, 0.45);
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.08) 0%, rgba(13, 20, 38, 0.75) 100%);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.1);
}

.comp-header {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.comp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.84rem;
}

.comp-list li {
  display: flex;
  gap: 0.5rem;
  line-height: 1.4;
}

/* Animations */
@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 223, 114, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 10px rgba(5, 223, 114, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 223, 114, 0); }
}

@keyframes dash-flow {
  from { stroke-dashoffset: 40; }
  to { stroke-dashoffset: 0; }
}

.hyperedge-open {
  stroke: var(--crimson-danger);
  stroke-dasharray: 8 6;
  animation: dash-flow 1.5s infinite linear;
}

.hyperedge-closed {
  stroke: var(--emerald-safe);
  stroke-width: 3.5px;
  filter: drop-shadow(0 0 8px rgba(5, 223, 114, 0.7));
}

/* ==========================================================================
   BioMCP (Biomedical Model Context Protocol) Styles
   ========================================================================== */
.btn-biomcp-highlight {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(0, 240, 255, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: var(--text-main);
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.5rem;
}

.btn-biomcp-highlight:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(0, 240, 255, 0.25));
  border-color: var(--cyan-neon);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.35);
}

.biomcp-status-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 800;
  background: rgba(0, 240, 255, 0.2);
  color: var(--cyan-neon);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.4);
  letter-spacing: 0.05em;
}

.biomcp-badge-btn {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #e2e8f0;
  border-radius: 9999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.biomcp-badge-btn:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: var(--cyan-neon);
  color: var(--text-main);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
  transform: translateY(-1px);
}

.biomcp-modal-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.15rem;
  margin-top: 1.1rem;
}

@media (max-width: 900px) {
  .biomcp-modal-grid {
    grid-template-columns: 1fr;
  }
}

.biomcp-column {
  background: rgba(6, 11, 22, 0.75);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.biomcp-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.6rem;
}

.biomcp-tag-cyan {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--cyan-neon);
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.biomcp-grade-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--emerald-safe);
  background: rgba(5, 223, 114, 0.12);
  border: 1px solid rgba(5, 223, 114, 0.35);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.biomcp-stream-box {
  background: rgba(2, 5, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.85rem;
  overflow-x: auto;
  max-height: 380px;
}

.biomcp-stream-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}

.biomcp-json-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #38bdf8;
  line-height: 1.45;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.biomcp-security-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: #94a3b8;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.biomcp-dossier-card {
  background: rgba(13, 20, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
}

.biomcp-link-chip {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--cyan-neon);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.biomcp-link-chip:hover {
  background: rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.biomcp-param-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.biomcp-param-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.biomcp-param-label {
  font-size: 0.66rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.biomcp-param-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ==========================================================================
   NOBLE MEDICAL EXTENSIONS: Mode Switcher, Counterfactual, OMOP/FHIR, Outreach
   ========================================================================== */

/* Mode Switcher Navigation Tabs */
.stage-view-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(6, 11, 24, 0.85);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.5rem;
  margin-bottom: -0.2rem;
}

.stage-tab-btn {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.55rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.stage-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.stage-tab-btn.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--text-main);
  box-shadow: 0 0 14px var(--cyan-glow);
}

.stage-tab-btn svg {
  stroke: var(--text-dim);
  transition: stroke 0.2s ease;
}

.stage-tab-btn.active svg {
  stroke: var(--cyan-neon);
}

.tab-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.tab-pill-success {
  background: rgba(5, 223, 114, 0.15);
  border: 1px solid rgba(5, 223, 114, 0.35);
  color: var(--emerald-safe);
}

.tab-pill-info {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--cyan-neon);
}

/* Stage View Container Panels */
.stage-view-panel {
  flex: 1;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 0;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
}

.stage-view-panel.hidden {
  display: none !important;
}

/* Counterfactual Causal Explorer */
.cf-container {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.cf-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cf-condition-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan-neon);
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.3rem;
}

.cf-hero-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.cf-hero-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Counterfactual Grand Metrics Ribbon */
.cf-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.cf-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  position: relative;
  overflow: hidden;
}

.cf-metric-card.highlight {
  border-color: rgba(5, 223, 114, 0.35);
  background: linear-gradient(135deg, var(--emerald-glow) 0%, var(--bg-card) 100%);
}

.cf-metric-card.liability {
  border-color: rgba(255, 42, 95, 0.3);
  background: linear-gradient(135deg, var(--crimson-glow) 0%, var(--bg-card) 100%);
}

.cf-metric-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.cf-metric-value {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.cf-metric-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Side-by-side Dual Trajectory Paths */
.cf-tracks-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.cf-track {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cf-track-neglected {
  border-color: rgba(255, 42, 95, 0.35);
  box-shadow: inset 0 0 20px rgba(255, 42, 95, 0.06);
}

.cf-track-intervened {
  border-color: rgba(5, 223, 114, 0.35);
  box-shadow: inset 0 0 20px rgba(5, 223, 114, 0.06);
}

.cf-track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cf-track-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cf-timeline-steps {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.cf-step {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  transition: all 0.2s ease;
}

.cf-step:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card);
}

.cf-step-time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan-neon);
  min-width: 58px;
  padding-top: 0.1rem;
}

.cf-step-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cf-step-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cf-step-state {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.cf-step-stage {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.stage-danger {
  background: rgba(255, 42, 95, 0.15);
  color: var(--crimson-danger);
  border: 1px solid rgba(255, 42, 95, 0.3);
}

.stage-success {
  background: rgba(5, 223, 114, 0.15);
  color: var(--emerald-safe);
  border: 1px solid rgba(5, 223, 114, 0.3);
}

.cf-step-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.cf-step-meta {
  display: flex;
  gap: 0.8rem;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* Evidence Rationale Callout */
.cf-evidence-callout {
  background: rgba(13, 22, 45, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* OMOP-CDM & FHIR Standards View */
.standards-container {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.standards-hero-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.standards-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.standard-badge {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
}

.standard-badge-omop {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.standard-badge-fhir {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: var(--cyan-neon);
}

.standard-badge-mtl {
  background: rgba(5, 223, 114, 0.15);
  border: 1px solid rgba(5, 223, 114, 0.4);
  color: var(--emerald-safe);
}

.standards-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.standards-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.standards-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.standards-card-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.omop-property-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.omop-prop-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.omop-prop-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

.omop-prop-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.fhir-code-viewer {
  background: rgba(2, 5, 10, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 6px;
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #38bdf8;
  line-height: 1.45;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.mtl-verification-card {
  background: var(--bg-card);
  border: 1px solid rgba(5, 223, 114, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mtl-formula-box {
  background: rgba(2, 5, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan-neon);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Patient Outreach Simulator Modal & Phone Mockup */
.phone-modal-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 0.5rem;
}

.phone-device {
  width: 340px;
  height: 640px;
  background: #000;
  border-radius: 42px;
  border: 10px solid #1e293b;
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.15), 0 25px 50px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-notch {
  width: 130px;
  height: 22px;
  background: #1e293b;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 10;
}

.phone-camera {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0f172a;
  border: 1px solid #334155;
}

.phone-speaker {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #334155;
}

.phone-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 1.4rem 0.2rem 1.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.phone-screen-content {
  flex: 1;
  background: #b2c7d9; /* KakaoTalk signature chat background */
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

.phone-chat-header {
  background: #a0b4c5;
  padding: 0.65rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.phone-chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #003087; /* Ajou Blue */
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.phone-chat-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.phone-message-area {
  flex: 1;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.kakao-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kakao-card-top {
  background: #fee500; /* KakaoTalk Yellow */
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 800;
  color: #181600;
}

.kakao-card-body {
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.5;
}

.kakao-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: #0f172a;
}

.kakao-jargon-box {
  background: #f8fafc;
  border-left: 3px solid #003087;
  padding: 0.5rem 0.7rem;
  font-size: 0.72rem;
  border-radius: 4px;
}

.kakao-booking-btn {
  background: #fee500;
  border: none;
  border-top: 1px solid #f1d700;
  color: #181600;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.75rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.kakao-booking-btn:hover {
  background: #ffd600;
}

.kakao-booking-btn.confirmed {
  background: #05df72;
  color: var(--text-main);
  border-color: #05df72;
}

.outreach-meta-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 480px;
}

.btn-outreach {
  background: #fef08a !important;
  border: 1.5px solid #ca8a04 !important;
  color: #713f12 !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(202, 138, 4, 0.2) !important;
}

.btn-outreach:hover {
  background: #fde047 !important;
  border-color: #a16207 !important;
  color: #451a03 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(202, 138, 4, 0.35) !important;
}

body.dark-theme .btn-outreach {
  background: rgba(234, 179, 8, 0.18) !important;
  border-color: #facc15 !important;
  color: #fef08a !important;
  font-weight: 800 !important;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.25) !important;
}

body.dark-theme .btn-outreach:hover {
  background: rgba(234, 179, 8, 0.3) !important;
  border-color: #fde047 !important;
  color: #ffffff !important;
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.45) !important;
}



/* ==========================================================================
   User-Friendly Simple Clinical Summary View
   ========================================================================== */
.summary-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.summary-hero-left {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.summary-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-pill {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
}

.badge-urgent {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.badge-safe {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

/* 3 Questions Grid */
.summary-questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.summary-q-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.summary-q-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.q-icon {
  font-size: 1.25rem;
}

.q-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.q-body {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.q-body strong {
  color: var(--text-main);
}

/* Comparison Section */
.summary-comparison-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.comparison-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.delta-highlight {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
}

.comparison-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.comparison-card {
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.neg-card {
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.pos-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.comp-badge {
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.4rem;
}

.comp-badge-danger {
  color: #b91c1c;
}

.comp-badge-success {
  color: #15803d;
}

.comp-metric-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
}

.comp-metric-value {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-heading);
}

.comp-metric-value.danger {
  color: #e11d48;
}

.comp-metric-value.success {
  color: #059669;
}

.comp-note {
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* Actions Section */
.summary-actions-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.summary-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.summary-action-btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.btn-outreach-highlight {
  background: #fef9c3;
  border: 1.5px solid #fde047;
}

.btn-outreach-highlight:hover {
  background: #fef08a;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-order-highlight {
  background: #e0f2fe;
  border: 1.5px solid #7dd3fc;
}

.btn-order-highlight:hover {
  background: #bae6fd;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.summary-action-btn .btn-icon {
  font-size: 1.8rem;
}

.summary-action-btn .btn-text-block {
  flex: 1;
}

.summary-action-btn .btn-main-label {
  font-size: 0.96rem;
  font-weight: 800;
  color: #0f172a;
}

.summary-action-btn .btn-sub-label {
  font-size: 0.76rem;
  color: #475569;
  margin-top: 0.2rem;
  line-height: 1.4;
}

.summary-action-btn .btn-arrow {
  font-size: 1.1rem;
  color: var(--text-dim);
  font-weight: 700;
}


/* Light Theme Strict Contrast & Hierarchy Overrides */
body {
  background: var(--bg-deep);
  color: var(--text-main);
}

.brand-title {
  color: var(--text-main);
}

.brand-subtitle {
  color: var(--text-muted);
}

.cockpit-triage-panel {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
}

.cockpit-center-stage {
  background: var(--bg-deep);
}

.cockpit-action-panel {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
}

.stage-view-tabs {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.stage-tab-btn {
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.stage-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-deep);
}

.stage-tab-btn.active {
  color: #0d9488;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-bottom: 2px solid #0d9488;
  box-shadow: var(--shadow-sm);
}

.case-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.case-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.case-card.active {
  background: #f0fdfa;
  border-color: #0d9488;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
}

.case-title {
  color: var(--text-main);
  font-weight: 700;
}

.case-meta {
  color: var(--text-muted);
}

.filter-btn.active {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.btn-secondary:hover {
  background: var(--bg-deep);
  border-color: var(--text-muted);
}

.comparison-modal {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

.panel-heading {
  color: var(--text-main);
}

.search-input {
  color: var(--text-main);
}

.search-input::placeholder {
  color: var(--text-dim);
}

/* ==========================================================================
   Segmented Theme Switcher Control
   ========================================================================== */
.theme-segmented-control {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 2px;
  gap: 2px;
}

body.dark-theme .theme-segmented-control {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-card);
}

.theme-opt-btn {
  background: transparent;
  border: none;
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
}

.theme-opt-btn:hover {
  color: var(--text-main);
}

.theme-opt-btn.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
  font-weight: 700;
}

body.dark-theme .theme-opt-btn.active {
  background: rgba(0, 240, 255, 0.2);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

/* Header Clock Badge */
.cockpit-clock-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #475569;
  background: #f1f5f9;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

body.dark-theme .cockpit-clock-badge {
  color: #94a3b8;
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

/* Collapsible AI Math Accordion */
.collapsible-ai-math {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}

.math-summary-toggle {
  padding: 0.55rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
  background: var(--bg-deep);
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.math-summary-toggle:hover {
  color: var(--cyan-neon);
}

.collapsible-ai-math[open] .math-summary-toggle {
  border-bottom-color: var(--border-subtle);
  color: var(--cyan-neon);
}

.collapsible-ai-math[open] .toggle-arrow {
  transform: rotate(180deg);
}

.toggle-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.math-summary-toggle::-webkit-details-marker {
  display: none;
}

/* Enhanced Patient Triage Card in Column 1 */
.case-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.case-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card);
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.case-card.active {
  background: #f0fdfa;
  border-color: #0284c7;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.12);
}

body.dark-theme .case-card.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: var(--cyan-neon);
  box-shadow: 0 0 20px var(--cyan-glow);
}

.case-card.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #0284c7, #7c3aed);
}

.pt-name-strong {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pt-dept-badge {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.25rem;
}

/* Modal Inner Boxes */
.modal-inner-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  color: var(--text-main);
}

body.dark-theme .modal-inner-box {
  background: rgba(13, 20, 38, 0.7);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

/* Dark Theme Overrides for Summary View */
body.dark-theme .summary-hero-card {
  background: rgba(11, 18, 34, 0.88);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .summary-avatar {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
}

body.dark-theme .summary-q-card {
  background: rgba(11, 18, 34, 0.88);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .summary-comparison-container {
  background: rgba(11, 18, 34, 0.88);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .summary-actions-container {
  background: rgba(11, 18, 34, 0.88);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .neg-card {
  background: rgba(225, 29, 72, 0.12);
  border-color: rgba(225, 29, 72, 0.35);
}

body.dark-theme .pos-card {
  background: rgba(5, 150, 105, 0.12);
  border-color: rgba(5, 150, 105, 0.35);
}

body.dark-theme .btn-outreach-highlight {
  background: rgba(254, 229, 0, 0.15);
  border-color: rgba(254, 229, 0, 0.4);
}

body.dark-theme .btn-outreach-highlight:hover {
  background: rgba(254, 229, 0, 0.22);
}

body.dark-theme .btn-order-highlight {
  background: rgba(2, 132, 199, 0.18);
  border-color: rgba(2, 132, 199, 0.4);
}

body.dark-theme .btn-order-highlight:hover {
  background: rgba(2, 132, 199, 0.26);
}

body.dark-theme .summary-action-btn .btn-main-label {
  color: var(--text-main);
}

body.dark-theme .summary-action-btn .btn-sub-label {
  color: #94a3b8;
}

body.dark-theme .comp-note {
  color: #cbd5e1;
}

/* ==========================================================================
   Prominent Theme Pill & Floating Theme Dock (100% Unmissable)
   ========================================================================== */
.prominent-theme-pill {
  margin-left: 1.25rem;
  padding: 3px;
  background: #e2e8f0;
  border: 1.5px solid #cbd5e1;
  border-radius: 9999px;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

body.dark-theme .prominent-theme-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.prominent-theme-pill .theme-opt-btn {
  padding: 0.4rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 9999px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s ease;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.35rem;
}

.prominent-theme-pill .theme-opt-btn:hover {
  color: var(--text-main);
}

.prominent-theme-pill .theme-opt-btn.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

body.dark-theme .prominent-theme-pill .theme-opt-btn.active {
  background: #00f0ff;
  color: #03060c;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.5);
}

/* Floating Bottom-Right Theme Switch Dock */
.floating-theme-switch-dock {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  background: var(--bg-surface);
  border: 2px solid var(--border-cyan);
  border-radius: 9999px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
}

.float-dock-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  padding: 0 0.4rem 0 0.6rem;
}

.dock-theme-btn {
  border: none;
  border-radius: 9999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s ease;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.35rem;
}

.dock-theme-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

body.dark-theme .dock-theme-btn.active {
  background: #00f0ff;
  color: #03060c;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

/* System Purpose & Quick Guide Banner */
.system-guide-banner {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0fdfa 100%);
  border: 1.5px solid #bae6fd;
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.06);
}

body.dark-theme .system-guide-banner {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15) 0%, rgba(5, 150, 105, 0.1) 100%);
  border-color: rgba(0, 240, 255, 0.25);
}

.guide-banner-icon {
  font-size: 2.2rem;
  line-height: 1;
  padding-top: 0.15rem;
}

.guide-banner-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0369a1;
  margin-bottom: 0.35rem;
}

body.dark-theme .guide-banner-title {
  color: #38bdf8;
}

.guide-banner-desc {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.55;
}

body.dark-theme .guide-banner-desc {
  color: #cbd5e1;
}

.guide-quick-instructions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
}

.guide-step {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-weight: 700;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

body.dark-theme .guide-step {
  background: rgba(11, 18, 34, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.guide-arrow {
  color: #0284c7;
  font-weight: 800;
  font-size: 0.85rem;
}

body.dark-theme .guide-arrow {
  color: #00f0ff;
}

/* ==========================================================================
   Language Segmented Control (KO / EN)
   ========================================================================== */
.prominent-lang-pill {
  margin-left: 0.65rem;
  padding: 3px;
  background: #e2e8f0;
  border: 1.5px solid #cbd5e1;
  border-radius: 9999px;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

body.dark-theme .prominent-lang-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.prominent-lang-pill .lang-opt-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 9999px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s ease;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-body);
}

.prominent-lang-pill .lang-opt-btn:hover {
  color: var(--text-main);
}

.prominent-lang-pill .lang-opt-btn.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

body.dark-theme .prominent-lang-pill .lang-opt-btn.active {
  background: #00f0ff;
  color: #03060c;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.5);
}

/* Floating Dock Multi-Control Segment */
.dock-segment {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dock-divider {
  width: 1px;
  height: 18px;
  background: var(--border-card);
  margin: 0 4px;
}

.dock-lang-btn {
  border: none;
  border-radius: 9999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s ease;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-body);
}

.dock-lang-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

body.dark-theme .dock-lang-btn.active {
  background: #00f0ff;
  color: #03060c;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

/* ==========================================================================
   API Key Management Button & Modal Styles
   ========================================================================== */
.btn-api-highlight {
  background: #ede9fe !important;
  border: 1.5px solid #8b5cf6 !important;
  color: #5b21b6 !important;
  font-weight: 700 !important;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
  transition: all 0.2s ease;
}

.btn-api-highlight:hover {
  background: #ddd6fe !important;
  border-color: #7c3aed !important;
  color: #4c1d95 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25);
}

body.dark-theme .btn-api-highlight {
  background: rgba(139, 92, 246, 0.18) !important;
  border-color: rgba(167, 139, 250, 0.5) !important;
  color: #c4b5fd !important;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.25);
}

body.dark-theme .btn-api-highlight:hover {
  background: rgba(139, 92, 246, 0.3) !important;
  border-color: #c4b5fd !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.45);
}

.api-status-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  background: #7c3aed;
  color: #ffffff;
  letter-spacing: 0.04em;
}

body.dark-theme .api-status-pill {
  background: #a78bfa;
  color: #0f172a;
}

/* API Key Modal Specifics */
.api-key-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.api-key-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 1rem;
  transition: all 0.2s ease;
}

.api-key-item:focus-within {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.api-key-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.api-key-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.api-key-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.6rem;
}

.api-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.api-key-input {
  flex: 1;
  background: var(--bg-page);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.api-key-input:focus {
  border-color: #8b5cf6;
}

.api-test-btn {
  padding: 0.55rem 0.95rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

body.dark-theme .api-test-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
}

.api-test-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

body.dark-theme .api-test-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.api-test-btn.testing {
  opacity: 0.7;
  cursor: wait;
}

.api-feedback-msg {
  font-size: 0.74rem;
  margin-top: 0.4rem;
  display: none;
}

.api-feedback-msg.success {
  display: block;
  color: var(--emerald-safe);
  font-weight: 600;
}

.api-feedback-msg.error {
  display: block;
  color: var(--crimson-danger);
  font-weight: 600;
}

/* ===================================================================
   🛡️ PRIVACY SHIELD — 8-Layer Protection Panel Styles
   =================================================================== */

/* Hero Banner */
.privacy-hero-banner {
  display: flex; align-items: flex-start; gap: 1.2rem;
  background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(6,182,212,0.08));
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 16px; padding: 1.2rem 1.5rem; margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.privacy-hero-icon { font-size: 2.4rem; flex-shrink: 0; }
.privacy-hero-text { flex: 1; min-width: 200px; }
.privacy-hero-title { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 800; color: #10b981; margin: 0 0 0.3rem; }
.privacy-hero-sub { font-size: 0.82rem; color: var(--text-muted); margin: 0; line-height: 1.5; }
.privacy-compliance-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.prv-badge { font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: 20px; border: 1px solid; }
.prv-badge-green { background: rgba(16,185,129,0.15); color: #10b981; border-color: rgba(16,185,129,0.4); }
.prv-badge-blue  { background: rgba(6,182,212,0.15);  color: #06b6d4; border-color: rgba(6,182,212,0.4); }
.prv-badge-purple{ background: rgba(139,92,246,0.15); color: #8b5cf6; border-color: rgba(139,92,246,0.4); }
.prv-badge-gold  { background: rgba(245,158,11,0.15); color: #f59e0b; border-color: rgba(245,158,11,0.4); }

/* Live PHI Firewall Demo */
.privacy-firewall-demo {
  background: var(--bg-card); border: 1px solid rgba(239,68,68,0.3);
  border-radius: 14px; padding: 1.2rem; margin-bottom: 1.2rem;
}
.firewall-demo-header { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.firewall-demo-icon { font-size: 1.5rem; }
.firewall-demo-title { font-family: var(--font-heading); font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.firewall-demo-sub { font-size: 0.76rem; color: var(--text-muted); }
.firewall-live-badge { margin-left: auto; font-size: 0.72rem; font-weight: 700; color: #10b981; background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); border-radius: 20px; padding: 0.2rem 0.6rem; animation: pulse 1.8s infinite; }
.firewall-io-grid { display: grid; grid-template-columns: 1fr 80px 1fr; gap: 0.8rem; align-items: start; }
@media (max-width: 700px) { .firewall-io-grid { grid-template-columns: 1fr; } }
.firewall-io-label { display: block; font-size: 0.72rem; font-weight: 700; margin-bottom: 0.4rem; }
.firewall-label-danger { color: #ef4444; }
.firewall-label-safe { color: #10b981; }
.firewall-textarea { width: 100%; box-sizing: border-box; border-radius: 10px; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.5; }
.firewall-input-area { height: 120px; background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.25); color: var(--text-main); padding: 0.6rem; resize: vertical; outline: none; }
.firewall-input-area:focus { border-color: rgba(239,68,68,0.5); }
.firewall-output-area { min-height: 120px; background: rgba(16,185,129,0.06); border: 1px solid rgba(16,185,129,0.25); color: #86efac; padding: 0.6rem; white-space: pre-wrap; word-break: break-word; }
.firewall-input-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 0.4rem; }
.phi-count { font-size: 0.72rem; color: #f59e0b; font-weight: 600; }
.firewall-sample-btn { font-size: 0.7rem; background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); color: #f59e0b; border-radius: 6px; padding: 0.2rem 0.6rem; cursor: pointer; }
.firewall-sample-btn:hover { background: rgba(245,158,11,0.25); }
.firewall-arrow-col { display: flex; align-items: center; justify-content: center; }
.firewall-arrow-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.firewall-shield-anim { font-size: 1.8rem; transition: transform 0.3s; }
.firewall-shield-anim.active { animation: shieldPulse 0.5s ease; }
.firewall-arrow { font-size: 1.4rem; color: #10b981; font-weight: 900; }
.firewall-stats { font-size: 0.68rem; color: var(--text-muted); text-align: center; }
.fstat { margin: 0.1rem 0; }
@keyframes shieldPulse { 0%{transform:scale(1)} 50%{transform:scale(1.3)} 100%{transform:scale(1)} }

/* 8-Layer Grid */
.privacy-layers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem; margin-bottom: 1.2rem;
}
.prv-layer-card {
  background: var(--bg-card);
  border-radius: 14px; padding: 1.1rem;
  border: 1px solid var(--border-subtle);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.prv-layer-card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.prv-status-active  { border-color: rgba(16,185,129,0.3); background: linear-gradient(135deg, var(--bg-card), rgba(16,185,129,0.05)); }
.prv-status-roadmap { border-color: rgba(245,158,11,0.3); background: linear-gradient(135deg, var(--bg-card), rgba(245,158,11,0.04)); }
.prv-status-future  { border-color: rgba(139,92,246,0.3); background: linear-gradient(135deg, var(--bg-card), rgba(139,92,246,0.04)); }
.prv-layer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.prv-layer-num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); font-weight: 700; }
.prv-layer-status-badge { font-size: 0.65rem; font-weight: 700; padding: 0.18rem 0.5rem; border-radius: 20px; border: 1px solid; }
.prv-badge-active  { background: rgba(16,185,129,0.15); color: #10b981; border-color: rgba(16,185,129,0.4); }
.prv-badge-roadmap { background: rgba(245,158,11,0.15); color: #f59e0b; border-color: rgba(245,158,11,0.4); }
.prv-badge-future  { background: rgba(139,92,246,0.15); color: #8b5cf6; border-color: rgba(139,92,246,0.4); }
.prv-layer-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.prv-layer-title { font-family: var(--font-heading); font-size: 0.92rem; font-weight: 800; color: var(--text-main); margin: 0 0 0.4rem; }
.prv-layer-desc { font-size: 0.76rem; color: var(--text-muted); line-height: 1.55; margin: 0 0 0.7rem; }
.prv-layer-tech { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.6rem; }
.tech-tag { font-size: 0.64rem; font-weight: 600; background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.25); color: #a5b4fc; border-radius: 6px; padding: 0.15rem 0.4rem; }
.prv-layer-metric { font-size: 0.7rem; color: var(--text-dim); display: flex; align-items: center; gap: 0.4rem; background: var(--bg-surface); border-radius: 8px; padding: 0.3rem 0.5rem; }
.metric-icon { font-size: 0.8rem; }

/* Federated Learning Diagram */
.prv-federated-diagram { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; margin-bottom: 0.6rem; }
.fed-node { font-size: 0.68rem; background: rgba(6,182,212,0.12); border: 1px solid rgba(6,182,212,0.3); color: #06b6d4; border-radius: 8px; padding: 0.2rem 0.4rem; }
.fed-center { font-size: 0.65rem; background: rgba(16,185,129,0.12); border: 1px dashed rgba(16,185,129,0.4); color: #10b981; border-radius: 8px; padding: 0.2rem 0.4rem; width: 100%; text-align: center; }

/* Differential Privacy Demo */
.prv-dp-demo { background: var(--bg-surface); border-radius: 8px; padding: 0.5rem; margin-bottom: 0.6rem; }
.dp-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.2rem 0; font-size: 0.72rem; flex-wrap: wrap; }
.dp-label { color: var(--text-muted); min-width: 80px; }
.dp-val { font-family: var(--font-mono); font-weight: 700; }
.dp-danger { color: #ef4444; }
.dp-safe { color: #10b981; }
.dp-note { color: var(--text-dim); font-size: 0.65rem; }

/* PHI Vault Demo */
.prv-vault-demo { background: var(--bg-surface); border-radius: 8px; padding: 0.5rem; margin-bottom: 0.6rem; }
.vault-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.25rem 0; font-size: 0.72rem; flex-wrap: wrap; }
.vault-before { font-family: var(--font-mono); color: #ef4444; text-decoration: line-through; }
.vault-arrow { color: var(--text-dim); }
.vault-after { font-family: var(--font-mono); color: #10b981; font-weight: 700; }

/* Privacy Score Bar */
.privacy-score-bar {
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(6,182,212,0.08));
  border: 1px solid rgba(16,185,129,0.25); border-radius: 14px;
  padding: 1rem 1.4rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.pscore-title { font-family: var(--font-heading); font-size: 0.88rem; font-weight: 800; color: var(--text-main); }
.pscore-items { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.pscore-item { display: flex; align-items: center; gap: 0.3rem; font-size: 0.76rem; color: var(--text-muted); }
.pscore-icon { font-size: 0.9rem; }
.pscore-total { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.pscore-score { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 900; color: #10b981; }
.pscore-label { font-size: 0.75rem; color: var(--text-muted); max-width: 80px; line-height: 1.3; }

/* ── DP Formula + Slider ── */
.dp-formula {
  font-family: var(--font-mono); font-size: 0.65rem; color: #8b5cf6;
  background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.2);
  border-radius: 6px; padding: 0.3rem 0.5rem; margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}
.dp-slider-row {
  display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem;
}

/* ── Global Audit Trail Panel ── */
.privacy-audit-trail {
  background: var(--bg-card); border: 1px solid rgba(99,102,241,0.25);
  border-radius: 14px; padding: 1rem; margin-bottom: 1.2rem;
}
.audit-trail-header {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 0.75rem; flex-wrap: wrap;
}
.audit-trail-title { font-family: var(--font-heading); font-size: 0.88rem; font-weight: 700; color: var(--text-main); }
.audit-trail-sub { font-size: 0.72rem; color: var(--text-muted); }
.audit-export-btn {
  margin-left: auto; font-size: 0.7rem; font-weight: 700;
  background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3);
  color: #a5b4fc; border-radius: 8px; padding: 0.3rem 0.7rem; cursor: pointer;
}
.audit-export-btn:hover { background: rgba(99,102,241,0.25); }
.audit-log-entries {
  max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.3rem;
}
.audit-entry {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  font-size: 0.7rem; background: var(--bg-surface); border-radius: 6px; padding: 0.3rem 0.5rem;
  border-left: 3px solid;
}
.audit-entry-system  { border-color: rgba(16,185,129,0.5); }
.audit-entry-kakao   { border-color: rgba(254,229,0,0.5); }
.audit-entry-order   { border-color: rgba(99,102,241,0.5); }
.audit-entry-model   { border-color: rgba(6,182,212,0.5); }
.audit-entry-warning { border-color: rgba(239,68,68,0.5); }
.audit-ts { font-family: var(--font-mono); color: var(--text-dim); min-width: 80px; font-size: 0.65rem; }
.audit-engine { font-weight: 700; color: #a5b4fc; min-width: 90px; }
.audit-action { flex: 1; color: var(--text-muted); }
.audit-phi-badge { font-size: 0.62rem; font-weight: 700; background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #10b981; border-radius: 4px; padding: 0.1rem 0.35rem; }

/* ── Hippocratic Oath Banner (inside Nobility Modal) ── */
.hippocratic-oath-banner {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(99,102,241,0.06));
  border: 1px solid rgba(16,185,129,0.25); border-radius: 12px;
  padding: 1rem 1.2rem; margin-bottom: 1rem; position: relative; overflow: hidden;
}
.hippocratic-oath-text {
  font-style: italic; font-size: 0.78rem; color: #94a3b8; line-height: 1.7;
  position: relative; z-index: 1;
}
.hippocratic-oath-attr {
  font-size: 0.68rem; color: var(--text-dim); margin-top: 0.5rem; font-style: normal;
}
