/* ==========================================================================
   CODECOACH • GOTHAM NOIR DESIGN SYSTEM
   Batman-Inspired Dark Knight Architecture for C# & .NET 9
   ========================================================================== */

/* --- 1. Design Tokens & Theme Palettes --- */
:root, [data-theme="dark"] {
  /* Gotham Dark Palette */
  --bg-canvas: #07080b;            /* Near-black Gotham night */
  --bg-surface: #12141a;           /* Armor charcoal */
  --bg-elevated: #1c2028;          /* Reinforced steel */
  --bg-elevated-hover: #242934;
  --bg-code: #0b0d12;              /* Recessed code well */
  --bg-glass: rgba(18, 20, 26, 0.82);

  --border-subtle: #191c24;
  --border-steel: #2a303c;         /* Steel armor border */
  --border-highlight: #3d4656;

  /* Signal Yellow (Bat-Signal Spotlight) */
  --accent-yellow: #f5c518;
  --accent-yellow-hover: #ffe66d;
  --accent-yellow-dim: rgba(245, 197, 24, 0.12);
  --accent-yellow-glow: rgba(245, 197, 24, 0.35);

  /* Cold Gray & Technical Text Hierarchy */
  --text-primary: #f1f3f7;         /* Crisp high contrast */
  --text-secondary: #c9ced6;       /* Cold gray body */
  --text-muted: #6b7280;           /* Muted technical detail */
  --text-dim: #4b5563;             /* De-emphasized tokens */

  /* Operational Signals */
  --status-success: #22c55e;
  --status-success-bg: rgba(34, 197, 94, 0.12);
  --status-error: #e11d48;         /* Gotham Crimson */
  --status-error-bg: rgba(225, 29, 72, 0.12);
  --status-warning: #f5c518;
  --status-warning-bg: rgba(245, 197, 24, 0.12);

  /* Typography */
  --font-display: 'Bebas Neue', 'Oswald', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', monospace;

  /* Angular Corner Radii */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;

  /* Spacing Scale (8pt Grid) */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;

  /* Angular Clip Paths (Clipped Armor Corners) */
  --clip-angular-sm: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  --clip-angular-md: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  --clip-badge: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- "Gotham Day" Light Theme --- */
[data-theme="light"] {
  --bg-canvas: #f0f3f8;
  --bg-surface: #ffffff;
  --bg-elevated: #e4e8f1;
  --bg-elevated-hover: #dbe0eb;
  --bg-code: #eaedf4;
  --bg-glass: rgba(255, 255, 255, 0.90);

  --border-subtle: #d2d8e4;
  --border-steel: #b0bac9;
  --border-highlight: #93a0b3;

  --accent-yellow: #d49b04;         /* High-contrast amber gold for light mode */
  --accent-yellow-hover: #b88602;
  --accent-yellow-dim: rgba(212, 155, 4, 0.12);
  --accent-yellow-glow: rgba(212, 155, 4, 0.25);

  --text-primary: #0a0d14;
  --text-secondary: #2b3342;
  --text-muted: #5e6b7e;
  --text-dim: #8b97a8;

  --status-success: #16a34a;
  --status-success-bg: rgba(22, 163, 74, 0.10);
  --status-error: #dc2626;
  --status-error-bg: rgba(220, 38, 38, 0.10);
  --status-warning: #d49b04;
  --status-warning-bg: rgba(212, 155, 4, 0.10);
}

/* --- 2. Base Reset & Layout --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-canvas);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Parallax Gotham Skyline Backdrop */
.gotham-skyline-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.skyline-layer-back, .skyline-layer-mid {
  position: absolute;
  bottom: 0;
  left: -5%;
  width: 110%;
  height: 48vh;
  transition: transform 0.1s ease-out;
  will-change: transform;
}

.skyline-layer-back svg, .skyline-layer-mid svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Drifting Gotham Fog / Mist */
.gotham-mist-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 28vh;
  background: radial-gradient(ellipse at 50% 100%, rgba(245, 197, 24, 0.04) 0%, rgba(18, 20, 26, 0.6) 45%, transparent 80%);
  animation: driftMist 45s linear infinite alternate;
  pointer-events: none;
}

