/* ============================================================================
   ANATOMICA // Bioluminescent Surgical Holo-Atlas Design System
   Dark obsidian theater + Netter anatomical neon accents + Flow Overdrive FX
   ============================================================================ */

:root {
  --bg-deep: #050a14;
  --bg-surface: #0b1324;
  --bg-card: rgba(13, 22, 40, 0.78);
  --bg-card-solid: #0f192d;
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-bright: rgba(56, 189, 248, 0.36);

  --text-main: #f1f5f9;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;

  --cyan: #00e5ff;
  --sky: #38bdf8;
  --emerald: #10f59b;
  --amber: #ffbe0b;
  --crimson: #ff3b5c;
  --violet: #c084fc;
  --orange: #fb923c;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 12px 36px rgba(0, 0, 0, 0.45);
  --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  background-image:
    radial-gradient(circle at 12% 10%, rgba(0, 229, 255, 0.09), transparent 42%),
    radial-gradient(circle at 88% 16%, rgba(192, 132, 252, 0.09), transparent 38%),
    radial-gradient(circle at 50% 92%, rgba(255, 59, 92, 0.07), transparent 46%);
  background-attachment: fixed;
  transition: box-shadow 0.45s ease;
}

/* Synapse Fever Overdrive Aura */
body.fever-mode::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 900;
  box-shadow: inset 0 0 68px rgba(255, 190, 11, 0.24), inset 0 0 18px rgba(0, 229, 255, 0.26);
  animation: feverPulse 1.3s ease-in-out infinite;
}

@keyframes feverPulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 950;
}

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

.app-shell.fx-shake {
  animation: shakeScreen 0.3s cubic-bezier(.36,.07,.19,.97);
}

@keyframes shakeScreen {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(calc(var(--shake-px, 5px) * -1), 2px, 0); }
  40% { transform: translate3d(var(--shake-px, 5px), -2px, 0); }
  60% { transform: translate3d(calc(var(--shake-px, 5px) * -0.7), 1px, 0); }
  80% { transform: translate3d(calc(var(--shake-px, 5px) * 0.6), -1px, 0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.6); }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.28); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(56, 189, 248, 0.5); }

