/* ==========================================================================
   Neural Network Visualizer - Minimalist Design System
   ========================================================================== */

@font-face {
  font-family: "Geist Mono";
  src: url("./fonts/GeistMono-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Pixel Square";
  src: url("./fonts/GeistPixel-Square.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   Design Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Spacing Scale (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Colors - Dark Theme */
  --color-bg: #09090b;
  --color-bg-elevated: rgba(24, 24, 27, 0.92);
  --color-bg-hover: rgba(39, 39, 42, 0.8);

  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 255, 255, 0.15);
  --color-border-focus: rgba(59, 130, 246, 0.5);

  --color-text: rgba(255, 255, 255, 0.92);
  --color-text-secondary: rgba(255, 255, 255, 0.6);
  --color-text-muted: rgba(255, 255, 255, 0.4);

  --color-accent: #3b82f6;
  --color-accent-hover: #60a5fa;
  --color-success: #3b82f6;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;

  --text-xs: 0.6875rem;   /* 11px */
  --text-sm: 0.75rem;     /* 12px */
  --text-base: 0.8125rem; /* 13px */
  --text-lg: 0.9375rem;   /* 15px */

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);

  /* Z-Index Scale */
  --z-base: 1;
  --z-elevated: 10;
  --z-overlay: 100;
  --z-modal: 1000;

  /* Transitions */
  --transition-fast: 100ms ease;
  --transition-base: 150ms ease;
  --transition-slow: 250ms ease;

  /* Safe areas */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */

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

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

body {
  background: var(--color-bg);
  background-image:
    radial-gradient(ellipse at 25% 15%, rgba(40, 35, 28, 0.5) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 85%, rgba(28, 38, 30, 0.3) 0%, transparent 50%);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Three.js Canvas */
body > canvas {
  position: fixed !important;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: var(--z-base) !important;
}

/* FPS Overlay */
.fps-overlay {
  position: fixed;
  top: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-overlay);
  pointer-events: none;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.fps-overlay__value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   App Layout
   -------------------------------------------------------------------------- */

.app {
  position: fixed;
  inset: 0;
  z-index: var(--z-elevated);
  display: grid;
  grid-template-areas:
    "left . right"
    "bottom bottom bottom";
  grid-template-columns: auto 1fr 380px;
  grid-template-rows: 1fr auto;
  padding: var(--space-3);
  padding-bottom: calc(var(--space-3) + var(--safe-bottom));
  gap: var(--space-3);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */

.panel {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.panel--left {
  grid-area: left;
  align-self: stretch;
  justify-content: start;
  width: 220px;
}

.panel--right {
  grid-area: right;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-md);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.card__title {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Drawing Grid
   -------------------------------------------------------------------------- */

.grid-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  gap: 1px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: var(--space-1);
  position: relative;
  touch-action: none;
  user-select: none;
}

.grid-overlay {
  position: absolute;
  inset: var(--space-2);
  width: auto;
  height: auto;
  pointer-events: none;
  image-rendering: pixelated;
  border-radius: calc(var(--radius-md) - 2px);
  opacity: 0.55;
}

.grid-overlay[hidden] {
  display: none;
}

.grid-cell {
  aspect-ratio: 1;
  width: 5px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.04);
  transition: background var(--transition-fast);
}

.grid-cell.active {
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

/* Grid Interaction Row - contains grid and sample buttons */
.grid-interaction-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.grid-interaction-row .digit-button-column {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-1);
  padding: var(--space-2);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

/* Sample Buttons */
.sample-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-1);
  margin-top: var(--space-3);
  padding: var(--space-2);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.sample-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 32px;
  padding: 0 var(--space-2);
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sample-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--color-accent);
}

.sample-btn:active {
  transform: scale(0.96);
}

/* Digit buttons (MNIST mode) */
.digit-button-column {
  display: contents;
}

.digit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 32px;
  padding: 0 var(--space-2);
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.digit-button:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--color-accent);
}

.digit-button:active {
  transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   Predictions
   -------------------------------------------------------------------------- */

.card--predictions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.card--predictions .card__content {
  flex: 1;
  overflow-y: auto;
}

.prediction-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.prediction-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.prediction-compact-insight {
  margin-top: var(--space-1);
  padding-top: var(--space-1);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 10px;
  line-height: 1.2;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prediction-compact-insight__label {
  color: var(--color-text-muted);
}

.prediction-compact-insight__value {
  color: var(--color-text);
}

.prediction-bar-container {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.prediction-label {
  width: 52px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-align: right;
  flex-shrink: 0;
}

.prediction-bar-track {
  flex: 1;
  height: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.prediction-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1e40af, var(--color-accent));
  border-radius: 4px;
  transition: width 200ms ease;
}

.prediction-bar.highest {
  background: linear-gradient(90deg, #166534, var(--color-success));
}

.prediction-percentage {
  width: 42px;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  text-align: right;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Educational Panel (MNIST/Fashion modes)
   -------------------------------------------------------------------------- */

/* Collapsible Cards */
.collapsible .card__header {
  cursor: default;
}

.collapsible.collapsed .card__content {
  display: none;
}

.collapsible.collapsed {
  padding-bottom: 0;
}

.card__header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-collapse {
  width: 20px;
  height: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1;
}

.btn-collapse:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.collapse-icon {
  display: block;
  transition: transform var(--transition-fast);
}

.collapsed .collapse-icon {
  transform: rotate(0deg);
}

.collapsed .btn-collapse .collapse-icon::before {
  content: "+";
}

.card__content {
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 1000px; }
}

.card--education {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-hover) transparent;
  padding: var(--space-2);
}

.card--education::-webkit-scrollbar {
  width: 5px;
}

.card--education::-webkit-scrollbar-thumb {
  background: var(--color-border-hover);
  border-radius: 3px;
}

.btn-tour {
  padding: 4px 8px;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-tour:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

.btn-tour.active {
  background: #64748b;
}

.edu-content {
  margin-bottom: var(--space-2);
}

.edu-welcome {
  padding: var(--space-2);
  background: rgba(59, 130, 246, 0.1);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--color-accent);
}

.edu-text {
  font-size: 11px;
  color: var(--color-text);
  margin: 0;
  line-height: 1.4;
}

.edu-text + .edu-text {
  margin-top: var(--space-1);
}

.edu-realtime {
  margin-top: var(--space-2);
  padding: var(--space-2);
  background: rgba(59, 130, 246, 0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-accent);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.edu-realtime-text {
  font-size: var(--text-sm);
  color: var(--color-text);
  margin: 0;
}

.edu-details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  overflow: hidden;
}

.edu-details summary {
  padding: 6px 10px;
  background: var(--color-bg-hover);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition-fast);
}

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

.edu-details summary::before {
  content: "▶";
  font-size: 10px;
  transition: transform var(--transition-fast);
}

.edu-details[open] summary::before {
  transform: rotate(90deg);
}

.edu-details summary:hover {
  background: rgba(59, 130, 246, 0.1);
}

.edu-details-content {
  padding: 8px 10px;
  font-size: 10px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  background: var(--color-bg);
}

.edu-details-content p {
  margin: 0 0 6px 0;
}

.edu-details-content p:last-child {
  margin-bottom: 0;
}

.edu-list {
  margin: 6px 0;
  padding-left: 14px;
}

.edu-list li {
  margin-bottom: 3px;
}

.edu-tip {
  padding: 6px;
  background: rgba(251, 191, 36, 0.1);
  border-radius: var(--radius-sm);
  border-left: 2px solid #fbbf24;
  margin-top: 6px;
  font-size: 10px;
}

/* Color Legend */
.color-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
}

.legend-color {
  width: 24px;
  height: 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.legend-color--green {
  background: linear-gradient(90deg, #166534, #22c55e);
}

.legend-color--red {
  background: linear-gradient(90deg, #991b1b, #ef4444);
}

.legend-color--gray {
  background: linear-gradient(90deg, #374151, #6b7280);
}

.legend-color--blue {
  background: linear-gradient(90deg, #1e40af, #3b82f6);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Tour Highlight */
.tour-highlight {
  position: relative;
  z-index: 1000;
  animation: tourPulse 1.5s ease-in-out infinite;
}

@keyframes tourPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
}

.tour-tooltip {
  position: fixed;
  z-index: 1001;
  max-width: 300px;
  padding: var(--space-4);
  background: var(--color-bg-elevated);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: tooltipFadeIn 0.3s ease;
}

@keyframes tooltipFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.tour-tooltip__title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.tour-tooltip__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-3);
}

.tour-tooltip__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.tour-tooltip__step {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.tour-tooltip__btn {
  padding: var(--space-1) var(--space-3);
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tour-tooltip__btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.tour-tooltip__btn--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.tour-tooltip__btn--primary:hover {
  background: var(--color-accent-hover);
}

/* --------------------------------------------------------------------------
   Bottom Bar
   -------------------------------------------------------------------------- */

/* Bottom bar hidden - selector moved to card header */
.bottom-bar {
  display: none !important;
}

/* Inline selector in card header */
.card__header--with-select {
  gap: var(--space-2);
}

.select-inline {
  appearance: none;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(96, 165, 250, 0.15) 100%);
  border: 1.5px solid rgba(59, 130, 246, 0.6);
  border-radius: var(--radius-sm);
  padding: 5px 24px 5px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='rgba(59,130,246,0.9)' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  min-width: 90px;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.select-inline:hover {
  border-color: rgba(59, 130, 246, 0.8);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(96, 165, 250, 0.25) 100%);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.select-inline:focus {
  outline: none;
  border-color: var(--color-accent);
}

.select-inline option {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn-icon--small {
  width: 22px;
  height: 22px;
}

.bottom-bar__left,
.bottom-bar__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Select */
.select-minimal {
  appearance: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-6) var(--space-2) var(--space-3);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-2) center;
}

.select-minimal:hover {
  border-color: var(--color-border-hover);
}

.select-minimal:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.select-minimal option {
  background: var(--color-bg);
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.btn-icon:active {
  transform: scale(0.92);
}

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.btn-ghost:active {
  transform: scale(0.94);
}

.btn-ghost[aria-pressed="true"] {
  background: var(--color-bg-hover);
  border-color: var(--color-border);
  color: var(--color-text);
}

.toggle {
  width: 44px;
  height: 24px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.toggle[aria-checked="true"] {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.55);
}

.toggle[aria-checked="true"]::after {
  transform: translateX(20px);
  background: rgba(255, 255, 255, 0.92);
}

.toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-border-hover);
}

.toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* --------------------------------------------------------------------------
   Drawer (Settings)
   -------------------------------------------------------------------------- */

.drawer {
  position: fixed;
  bottom: calc(60px + var(--space-4) + var(--safe-bottom));
  right: var(--space-4);
  width: min(320px, calc(100vw - var(--space-8)));
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-overlay);
  animation: slideUp var(--transition-slow) ease;
  pointer-events: auto;
}

.drawer * {
  pointer-events: auto;
}

.drawer[hidden] {
  display: none;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.drawer__title {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
}

.drawer__content {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Settings */
.setting__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.setting__label {
  font-size: var(--text-sm);
  color: var(--color-text);
}

.setting__value {
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}

/* Slider */
.slider {
  width: 100%;
  height: 4px;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

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

.slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Modal (Info)
   -------------------------------------------------------------------------- */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  z-index: var(--z-modal);
  pointer-events: none;
}

.modal[open] {
  display: flex;
  max-height: 100%;
  background: transparent;
  border: none;
  padding: var(--space-4);
  align-items: center;
  justify-content: center;
  pointer-events: auto !important;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal__content {
  width: min(480px, 100%);
  max-height: 80vh;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn var(--transition-slow) ease;
  pointer-events: auto !important;
}

.modal__content * {
  pointer-events: auto;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  z-index: 10;
}

.modal__header .btn-icon {
  position: relative;
  z-index: 20;
  pointer-events: auto !important;
}

.modal__header .btn-icon svg {
  pointer-events: none;
}

.modal__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.modal__body {
  padding: var(--space-4);
  overflow-y: auto;
  max-height: calc(80vh - 120px);
}

.modal__description {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.modal__section {
  margin-bottom: var(--space-4);
}

.modal__section h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.modal__note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* Architecture Display */
.architecture {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
}

.arch-layer {
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg-hover);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
}

.arch-arrow {
  color: var(--color-text-muted);
}

/* Controls List */
.controls-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.controls-list li {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.controls-list kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text);
}

/* Modal Footer */
.modal__footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.link-external {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.link-external:hover {
  color: var(--color-accent-hover);
}

/* --------------------------------------------------------------------------
   Timeline
   -------------------------------------------------------------------------- */

.timeline {
  position: fixed;
  bottom: calc(60px + var(--space-4) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(500px, calc(100vw - var(--space-8)));
  z-index: var(--z-overlay);
}

.timeline[hidden] {
  display: none;
}

.timeline__container {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-md);
}

.timeline__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.timeline__title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.timeline__summary {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.timeline__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.slider--timeline {
  margin: var(--space-2) 0;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Sidebar Cursor-style (MNIST/Fashion right panel)
   -------------------------------------------------------------------------- */

.sidebar-cursor {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-hover) transparent;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sidebar-scroll > .live-section:last-child {
  flex: 1;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 5px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border-hover);
  border-radius: 3px;
}

/* Live Section */
.live-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.live-section__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-2);
}

.live-section__header h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin: 0;
  flex: 1;
}

/* Live dot indicator */
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6b7280;
  flex-shrink: 0;
  transition: background 0.3s;
}

.live-dot--active {
  background: var(--color-accent);
  animation: livePulse 1.5s ease-in-out infinite;
}

.live-dot--inactive {
  background: #52525b;
  animation: none;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.3); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0); }
}