@keyframes driftMist {
  0% { transform: translateX(0); }
  100% { transform: translateX(-40%); }
}

/* Throttled Lightning Flash Overlay */
#gothamLightningFlash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 9998;
}

/* Diagonal Slash Wipe Overlay for Tab Transitions */
#gothamSlashWipe {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #07080b;
  display: none;
  pointer-events: none;
  z-index: 9990;
}

/* App Shell Structure */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- 3. App Header & Bat-Emblem Wordmark --- */
.app-header {
  height: 56px;
  background-color: var(--bg-glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-steel);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Subtle Golden Underline Glow on Header */
.app-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 10%;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-yellow) 50%, transparent 100%);
  opacity: 0.5;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.brand-logo-bat {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 6px var(--accent-yellow-glow));
  transition: transform var(--transition-fast);
}

.brand-logo-bat:hover {
  transform: scale(1.08);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 1.5px;
  color: var(--text-primary);
  margin: 0;
  line-height: 1;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-yellow);
  background-color: var(--accent-yellow-dim);
  border: 1px solid rgba(245, 197, 24, 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.5px;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 6px;
}

.nav-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-elevated);
  border-color: var(--border-steel);
}

.nav-tab-btn.active {
  color: var(--bg-canvas);
  background-color: var(--accent-yellow);
  border-color: var(--accent-yellow);
  font-weight: 700;
  box-shadow: 0 0 12px var(--accent-yellow-glow);
}

/* Header Action Buttons (Utility Belt Style) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.streak-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-yellow);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-steel);
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  gap: 6px;
  clip-path: var(--clip-badge);
  transition: transform var(--transition-fast);
}

.streak-pill:hover {
  border-color: var(--accent-yellow);
  transform: scale(1.04);
}

.icon-btn {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-steel);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  background-color: var(--bg-elevated);
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
  box-shadow: 0 0 8px var(--accent-yellow-glow);
}

/* --- 4. Master-Detail Split Workspace --- */
.workspace-split {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 56px);
}

/* Left Curriculum Rail */
.curriculum-rail {
  width: 280px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-steel);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  z-index: 20;
}

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

.rail-header-title h3 {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin: 0;
}

.rail-calibrate-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-yellow);
  background-color: var(--accent-yellow-dim);
  border: 1px solid rgba(245, 197, 24, 0.4);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-fast);
}

.rail-calibrate-btn:hover {
  background-color: var(--accent-yellow);
  color: var(--bg-canvas);
}

.rail-tree-container {
  flex: 1;
  padding: var(--space-xs);
  overflow-y: auto;
}

.rail-level-group {
  margin-bottom: var(--space-sm);
}

.rail-level-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 8px;
  letter-spacing: 0.5px;
}

.rail-topic-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 3px;
  transition: var(--transition-fast);
}

.rail-topic-item:hover {
  background-color: var(--bg-elevated);
  border-color: var(--border-steel);
  color: var(--text-primary);
}

.rail-topic-item.active {
  background-color: var(--bg-elevated);
  border-left: 3px solid var(--accent-yellow);
  color: var(--text-primary);
  font-weight: 600;
}

.rail-topic-status-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.status-mastered { color: var(--status-success); background: var(--status-success-bg); }
.status-reviewing { color: var(--accent-yellow); background: var(--accent-yellow-dim); }
.status-learning { color: #38bdf8; background: rgba(56, 189, 248, 0.1); }
.status-new { color: var(--text-dim); background: rgba(255, 255, 255, 0.05); }

.rail-telemetry-footer {
  padding: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-canvas);
  font-family: var(--font-mono);
  font-size: 11px;
}

.mono-meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

/* Main Workspace Canvas */
.main-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

.view-section {
  display: none;
  padding: var(--space-md);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.view-section.active {
  display: block;
}

/* --- 5. Gotham Noir Typography & Section Headers --- */
.view-title {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 1.5px;
  color: var(--text-primary);
  margin-top: 2px;
  margin-bottom: 6px;
  line-height: 1.1;
}

.view-subtitle {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 680px;
}

.mono-step {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-yellow);
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 4px;
}