/* ============================================================================
   TOPBAR & HUD
   ============================================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 9px 14px;
  width: 100%;
  max-width: 100vw;
  background: rgba(6, 11, 20, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.brand-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: transform 0.15s;
}
.brand-btn:hover { transform: scale(1.02); }
.brand-logo {
  font-size: 24px;
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.6));
}
.brand-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.1;
}
.brand-text strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.2px;
  background: linear-gradient(90deg, #00e5ff, #10f59b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text span {
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.8px;
}

.hud-ecg-pill {
  background: #060b14;
  border: 1px solid rgba(16, 245, 155, 0.28);
  border-radius: 8px;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  box-shadow: inset 0 0 12px rgba(16, 245, 155, 0.08);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(15, 23, 42, 0.72);
  padding: 3px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  justify-content: center;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 11.8px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.nav-item:hover {
  color: #fff;
  background: rgba(56, 189, 248, 0.12);
}
.nav-item.active {
  color: #060b14;
  background: linear-gradient(135deg, var(--cyan), #38bdf8);
  font-weight: 700;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.36);
}
.nav-item.nav-olympic.active {
  background: linear-gradient(135deg, #ffbe0b, #fb923c);
  box-shadow: 0 0 18px rgba(255, 190, 11, 0.4);
}

.hud-rank-mini {
  min-width: 144px;
  max-width: 185px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 5px 9px;
}
.hrm-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-soft);
  margin-bottom: 4px;
  white-space: nowrap;
}
.hrm-top span {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 112px;
}
.hrm-top strong { color: var(--amber); font-family: var(--font-mono); }
.hrm-bar {
  height: 4px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 99px;
  overflow: hidden;
}
#hud-rank-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
  transition: width 0.35s ease;
}

.hud-stat-chip {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 190, 11, 0.28);
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 9px;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.hud-stat-chip.emerald {
  border-color: rgba(16, 245, 155, 0.3);
  color: var(--emerald);
}

.hud-icon-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 9px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s;
}
.hud-icon-btn:hover { border-color: var(--cyan); color: #fff; }
.hud-icon-btn.active { border-color: var(--cyan); color: var(--cyan); background: rgba(0, 229, 255, 0.12); }
.hud-icon-btn.muted { opacity: 0.55; }

/* Bilingual VI | EN Segmented Toggle Pill */
.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: rgba(6, 11, 20, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.36);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.lang-switch-btn:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.28);
}
.lang-seg {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all 0.16s ease;
}
.lang-seg.on {
  background: linear-gradient(135deg, var(--cyan), #38bdf8);
  color: #050a14;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
}

/* ============================================================================
   COMMON GLASS PANELS, BUTTONS, BADGES
   ============================================================================ */
.main-view {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 22px 44px;
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--sky);
  background: rgba(15, 23, 42, 0.72);
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:hover:not(:disabled) { transform: translateY(-1.5px); }
.btn:active:not(:disabled) { transform: translateY(0); }

.btn-lg { font-size: 14.5px; padding: 13px 22px; border-radius: 13px; }
.btn-sm { font-size: 12px; padding: 6px 12px; border-radius: 8px; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, #00e5ff, #0284c7);
  color: #04101f;
  box-shadow: 0 6px 22px rgba(0, 229, 255, 0.3);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 28px rgba(0, 229, 255, 0.48); }

.btn-emerald {
  background: linear-gradient(135deg, #10f59b, #059669);
  color: #031910;
  box-shadow: 0 6px 20px rgba(16, 245, 155, 0.28);
}

.btn-amber {
  background: linear-gradient(135deg, #ffbe0b, #ea580c);
  color: #1c0f02;
  box-shadow: 0 6px 20px rgba(255, 190, 11, 0.28);
}

.btn-crimson {
  background: linear-gradient(135deg, #ff3b5c, #be123c);
  color: #fff;
  box-shadow: 0 6px 22px rgba(255, 59, 92, 0.35);
}

.btn-outline {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.32);
  color: var(--text-main);
}
.btn-outline:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }

.btn-crimson-outline {
  background: rgba(255, 59, 92, 0.08);
  border-color: rgba(255, 59, 92, 0.45);
  color: #fda4af;
}
.btn-crimson-outline:hover { background: rgba(255, 59, 92, 0.2); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: #fff; background: rgba(148, 163, 184, 0.14); }

.glow-cta {
  animation: ctaPulse 2.8s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 6px 22px rgba(0, 229, 255, 0.32); }
  50% { box-shadow: 0 8px 34px rgba(0, 229, 255, 0.62); }
}

.icon-mini-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(6, 11, 20, 0.85);
  color: var(--text-soft);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-mini-btn:hover { border-color: var(--cyan); color: var(--cyan); }

.text-emerald { color: var(--emerald); }
.text-crimson { color: var(--crimson); }
.latin-muted { color: var(--sky); font-style: italic; font-size: 0.9em; }

/* ============================================================================
   DASHBOARD VIEW
   ============================================================================ */
.dashboard-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dash-hero {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 24px;
  padding: 28px;
  background: linear-gradient(135deg, rgba(13, 25, 48, 0.92), rgba(7, 14, 28, 0.94));
  border-color: rgba(0, 229, 255, 0.24);
  position: relative;
  overflow: hidden;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 1.4px;
  margin-bottom: 10px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 35px);
  font-weight: 800;
  line-height: 1.18;
}
.gradient-text {
  background: linear-gradient(90deg, #00e5ff, #10f59b, #ffbe0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-desc {
  margin: 0 0 22px;
  color: var(--text-soft);
  font-size: 14.5px;
  max-width: 660px;
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-rank-card {
  background: rgba(6, 11, 20, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  justify-content: center;
}
.hr-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hr-badge {
  font-size: 36px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 14px;
}
.hr-level { font-family: var(--font-mono); font-size: 11px; color: var(--amber); font-weight: 700; }
.hr-title { font-size: 17px; font-weight: 800; }
.hr-bar-track {
  height: 8px;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 99px;
  overflow: hidden;
}
.hr-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--emerald), var(--amber));
  transition: width 0.4s ease;
}
.hr-sub { font-size: 12px; color: var(--text-muted); }

.hero-mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}
.hero-mini-metrics strong { display: block; font-size: 16px; font-family: var(--font-mono); color: #fff; }
.hero-mini-metrics span { font-size: 10.5px; color: var(--text-muted); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.section-head h2 { margin: 0; font-size: 19px; font-weight: 800; }
.section-head span { font-size: 13px; color: var(--text-muted); }

.modes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.mode-card {
  text-align: left;
  padding: 18px 20px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: all 0.2s ease;
  border-top: 3px solid var(--m-color, var(--cyan));
}
.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--m-color);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), 0 0 24px color-mix(in srgb, var(--m-color) 22%, transparent);
}
.mc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.mc-icon { font-size: 28px; }
.mc-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--m-color);
  background: rgba(6, 11, 20, 0.72);
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--m-color) 42%, transparent);
}
.mode-card h3 { margin: 0 0 6px; font-size: 16.5px; font-weight: 800; }
.mode-card p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.48; }