/* Narrative */
.narrative-text {
  font-size: 12px;
  color: var(--color-text);
  margin: 0;
  line-height: 1.5;
}

.narrative-confidence {
  display: inline-block;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.narrative-confidence--high {
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-accent);
}

.narrative-confidence--medium {
  background: rgba(161, 161, 170, 0.12);
  color: #a1a1aa;
}

.narrative-confidence--low {
  background: rgba(113, 113, 122, 0.12);
  color: #71717a;
}

/* Pipeline */
.pipeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pipeline-node {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.pipeline-node:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pipeline-node__icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-accent);
  flex-shrink: 0;
  border: 1px solid rgba(59, 130, 246, 0.3);
  transition: all var(--transition-fast);
}

.pipeline-node--active .pipeline-node__icon {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  color: var(--color-accent);
}

.pipeline-node__info {
  flex: 1;
  min-width: 0;
}

.pipeline-node__name {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 3px 0;
}

.pipeline-node__stats {
  font-size: 10px;
  color: var(--color-text-muted);
  margin: 0;
  font-family: var(--font-mono);
}

.pipeline-node__bar-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.pipeline-node__bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--color-accent);
  transition: width 0.15s ease;
}

.pipeline-node--active .pipeline-node__bar-fill {
  background: var(--color-accent);
}

.pipeline-arrow {
  display: flex;
  justify-content: center;
  height: 16px;
  position: relative;
}

.pipeline-arrow__line {
  width: 2px;
  height: 100%;
  background: var(--color-border);
  position: relative;
  overflow: hidden;
}

.pipeline-arrow--flowing .pipeline-arrow__line {
  background: rgba(59, 130, 246, 0.3);
}

.pipeline-arrow--flowing .pipeline-arrow__line::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--color-accent), transparent);
  animation: flowDown 1s linear infinite;
}

@keyframes flowDown {
  from { top: -100%; }
  to { top: 100%; }
}

/* Math Live */
.math-live-card {
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
}

.math-live-card:last-child {
  margin-bottom: 0;
}

.math-live-card__title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0 0 6px 0;
}

.math-live-card__label {
  font-size: 10px;
  color: var(--color-text-secondary);
  margin: 6px 0 4px 0;
}

.math-live-formula {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-text);
  margin: 0;
  word-break: break-all;
}

.math-value {
  font-weight: 600;
  transition: color 0.15s;
}

.math-value--positive {
  color: #60a5fa;
}

.math-value--negative {
  color: #94a3b8;
}

.math-value--zero {
  color: #6b7280;
}

.math-dots {
  color: var(--color-text-muted);
}

.math-result {
  font-weight: 700;
  color: var(--color-accent);
  border-top: 1px solid var(--color-border);
  padding-top: 6px;
  margin-top: 6px;
}

.math-placeholder {
  font-size: 11px;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0;
}

/* ReLU mini indicator */
.relu-indicator {
  display: block;
  margin: 6px 0;
}

/* Softmax rows */
.softmax-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 2px 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  align-items: center;
}

.softmax-label {
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.softmax-logit {
  color: var(--color-text-muted);
  text-align: right;
}

.softmax-prob {
  font-weight: 600;
  text-align: right;
}

.softmax-bar-track {
  grid-column: 1 / -1;
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 2px;
}

.softmax-bar-fill {
  height: 100%;
  border-radius: 1px;
  background: var(--color-accent);
  transition: width 0.15s ease;
}

.softmax-bar-fill--winner {
  background: var(--color-accent);
}

/* Live Result */
.result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.result-row + .result-row {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.result-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text);
  min-width: 60px;
}

.result-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.result-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.15s ease, background 0.15s ease;
}

.result-bar-fill--winner {
  background: var(--color-accent);
}

.result-bar-fill--other {
  background: var(--color-accent);
}

.result-pct {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  min-width: 42px;
  text-align: right;
}

.result-placeholder {
  font-size: 11px;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0;
}

.result-confidence {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  font-size: 11px;
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Neuron Popup (floating, MNIST modes)
   -------------------------------------------------------------------------- */

.neuron-popup {
  display: none;
  position: fixed;
  z-index: var(--z-modal);
  width: 360px;
  max-height: 70vh;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  overflow: hidden;
  overflow-y: auto;
  pointer-events: auto;
  font-size: var(--text-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-hover) transparent;
}

.neuron-popup::-webkit-scrollbar {
  width: 5px;
}

.neuron-popup::-webkit-scrollbar-thumb {
  background: var(--color-border-hover);
  border-radius: 3px;
}

.neuron-popup.visible {
  display: block;
  animation: popupFadeIn 0.2s ease;
}

@keyframes popupFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Neuron Popup - Educational Content */
.neuron-popup__inner {
  padding: var(--space-3);
}

.neuron-popup__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.neuron-popup__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.neuron-popup__subtitle {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.neuron-popup__close {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.neuron-popup__close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.neuron-popup__status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: var(--space-3);
}

.neuron-popup__status--active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.neuron-popup__status--inactive {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.neuron-popup__section {
  margin-bottom: var(--space-3);
}

.neuron-popup__section:last-child {
  margin-bottom: 0;
}

.neuron-popup__section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.neuron-popup__desc {
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0 0 var(--space-2) 0;
}

.neuron-popup__formula {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--color-border);
  margin-bottom: var(--space-1);
  color: var(--color-text);
}

.neuron-popup__formula--result {
  border-left-color: var(--color-accent);
  background: rgba(59, 130, 246, 0.08);
}

/* Contributions list */
.neuron-popup__contribs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-2);
}

.neuron-popup__contrib {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: var(--space-2);
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
}

.neuron-popup__contrib--positive {
  background: rgba(59, 130, 246, 0.06);
}

.neuron-popup__contrib--negative {
  background: rgba(148, 163, 184, 0.06);
}

.neuron-popup__contrib--zero {
  background: rgba(107, 114, 128, 0.06);
}

.neuron-popup__contrib-label {
  font-size: 10px;
  color: var(--color-text-muted);
}

.neuron-popup__contrib-calc {
  font-size: 10px;
  color: var(--color-text-secondary);
}

.neuron-popup__contrib-result {
  font-weight: 600;
  font-size: 11px;
  text-align: right;
}

/* (Math card styles replaced by .math-live-card in sidebar section above) */

/* --------------------------------------------------------------------------
   Responsive - Desktop Breakpoints (Mobile handled at end of file)
   -------------------------------------------------------------------------- */

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .grid-cell {
    width: 5px;
  }

  .app {
    grid-template-columns: auto 1fr 320px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .app {
    padding: var(--space-5);
    grid-template-columns: auto 1fr 380px;
  }

  .grid-cell {
    width: 6px;
  }

  .panel--left {
    width: 240px;
  }
}

/* Large Desktop */
@media (min-width: 1440px) {
  .app {
    padding: var(--space-6);
    grid-template-columns: auto 1fr 420px;
  }

  .grid-cell {
    width: 7px;
  }

  .panel--left {
    width: 270px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Neuron Detail Panel
   -------------------------------------------------------------------------- */

.neuron-detail-panel {
  display: none;
  margin-top: var(--space-3);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  overflow-y: auto;
  pointer-events: auto;
  font-size: var(--text-sm);
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 450px);
}

.neuron-detail-panel.visible {
  display: block;
}

/* Hide floating popup in playground mode - use side panel instead */
body.playground-mode .neuron-detail-panel,
body.playground-mode .neuron-detail-panel.visible {
  display: none !important;
}

/* Hide MNIST popup in playground mode */
body.playground-mode .neuron-popup,
body.playground-mode .neuron-popup.visible {
  display: none !important;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.neuron-detail-panel__inner {
  padding: var(--space-4);
}

body.playground-mode .neuron-detail-panel__inner {
  padding: var(--space-5);
}

.neuron-detail-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--color-border);
}

.neuron-detail-panel__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.neuron-detail-panel__close {
  font-size: var(--text-xs);
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.neuron-detail-panel__close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.neuron-detail-panel__body {
  padding: var(--space-3);
}

.neuron-detail-panel__summary {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
}

.neuron-detail-panel__section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  margin: var(--space-2) 0 var(--space-1);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--color-border);
}

.neuron-detail-panel__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-1);
  padding: var(--space-1) 0;
  font-size: var(--text-xs);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.neuron-detail-panel__row:last-child {
  border-bottom: none;
}

.neuron-detail-panel__row--header {
  font-weight: 600;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.02);
  padding: 2px;
  border-radius: var(--radius-sm);
}

.neuron-detail-panel__row--bias,
.neuron-detail-panel__row--total {
  background: rgba(59, 130, 246, 0.1);
  border-radius: var(--radius-sm);
  margin-top: 2px;
}

.neuron-detail-panel__row div {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.neuron-detail-panel__row small {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.neuron-detail-panel__row strong {
  color: var(--color-text);
}

.neuron-detail-panel__totals {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

.neuron-detail-panel__empty {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-2);
}

/* --------------------------------------------------------------------------
   Playground 2D Styles
   -------------------------------------------------------------------------- */

/* Canvas 2D Playground */
.card--playground {
  min-width: 300px;
}

.card--playground canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  cursor: crosshair;
  border: 1px solid var(--color-border);
}

/* Data Pattern Generators */
.data-generators {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.btn-data-gen {
  flex: 1 1 calc(50% - var(--space-1));
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-data-gen:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--color-accent);
}

.btn-data-gen:active {
  transform: scale(0.96);
}

.btn-data-gen.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

/* Label Selector */
.label-selector {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

.label-selector__label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.btn-label {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-label:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

.btn-label--active {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(59, 130, 246, 0.1);
}

/* Training Metrics Panel */
.card--metrics {
  min-width: 220px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.metric {
  text-align: center;
  padding: var(--space-2);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.metric__label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.metric__value {
  display: block;
  font-size: var(--text-lg);
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--color-text);
}

/* Loss Chart */
#lossChart {
  width: 100%;
  height: 80px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-3);
}

/* Training Controls */
.training-controls {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.btn-training {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-training--primary {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.btn-training--primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn-training--primary:active {
  transform: scale(0.96);
}

.btn-training--primary.training-active {
  background: var(--color-success);
  border-color: var(--color-success);
  animation: pulse 1.5s ease-in-out infinite;
}

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

.btn-training--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-border-hover);
}

.btn-training--secondary:active {
  transform: scale(0.96);
}

.btn-training--download {
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
  border-color: var(--color-border);
  padding: var(--space-2);
  min-width: auto;
  flex: 0;
}

.btn-training--download:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-training--download:active {
  transform: scale(0.96);
}

.btn-training:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
  }
}

/* Panel visibility for playground mode */
.panel--playground[hidden],
.panel--metrics[hidden] {
  display: none;
}

/* Playground mode body class adjustments */
body.playground-mode #panelLeftMnist,
body.playground-mode #panelRightMnist {
  display: none;
}

body.playground-mode #panelLeftPlayground,
body.playground-mode #panelRightPlayground {
  display: flex;
}


body.playground-mode .bottom-bar {
  display: none;
}

body.playground-mode .panel--right {
  bottom: var(--space-4);
}

/* Playground controls (dataset selector + info button) */
.playground-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

/* Gradient visualization colors for backprop */
.gradient-positive {
  color: var(--color-success);
}

.gradient-negative {
  color: #94a3b8;
}