/* --- 6. Angular Buttons & Light Sweeps --- */
.btn-primary {
  background-color: var(--accent-yellow);
  color: #07080b;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  font-weight: 700;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  clip-path: var(--clip-angular-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: rotate(25deg);
  transition: left 0.5s ease-in-out;
}

.btn-primary:hover {
  background-color: var(--accent-yellow-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 16px var(--accent-yellow-glow);
}

.btn-primary:hover::after {
  left: 130%;
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-steel);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 1px;
  padding: 9px 20px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  clip-path: var(--clip-angular-sm);
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary:hover {
  background-color: var(--bg-elevated);
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

/* --- 7. Chat Console: REPL Terminal & Gotham Styling --- */
.chat-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-sm);
  clip-path: var(--clip-angular-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  min-height: 520px;
}

.chat-status-bar {
  background-color: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  background-color: var(--status-success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--status-success);
}

.chat-messages {
  flex: 1;
  padding: var(--space-md);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.message-row {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}

.message-row.user {
  align-self: flex-end;
  align-items: flex-end;
}

.message-row.assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.repl-speaker-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.speaker-assistant {
  color: var(--accent-yellow);
}

.speaker-user {
  color: var(--text-muted);
}

.message-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  line-height: 1.6;
}

.message-row.assistant .message-bubble {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-steel);
  border-left: 3px solid var(--accent-yellow);
  color: var(--text-primary);
  clip-path: var(--clip-angular-sm);
}

.message-row.user .message-bubble {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-steel);
  color: var(--text-primary);
  clip-path: var(--clip-angular-sm);
}

/* Detective Reasoning Matrix Drawer (<think> tags) */
.gotham-thought-drawer {
  background-color: rgba(7, 8, 11, 0.6);
  border: 1px dashed var(--border-steel);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.gotham-thought-drawer summary {
  cursor: pointer;
  color: var(--accent-yellow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
}

.gotham-thought-drawer summary::-webkit-details-marker {
  display: none;
}

.thought-badge {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.thought-toggle-hint {
  font-size: 10.5px;
  color: var(--text-muted);
}

.thought-content {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
}

/* GitHub-Flavored Markdown Tables in Chat, Quiz & Explanations */
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.75rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-steel);
  background: var(--bg-card);
}

.gotham-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.gotham-table th,
.gotham-table td {
  border: 1px solid rgba(245, 197, 24, 0.2);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.gotham-table th {
  background: rgba(245, 197, 24, 0.08);
  color: var(--accent-yellow, #f5c518);
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.gotham-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.gotham-table tr:hover td {
  background: rgba(245, 197, 24, 0.05);
}

/* Drill Calibration Progress Engine */
.drill-progress-container {
  max-width: 540px;
  margin: 18px auto 0;
  padding: 16px 20px;
  background: rgba(14, 16, 22, 0.7);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-sm);
}

.drill-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.drill-progress-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.drill-progress-percent {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--accent-yellow);
  text-shadow: 0 0 10px rgba(245, 197, 24, 0.35);
}

.drill-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-canvas);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-steel);
  position: relative;
}

.drill-progress-fill {
  height: 100%;
  width: 5%;
  background: linear-gradient(90deg, #d97706, var(--accent-yellow));
  box-shadow: 0 0 12px rgba(245, 197, 24, 0.6);
  border-radius: 4px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.drill-progress-checkpoint {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 10px;
  text-align: left;
  min-height: 18px;
}

/* Code Blocks in Chat */
.code-block-wrapper {
  margin: 14px 0;
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-xs);
  background-color: var(--bg-code);
  overflow: hidden;
}

.code-block-header {
  background-color: var(--bg-canvas);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.code-lang-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-yellow);
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-steel);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-fast);
}

.copy-btn:hover {
  color: var(--accent-yellow);
  border-color: var(--accent-yellow);
}

.inline-code {
  font-family: var(--font-mono);
  font-size: 13px;
  background-color: rgba(245, 197, 24, 0.08);
  color: var(--accent-yellow);
  border: 1px solid rgba(245, 197, 24, 0.2);
  padding: 2px 5px;
  border-radius: var(--radius-xs);
}

/* Bat-Flap Streaming Typing Indicator */
.streaming-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bat-flap {
  display: inline-block;
  animation: batFlap 0.7s infinite alternate ease-in-out;
}