.dash-analytics-row {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
}
.radar-panel, .quests-panel { padding: 20px; }
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-title-row h3 { margin: 0; font-size: 15.5px; font-weight: 800; }
.radar-wrap { display: flex; justify-content: center; }
.radar-svg { width: 100%; max-width: 330px; height: auto; }

.quests-list { display: flex; flex-direction: column; gap: 10px; }
.quest-item {
  background: rgba(6, 11, 20, 0.58);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 10px 13px;
}
.quest-item.done { border-color: rgba(16, 245, 155, 0.45); background: rgba(16, 245, 155, 0.06); }
.qi-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.qi-reward { color: var(--amber); font-family: var(--font-mono); font-size: 12px; }
.qi-bar { height: 6px; background: rgba(148, 163, 184, 0.16); border-radius: 99px; overflow: hidden; }
.qi-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--emerald)); transition: width 0.35s; }
.qi-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.badge-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 9px 6px;
  border-radius: 10px;
  background: rgba(6, 11, 20, 0.56);
  border: 1px solid var(--border-subtle);
}
.badge-tile.unlocked {
  border-color: rgba(255, 190, 11, 0.55);
  background: rgba(255, 190, 11, 0.09);
}
.badge-tile.locked { opacity: 0.42; filter: grayscale(0.8); }
.bt-icon { font-size: 20px; }
.bt-name { font-size: 10.5px; font-weight: 600; line-height: 1.25; }

.systems-mastery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.sys-card {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.18s, border-color 0.18s;
}
.sys-card:hover { transform: translateY(-3px); border-color: var(--sys-color); }
.sc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sc-icon { font-size: 22px; }
.sc-pct { font-family: var(--font-mono); font-size: 13px; font-weight: 800; color: var(--sys-color); }
.sys-card h4 { margin: 0; font-size: 14px; font-weight: 800; line-height: 1.3; }
.sc-desc { margin: 0; font-size: 11.5px; color: var(--text-muted); flex: 1; line-height: 1.4; }
.sc-bar { height: 5px; background: rgba(148, 163, 184, 0.16); border-radius: 99px; overflow: hidden; }
.sc-bar-fill { height: 100%; border-radius: 99px; transition: width 0.35s; }
.sc-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.sc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 2px; }

/* ============================================================================
   HOLO-ATLAS EXPLORER MODE
   ============================================================================ */
.atlas-view { display: flex; flex-direction: column; gap: 14px; }

.atlas-toolbar {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  position: relative;
  z-index: 30;
}

.atlas-search-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
  display: flex;
  align-items: center;
}
.search-icon { position: absolute; left: 12px; opacity: 0.7; }
.atlas-search-input {
  width: 100%;
  background: rgba(6, 11, 20, 0.85);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 34px 9px 36px;
  border-radius: 10px;
  outline: none;
}
.atlas-search-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.14); }
.clear-search-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
}
.atlas-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #0b1324;
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.7);
  max-height: 330px;
  overflow-y: auto;
  z-index: 60;
}
.search-hit-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
  font-family: inherit;
}
.search-hit-item:hover { background: rgba(0, 229, 255, 0.12); }
.hit-icon { font-size: 18px; }
.hit-text strong { display: block; font-size: 13.5px; }
.hit-text span { font-size: 11.5px; color: var(--text-muted); }
.search-empty { padding: 14px; color: var(--text-muted); font-size: 13px; text-align: center; }

.atlas-toggles { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 9px;
  background: rgba(6, 11, 20, 0.75);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
}
.toggle-chip input { accent-color: var(--cyan); }
.toggle-chip.active { border-color: var(--cyan); color: var(--cyan); background: rgba(0, 229, 255, 0.08); }