.gradient-neutral {
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Architecture Configuration Panel
   -------------------------------------------------------------------------- */

.card--architecture {
  margin-top: var(--space-3);
}

.btn-apply {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-apply:hover {
  background: var(--color-accent-hover);
}

.btn-apply:active {
  transform: scale(0.95);
}

.arch-info {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-3);
}

.arch-info__item {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.arch-info__item strong {
  color: var(--color-text);
}

.arch-section {
  margin-bottom: var(--space-3);
}

.arch-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.arch-section__header span {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.arch-section__buttons {
  display: flex;
  gap: var(--space-1);
}

.btn-arch-sm {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-arch-sm:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--color-accent);
}

.btn-arch-sm:active {
  transform: scale(0.9);
}

.arch-layers {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 180px;
  overflow-y: auto;
  padding-right: var(--space-1);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-hover) transparent;
}

.arch-layers::-webkit-scrollbar {
  width: 6px;
}

.arch-layers::-webkit-scrollbar-track {
  background: transparent;
}

.arch-layers::-webkit-scrollbar-thumb {
  background: var(--color-border-hover);
  border-radius: 3px;
}

.arch-layers::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

.arch-layer-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.arch-layer-row__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  min-width: 50px;
}

.arch-layer-row__neurons {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.arch-layer-row__neurons input {
  width: 50px;
  padding: var(--space-1);
  font-size: var(--text-sm);
  text-align: center;
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
}

.arch-layer-row__neurons input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.select-arch {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
}

.select-arch:focus {
  outline: none;
  border-color: var(--color-accent);
}

.setting--compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.setting--compact .setting__label {
  font-size: var(--text-xs);
  margin-bottom: 0;
}

/* Empty state for layers */
.arch-layers-empty {
  padding: var(--space-3);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--color-border);
}

/* Scrollable panels */
.panel--metrics {
  max-height: 100vh;
  overflow-y: auto;
}

/* --------------------------------------------------------------------------
   Educational Panel - Tabs System & Math Formulas
   -------------------------------------------------------------------------- */

/* Color tokens for math visualization */
:root {
  --color-math-primary: #60a5fa;
  --color-math-variable: #a78bfa;
  --color-math-result: #60a5fa;
  --color-math-operator: #94a3b8;
  --color-gradient-pos: #60a5fa;
  --color-gradient-neg: #94a3b8;
}

/* Tabs Navigation */
.neuron-detail-panel__tabs {
  display: flex;
  gap: 2px;
  padding: var(--space-1) var(--space-2);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--color-border);
}

.neuron-detail-panel__tab {
  flex: 1;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.neuron-detail-panel__tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
}

.neuron-detail-panel__tab--active {
  background: var(--color-accent);
  color: white;
}

/* Tab Content Sections */
.neuron-detail-panel__content {
  display: none;
  padding: var(--space-2);
}

.neuron-detail-panel__content--active {
  display: block;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Math Formula Styles (CSS-only LaTeX-like rendering)
   -------------------------------------------------------------------------- */

.math-formula {
  font-family: 'Times New Roman', 'Cambria Math', Georgia, serif;
  font-size: 1.05em;
  line-height: 1.6;
  color: var(--color-math-primary);
}

.math-block {
  margin: var(--space-2) 0;
  padding: var(--space-2) var(--space-3);
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--color-math-primary);
}

.math-step {
  margin: var(--space-2) 0;
}

.math-step__label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.math-step__content {
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 1em;
  padding-left: var(--space-2);
}

/* Fraction styling */
.math-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  margin: 0 2px;
}

.math-frac__num {
  border-bottom: 1px solid var(--color-math-primary);
  padding-bottom: 1px;
}

.math-frac__den {
  padding-top: 1px;
}

/* Subscript and superscript */
.math-sub {
  font-size: 0.7em;
  vertical-align: sub;
}

.math-sup {
  font-size: 0.7em;
  vertical-align: super;
}

/* Variable styling */
.math-var {
  font-style: italic;
  color: var(--color-math-variable);
}

/* Result/output styling */
.math-result {
  color: var(--color-math-result);
  font-weight: 600;
}

/* Number styling */
.math-num {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--color-text);
}

/* Operator styling */
.math-op {
  color: var(--color-math-operator);
  padding: 0 2px;
}

/* Greek letters simulation */
.math-sigma { font-size: 1.2em; }
.math-partial { font-style: normal; }

/* Equation alignment */
.math-eq {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: var(--space-1) 0;
}

.math-eq__lhs {
  min-width: 60px;
  text-align: right;
}

.math-eq__rhs {
  flex: 1;
}

/* Status indicator */
.math-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  margin-top: var(--space-2);
}

.math-status--active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-accent);
}

.math-status--inactive {
  background: rgba(107, 114, 128, 0.15);
  color: #94a3b8;
}

/* --------------------------------------------------------------------------
   Activation Graph Canvas
   -------------------------------------------------------------------------- */

.activation-graph-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
}

.activation-graph {
  width: 180px;
  height: 120px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.activation-graph__legend {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.activation-graph__legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

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

.activation-graph__legend-dot--function {
  background: var(--color-accent);
}

.activation-graph__legend-dot--point {
  background: var(--color-math-result);
}

.activation-graph__info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  width: 100%;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}

.activation-graph__value {
  padding: var(--space-1) var(--space-2);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  text-align: center;
}

.activation-graph__value-label {
  color: var(--color-text-muted);
  font-size: 0.9em;
}

.activation-graph__value-num {
  color: var(--color-text);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Gradient Visualization
   -------------------------------------------------------------------------- */

.gradient-section {
  margin-top: var(--space-2);
}

.gradient-chain {
  padding: var(--space-2);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.gradient-chain__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.gradient-eq {
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 1em;
  color: rgba(255, 255, 255, 0.95);
}

.gradient-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
}

.gradient-table th {
  padding: var(--space-1) var(--space-2);
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}

.gradient-table td {
  padding: var(--space-1) var(--space-2);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.85);
}

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

/* Gradient color coding */
.grad-positive {
  color: var(--color-gradient-pos);
}

.grad-negative {
  color: var(--color-gradient-neg);
}

.grad-neutral {
  color: var(--color-text-muted);
}

/* Gradient direction indicator */
.gradient-direction {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2);
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.gradient-direction__arrow {
  font-size: 1.2em;
}

.gradient-direction--increase {
  color: var(--color-gradient-pos);
}

.gradient-direction--decrease {
  color: var(--color-gradient-neg);
}

/* No training indicator */
.gradient-no-data {
  padding: var(--space-4);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Educational Tooltips
   -------------------------------------------------------------------------- */

.edu-tooltip {
  position: absolute;
  z-index: var(--z-modal);
  max-width: 280px;
  padding: var(--space-2) var(--space-3);
  background: rgba(24, 24, 27, 0.98);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-xs);
  color: var(--color-text);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.edu-tooltip--visible {
  opacity: 1;
  transform: translateY(0);
}

.edu-tooltip__title {
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: var(--space-1);
}

.edu-tooltip__content {
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.edu-tooltip__formula {
  margin-top: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  font-family: 'Times New Roman', Georgia, serif;
  color: var(--color-math-primary);
}

/* --------------------------------------------------------------------------
   Responsive adjustments for educational panel
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .neuron-detail-panel__tabs {
    flex-wrap: wrap;
  }

  .neuron-detail-panel__tab {
    flex: 1 1 calc(50% - 2px);
    font-size: 10px;
    padding: var(--space-1);
  }

  .activation-graph {
    width: 150px;
    height: 100px;
  }

  .math-formula {
    font-size: 0.95em;
  }
}

/* ==========================================================================
   Educational Panel - Large Panel for Playground Mode
   ========================================================================== */

/* Panel Container */
.panel--playground-edu {
  width: 380px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-hover) transparent;
}

/* Ensure hidden attribute works for playground educational panel */
.panel--playground-edu[hidden] {
  display: none !important;
}

.panel--playground-edu::-webkit-scrollbar {
  width: 6px;
}

.panel--playground-edu::-webkit-scrollbar-track {
  background: transparent;
}

.panel--playground-edu::-webkit-scrollbar-thumb {
  background: var(--color-border-hover);
  border-radius: 3px;
}

/* Educational Panel Main Container */
.edu-panel {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1002;
  overflow: hidden;
}

/* Educational Panel Tabs */
.edu-panel__tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-1);
  gap: var(--space-1);
}

.edu-panel__tab {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.edu-panel__tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
}

.edu-panel__tab--active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* Tab Content */
.edu-panel__tab-content {
  display: none;
  flex-direction: column;
  padding: var(--space-3);
  gap: var(--space-2);
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.edu-panel__tab-content--active {
  display: flex;
}

/* Math Content Area */
.edu-panel__math-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.edu-panel__math-empty {
  text-align: center;
  padding: var(--space-6);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.edu-panel__math-empty p {
  margin: 0;
}

/* Math Section Styling */
.math-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  border-left: 3px solid var(--color-accent);
}

.math-section__title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.math-section__formula {
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 1.1em;
  color: var(--color-math-primary);
  margin-bottom: var(--space-2);
}

.math-section__calculation {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.8;
  padding: var(--space-2);
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
}

.math-section__result {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-success);
  margin-top: var(--space-2);
}

/* Neuron Status Badge */
.neuron-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
}

.neuron-status--active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-accent);
}

.neuron-status--inactive {
  background: rgba(107, 114, 128, 0.15);
  color: #94a3b8;
}

/* Header with Learn Button */
.edu-panel__header {
  margin-bottom: var(--space-1);
}

.edu-panel__learn-btn {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.edu-panel__learn-btn:hover {
  background: var(--color-accent-hover);
}

.edu-panel__learn-btn:active {
  opacity: 0.9;
}

.edu-panel__learn-btn.edu-panel__learn-btn--active {
  background: var(--color-success);
}

/* Panel Content Area */
.edu-panel__content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Welcome State */
.edu-panel__welcome {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Title */
.edu-panel__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.4;
}

/* Simple Text (readable) */
.edu-panel__simple-text {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0;
}

/* Tour Navigation */
.edu-panel__tour-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  margin-top: auto;
}

.edu-panel__tour-nav[hidden] {
  display: none;
}

.edu-panel__nav-btn {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.edu-panel__nav-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.edu-panel__nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.edu-panel__step {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* Collapsible Sections */
.edu-panel__section {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.edu-panel__section-header {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast);
  list-style: none;
}

.edu-panel__section-header::-webkit-details-marker {
  display: none;
}

.edu-panel__section-header::after {
  content: '';
  margin-left: auto;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--color-text-muted);
  transition: transform var(--transition-fast);
}

.edu-panel__section[open] .edu-panel__section-header::after {
  transform: rotate(180deg);
}

.edu-panel__section-header:hover {
  background: var(--color-bg-hover);
}

.edu-panel__section-content {
  padding: var(--space-4);
  padding-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Architecture header row */
.arch-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.arch-header-row .arch-info {
  flex: 1;
  margin-bottom: 0;
}

/* ==========================================================================
   Minimal Playground Left Panel
   ========================================================================== */

/* Playground Panel - Full Height Layout */
.panel--pg {
  width: clamp(260px, 24vw, 340px);
  max-width: 100%;
  align-self: start;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0;
}

/* Ensure hidden attribute works for playground panels */
.panel--pg[hidden] {
  display: none !important;
}

.pg-topbar {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
}

.pg-train {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow: hidden;
}

.pg-data {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 0 0 auto;
  min-height: 0;
  overflow: hidden;
}

.pg-row { display: flex; gap: var(--space-2); }

.pg-btn {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.pg-btn:hover { background: rgba(255,255,255,0.1); color: var(--color-text); }
.pg-btn--pri { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.pg-btn--pri:hover { background: var(--color-accent-hover); }

.pg-m {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-1);
  background: rgba(0,0,0,0.25);
  border-radius: var(--radius-sm);
  min-height: 40px;
}
.pg-m__l { font-size: var(--text-xs); text-transform: uppercase; color: var(--color-text-muted); letter-spacing: 0.5px; }
.pg-m__v { font-size: var(--text-base); font-weight: 600; font-family: var(--font-mono); color: var(--color-text); }

.pg-train canvas {
  width: 100%;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.25);
}

.pg-lr {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.pg-lr span { min-width: 20px; }
.pg-lr input { flex: 1; height: 4px; }
.pg-lr output { font-size: var(--text-xs); font-family: var(--font-mono); min-width: 32px; text-align: right; color: var(--color-text-secondary); }

.pg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.pg-x {
  width: 20px; height: 20px;
  font-size: var(--text-sm);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast);
}
.pg-x:hover { border-color: #94a3b8; color: #94a3b8; background: rgba(148,163,184,0.1); }

.pg-x--undo {
  color: var(--color-accent);
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.12);
}

.pg-data canvas {
  display: block;
  width: min(100%, 244px);
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  min-height: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: rgba(0,0,0,0.2);
  align-self: center;
}

.pg-gens { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-1); }
.pg-g {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}
.pg-g:hover { background: rgba(255,255,255,0.1); color: var(--color-text); border-color: var(--color-border-hover); }

.pg-cls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.pg-c {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}
.pg-c:hover { border-color: var(--color-border-hover); color: var(--color-text-secondary); }
.pg-c--on { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

.pg-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}
.pg-sel {
  width: 100%;
  padding: 6px 10px;
  font-size: var(--text-xs);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
}
.pg-i {
  width: 22px; height: 22px;
  font-size: var(--text-sm);
  font-style: italic;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast);
}
.pg-i:hover { background: rgba(255,255,255,0.05); border-color: var(--color-border-hover); }