.bat-flap.delayed {
  animation-delay: 0.25s;
}

@keyframes batFlap {
  0% { transform: scaleY(0.7) rotate(-10deg); }
  100% { transform: scaleY(1.3) rotate(10deg); }
}

/* Slash Command Pills */
.chat-controls-deck {
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--bg-canvas);
  border-top: 1px solid var(--border-subtle);
}

.slash-pills-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.slash-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-yellow);
  background-color: var(--accent-yellow-dim);
  border: 1px solid rgba(245, 197, 24, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.slash-pill:hover {
  background-color: var(--accent-yellow);
  color: var(--bg-canvas);
}

.chat-form {
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-steel);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  outline: none;
  transition: var(--transition-fast);
}

.chat-input:focus {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 10px var(--accent-yellow-glow);
}

/* --- 8. Active Drill Arena (Quiz Cards) --- */
.quiz-container {
  max-width: 820px;
  margin: 0 auto;
}

.quiz-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-sm);
  clip-path: var(--clip-angular-md);
  padding: var(--space-lg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.quiz-card:hover {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 20px var(--accent-yellow-glow);
}

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

.quiz-badge-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

.badge-topic { color: var(--accent-yellow); background: var(--accent-yellow-dim); border: 1px solid rgba(245, 197, 24, 0.3); }
.badge-type { color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border-steel); }
.badge-diff { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }

.quiz-progress-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.quiz-prompt {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.5;
}

.quiz-code-box {
  background-color: var(--bg-code);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-xs);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.quiz-code-box pre {
  padding: 14px;
  margin: 0 !important;
  font-family: var(--font-mono);
  font-size: 13.5px;
  overflow-x: auto;
}

/* MCQ Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: var(--space-sm);
}

.option-btn {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-steel);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  clip-path: var(--clip-angular-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  min-height: 48px;
  transition: var(--transition-fast);
}

.option-btn:hover:not(:disabled) {
  background-color: var(--bg-elevated-hover);
  border-color: var(--accent-yellow);
  transform: translateX(4px);
}

.option-btn.evaluating {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 14px var(--accent-yellow-glow);
  background-color: var(--accent-yellow-dim);
}

.option-btn.selected-correct {
  background-color: var(--status-success-bg);
  border-color: var(--status-success);
  color: #ffffff;
  font-weight: 600;
}

.option-btn.selected-wrong {
  background-color: var(--status-error-bg);
  border-color: var(--status-error);
  color: #ffffff;
  font-weight: 600;
}

.option-key-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-yellow);
  background-color: var(--accent-yellow-dim);
  border: 1px solid rgba(245, 197, 24, 0.3);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feedback-box {
  padding: 16px;
  border-radius: var(--radius-xs);
  margin: 18px 0;
  clip-path: var(--clip-angular-sm);
}

.feedback-box.correct {
  background-color: var(--status-success-bg);
  border: 1px solid var(--status-success);
}

.feedback-box.wrong {
  background-color: var(--status-error-bg);
  border: 1px solid var(--status-error);
}

.feedback-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.feedback-box.correct .feedback-title { color: var(--status-success); }
.feedback-box.wrong .feedback-title { color: var(--status-error); }

.feedback-explanation {
  font-size: 14px;
  line-height: 1.5;
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

.loading-bat-spinner {
  font-size: 42px;
  display: inline-block;
  animation: pulseBat 1.2s infinite alternate ease-in-out;
}

@keyframes pulseBat {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 12px var(--accent-yellow)); }
}

/* --- 9. Gotham Roadmap Map Node Architecture --- */
.gotham-zone-block {
  margin-bottom: var(--space-lg);
}

.level-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--accent-yellow);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-steel);
  padding-bottom: 6px;
}

.gotham-node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.gotham-map-node {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-xs);
  clip-path: var(--clip-angular-sm);
  padding: 16px;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.gotham-map-node.unlocked-node:hover {
  transform: translateY(-2px);
  border-color: var(--accent-yellow);
  box-shadow: 0 0 16px var(--accent-yellow-glow);
}

.gotham-map-node.locked-node {
  opacity: 0.55;
  background-color: rgba(18, 20, 26, 0.4);
}