.system-pills-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.sys-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 11px;
  background: rgba(13, 22, 40, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s;
}
.sys-pill:hover { border-color: var(--sys-color); color: #fff; }
.sys-pill.active {
  background: color-mix(in srgb, var(--sys-color) 18%, #070e1a);
  border-color: var(--sys-color);
  color: #fff;
  box-shadow: 0 0 16px color-mix(in srgb, var(--sys-color) 28%, transparent);
}
.sys-pill-pct { font-family: var(--font-mono); font-size: 11px; color: var(--sys-color); }

.atlas-workspace {
  display: grid;
  grid-template-columns: 1.32fr 1fr;
  gap: 16px;
  align-items: start;
}

.atlas-stage-card { padding: 16px; }
.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.stage-title { margin: 6px 0 2px; font-size: 19px; font-weight: 800; }
.stage-sub { margin: 0; font-size: 12.5px; color: var(--text-muted); }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(6, 11, 20, 0.72);
  padding: 5px 10px;
  border-radius: 8px;
}
.heatmap-legend span { display: inline-flex; align-items: center; gap: 4px; }
.heatmap-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Interactive SVG Stage */
.atlas-stage-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.24);
  background: #070e1a;
}
.atlas-svg-scroll {
  overflow: auto;
  max-height: 540px;
}
.atlas-svg {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.22s ease;
}
.atlas-zoom-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 12;
  display: flex;
  gap: 4px;
}
.atlas-tooltip {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  background: rgba(6, 11, 20, 0.96);
  border: 1px solid var(--cyan);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  max-width: 240px;
}
.tip-title { font-size: 12.5px; font-weight: 700; color: #fff; }
.tip-latin { font-size: 11px; color: var(--sky); font-style: italic; }
.tip-meta { font-size: 10.5px; font-weight: 600; margin-top: 2px; }

.atlas-pin { cursor: pointer; outline: none; }
.atlas-pin:hover .pin-core { filter: drop-shadow(0 0 8px #00e5ff); stroke-width: 3.2; }
.atlas-pin.pin-muted { opacity: 0.45; cursor: default; }
.pin-radar-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: radarPulse 1.5s ease-out infinite;
}
@keyframes radarPulse {
  0% { transform: scale(0.75); opacity: 0.95; }
  100% { transform: scale(1.42); opacity: 0; }
}

.atlas-pin-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.pin-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(6, 11, 20, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.14s;
}
.pin-chip:hover { border-color: var(--tier-color); color: #fff; }
.pin-chip.active {
  border-color: var(--tier-color);
  background: color-mix(in srgb, var(--tier-color) 16%, #070e1a);
  color: #fff;
}
.pin-chip-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--tier-color);
  color: #050a14;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Holo-Inspector Drawer */
.atlas-inspector {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.inspector-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.inspector-title { margin: 0 0 3px; font-size: 21px; font-weight: 800; line-height: 1.25; }
.inspector-latin { font-size: 13.5px; color: var(--sky); font-style: italic; margin-bottom: 6px; }
.inspector-alt-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  padding: 3px 9px;
  border-radius: 7px;
  margin-bottom: 10px;
}
.inspector-alt-lang span {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--cyan);
}
.mastery-bar-track {
  height: 6px;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 99px;
  overflow: hidden;
}
.mastery-bar-fill { height: 100%; transition: width 0.35s ease; }

.inspector-sections { display: flex; flex-direction: column; gap: 10px; }
.info-block {
  background: rgba(6, 11, 20, 0.62);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 11px 13px;
}
.info-block.compact { padding: 10px 11px; }
.info-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--sky);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.info-block p { margin: 0; font-size: 13px; color: var(--text-soft); line-height: 1.52; }
.info-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.info-block.clinical-pearl {
  border-color: rgba(255, 59, 92, 0.36);
  background: rgba(255, 59, 92, 0.08);
}
.info-block.clinical-pearl .info-label { color: #fda4af; }

.info-block.mnemonic-box {
  border-color: rgba(255, 190, 11, 0.42);
  background: rgba(255, 190, 11, 0.09);
}
.info-block.mnemonic-box .info-label { color: var(--amber); }
.info-block.mnemonic-box p { color: #fef3c7; font-weight: 600; }

.inspector-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ============================================================================
   SHARED SETUP SHELLS, ARENA HUD & SUMMARY CARDS
   ============================================================================ */
.mode-setup-shell { max-width: 1040px; margin: 0 auto; }
.setup-hero { padding: 28px; }
.setup-hero-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.setup-hero h1 { margin: 0 0 10px; font-size: 28px; font-weight: 800; }
.setup-hero > p { margin: 0 0 22px; color: var(--text-soft); font-size: 14.5px; }

.setup-grid { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; }
.setup-label { display: block; font-size: 13px; font-weight: 700; color: var(--sky); margin-bottom: 10px; }

.setup-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
}
.setup-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.select-chip {
  background: rgba(6, 11, 20, 0.72);
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 13px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.16s;
  text-align: left;
}
.select-chip:hover { border-color: var(--cyan); color: #fff; }
.select-chip.active {
  background: rgba(0, 229, 255, 0.16);
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.22);
}

.setup-cta-row { display: flex; justify-content: center; }

/* Arena HUD */
.arena-hud {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hud-left, .hud-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hud-station-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 9px;
  background: rgba(0, 229, 255, 0.16);
  color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.35);
}
.hud-hearts { font-size: 15px; letter-spacing: 2px; }

.hud-timer-wrap {
  flex: 1;
  min-width: 180px;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.timer-track {
  flex: 1;
  height: 9px;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 99px;
  overflow: hidden;
}
.timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
  transition: width 0.9s linear;
}
.timer-fill.urgent { background: linear-gradient(90deg, #ff3b5c, #fb923c); }
.timer-num { font-family: var(--font-mono); font-size: 14px; font-weight: 800; min-width: 34px; }
.timer-num.urgent { color: var(--crimson); animation: pulseFast 0.6s infinite; }

@keyframes pulseFast {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.16); }
}

.combo-pill {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(255, 190, 11, 0.12);
  border: 1px solid rgba(255, 190, 11, 0.38);
  color: var(--amber);
}
.combo-pill.fever {
  background: linear-gradient(135deg, #ffbe0b, #ff3b5c);
  color: #060b14;
  border-color: #fff;
  box-shadow: 0 0 22px rgba(255, 190, 11, 0.65);
}

/* ============================================================================
   OSCE ARENA
   ============================================================================ */
.osce-body {
  display: grid;
  grid-template-columns: 1.38fr 1fr;
  gap: 16px;
  align-items: start;
}
.osce-map-panel { padding: 14px; }
.osce-side-panel { padding: 20px; display: flex; flex-direction: column; gap: 12px; }

.station-type-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  width: fit-content;
}
.station-type-tag.locate { background: rgba(0, 229, 255, 0.14); color: var(--cyan); border: 1px solid rgba(0, 229, 255, 0.4); }
.station-type-tag.identify { background: rgba(255, 59, 92, 0.16); color: #fda4af; border: 1px solid rgba(255, 59, 92, 0.45); }

.station-prompt-label { font-size: 13.5px; color: var(--text-soft); }
.station-target-name { margin: 0; font-size: 24px; font-weight: 800; color: #fff; line-height: 1.25; }
.station-target-latin { font-size: 14px; color: var(--sky); font-style: italic; }
.station-cat-chip { font-size: 12px; color: var(--text-muted); }

.hint-reveal-box {
  background: rgba(255, 190, 11, 0.1);
  border: 1px solid rgba(255, 190, 11, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #fef3c7;
}

.osce-options-list, .er-options-stack { display: flex; flex-direction: column; gap: 9px; }

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(6, 11, 20, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.option-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.1);
  transform: translateX(3px);
}
.option-btn.selected-exam {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.16);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.22);
}
.option-btn.correct {
  border-color: var(--emerald);
  background: rgba(16, 245, 155, 0.16);
  color: #fff;
}
.option-btn.wrong {
  border-color: var(--crimson);
  background: rgba(255, 59, 92, 0.18);
  color: #fecdd3;
}
.option-btn.dimmed { opacity: 0.45; }

.opt-key {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.16);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
}
.option-btn.correct .opt-key { background: var(--emerald); color: #041910; }
.option-btn.wrong .opt-key { background: var(--crimson); color: #fff; }
.opt-text strong { display: block; font-size: 13.5px; }
.opt-text span { font-size: 11.5px; color: var(--sky); font-style: italic; }

.post-answer-card {
  margin-top: 6px;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(16, 245, 155, 0.45);
  background: rgba(16, 245, 155, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-answer-card.is-wrong {
  border-color: rgba(255, 59, 92, 0.48);
  background: rgba(255, 59, 92, 0.09);
}
.pa-title { font-size: 15px; font-weight: 800; }
.pa-title small { color: var(--sky); font-weight: 500; font-style: italic; }
.pa-clinical, .pa-mnemonic { margin: 0; font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }
.pa-mnemonic { color: #fef3c7; }

/* ============================================================================
   SYNAPSE SPRINT MODE
   ============================================================================ */
.format-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.format-card {
  background: rgba(6, 11, 20, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all 0.16s;
}
.format-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.format-card.active {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.14);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
}
.fc-icon { font-size: 24px; }
.format-card strong { font-size: 14px; }
.format-card small { font-size: 11.5px; color: var(--text-muted); line-height: 1.38; }

.sprint-arena { max-width: 880px; margin: 0 auto; }
.hud-center-progress { flex: 1; min-width: 150px; display: flex; justify-content: center; }
.linear-progress { width: 100%; max-width: 340px; height: 8px; background: rgba(148, 163, 184, 0.18); border-radius: 99px; overflow: hidden; }
.linear-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--emerald)); transition: width 0.3s ease; }

.blitz-clock { font-family: var(--font-mono); font-size: 22px; font-weight: 800; color: var(--amber); }
.blitz-clock.urgent { color: var(--crimson); animation: pulseFast 0.55s infinite; }

.fever-meter-wrap {
  height: 4px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}
.fever-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--amber), var(--crimson));
  transition: width 0.28s ease;
}
.fever-meter-fill.active { box-shadow: 0 0 14px var(--amber); }