/* ==========================================================================
   Interactive Educational Panel - Formula, Slider, Animation
   ========================================================================== */

/* Interactive Formula */
.interactive-formula {
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}

.interactive-formula__title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.interactive-formula__main {
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 1.1em;
  color: var(--color-math-primary);
  margin-bottom: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.interactive-formula__calculation {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.6;
  padding: var(--space-2);
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
}

/* Formula Term (hover interactive) */
.formula-term {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  position: relative;
}

.formula-term:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--color-accent);
  color: white;
}

.formula-term--highlighted {
  background: rgba(59, 130, 246, 0.3);
  border-color: var(--color-accent);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.formula-term__weight {
  color: var(--color-math-variable);
}

.formula-term__input {
  color: var(--color-math-result);
}

.formula-term__op {
  color: var(--color-math-operator);
  padding: 0 2px;
}

.formula-term__bias {
  color: #fbbf24;
}

/* Formula Tooltip */
.formula-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  background: rgba(24, 24, 27, 0.98);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text);
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: var(--shadow-md);
}

.formula-term:hover .formula-tooltip {
  opacity: 1;
}

.formula-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-accent);
}

/* Activation Slider */
.activation-slider {
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}

.activation-slider__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.activation-slider__label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.activation-slider__values {
  display: flex;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.activation-slider__z {
  color: var(--color-math-primary);
}

.activation-slider__a {
  color: var(--color-success);
}

.activation-slider__input {
  width: 100%;
  height: 6px;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  cursor: pointer;
  margin: var(--space-2) 0;
}

.activation-slider__input::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.activation-slider__input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.5);
}

.activation-slider__input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.activation-slider__hint {
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-1);
}

/* Animation Button */
.btn-animate {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.btn-animate:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

.btn-animate:active {
  transform: translateY(0);
}

.btn-animate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-animate--playing {
  background: var(--color-success);
}

.btn-animate__icon {
  font-size: 1.1em;
}

/* Animation Steps Display */
.animation-steps {
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  margin-top: var(--space-3);
}

.animation-step {
  padding: var(--space-2);
  margin-bottom: var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.animation-step:last-child {
  margin-bottom: 0;
}

.animation-step--active {
  background: rgba(59, 130, 246, 0.15);
  border-left-color: var(--color-accent);
  color: var(--color-text);
}

.animation-step--completed {
  background: rgba(59, 130, 246, 0.1);
  border-left-color: var(--color-accent);
  color: var(--color-accent);
}

.animation-step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-right: var(--space-2);
}

.animation-step--active .animation-step__number {
  background: var(--color-accent);
  color: white;
}

.animation-step--completed .animation-step__number {
  background: var(--color-success);
  color: white;
}

/* Connection Highlight Effect (3D) */
.connection-highlighted {
  /* Applied via Three.js - just for reference */
}

/* ==========================================================================
   Educational Content States (Neuron Selected, Training, etc.)
   ========================================================================== */

/* Neuron Info State */
.edu-panel__neuron-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.edu-panel__neuron-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.edu-panel__neuron-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

/* Status Badge */
.edu-panel__status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
}

.edu-panel__status--active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-accent);
}

.edu-panel__status--inactive {
  background: rgba(107, 114, 128, 0.15);
  color: #94a3b8;
}

/* Large Activation Graph */
.edu-panel__graph-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
}

.edu-panel__graph {
  width: 100%;
  max-width: 280px;
  height: 180px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.edu-panel__graph-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  width: 100%;
  font-size: var(--text-sm);
}

.edu-panel__graph-value {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-2);
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
}

.edu-panel__graph-value-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.edu-panel__graph-value-num {
  font-size: var(--text-lg);
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-text);
}

/* Technical Details (Collapsible) */
.edu-panel__technical {
  margin-top: var(--space-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.edu-panel__technical summary {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: rgba(0, 0, 0, 0.1);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast);
  list-style: none;
}

.edu-panel__technical summary:hover {
  background: rgba(0, 0, 0, 0.2);
}

.edu-panel__technical summary::-webkit-details-marker {
  display: none;
}

.edu-panel__technical-content {
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.05);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Tour Highlight Effect - Subtle
   ========================================================================== */

.tour-highlight {
  position: relative;
  outline: 2px solid #fbbf24 !important;
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Highlight for buttons */
button.tour-highlight,
.tour-highlight button,
#trainBtn.tour-highlight {
  outline: 2px solid #4ade80 !important;
  outline-offset: 3px;
}

/* Tour Overlay - Disabled (not needed) */
.tour-overlay {
  display: none;
}

.tour-overlay--visible {
  display: none;
}

/* Tour Step Content */
.edu-panel__tour-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: rgba(30, 30, 35, 0.95);
  border-radius: var(--radius-md);
  border: 1px solid #fbbf24;
}

.edu-panel__tour-step-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.edu-panel__tour-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #fbbf24;
  border-radius: 50%;
  font-size: var(--text-xs);
  font-weight: 700;
  color: #1a1a1a;
  flex-shrink: 0;
}

.edu-panel__tour-text {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: #d4d4d4;
  padding-left: calc(24px + var(--space-2));
}

/* Highlighted words in tour text */
.edu-panel__tour-text strong,
.edu-panel__tour-text b {
  color: #fbbf24;
  font-weight: 600;
}

/* Tour navigation improvements */
.edu-panel__tour-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
}

.edu-panel__tour-nav button {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.edu-panel__tour-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.edu-panel__prev {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.edu-panel__prev:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.edu-panel__next {
  background: #fbbf24;
  border: none;
  color: #1a1a1a;
  font-weight: 600;
}

.edu-panel__next:hover:not(:disabled) {
  background: #fcd34d;
}

.edu-panel__step {
  font-size: var(--text-xs);
  color: #a3a3a3;
}

/* ==========================================================================
   Training Progress State
   ========================================================================== */

.edu-panel__training {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.edu-panel__training-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.edu-panel__training-icon {
  font-size: 1.4em;
  animation: trainingSpin 1s linear infinite;
}

@keyframes trainingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.edu-panel__training-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
}

.edu-panel__training-stat {
  text-align: center;
}

.edu-panel__training-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-text);
}

.edu-panel__training-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Responsive Adjustments for Educational Panel
   ========================================================================== */

@media (max-width: 1400px) {
  .panel--playground-edu {
    width: 420px;
    max-width: 420px;
  }
}

@media (max-width: 1200px) {
  .panel--playground-edu {
    width: 380px;
    max-width: 380px;
  }

  .edu-panel__title {
    font-size: 1.3rem;
  }

  .edu-panel__simple-text {
    font-size: 1rem;
  }

  .edu-panel__graph {
    height: 150px;
  }
}

@media (min-width: 1024px) and (max-width: 1439px) {
  body.playground-mode #panelLeftPlayground,
  body.playground-mode #panelRightPlayground {
    margin-top: 14px;
  }

  .panel--pg {
    width: 240px;
  }

  .panel--playground-edu {
    width: 380px;
    max-width: 380px;
    max-height: calc(100vh - 62px);
  }
}

@media (min-width: 1440px) {
  body.playground-mode #panelLeftPlayground,
  body.playground-mode #panelRightPlayground {
    margin-top: 14px;
  }

  .panel--pg {
    width: 270px;
  }

  .panel--playground-edu {
    width: 420px;
    max-width: 420px;
    max-height: calc(100vh - 62px);
  }
}

@media (max-width: 1024px) {
  .panel--playground-edu {
    width: 340px;
    max-width: 340px;
  }

  .edu-panel {
    min-height: 280px;
    padding: var(--space-3);
  }

  .edu-panel__learn-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-base);
  }
}

/* ==========================================================================
   MOBILE TOGGLE BUTTON - Show/Hide Panels
   ========================================================================== */

.mobile-toggle-btn {
  display: none;
}

@media (max-width: 767px) {
  .mobile-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: calc(20px + var(--safe-bottom, 0px));
    right: 16px;
    width: 56px;
    height: 56px;
    background: var(--color-accent);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
    pointer-events: auto;
  }

  .mobile-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), 0 0 24px rgba(59, 130, 246, 0.4);
  }

  .mobile-toggle-btn:active {
    transform: scale(0.95);
  }

  /* Icon states */
  .mobile-toggle-btn__icon--show {
    display: none;
  }

  .mobile-toggle-btn__icon--hide {
    display: block;
  }

  /* When panels are hidden */
  .app.panels-hidden .mobile-toggle-btn__icon--show {
    display: block;
  }

  .app.panels-hidden .mobile-toggle-btn__icon--hide {
    display: none;
  }

  .app.panels-hidden .mobile-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }

  /* Hide all panels when toggled */
  .app.panels-hidden .panel {
    display: none !important;
  }

  .app.panels-hidden .panel--pg {
    display: none !important;
  }

  .app.panels-hidden .panel--playground-edu {
    display: none !important;
  }

  /* Show a hint when panels are hidden */
  .app.panels-hidden::before {
    content: 'Toca el ojo para mostrar controles';
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    z-index: 100;
    pointer-events: none;
    animation: fadeInOut 3s ease forwards;
  }

  @keyframes fadeInOut {
    0% { opacity: 0; }
    15% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
  }
}

/* ==========================================================================
   MOBILE RESPONSIVE - Complete Rewrite
   Designed to work on phones without breaking desktop
   ========================================================================== */