.gotham-map-node.mastered-node {
  border-left: 3px solid var(--status-success);
}

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

.node-order-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.status-badge.mastered { color: var(--status-success); background: var(--status-success-bg); }
.status-badge.locked { color: var(--text-dim); }

.topic-title-text {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.topic-desc-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.topic-node-footer {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

.train-prompt-link {
  color: var(--accent-yellow);
  font-weight: 600;
}

/* --- 10. Dashboard & Telemetry Visualizations --- */
.telemetry-hero-strip {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.telemetry-primary-card, .telemetry-secondary-card, .telemetry-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-xs);
  clip-path: var(--clip-angular-sm);
  padding: var(--space-md);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.card-eyebrow {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--accent-yellow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.mastery-segmented-bar {
  display: flex;
  height: 14px;
  background-color: var(--bg-code);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border-steel);
}

.segment {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.segment-mastered { background-color: var(--status-success); }
.segment-reviewing { background-color: var(--accent-yellow); }
.segment-learning { background-color: #38bdf8; }
.segment-locked { background-color: var(--border-steel); }

.mastery-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

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

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-mastered { background: var(--status-success); }
.dot-reviewing { background: var(--accent-yellow); }
.dot-learning { background: #38bdf8; }
.dot-locked { background: var(--border-steel); }

.score-chart-container {
  display: flex;
  align-items: flex-end;
  height: 160px;
  gap: 10px;
  padding-top: 20px;
}

.system-status-footer {
  margin-top: 24px;
  padding: 12px 16px;
  background-color: var(--bg-code);
  border: 1px solid var(--border-steel);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* --- 11. Modals & Diagonal Slash Reveals --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(7, 8, 11, 0.82);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-md);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-sm);
  clip-path: var(--clip-angular-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  padding: var(--space-lg);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--accent-yellow);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.code-editor-area {
  width: 100%;
  background-color: var(--bg-code);
  border: 1px solid var(--border-steel);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 12px;
  border-radius: var(--radius-xs);
  outline: none;
  resize: vertical;
}

.code-editor-area:focus {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 10px var(--accent-yellow-glow);
}

/* --- 12. Intro Loader Bat-Signal Overlay --- */
#gothamIntroLoader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #07080b;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.signal-beam {
  position: absolute;
  bottom: 0;
  width: 320px;
  height: 70vh;
  background: linear-gradient(0deg, rgba(245, 197, 24, 0.4) 0%, rgba(245, 197, 24, 0.15) 60%, transparent 100%);
  clip-path: polygon(42% 100%, 58% 100%, 100% 0%, 0% 0%);
  pointer-events: none;
}

.signal-cloud-target {
  position: relative;
  width: 240px;
  height: 160px;
  background: radial-gradient(ellipse at center, rgba(245, 197, 24, 0.3) 0%, rgba(28, 32, 40, 0.8) 50%, transparent 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.signal-emblem-reveal {
  width: 130px;
  height: 130px;
  filter: drop-shadow(0 0 16px var(--accent-yellow));
}

.intro-tagline {
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 2px;
  color: var(--accent-yellow);
}

.skip-intro-btn {
  position: absolute;
  bottom: 32px;
  background: transparent;
  border: 1px solid var(--border-steel);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-fast);
}

.skip-intro-btn:hover {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

/* --- 13. Gotham Signal Toasts --- */
.gotham-toast {
  position: fixed;
  bottom: 72px;
  right: 20px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-steel);
  border-left: 4px solid var(--accent-yellow);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: var(--radius-xs);
  clip-path: var(--clip-angular-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.gotham-toast.toast-error {
  border-left-color: var(--status-error);
}

.gotham-toast.fade-out {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

@keyframes slideToastIn {
  0% { transform: translateX(60px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* --- 14. Responsive Layout & Mobile Bottom Navigation --- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  .curriculum-rail {
    position: fixed;
    top: 56px;
    left: -290px;
    width: 280px;
    height: calc(100vh - 56px);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.7);
  }

  .curriculum-rail.open {
    left: 0;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 54px;
    background-color: var(--bg-glass);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-steel);
    z-index: 100;
    align-items: center;
    justify-content: space-around;
  }

  .bottom-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    min-width: 48px;
    min-height: 44px;
    cursor: pointer;
  }

  .bottom-nav-btn.active {
    color: var(--accent-yellow);
    font-weight: 700;
  }

  .main-workspace {
    padding-bottom: 64px;
  }

  .telemetry-hero-strip {
    grid-template-columns: 1fr;
  }
}

/* Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .gotham-mist-layer, .bat-flap, .loading-bat-spinner {
    animation: none !important;
  }
}

/* ==========================================================================
   PHASE 1: PRACTICE ARENA STYLING (GOTHAM NOIR)
   ========================================================================== */

.practice-subtabs-deck {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.practice-subtab-btn {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-steel);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  clip-path: var(--clip-angular-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.practice-subtab-btn:hover {
  background-color: var(--bg-elevated);
  border-color: var(--accent-yellow);
  color: var(--text-primary);
}

.practice-subtab-btn.active {
  background-color: var(--accent-yellow);
  color: #07080b;
  border-color: var(--accent-yellow);
  font-weight: 700;
  box-shadow: 0 0 14px var(--accent-yellow-glow);
}

.practice-mode-panel {
  display: none;
}

.practice-mode-panel.active {
  display: block;
}

/* CodeMirror Gotham Theme Overrides */
.CodeMirror {
  font-family: var(--font-mono) !important;
  font-size: 13.5px !important;
  line-height: 1.55 !important;
  background-color: var(--bg-code) !important;
  color: var(--text-primary) !important;
}

.CodeMirror-gutters {
  background-color: var(--bg-canvas) !important;
  border-right: 1px solid var(--border-steel) !important;
}

.CodeMirror-linenumber {
  color: var(--text-dim) !important;
}

.CodeMirror-cursor {
  border-left: 2px solid var(--accent-yellow) !important;
}

/* Terminal Execution Wells */
.terminal-well {
  background-color: var(--bg-code);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-well-stderr {
  background-color: rgba(225, 29, 72, 0.08);
  border: 1px solid rgba(225, 29, 72, 0.3);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #f87171;
  empty-cells: hide;
}

.terminal-well-stderr:empty {
  display: none;
}

/* Bug Hunt Interactive Line Selector */
.bug-hunt-code-container {
  background-color: var(--bg-code);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-xs);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.bug-hunt-line-row {
  display: flex;
  align-items: center;
  padding: 2px 12px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  user-select: none;
}

.bug-hunt-line-row:hover {
  background-color: rgba(245, 197, 24, 0.08);
}

.bug-hunt-line-row.selected-target {
  background-color: rgba(225, 29, 72, 0.18);
  border-left: 3px solid var(--status-error);
}

.bug-hunt-line-num {
  width: 38px;
  color: var(--text-dim);
  text-align: right;
  padding-right: 14px;
  flex-shrink: 0;
}

.bug-hunt-line-code {
  flex: 1;
  color: var(--text-primary);
  white-space: pre;
}

.bug-hunt-target-flag {
  opacity: 0;
  margin-left: 8px;
  font-size: 12px;
  transition: opacity var(--transition-fast);
}

.bug-hunt-line-row.selected-target .bug-hunt-target-flag {
  opacity: 1;
}

/* 60s Predictor Timer Badge */
.predictor-timer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-surface);
  border: 1px solid var(--accent-yellow);
  color: var(--accent-yellow);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  box-shadow: 0 0 10px var(--accent-yellow-glow);
}

/* ==========================================================================
   PHASE 2: SMART LEARNING STYLES (GOTHAM NOIR)
   ========================================================================== */

/* 1. Concept Map Graph */
.concept-map-wrapper {
  position: relative;
  width: 100%;
  min-height: 600px;
  background: var(--bg-surface);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.concept-map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.concept-map-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
}

.concept-map-svg-canvas {
  width: 100%;
  min-height: 540px;
  display: block;
}

.concept-edge-path {
  fill: none;
  stroke: var(--border-highlight);
  stroke-width: 2px;
  stroke-dasharray: 4 4;
  transition: stroke var(--transition-normal), stroke-width var(--transition-normal);
}

.concept-edge-path.active {
  stroke: var(--accent-yellow);
  stroke-width: 2.5px;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 4px var(--accent-yellow-glow));
}

.concept-node-group {
  cursor: pointer;
  transition: transform var(--transition-normal);
}

.concept-node-group:hover {
  transform: translateY(-2px);
}

.concept-node-rect {
  fill: var(--bg-surface);
  stroke: var(--border-steel);
  stroke-width: 1.5px;
  rx: 4px;
  transition: stroke var(--transition-normal), fill var(--transition-normal);
}

.concept-node-group.status-mastered .concept-node-rect {
  stroke: var(--status-success);
  fill: rgba(34, 197, 94, 0.08);
}

.concept-node-group.status-reviewing .concept-node-rect {
  stroke: var(--accent-yellow);
  fill: rgba(245, 197, 24, 0.08);
}

.concept-node-group.status-learning .concept-node-rect {
  stroke: var(--border-highlight);
  fill: rgba(28, 32, 40, 0.9);
}

.concept-node-group.status-locked .concept-node-rect {
  stroke: var(--border-subtle);
  fill: #0c0e13;
  opacity: 0.65;
}

.concept-node-text-title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  fill: var(--text-primary);
}

.concept-node-text-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-muted);
}

/* 2. Concept Map Node Drawer / Popover */
.concept-drawer {
  position: absolute;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--accent-yellow);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  padding: var(--space-md);
  z-index: 20;
  transition: right var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.concept-drawer.open {
  right: 0;
}

/* 3. 3D Spaced Repetition Flashcard Flipper */
.flashcard-stage {
  perspective: 1200px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto 24px;
}

.flashcard-card {
  position: relative;
  width: 100%;
  min-height: 280px;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.flashcard-card.flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-sm);
  clip-path: var(--clip-angular-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.flashcard-back {
  transform: rotateY(180deg);
  border-color: var(--accent-yellow);
  background: #11141b;
}

.flashcard-rating-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.btn-sm2-again {
  background: rgba(225, 29, 72, 0.15);
  border: 1px solid var(--status-error);
  color: #ff4d6d;
}
.btn-sm2-again:hover {
  background: var(--status-error);
  color: #fff;
}

.btn-sm2-hard {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid #f97316;
  color: #fb923c;
}
.btn-sm2-hard:hover {
  background: #f97316;
  color: #fff;
}

.btn-sm2-good {
  background: var(--accent-yellow-dim);
  border: 1px solid var(--accent-yellow);
  color: var(--accent-yellow);
}
.btn-sm2-good:hover {
  background: var(--accent-yellow);
  color: #07080b;
}

.btn-sm2-easy {
  background: var(--status-success-bg);
  border: 1px solid var(--status-success);
  color: var(--status-success);
}
.btn-sm2-easy:hover {
  background: var(--status-success);
  color: #07080b;
}

/* 4. Personal Notes Grid */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.note-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-xs);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.note-card:hover {
  border-color: var(--accent-yellow);
  transform: translateY(-2px);
}

/* 5. Study Plan Timeline */
.studyplan-week-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-xs);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color var(--transition-normal);
}

.studyplan-week-card.current-active-week {
  border-left: 4px solid var(--accent-yellow);
  background: rgba(245, 197, 24, 0.03);
}

.studyplan-week-card.completed-week {
  border-left: 4px solid var(--status-success);
}

.studyplan-progress-track {
  height: 6px;
  background: var(--bg-canvas);
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0 14px;
}

.studyplan-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-yellow), #ffe66d);
  transition: width 0.4s ease;
}

/* 6. Explain Differently & Adaptive Badges */
.adaptive-diff-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  background: rgba(245, 197, 24, 0.1);
  border: 1px solid var(--accent-yellow);
  color: var(--accent-yellow);
}

.explain-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xs);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 50;
  min-width: 200px;
  padding: 4px;
}

.explain-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.explain-dropdown-item:hover {
  background: var(--accent-yellow);
  color: #07080b;
}

.alternate-explain-box {
  background: var(--bg-canvas);
  border: 1px solid var(--accent-yellow);
  border-radius: var(--radius-xs);
  padding: 14px;
  margin-top: 12px;
  animation: fadeIn 0.3s ease;
}