.sprint-card { padding: 26px; display: flex; flex-direction: column; gap: 18px; }
.sprint-card-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.sprint-type-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.12);
  padding: 4px 10px;
  border-radius: 99px;
}
.sprint-sub { font-size: 12.5px; color: var(--text-muted); }
.sprint-question { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.42; }

.sprint-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sprint-opt { padding: 14px 16px; }
.opt-label { font-weight: 600; line-height: 1.4; }

.sprint-feedback {
  border-radius: 12px;
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sprint-feedback.ok { background: rgba(16, 245, 155, 0.1); border: 1px solid rgba(16, 245, 155, 0.45); }
.sprint-feedback.bad { background: rgba(255, 59, 92, 0.1); border: 1px solid rgba(255, 59, 92, 0.45); }
.sf-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sprint-feedback p { margin: 0; font-size: 13.5px; color: var(--text-soft); line-height: 1.55; }
.sprint-kbd-hint { font-size: 12px; color: var(--text-muted); text-align: center; }
code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(148, 163, 184, 0.18);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--cyan);
}

/* ============================================================================
   CLINICAL ER MONITOR MODE
   ============================================================================ */
.clinical-arena { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

.er-monitor-bar {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-color: rgba(16, 245, 155, 0.35);
}
.er-monitor-bar.critical { border-color: rgba(255, 59, 92, 0.6); box-shadow: 0 0 24px rgba(255, 59, 92, 0.18); }
.er-patient-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.er-dept-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 59, 92, 0.18);
  color: #fda4af;
}
.er-case-num { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text-soft); }
.diff-stars { color: var(--amber); font-size: 13px; }