@media (max-width: 767px) {
  /* -------------------------------------------------------------------------
     Root & Base - Mobile Adjustments
     ------------------------------------------------------------------------- */
  :root {
    --mobile-panel-padding: 12px;
    --mobile-card-padding: 10px;
    --mobile-gap: 10px;
  }

  html, body {
    overflow-x: hidden;
    overscroll-behavior: none;
  }

  /* -------------------------------------------------------------------------
     FPS Overlay - Hide on Mobile
     ------------------------------------------------------------------------- */
  .fps-overlay {
    display: none !important;
  }

  /* -------------------------------------------------------------------------
     Three.js Canvas - Ensure proper sizing
     ------------------------------------------------------------------------- */
  body > canvas {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1 !important;
  }

  /* -------------------------------------------------------------------------
     App Layout - Vertical Stack for Mobile
     ------------------------------------------------------------------------- */
  .app {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    padding: var(--mobile-panel-padding);
    padding-bottom: calc(var(--mobile-panel-padding) + var(--safe-bottom));
    gap: var(--mobile-gap);
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* -------------------------------------------------------------------------
     Panels - Full Width on Mobile
     ------------------------------------------------------------------------- */
  .panel {
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 0;
  }

  .panel--left {
    order: 1;
  }

  .panel--right {
    order: 2;
    max-height: none;
    overflow: visible;
  }

  /* -------------------------------------------------------------------------
     Cards - Mobile Optimized
     ------------------------------------------------------------------------- */
  .card {
    width: 100% !important;
    max-width: 100% !important;
    padding: var(--mobile-card-padding);
    border-radius: var(--radius-md);
  }

  .card__header {
    margin-bottom: var(--space-2);
  }

  /* -------------------------------------------------------------------------
     Drawing Card - Horizontal Layout on Mobile
     ------------------------------------------------------------------------- */
  .card--drawing {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  .card--drawing .card__header {
    display: flex;
    width: 100%;
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-2);
  }

  /* Grid wrapper with grid and buttons side by side */
  .grid-wrapper {
    display: flex;
    flex-direction: row;
    gap: var(--space-3);
    align-items: flex-start;
  }

  /* The actual pixel grid */
  .grid {
    width: auto;
    flex-shrink: 0;
  }

  .grid-cell {
    width: 9px;
    height: 9px;
  }

  /* Sample buttons container */
  .sample-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    margin-top: 0;
    padding: var(--space-2);
    flex: 1;
    max-width: 120px;
    align-content: start;
  }

  .sample-btn {
    height: 28px;
    min-width: 44px;
    padding: 0 var(--space-1);
    font-size: 10px;
    font-weight: 600;
  }

  /* -------------------------------------------------------------------------
     Predictions Card - Compact Mobile
     ------------------------------------------------------------------------- */
  .card--predictions {
    width: 100% !important;
    max-width: 100% !important;
  }

  .prediction-chart {
    gap: var(--space-1);
  }

  .prediction-bar-container {
    gap: var(--space-1);
  }

  .prediction-label {
    width: 44px;
    font-size: 10px;
  }

  .prediction-bar-track {
    height: 14px;
  }

  .prediction-percentage {
    width: 36px;
    font-size: 10px;
  }

  /* -------------------------------------------------------------------------
     Educational Card - Collapsible & Compact
     ------------------------------------------------------------------------- */
  .card--education {
    width: 100% !important;
    max-width: 100% !important;
    max-height: none;
    padding: var(--space-2);
  }

  .edu-content {
    margin-bottom: var(--space-2);
  }

  .edu-welcome {
    padding: var(--space-2);
  }

  .edu-text {
    font-size: 11px;
    line-height: 1.4;
  }

  .edu-details {
    margin-bottom: 4px;
  }

  .edu-details summary {
    padding: 6px 8px;
    font-size: 11px;
  }

  .edu-details-content {
    padding: 6px 8px;
    font-size: 10px;
  }

  .btn-tour {
    padding: 4px 10px;
    font-size: 10px;
  }

  /* -------------------------------------------------------------------------
     Neuron Detail Panel - Mobile
     ------------------------------------------------------------------------- */
  .neuron-detail-panel {
    max-height: 200px;
    margin-top: var(--space-2);
  }

  .neuron-detail-panel__header {
    padding: var(--space-1) var(--space-2);
  }

  .neuron-detail-panel__title {
    font-size: 11px;
  }

  .neuron-detail-panel__body {
    padding: var(--space-2);
  }

  .neuron-detail-panel__row {
    font-size: 10px;
    gap: 2px;
  }

  /* -------------------------------------------------------------------------
     Sidebar & Popup - Mobile
     ------------------------------------------------------------------------- */
  .sidebar-cursor {
    border-radius: var(--radius-md);
  }

  .neuron-popup {
    width: 300px;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%);
    max-height: 60vh;
  }

  .neuron-popup.visible {
    animation: none;
  }

  /* -------------------------------------------------------------------------
     Bottom Bar - Hidden (controls in cards)
     ------------------------------------------------------------------------- */
  .bottom-bar {
    display: none !important;
  }

  /* -------------------------------------------------------------------------
     Drawer (Settings) - Full Width Mobile
     ------------------------------------------------------------------------- */
  .drawer {
    position: fixed;
    bottom: var(--safe-bottom);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 70vh;
    overflow-y: auto;
  }

  .drawer__content {
    padding: var(--space-3);
  }

  .setting__label {
    font-size: 12px;
  }

  /* -------------------------------------------------------------------------
     Modal - Full Screen Mobile
     ------------------------------------------------------------------------- */
  .modal[open] {
    padding: var(--space-2);
  }

  .modal__content {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-md);
  }

  .modal__header {
    padding: var(--space-3);
  }

  .modal__title {
    font-size: var(--text-base);
  }

  .modal__body {
    padding: var(--space-3);
    max-height: calc(90vh - 100px);
  }

  .modal__description {
    font-size: 12px;
  }

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

  .controls-list {
    gap: var(--space-1);
  }

  .controls-list li {
    font-size: 12px;
  }

  /* -------------------------------------------------------------------------
     Timeline - Full Width Mobile
     ------------------------------------------------------------------------- */
  .timeline {
    left: var(--space-2);
    right: var(--space-2);
    bottom: calc(var(--space-2) + var(--safe-bottom));
    width: auto;
    transform: none;
  }

  .timeline__container {
    padding: var(--space-2) var(--space-3);
  }

  .timeline__title {
    font-size: 10px;
  }

  /* -------------------------------------------------------------------------
     Tour Tooltips - Mobile Adjustments
     ------------------------------------------------------------------------- */
  .tour-tooltip {
    max-width: calc(100vw - 32px);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-3);
  }

  .tour-tooltip__title {
    font-size: 13px;
  }

  .tour-tooltip__text {
    font-size: 12px;
  }

  .tour-tooltip__nav {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  /* -------------------------------------------------------------------------
     Select Inline - Touch Friendly
     ------------------------------------------------------------------------- */
  .select-inline {
    padding: 8px 28px 8px 12px;
    font-size: 13px;
    min-width: 100px;
    min-height: 44px;
  }

  /* -------------------------------------------------------------------------
     Header Actions - Touch Friendly
     ------------------------------------------------------------------------- */
  .card__header-actions {
    gap: 8px;
  }

  .btn-icon--small {
    width: 32px;
    height: 32px;
  }

  .btn-collapse {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
}

/* ==========================================================================
   MOBILE - Playground Mode Specific
   ========================================================================== */

@media (max-width: 767px) {
  /* Playground Mode - Body adjustments */
  body.playground-mode .app {
    position: relative;
    min-height: 100vh;
    height: auto;
    padding-top: var(--space-2);
    gap: var(--space-3);
  }

  /* Playground Left Panel */
  .panel--pg {
    width: 100% !important;
    height: auto;
    padding: 0;
    gap: var(--space-2);
    position: relative;
    z-index: 20;
    background: transparent;
  }

  .pg-train {
    padding: var(--space-2);
    gap: var(--space-2);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }

  .pg-data {
    padding: var(--space-2);
    gap: var(--space-2);
    min-height: auto;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    flex: none;
  }

  .pg-row {
    gap: var(--space-1);
  }

  .pg-btn {
    padding: var(--space-2);
    font-size: 12px;
    min-height: 44px;
  }

  .pg-m {
    padding: var(--space-1);
    min-height: 40px;
  }

  .pg-m__l {
    font-size: 9px;
  }

  .pg-m__v {
    font-size: 13px;
  }

  .pg-train canvas {
    height: 32px;
  }

  .pg-lr {
    font-size: 11px;
  }

  .pg-data canvas {
    width: min(100%, 260px);
    max-width: 100%;
    max-height: none;
    min-height: 0;
    height: auto;
    aspect-ratio: 1 / 1;
    margin-inline: auto;
  }

  .pg-gens {
    grid-template-columns: repeat(2, 1fr);
  }

  .pg-g {
    padding: var(--space-1);
    font-size: 10px;
    min-height: 36px;
  }

  .pg-cls {
    font-size: 11px;
  }

  .pg-c {
    padding: var(--space-1) var(--space-2);
    min-height: 36px;
  }

  .pg-sel {
    width: 100%;
    font-size: 11px;
    padding: var(--space-1) var(--space-2);
    min-height: 36px;
  }

  /* Playground Educational Panel */
  .panel--playground-edu {
    width: 100% !important;
    max-width: 100% !important;
    max-height: none;
    margin-top: var(--space-2);
    overflow: visible;
  }

  body.playground-mode .panel--playground-edu {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    border-radius: var(--radius-md);
  }

  .edu-panel {
    min-height: auto;
    overflow: hidden;
  }

  .edu-panel__tabs {
    padding: var(--space-1);
    gap: var(--space-1);
  }

  .edu-panel__tab {
    padding: var(--space-2);
    font-size: 11px;
    min-height: 36px;
  }

  .edu-panel__tab-content {
    padding: var(--space-2);
    max-height: none;
    overflow: visible;
  }

  .edu-panel__header {
    margin-bottom: var(--space-2);
  }

  .edu-panel__title {
    font-size: 14px;
    margin-bottom: var(--space-1);
  }

  .edu-panel__simple-text {
    font-size: 11px;
    line-height: 1.4;
  }

  .edu-panel__welcome {
    gap: var(--space-2);
  }

  .edu-panel__learn-btn {
    padding: var(--space-2);
    font-size: 11px;
    min-height: 40px;
    width: 100%;
    border-radius: var(--radius-sm);
  }

  .edu-panel__section {
    margin-top: var(--space-2);
  }

  .edu-panel__section-header {
    padding: var(--space-2) var(--space-3);
    font-size: 10px;
  }

  .edu-panel__section-content {
    padding: var(--space-2) var(--space-3);
  }

  /* Architecture Config */
  .arch-header-row {
    flex-direction: column;
    gap: var(--space-2);
  }

  .arch-info {
    width: 100%;
    flex-direction: column;
    gap: var(--space-1);
  }

  .arch-info__item {
    font-size: 11px;
  }

  .btn-apply {
    width: 100%;
    padding: var(--space-2);
    min-height: 40px;
  }

  .arch-section__header span {
    font-size: 10px;
  }

  .btn-arch-sm {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .arch-layers {
    max-height: 120px;
  }

  .arch-layer-row {
    padding: var(--space-1);
  }

  .arch-layer-row__label {
    font-size: 10px;
  }

  .arch-layer-row__neurons input {
    width: 44px;
    font-size: 12px;
    padding: var(--space-1);
  }

  .select-arch {
    font-size: 11px;
    min-height: 32px;
  }

  .setting--compact .setting__label {
    font-size: 11px;
  }
}

/* ==========================================================================
   MOBILE - Portrait Orientation Specific
   ========================================================================== */

@media (max-width: 767px) and (orientation: portrait) {
  .app {
    padding-bottom: calc(20px + var(--safe-bottom));
  }

  /* Stack everything vertically */
  .grid-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .sample-buttons {
    max-width: 100%;
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
  }

  .sample-btn {
    min-width: auto;
  }

  /* Larger grid cells in portrait */
  .grid-cell {
    width: 10px;
    height: 10px;
  }
}

/* ==========================================================================
   MOBILE - Landscape Orientation
   ========================================================================== */

@media (max-width: 896px) and (orientation: landscape) {
  .app {
    flex-direction: row;
    flex-wrap: wrap;
    padding: var(--space-2);
    gap: var(--space-2);
    max-height: 100vh;
    overflow-y: auto;
  }

  .panel--left {
    width: 45% !important;
    max-width: 45% !important;
    order: 1;
  }

  .panel--right {
    width: 52% !important;
    max-width: 52% !important;
    order: 2;
  }

  .grid-cell {
    width: 7px;
    height: 7px;
  }

  .sample-buttons {
    grid-template-columns: repeat(5, 1fr);
    max-width: 100%;
  }

  .card--predictions,
  .card--education {
    max-height: 35vh;
    overflow-y: auto;
  }

  /* Playground in landscape */
  .panel--pg {
    width: 40% !important;
    max-width: 40% !important;
    height: calc(100vh - var(--space-4));
  }

  .panel--playground-edu {
    width: 58% !important;
    max-width: 58% !important;
    max-height: calc(100vh - var(--space-4));
  }

  .pg-data canvas {
    width: min(100%, 220px);
    max-width: 100%;
    min-height: 0;
    max-height: none;
    height: auto;
    aspect-ratio: 1 / 1;
    margin-inline: auto;
  }
}

/* ==========================================================================
   TOUCH DEVICE OPTIMIZATIONS
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn-icon,
  .btn-ghost {
    min-width: 44px;
    min-height: 44px;
  }

  .sample-btn,
  .digit-button {
    min-height: 44px;
  }

  .btn-collapse {
    min-width: 36px;
    min-height: 36px;
  }

  /* Better touch feedback */
  .sample-btn:active,
  .digit-button:active,
  .btn-icon:active,
  .pg-btn:active,
  .pg-g:active,
  .pg-c:active {
    transform: scale(0.95);
    opacity: 0.8;
  }

  /* Prevent text selection while drawing */
  .grid {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  /* Smoother scrolling */
  .card--education,
  .panel--playground-edu,
  .arch-layers,
  .drawer__content {
    -webkit-overflow-scrolling: touch;
  }

  /* Larger slider thumbs */
  .slider::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }

  .slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }

  .activation-slider__input::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }

  .activation-slider__input::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }
}

/* ==========================================================================
   VERY SMALL SCREENS (< 380px)
   ========================================================================== */

@media (max-width: 379px) {
  :root {
    --mobile-panel-padding: 8px;
    --mobile-card-padding: 8px;
    --mobile-gap: 8px;
  }

  .grid-cell {
    width: 8px;
    height: 8px;
  }

  .sample-buttons {
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: var(--space-1);
  }

  .sample-btn {
    height: 24px;
    font-size: 9px;
    padding: 0 2px;
  }

  .select-inline {
    padding: 6px 20px 6px 8px;
    font-size: 11px;
    min-width: 80px;
  }

  .card__title {
    font-size: 10px;
  }

  .prediction-label {
    width: 36px;
    font-size: 9px;
  }

  .prediction-percentage {
    width: 32px;
    font-size: 9px;
  }

  .edu-text {
    font-size: 10px;
  }

  .pg-btn {
    font-size: 11px;
    padding: var(--space-1);
  }

  .pg-m__l {
    font-size: 8px;
  }

  .pg-m__v {
    font-size: 12px;
  }
}