.er-telemetry {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #060b14;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 4px 10px;
}
.vital-box { text-align: center; min-width: 44px; }
.vital-box small { display: block; font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); }
.vital-box strong { font-family: var(--font-mono); font-size: 13px; }

.er-case-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.er-patient-header { display: flex; align-items: center; gap: 12px; }
.er-avatar {
  font-size: 28px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
}
.er-patient-name { font-size: 16.5px; font-weight: 800; }
.er-status-sub { font-size: 12.5px; color: var(--text-muted); }

.er-vignette-box {
  background: rgba(6, 11, 20, 0.72);
  border-left: 4px solid var(--sky);
  border-radius: 10px;
  padding: 15px 18px;
  font-size: 14.5px;
  color: #e2e8f0;
  line-height: 1.65;
}
.er-vignette-box.compact { font-size: 13.5px; padding: 12px 14px; }
.er-question { margin: 0; font-size: 17.5px; font-weight: 800; color: #fff; }

.er-mechanism-box {
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.er-mechanism-box.ok { background: rgba(16, 245, 155, 0.09); border: 1px solid rgba(16, 245, 155, 0.45); }
.er-mechanism-box.bad { background: rgba(255, 59, 92, 0.09); border: 1px solid rgba(255, 59, 92, 0.45); }
.er-mech-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.er-mechanism-box p { margin: 0; font-size: 14px; color: var(--text-soft); line-height: 1.6; }

/* ============================================================================
   MATCH MATRIX MODE
   ============================================================================ */
.deck-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.deck-card {
  padding: 16px;
  text-align: left;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 3px solid var(--deck-color);
  transition: all 0.18s;
}
.deck-card:hover { transform: translateY(-3px); border-color: var(--deck-color); }
.deck-top { display: flex; justify-content: space-between; align-items: center; }
.deck-icon { font-size: 24px; }
.deck-count { font-family: var(--font-mono); font-size: 11px; color: var(--deck-color); }
.deck-card h3 { margin: 0; font-size: 14.5px; font-weight: 800; }
.deck-card p { margin: 0; font-size: 12px; color: var(--text-muted); flex: 1; }
.deck-cta { font-size: 12px; font-weight: 700; color: var(--deck-color); }

.match-arena { max-width: 1060px; margin: 0 auto; }
.match-deck-title { font-size: 15px; }
.match-timer-badge { font-family: var(--font-mono); font-size: 13.5px; color: var(--sky); }
.match-board-wrap { padding: 20px; }
.match-instruction { font-size: 13.5px; color: var(--text-muted); text-align: center; margin-bottom: 18px; }

.match-board {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 84px;
}
.match-lines-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.match-col { display: flex; flex-direction: column; gap: 11px; position: relative; z-index: 3; }

.match-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(6, 11, 20, 0.85);
  border: 1.5px solid rgba(148, 163, 184, 0.24);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  min-height: 58px;
  transition: all 0.16s ease;
}
.match-node.right-node { flex-direction: row-reverse; text-align: left; }
.match-node:hover:not(:disabled) { border-color: var(--cyan); background: rgba(0, 229, 255, 0.09); }
.match-node.selected {
  border-color: var(--amber);
  background: rgba(255, 190, 11, 0.16);
  box-shadow: 0 0 18px rgba(255, 190, 11, 0.35);
}
.match-node.matched {
  border-color: var(--emerald);
  background: rgba(16, 245, 155, 0.12);
  color: #a7f3d0;
  cursor: default;
}
.match-node.wrong {
  border-color: var(--crimson);
  background: rgba(255, 59, 92, 0.22);
}
.node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.45);
  flex-shrink: 0;
}
.match-node.selected .node-dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.match-node.matched .node-dot { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }

/* ============================================================================
   OLYMPIC EXAM SIMULATOR MODE
   ============================================================================ */
.exam-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.exam-preset-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 3px solid var(--preset-color);
}
.ep-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid;
  width: fit-content;
}
.ep-head { display: flex; align-items: center; gap: 10px; }
.ep-icon { font-size: 28px; }
.ep-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.ep-desc { margin: 0; font-size: 13px; color: var(--text-muted); flex: 1; }
.ep-specs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text-soft); }
.ep-specs span { background: rgba(6, 11, 20, 0.72); padding: 4px 8px; border-radius: 7px; }

.exam-history-box {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}
.exam-history-box h4 { margin: 0 0 10px; font-size: 14.5px; }
.exam-history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.exam-hist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(6, 11, 20, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 13px;
}
.exam-hist-row strong { display: block; font-size: 13px; }
.exam-hist-row small { font-size: 11px; color: var(--text-muted); }
.exam-hist-score { font-family: var(--font-mono); font-size: 15px; font-weight: 800; text-align: right; }
.exam-hist-score span { display: block; font-size: 10.5px; opacity: 0.75; }
.exam-hist-score.high { color: var(--emerald); }
.exam-hist-score.mid { color: var(--amber); }
.exam-hist-score.low { color: var(--crimson); }

.exam-timer-pill {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--amber);
  background: rgba(255, 190, 11, 0.12);
  border: 1px solid rgba(255, 190, 11, 0.4);
  padding: 5px 12px;
  border-radius: 10px;
}
.exam-timer-pill.urgent { color: var(--crimson); border-color: var(--crimson); }

.exam-layout {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 16px;
  align-items: start;
}
.exam-main { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.exam-q-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.exam-q-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.42; }
.exam-svg-box { max-width: 580px; margin: 0 auto; width: 100%; }
.exam-nav-footer { display: flex; justify-content: space-between; gap: 10px; padding-top: 6px; }