/* ==========================================================================
   SAFE AREA HANDLING (iPhone X and newer)
   ========================================================================== */

@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 767px) {
    .app {
      padding-left: max(var(--mobile-panel-padding), env(safe-area-inset-left));
      padding-right: max(var(--mobile-panel-padding), env(safe-area-inset-right));
      padding-bottom: max(var(--mobile-panel-padding), env(safe-area-inset-bottom));
    }

    .drawer {
      padding-bottom: env(safe-area-inset-bottom);
    }

    body.playground-mode .panel--playground-edu {
      padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
    }
  }
}

/* ==========================================================================
   HIGH CONTRAST MODE
   ========================================================================== */

@media (prefers-contrast: high) {
  .card {
    border-width: 2px;
  }

  .btn-collapse,
  .btn-icon,
  .sample-btn,
  .pg-btn {
    border-width: 2px;
  }

  .grid-cell {
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
}

/* ==========================================================================
   PRINT STYLES (just in case)
   ========================================================================== */

@media print {
  .app {
    display: block;
    position: static;
    overflow: visible;
  }

  .panel {
    page-break-inside: avoid;
  }

  .drawer,
  .modal,
  .timeline,
  .btn-collapse,
  .tour-tooltip {
    display: none !important;
  }
}

/* ==========================================================================
   GEIST TERMINAL THEME
   ========================================================================== */

body.theme-geist-terminal {
  position: relative;
  isolation: isolate;
  color-scheme: dark;
  --color-bg: #020202;
  --color-bg-elevated: rgba(8, 8, 8, 0.92);
  --color-bg-hover: rgba(255, 255, 255, 0.045);
  --color-border: rgba(255, 255, 255, 0.12);
  --color-border-hover: rgba(255, 255, 255, 0.24);
  --color-border-focus: rgba(255, 255, 255, 0.42);
  --color-text: rgba(245, 245, 239, 0.93);
  --color-text-secondary: rgba(245, 245, 239, 0.68);
  --color-text-muted: rgba(245, 245, 239, 0.38);
  --color-accent: #f0f0eb;
  --color-accent-hover: #ffffff;
  --color-success: #d6d6d0;
  --color-math-primary: #f0f0eb;
  --color-math-variable: #c9c9c3;
  --color-math-result: #ffffff;
  --color-math-operator: rgba(255, 255, 255, 0.54);
  --color-gradient-pos: #ffffff;
  --color-gradient-neg: #8e8e89;
  --font-sans: "Geist Mono", "SF Mono", "Fira Code", "Consolas", monospace;
  --font-mono: "Geist Mono", "SF Mono", "Fira Code", "Consolas", monospace;
  --font-display: "Geist Pixel Square", "Geist Mono", "SF Mono", monospace;
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-md: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 18px 40px rgba(0, 0, 0, 0.58);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 60px rgba(0, 0, 0, 0.74);
  background-color: var(--color-bg);
  background-image:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.08) 0%, transparent 24%),
    radial-gradient(circle at 82% 4%, rgba(255, 255, 255, 0.04) 0%, transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 30%);
  letter-spacing: 0.01em;
}

body.theme-geist-terminal,
body.theme-geist-terminal input,
body.theme-geist-terminal select,
body.theme-geist-terminal textarea,
body.theme-geist-terminal button,
body.theme-geist-terminal output,
body.theme-geist-terminal option {
  font-family: var(--font-mono);
}

body.theme-geist-terminal::before,
body.theme-geist-terminal::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body.theme-geist-terminal::before {
  z-index: 0;
  opacity: 0.12;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 4px
    ),
    repeating-linear-gradient(
      to right,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 96px
    );
}

body.theme-geist-terminal::after {
  z-index: 0;
  background: radial-gradient(circle at center, transparent 46%, rgba(0, 0, 0, 0.62) 100%);
}

body.theme-geist-terminal .card,
body.theme-geist-terminal .live-section,
body.theme-geist-terminal .edu-panel,
body.theme-geist-terminal .edu-panel__section,
body.theme-geist-terminal .timeline__container,
body.theme-geist-terminal .bottom-bar,
body.theme-geist-terminal .drawer,
body.theme-geist-terminal .modal,
body.theme-geist-terminal dialog,
body.theme-geist-terminal .tour-tooltip,
body.theme-geist-terminal .edu-tooltip,
body.theme-geist-terminal .neuron-popup,
body.theme-geist-terminal .neuron-detail-panel,
 body.theme-geist-terminal .fps-overlay,
 body.theme-geist-terminal .pg-topbar,
 body.theme-geist-terminal .pg-train,
 body.theme-geist-terminal .pg-data,
 body.theme-geist-terminal .panel--playground-edu,
 body.theme-geist-terminal .edu-panel__tour-nav,
 body.theme-geist-terminal .edu-panel__math-content,
 body.theme-geist-terminal .edu-panel__math-empty,
 body.theme-geist-terminal .arch-section,
 body.theme-geist-terminal .arch-info,
 body.theme-geist-terminal .architecture,
 body.theme-geist-terminal .gradient-chain,
 body.theme-geist-terminal .math-block,
 body.theme-geist-terminal .interactive-formula,
 body.theme-geist-terminal .interactive-formula__calculation,
 body.theme-geist-terminal .gradient-direction,
 body.theme-geist-terminal .gradient-no-data {
  background: linear-gradient(180deg, rgba(12, 12, 12, 0.88) 0%, rgba(5, 5, 5, 0.96) 100%) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: var(--shadow-md) !important;
  backdrop-filter: blur(10px);
}

body.theme-geist-terminal .sample-buttons,
body.theme-geist-terminal .grid,
body.theme-geist-terminal .prediction-bar-track,
body.theme-geist-terminal .pg-data,
body.theme-geist-terminal .pg-train,
body.theme-geist-terminal .pg-m,
body.theme-geist-terminal .pg-foot,
body.theme-geist-terminal .setting,
body.theme-geist-terminal .architecture,
body.theme-geist-terminal .controls-list kbd,
body.theme-geist-terminal .arch-layer,
body.theme-geist-terminal .arch-layer-row,
body.theme-geist-terminal .arch-layers-empty,
body.theme-geist-terminal #playground2DCanvas,
body.theme-geist-terminal #lossChart {
  background: rgba(255, 255, 255, 0.018) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02) !important;
}

body.theme-geist-terminal #playground2DCanvas,
body.theme-geist-terminal #lossChart {
  background-color: #050505;
}

body.theme-geist-terminal .grid-cell:not(.active) {
  background: rgba(255, 255, 255, 0.025) !important;
  border-radius: 0 !important;
}

body.theme-geist-terminal .grid-cell.active {
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.12);
}

body.theme-geist-terminal .grid-overlay {
  opacity: 0.42;
  mix-blend-mode: screen;
}

body.theme-geist-terminal .card__title,
body.theme-geist-terminal .live-section__header h3,
body.theme-geist-terminal .timeline__title,
body.theme-geist-terminal .timeline__summary,
body.theme-geist-terminal .timeline__label,
body.theme-geist-terminal .timeline__metrics,
body.theme-geist-terminal .drawer__title,
body.theme-geist-terminal .modal__title,
body.theme-geist-terminal .modal__section h3,
body.theme-geist-terminal .setting__label,
body.theme-geist-terminal .interactive-formula__title,
body.theme-geist-terminal .math-step__label,
body.theme-geist-terminal .prediction-label,
body.theme-geist-terminal .prediction-compact-insight__label,
body.theme-geist-terminal .pipeline-node__label,
body.theme-geist-terminal .architecture,
body.theme-geist-terminal .controls-list kbd,
body.theme-geist-terminal .link-external,
body.theme-geist-terminal .arch-info__item strong,
body.theme-geist-terminal .arch-layer-row__label,
body.theme-geist-terminal .arch-section__header span,
body.theme-geist-terminal .edu-panel__learn-btn,
body.theme-geist-terminal .edu-panel__nav-btn,
body.theme-geist-terminal .edu-panel__step,
body.theme-geist-terminal .mobile-toggle-btn,
body.theme-geist-terminal .pg-head,
body.theme-geist-terminal .pg-foot,
body.theme-geist-terminal .pg-m__l,
body.theme-geist-terminal .edu-panel__section-header,
body.theme-geist-terminal .edu-panel__title {
  font-family: var(--font-display) !important;
  letter-spacing: 0.08em;
}

body.theme-geist-terminal button,
body.theme-geist-terminal select,
body.theme-geist-terminal summary,
body.theme-geist-terminal input[type="number"],
body.theme-geist-terminal input[type="text"],
body.theme-geist-terminal .select-inline,
body.theme-geist-terminal .select-minimal,
body.theme-geist-terminal .select-arch,
body.theme-geist-terminal .pg-sel,
body.theme-geist-terminal .btn-icon,
body.theme-geist-terminal .btn-collapse,
body.theme-geist-terminal .btn-ghost,
body.theme-geist-terminal .btn-tour,
body.theme-geist-terminal .sample-btn,
body.theme-geist-terminal .pg-btn,
body.theme-geist-terminal .pg-g,
body.theme-geist-terminal .pg-c,
body.theme-geist-terminal .pg-x,
body.theme-geist-terminal .btn-apply,
body.theme-geist-terminal .btn-arch-sm,
body.theme-geist-terminal .toggle,
body.theme-geist-terminal .edu-panel__learn-btn,
body.theme-geist-terminal .edu-panel__nav-btn,
body.theme-geist-terminal .edu-panel__tab,
body.theme-geist-terminal .neuron-detail-panel__tab {
  font-family: var(--font-display) !important;
  background: rgba(255, 255, 255, 0.025) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: var(--color-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  border-radius: 2px !important;
}

body.theme-geist-terminal button:hover,
body.theme-geist-terminal select:hover,
body.theme-geist-terminal summary:hover,
body.theme-geist-terminal input[type="number"]:hover,
body.theme-geist-terminal input[type="text"]:hover,
body.theme-geist-terminal .btn-icon:hover,
body.theme-geist-terminal .btn-collapse:hover,
body.theme-geist-terminal .btn-ghost:hover,
body.theme-geist-terminal .btn-tour:hover,
body.theme-geist-terminal .sample-btn:hover,
body.theme-geist-terminal .pg-btn:hover,
body.theme-geist-terminal .pg-g:hover,
body.theme-geist-terminal .pg-c:hover,
body.theme-geist-terminal .pg-x:hover,
body.theme-geist-terminal .btn-apply:hover,
body.theme-geist-terminal .btn-arch-sm:hover,
body.theme-geist-terminal .edu-panel__learn-btn:hover,
body.theme-geist-terminal .edu-panel__nav-btn:hover,
body.theme-geist-terminal .edu-panel__tab:hover,
body.theme-geist-terminal .neuron-detail-panel__tab:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.34) !important;
  color: #ffffff !important;
}

body.theme-geist-terminal .btn-tour,
body.theme-geist-terminal .btn-tour.active,
body.theme-geist-terminal .pg-btn--pri,
body.theme-geist-terminal .btn-ghost[aria-pressed="true"],
body.theme-geist-terminal .pg-c--on,
body.theme-geist-terminal .pg-x--undo,
body.theme-geist-terminal .toggle[aria-checked="true"],
body.theme-geist-terminal .edu-panel__learn-btn,
body.theme-geist-terminal .edu-panel__tab--active,
body.theme-geist-terminal .neuron-detail-panel__tab--active {
  background: var(--color-accent) !important;
  border-color: rgba(255, 255, 255, 0.82) !important;
  color: #050505 !important;
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.08) !important;
}

body.theme-geist-terminal .toggle {
  position: relative;
  background: rgba(255, 255, 255, 0.04) !important;
}

body.theme-geist-terminal .toggle::after {
  background: rgba(255, 255, 255, 0.86) !important;
}

body.theme-geist-terminal .toggle[aria-checked="true"]::after {
  background: #050505 !important;
}

body.theme-geist-terminal input[type="range"],
body.theme-geist-terminal .slider,
body.theme-geist-terminal .pg-lr input {
  appearance: none;
  background: rgba(255, 255, 255, 0.14) !important;
  border-radius: 999px;
  accent-color: #ffffff;
}

body.theme-geist-terminal input[type="range"]::-webkit-slider-thumb,
body.theme-geist-terminal .slider::-webkit-slider-thumb,
body.theme-geist-terminal .pg-lr input::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.72);
  background: #f5f5ef !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

body.theme-geist-terminal input[type="range"]::-moz-range-thumb,
body.theme-geist-terminal .slider::-moz-range-thumb,
body.theme-geist-terminal .pg-lr input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.72);
  background: #f5f5ef !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

body.theme-geist-terminal input[type="range"]::-moz-range-track,
body.theme-geist-terminal .slider::-moz-range-track,
body.theme-geist-terminal .pg-lr input::-moz-range-track {
  background: rgba(255, 255, 255, 0.14) !important;
  border-radius: 999px;
}

body.theme-geist-terminal .prediction-bar-track {
  border-radius: 2px !important;
}

body.theme-geist-terminal .prediction-bar {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.72)) !important;
  border-radius: 1px !important;
}

body.theme-geist-terminal .prediction-bar.highest {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.98)) !important;
}

body.theme-geist-terminal .live-dot--active {
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

body.theme-geist-terminal .live-dot--inactive {
  background: rgba(255, 255, 255, 0.18);
}

body.theme-geist-terminal .drawer__title,
body.theme-geist-terminal .modal__title,
body.theme-geist-terminal .timeline__summary,
body.theme-geist-terminal .timeline__label,
body.theme-geist-terminal .timeline__metrics,
body.theme-geist-terminal .setting__value,
body.theme-geist-terminal .prediction-compact-insight,
body.theme-geist-terminal .modal__description,
body.theme-geist-terminal .modal__note,
body.theme-geist-terminal .controls-list li,
body.theme-geist-terminal .edu-panel__simple-text,
body.theme-geist-terminal .pg-cls,
body.theme-geist-terminal .arch-info__item,
body.theme-geist-terminal .arch-layer-row__neurons span,
body.theme-geist-terminal .arch-layers-empty,
body.theme-geist-terminal .result-placeholder,
body.theme-geist-terminal .math-placeholder,
body.theme-geist-terminal .narrative-text {
  color: var(--color-text-secondary) !important;
}

body.theme-geist-terminal .arch-arrow,
body.theme-geist-terminal .prediction-percentage,
body.theme-geist-terminal .modal__note,
body.theme-geist-terminal .pg-head,
body.theme-geist-terminal .pg-m__l,
body.theme-geist-terminal .pg-lr,
body.theme-geist-terminal .timeline__title {
  color: var(--color-text-muted) !important;
}

body.theme-geist-terminal .drawer__header,
body.theme-geist-terminal .modal__header,
body.theme-geist-terminal .timeline__header,
body.theme-geist-terminal .modal__footer,
body.theme-geist-terminal .setting__header,
body.theme-geist-terminal .live-section__header,
body.theme-geist-terminal .pg-head,
body.theme-geist-terminal .arch-section__header,
body.theme-geist-terminal .edu-panel__tabs,
body.theme-geist-terminal .pg-foot {
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-geist-terminal .drawer__content,
body.theme-geist-terminal .modal__body,
body.theme-geist-terminal .edu-panel__section-content,
body.theme-geist-terminal .edu-panel__content,
body.theme-geist-terminal .pg-train,
body.theme-geist-terminal .pg-data {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.018) 0%, rgba(255, 255, 255, 0) 100%);
}

body.theme-geist-terminal .modal::backdrop {
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(8px);
}

body.theme-geist-terminal option {
  background: #0a0a0a;
  color: var(--color-text);
}

body.theme-geist-terminal .arch-layer,
body.theme-geist-terminal .controls-list kbd,
body.theme-geist-terminal .setting__value,
body.theme-geist-terminal .arch-info__item strong,
body.theme-geist-terminal .timeline__summary,
body.theme-geist-terminal .timeline__metrics,
body.theme-geist-terminal .timeline__label,
body.theme-geist-terminal .link-external {
  color: var(--color-text) !important;
}

body.theme-geist-terminal .arch-info__item,
body.theme-geist-terminal .controls-list li,
body.theme-geist-terminal .modal__description,
body.theme-geist-terminal .modal__note,
body.theme-geist-terminal .edu-panel__simple-text,
body.theme-geist-terminal .pg-cls,
body.theme-geist-terminal .pg-lr,
body.theme-geist-terminal .arch-layer-row__neurons span {
  color: var(--color-text-secondary) !important;
}

body.theme-geist-terminal .pg-train canvas,
body.theme-geist-terminal .pg-data canvas,
body.theme-geist-terminal .grid,
body.theme-geist-terminal .timeline__container,
body.theme-geist-terminal .drawer,
body.theme-geist-terminal .modal__content,
body.theme-geist-terminal .live-section,
body.theme-geist-terminal .card,
body.theme-geist-terminal .edu-panel__section,
body.theme-geist-terminal .pg-topbar,
body.theme-geist-terminal .pg-train,
body.theme-geist-terminal .pg-data {
  border-radius: 2px !important;
}

body.theme-geist-terminal .panel--pg,
body.theme-geist-terminal .panel--playground-edu,
body.theme-geist-terminal .sidebar-scroll,
body.theme-geist-terminal .edu-panel__content,
body.theme-geist-terminal .edu-panel__welcome,
body.theme-geist-terminal .drawer__content,
body.theme-geist-terminal .modal__body,
body.theme-geist-terminal .timeline__container {
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

body.theme-geist-terminal .panel--playground-edu::-webkit-scrollbar,
body.theme-geist-terminal .arch-layers::-webkit-scrollbar,
body.theme-geist-terminal .sidebar-scroll::-webkit-scrollbar,
body.theme-geist-terminal .modal__body::-webkit-scrollbar,
body.theme-geist-terminal .drawer__content::-webkit-scrollbar {
  width: 8px;
}

body.theme-geist-terminal .panel--playground-edu::-webkit-scrollbar-thumb,
body.theme-geist-terminal .arch-layers::-webkit-scrollbar-thumb,
body.theme-geist-terminal .sidebar-scroll::-webkit-scrollbar-thumb,
body.theme-geist-terminal .modal__body::-webkit-scrollbar-thumb,
body.theme-geist-terminal .drawer__content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
}

body.theme-geist-terminal .mobile-toggle-btn {
  background: rgba(9, 9, 9, 0.92);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
}

body.theme-geist-terminal .mobile-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.34);
}

body.theme-geist-terminal .link-external,
body.theme-geist-terminal .link-external:hover {
  color: var(--color-text);
}

body.theme-geist-terminal .math-formula,
body.theme-geist-terminal .math-step__content,
body.theme-geist-terminal .gradient-eq,
body.theme-geist-terminal .edu-tooltip__formula,
body.theme-geist-terminal .interactive-formula__main {
  font-family: var(--font-mono) !important;
}

body.theme-geist-terminal .math-value--positive {
  color: rgba(255, 255, 255, 0.98);
}

body.theme-geist-terminal .math-value--negative {
  color: rgba(255, 255, 255, 0.62);
}

body.theme-geist-terminal .math-value--zero {
  color: rgba(255, 255, 255, 0.32);
}

body.theme-geist-terminal .prediction-percentage,
body.theme-geist-terminal .fps-overlay__value,
body.theme-geist-terminal .pg-m__v,
body.theme-geist-terminal .pg-lr output {
  font-family: var(--font-mono);
}

body.theme-geist-terminal .panel,
body.theme-geist-terminal .app,
body.theme-geist-terminal .grid-wrapper,
body.theme-geist-terminal .live-narrative__body,
body.theme-geist-terminal .live-math__body,
body.theme-geist-terminal .live-result__body,
body.theme-geist-terminal .prediction-chart,
body.theme-geist-terminal .prediction-bars,
body.theme-geist-terminal .network-info-panel,
body.theme-geist-terminal .network-info-panel__summary,
body.theme-geist-terminal .network-info-panel__layer,
body.theme-geist-terminal .tour-overlay,
body.theme-geist-terminal .edu-panel__training-stats,
body.theme-geist-terminal .edu-panel__technical,
body.theme-geist-terminal .edu-panel__technical-content,
body.theme-geist-terminal .edu-panel__graph-container,
body.theme-geist-terminal .edu-panel__graph-value,
body.theme-geist-terminal .edu-panel__tour-content,
body.theme-geist-terminal .math-section,
body.theme-geist-terminal .activation-slider,
body.theme-geist-terminal .animation-steps,
body.theme-geist-terminal .math-live-card,
body.theme-geist-terminal .softmax-bar-track,
body.theme-geist-terminal .result-bar-track,
body.theme-geist-terminal .pipeline-node,
body.theme-geist-terminal .pipeline-node__icon,
body.theme-geist-terminal .pipeline-node__bar-track,
body.theme-geist-terminal .formula-tooltip,
body.theme-geist-terminal .activation-graph,
body.theme-geist-terminal .activation-graph__value,
body.theme-geist-terminal .edu-panel__graph,
body.theme-geist-terminal .neuron-popup__formula,
body.theme-geist-terminal .neuron-popup__contrib,
body.theme-geist-terminal .neuron-detail-panel__row,
body.theme-geist-terminal .neuron-detail-panel__row--header,
body.theme-geist-terminal .neuron-detail-panel__row--bias,
body.theme-geist-terminal .neuron-detail-panel__row--total,
body.theme-geist-terminal .interactive-formula,
body.theme-geist-terminal .interactive-formula__calculation,
body.theme-geist-terminal .math-section__calculation {
  background: linear-gradient(180deg, rgba(12, 12, 12, 0.94) 0%, rgba(4, 4, 4, 0.98) 100%) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

body.theme-geist-terminal .pipeline-node:hover,
body.theme-geist-terminal .formula-term:hover,
body.theme-geist-terminal .formula-term--highlighted,
body.theme-geist-terminal .animation-step--active,
body.theme-geist-terminal .animation-step--completed,
body.theme-geist-terminal .tour-highlight,
body.theme-geist-terminal .edu-panel__technical summary:hover,
body.theme-geist-terminal .edu-panel__section-header:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
  outline-color: rgba(255, 255, 255, 0.8) !important;
}

body.theme-geist-terminal button.tour-highlight,
body.theme-geist-terminal .tour-highlight button,
body.theme-geist-terminal #trainBtn.tour-highlight {
  outline-color: rgba(255, 255, 255, 0.9) !important;
}

body.theme-geist-terminal .pipeline-node__icon,
body.theme-geist-terminal .pipeline-node--active .pipeline-node__icon,
body.theme-geist-terminal .animation-step__number,
body.theme-geist-terminal .edu-panel__tour-step-number,
body.theme-geist-terminal .edu-panel__status,
body.theme-geist-terminal .edu-panel__status--active,
body.theme-geist-terminal .edu-panel__status--inactive,
body.theme-geist-terminal .neuron-status,
body.theme-geist-terminal .neuron-status--active,
body.theme-geist-terminal .neuron-status--inactive,
body.theme-geist-terminal .neuron-popup__status,
body.theme-geist-terminal .neuron-popup__status--active,
body.theme-geist-terminal .neuron-popup__status--inactive,
body.theme-geist-terminal .result-confidence,
body.theme-geist-terminal .narrative-confidence,
body.theme-geist-terminal .narrative-confidence--high,
body.theme-geist-terminal .narrative-confidence--medium,
body.theme-geist-terminal .narrative-confidence--low {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: var(--color-text) !important;
}

body.theme-geist-terminal .pipeline-node__bar-fill,
body.theme-geist-terminal .pipeline-node--active .pipeline-node__bar-fill,
body.theme-geist-terminal .softmax-bar-fill,
body.theme-geist-terminal .softmax-bar-fill--winner,
body.theme-geist-terminal .result-bar-fill,
body.theme-geist-terminal .result-bar-fill--winner,
body.theme-geist-terminal .result-bar-fill--other,
body.theme-geist-terminal .prediction-bar,
body.theme-geist-terminal .prediction-bar.highest {
  background: linear-gradient(90deg, rgba(180, 180, 176, 0.4), rgba(255, 255, 255, 0.96)) !important;
}

body.theme-geist-terminal .pipeline-arrow__line,
body.theme-geist-terminal .pipeline-arrow--flowing .pipeline-arrow__line {
  background: rgba(255, 255, 255, 0.18) !important;
}

body.theme-geist-terminal .pipeline-arrow--flowing .pipeline-arrow__line::after {
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.92), transparent) !important;
}

body.theme-geist-terminal .card__header,
body.theme-geist-terminal .card__content,
body.theme-geist-terminal .panel--left,
body.theme-geist-terminal .panel--right,
body.theme-geist-terminal .panel--pg,
body.theme-geist-terminal .panel--playground-edu,
body.theme-geist-terminal .sidebar-scroll,
body.theme-geist-terminal .grid-interaction-row,
body.theme-geist-terminal .digit-button-column,
body.theme-geist-terminal .sample-buttons {
  color: var(--color-text) !important;
}