.exam-palette { padding: 16px; position: sticky; top: 76px; }
.palette-title { font-size: 13px; font-weight: 800; margin-bottom: 12px; color: var(--sky); }
.palette-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pal-cell {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(6, 11, 20, 0.72);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.pal-cell.answered { background: rgba(16, 245, 155, 0.22); border-color: var(--emerald); color: #fff; }
.pal-cell.flagged { background: rgba(255, 190, 11, 0.25); border-color: var(--amber); color: #fef08a; }
.pal-cell.current { box-shadow: 0 0 0 2px var(--cyan); border-color: var(--cyan); color: #fff; }
.palette-legend { display: flex; justify-content: space-between; margin-top: 12px; font-size: 10.5px; color: var(--text-muted); }
.palette-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 4px; }
.leg-ans { background: var(--emerald); }
.leg-flag { background: var(--amber); }
.leg-cur { background: var(--cyan); }

/* Olympic Report */
.olympic-report { display: flex; flex-direction: column; gap: 18px; max-width: 1060px; margin: 0 auto; }
.report-hero { padding: 26px; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.report-score-ring {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 6px solid var(--emerald);
  background: rgba(6, 11, 20, 0.86);
  flex-shrink: 0;
}
.report-score-ring.gold { border-color: var(--amber); box-shadow: 0 0 28px rgba(255, 190, 11, 0.4); }
.report-score-ring.fail { border-color: var(--crimson); }
.rs-num { font-family: var(--font-mono); font-size: 34px; font-weight: 800; line-height: 1; }
.rs-sub { font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); margin-top: 4px; }
.report-medal { font-family: var(--font-mono); font-size: 13px; font-weight: 800; color: var(--amber); margin-bottom: 4px; }
.report-meta h2 { margin: 0 0 6px; font-size: 24px; }
.report-meta p { margin: 0 0 14px; color: var(--text-soft); }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.report-section { padding: 22px; }
.report-section h3 { margin: 0 0 14px; font-size: 17px; }
.diag-bars-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.diag-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.diag-track { height: 8px; background: rgba(148, 163, 184, 0.16); border-radius: 99px; overflow: hidden; }
.diag-fill { height: 100%; border-radius: 99px; }

.review-items-list { display: flex; flex-direction: column; gap: 10px; }
.review-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(6, 11, 20, 0.72);
  border-left: 4px solid var(--emerald);
}
.review-card.bad { border-left-color: var(--crimson); }
.rc-head { display: flex; justify-content: space-between; font-size: 12px; font-family: var(--font-mono); margin-bottom: 6px; color: var(--text-muted); }
.rc-vignette { margin: 0 0 6px; font-size: 12.5px; color: var(--text-muted); font-style: italic; }
.rc-prompt { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.rc-ans { font-size: 13px; display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.rc-exp { font-size: 12.5px; color: #cbd5e1; }

/* ============================================================================
   SUMMARY & MISSED REVIEW
   ============================================================================ */
.summary-shell { max-width: 780px; margin: 16px auto; }
.summary-card { padding: 30px; text-align: center; display: flex; flex-direction: column; gap: 16px; }
.summary-trophy { font-size: 54px; line-height: 1; }
.summary-card h2 { margin: 0; font-size: 25px; font-weight: 800; }
.summary-grade { font-size: 14px; color: var(--cyan); font-weight: 600; }

.summary-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat-pill {
  background: rgba(6, 11, 20, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 10px;
}
.stat-val { display: block; font-family: var(--font-mono); font-size: 22px; font-weight: 800; }
.stat-lbl { font-size: 11.5px; color: var(--text-muted); }

.missed-review-box { text-align: left; background: rgba(255, 59, 92, 0.08); border: 1px solid rgba(255, 59, 92, 0.35); border-radius: 12px; padding: 14px 16px; }
.missed-review-box h4 { margin: 0 0 10px; font-size: 13.5px; color: #fda4af; }
.missed-list { display: flex; flex-direction: column; gap: 8px; }
.missed-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: rgba(6, 11, 20, 0.65);
  padding: 10px 12px;
  border-radius: 9px;
}
.missed-mnemonic { font-size: 12px; color: #fef3c7; margin-top: 3px; }
.perfect-banner {
  background: rgba(16, 245, 155, 0.12);
  border: 1px solid rgba(16, 245, 155, 0.45);
  color: var(--emerald);
  padding: 12px;
  border-radius: 11px;
  font-weight: 700;
}
.summary-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* ============================================================================
   MODAL
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(4, 8, 18, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal-card { width: 100%; max-width: 440px; padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-desc { font-size: 13px; color: var(--text-muted); margin: 0 0 18px; }
.modal-actions-stack { display: flex; flex-direction: column; gap: 10px; }
.file-import-btn { text-align: center; }

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */
@media (max-width: 1520px) {
  .hud-ecg-pill { display: none; }
}

@media (max-width: 1320px) {
  .hud-rank-mini { display: none; }
}

@media (max-width: 1160px) {
  .primary-nav {
    order: 3;
    width: 100%;
  }
}

@media (max-width: 1200px) {
  .systems-mastery-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-hero { grid-template-columns: 1fr; }
  .atlas-workspace, .osce-body { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .modes-grid, .exam-presets-grid { grid-template-columns: repeat(2, 1fr); }
  .format-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-analytics-row, .exam-layout { grid-template-columns: 1fr; }
  .systems-mastery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .topbar { padding: 8px 10px; }
  .main-view { padding: 14px 12px 36px; }
  .modes-grid, .exam-presets-grid, .sprint-options-grid, .diag-bars-grid, .systems-mastery-grid, .info-grid-2 {
    grid-template-columns: 1fr;
  }
  .badges-grid { grid-template-columns: repeat(2, 1fr); }
  .match-board { gap: 20px; }
}