body.theme-geist-terminal .network-info-panel__title,
body.theme-geist-terminal .network-info-panel__layer-title,
body.theme-geist-terminal .network-info-panel__metric-label,
body.theme-geist-terminal .pipeline-node__name,
body.theme-geist-terminal .math-live-card__title,
body.theme-geist-terminal .math-section__title,
body.theme-geist-terminal .activation-slider__label,
body.theme-geist-terminal .edu-panel__neuron-title,
body.theme-geist-terminal .edu-panel__tour-step-title,
body.theme-geist-terminal .edu-panel__training-stat-label,
body.theme-geist-terminal .tour-tooltip__title,
body.theme-geist-terminal .neuron-popup__title,
body.theme-geist-terminal .neuron-popup__section-title,
body.theme-geist-terminal .neuron-detail-panel__title,
body.theme-geist-terminal .neuron-detail-panel__section-title,
body.theme-geist-terminal .digit-button,
body.theme-geist-terminal .sample-btn {
  font-family: var(--font-display) !important;
  letter-spacing: 0.06em !important;
  color: var(--color-text) !important;
}

body.theme-geist-terminal .network-info-panel__summary,
body.theme-geist-terminal .network-info-panel__summary-line,
body.theme-geist-terminal .network-info-panel__layer-metrics,
body.theme-geist-terminal .network-info-panel__empty,
body.theme-geist-terminal .pipeline-node__stats,
body.theme-geist-terminal .math-live-card__label,
body.theme-geist-terminal .math-live-formula,
body.theme-geist-terminal .softmax-label,
body.theme-geist-terminal .softmax-logit,
body.theme-geist-terminal .softmax-prob,
body.theme-geist-terminal .result-label,
body.theme-geist-terminal .result-pct,
body.theme-geist-terminal .result-confidence,
body.theme-geist-terminal .math-section__calculation,
body.theme-geist-terminal .math-section__result,
body.theme-geist-terminal .activation-slider__values,
body.theme-geist-terminal .activation-slider__hint,
body.theme-geist-terminal .edu-panel__graph-value-label,
body.theme-geist-terminal .edu-panel__graph-value-num,
body.theme-geist-terminal .edu-panel__technical-content,
body.theme-geist-terminal .edu-panel__tour-text,
body.theme-geist-terminal .tour-tooltip__text,
body.theme-geist-terminal .tour-tooltip__step,
body.theme-geist-terminal .neuron-popup__subtitle,
body.theme-geist-terminal .neuron-popup__desc,
body.theme-geist-terminal .neuron-popup__contrib-label,
body.theme-geist-terminal .neuron-popup__contrib-calc,
body.theme-geist-terminal .neuron-popup__contrib-result,
body.theme-geist-terminal .neuron-detail-panel__summary,
body.theme-geist-terminal .neuron-detail-panel__row,
body.theme-geist-terminal .neuron-detail-panel__row small,
body.theme-geist-terminal .neuron-detail-panel__empty,
body.theme-geist-terminal .math-value,
body.theme-geist-terminal .math-dots,
body.theme-geist-terminal .formula-term,
body.theme-geist-terminal .formula-tooltip,
body.theme-geist-terminal .activation-graph__value-label,
body.theme-geist-terminal .activation-graph__value-num,
body.theme-geist-terminal .error-text {
  font-family: var(--font-mono) !important;
  color: var(--color-text-secondary) !important;
}

body.theme-geist-terminal .math-section__formula,
body.theme-geist-terminal .interactive-formula__main,
body.theme-geist-terminal .activation-slider__z,
body.theme-geist-terminal .activation-slider__a,
body.theme-geist-terminal .neuron-popup__formula,
body.theme-geist-terminal .math-result,
body.theme-geist-terminal .math-var,
body.theme-geist-terminal .math-num,
body.theme-geist-terminal .math-op,
body.theme-geist-terminal .math-sub,
body.theme-geist-terminal .math-sup,
body.theme-geist-terminal .math-frac,
body.theme-geist-terminal .math-frac__num,
body.theme-geist-terminal .math-frac__den,
body.theme-geist-terminal .math-partial {
  font-family: var(--font-mono) !important;
  color: var(--color-text) !important;
}

body.theme-geist-terminal .math-section__result,
body.theme-geist-terminal .network-info-panel__metric span:last-child,
body.theme-geist-terminal .network-info-panel__summary-line span,
body.theme-geist-terminal .network-info-panel__summary-line strong,
body.theme-geist-terminal .softmax-prob,
body.theme-geist-terminal .result-pct,
body.theme-geist-terminal .edu-panel__training-stat-value,
body.theme-geist-terminal .edu-panel__graph-value-num,
body.theme-geist-terminal .activation-graph__value-num,
body.theme-geist-terminal .neuron-popup__contrib-result,
body.theme-geist-terminal .neuron-detail-panel__row strong {
  color: var(--color-text) !important;
}

body.theme-geist-terminal .formula-term__weight,
body.theme-geist-terminal .formula-term__input,
body.theme-geist-terminal .formula-term__bias,
body.theme-geist-terminal .formula-term__op,
body.theme-geist-terminal .softmax-label.math-dots {
  color: var(--color-text-secondary) !important;
}

body.theme-geist-terminal .activation-slider__input,
body.theme-geist-terminal .activation-slider__input::-moz-range-track {
  background: rgba(255, 255, 255, 0.12) !important;
}

body.theme-geist-terminal .activation-slider__input::-webkit-slider-thumb,
body.theme-geist-terminal .activation-slider__input::-moz-range-thumb {
  background: #f5f5ef !important;
  border: 1px solid rgba(0, 0, 0, 0.72) !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08) !important;
}

body.theme-geist-terminal .btn-animate,
body.theme-geist-terminal .btn-animate:hover,
body.theme-geist-terminal .btn-animate:active,
body.theme-geist-terminal .btn-animate--playing,
body.theme-geist-terminal .tour-tooltip__btn,
body.theme-geist-terminal .tour-tooltip__btn:hover,
body.theme-geist-terminal .tour-tooltip__btn--primary,
body.theme-geist-terminal .tour-tooltip__btn--primary:hover,
body.theme-geist-terminal .edu-panel__prev,
body.theme-geist-terminal .edu-panel__next {
  font-family: var(--font-display) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: var(--color-text) !important;
  transform: none !important;
  box-shadow: none !important;
}

body.theme-geist-terminal .btn-animate[disabled],
body.theme-geist-terminal .tour-tooltip__btn[disabled],
body.theme-geist-terminal .edu-panel__nav-btn[disabled] {
  opacity: 0.4 !important;
}

body.theme-geist-terminal .tour-tooltip,
body.theme-geist-terminal .formula-tooltip,
body.theme-geist-terminal .neuron-popup,
body.theme-geist-terminal .neuron-detail-panel {
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.96) 0%, rgba(3, 3, 3, 0.98) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: var(--shadow-lg) !important;
}

body.theme-geist-terminal .modal__content {
  background: linear-gradient(180deg, rgba(12, 12, 12, 0.96) 0%, rgba(4, 4, 4, 0.98) 100%) !important;
}

body.theme-geist-terminal .drawer__title,
body.theme-geist-terminal .modal__title,
body.theme-geist-terminal .timeline__title {
  color: var(--color-text) !important;
}

body.theme-geist-terminal .tour-tooltip::after,
body.theme-geist-terminal .formula-tooltip::after {
  border-top-color: rgba(255, 255, 255, 0.7) !important;
}

body.theme-geist-terminal .app.panels-hidden::before {
  background: rgba(8, 8, 8, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 999px !important;
  color: var(--color-text-secondary) !important;
  font-family: var(--font-display) !important;
  letter-spacing: 0.06em !important;
}

@keyframes geistTerminalTourPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.26);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
}

body.theme-geist-terminal .prediction-bar-container,
body.theme-geist-terminal .prediction-compact-insight,
body.theme-geist-terminal .prediction-compact-insight__value,
body.theme-geist-terminal .edu-welcome,
body.theme-geist-terminal .edu-realtime,
body.theme-geist-terminal .edu-details,
body.theme-geist-terminal .edu-details summary,
body.theme-geist-terminal .edu-details-content,
body.theme-geist-terminal .edu-tip,
body.theme-geist-terminal .legend-item,
body.theme-geist-terminal .softmax-grid,
body.theme-geist-terminal .result-row,
body.theme-geist-terminal .tour-tooltip__nav {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--color-text-secondary) !important;
}

body.theme-geist-terminal .edu-welcome,
body.theme-geist-terminal .edu-realtime,
body.theme-geist-terminal .edu-tip,
body.theme-geist-terminal .edu-details-content,
body.theme-geist-terminal .prediction-compact-insight,
body.theme-geist-terminal .math-live-card,
body.theme-geist-terminal .live-narrative__body,
body.theme-geist-terminal .live-math__body,
body.theme-geist-terminal .live-result__body {
  background: linear-gradient(180deg, rgba(14, 14, 14, 0.94) 0%, rgba(5, 5, 5, 0.98) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
}

body.theme-geist-terminal .edu-welcome,
body.theme-geist-terminal .edu-realtime,
body.theme-geist-terminal .edu-tip {
  border-left: 2px solid rgba(255, 255, 255, 0.66) !important;
}

body.theme-geist-terminal .edu-details summary,
body.theme-geist-terminal .btn-tour,
body.theme-geist-terminal .btn-tour.active,
body.theme-geist-terminal .tour-tooltip__btn,
body.theme-geist-terminal .tour-tooltip__btn--primary {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--color-text) !important;
}

body.theme-geist-terminal .edu-details summary::before,
body.theme-geist-terminal .tour-tooltip__step,
body.theme-geist-terminal .prediction-compact-insight__label,
body.theme-geist-terminal .math-placeholder,
body.theme-geist-terminal .result-placeholder,
body.theme-geist-terminal .legend-item,
body.theme-geist-terminal .softmax-label,
body.theme-geist-terminal .softmax-logit {
  color: var(--color-text-muted) !important;
}

body.theme-geist-terminal .prediction-label,
body.theme-geist-terminal .prediction-percentage,
body.theme-geist-terminal .result-label,
body.theme-geist-terminal .result-pct,
body.theme-geist-terminal .softmax-prob,
body.theme-geist-terminal .prediction-compact-insight__value,
body.theme-geist-terminal .math-live-card__title,
body.theme-geist-terminal .math-live-card__label,
body.theme-geist-terminal .math-live-formula,
body.theme-geist-terminal .narrative-text,
body.theme-geist-terminal .tour-tooltip__title,
body.theme-geist-terminal .tour-tooltip__text {
  color: var(--color-text-secondary) !important;
}

body.theme-geist-terminal .prediction-label,
body.theme-geist-terminal .result-label,
body.theme-geist-terminal .math-live-card__title,
body.theme-geist-terminal .tour-tooltip__title {
  font-family: var(--font-display) !important;
  letter-spacing: 0.06em !important;
}

body.theme-geist-terminal .math-live-formula,
body.theme-geist-terminal .prediction-percentage,
body.theme-geist-terminal .result-pct,
body.theme-geist-terminal .softmax-prob {
  font-family: var(--font-mono) !important;
  color: var(--color-text) !important;
}

body.theme-geist-terminal .legend-color,
body.theme-geist-terminal .legend-color--green,
body.theme-geist-terminal .legend-color--red,
body.theme-geist-terminal .legend-color--gray,
body.theme-geist-terminal .legend-color--blue {
  background: linear-gradient(90deg, rgba(120, 120, 116, 0.45), rgba(255, 255, 255, 0.92)) !important;
  box-shadow: none !important;
  border-radius: 1px !important;
}

body.theme-geist-terminal .tour-highlight,
body.theme-geist-terminal button.tour-highlight,
body.theme-geist-terminal .tour-highlight button,
body.theme-geist-terminal #trainBtn.tour-highlight {
  animation: geistTerminalTourPulse 1.5s ease-in-out infinite !important;
  outline: 1px solid rgba(255, 255, 255, 0.82) !important;
  outline-offset: 3px !important;
}

body.theme-geist-terminal .tour-tooltip {
  border-width: 1px !important;
}

body.theme-geist-terminal .error-text {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(14, 14, 14, 0.94) 0%, rgba(5, 5, 5, 0.98) 100%);
  line-height: 1.6;
}

body.theme-geist-terminal .app,
body.theme-geist-terminal .grid-wrapper {
  background: transparent !important;
}
