/* === Seizure Origin Detection — Purple Theme === */

:root {
  --bg: #06060e;
  --surface: #0c0c1d;
  --surface2: #141428;
  --border: #1e1e3a;
  --text: #e0dff0;
  --text-dim: #7a78a0;
  --accent: #8b5cf6;
  --accent-bright: #a78bfa;
  --accent2: #c084fc;
  --green: #22d3a0;
  --danger: #f43f5e;
  --warn: #f59e0b;
  --glow: rgba(139, 92, 246, 0.25);
  --gradient: linear-gradient(135deg, #8b5cf6, #6d28d9);
  --gradient-subtle: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(109,40,217,0.06));
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
}

/* === Animations === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 20px var(--glow); } 50% { box-shadow: 0 0 40px var(--glow), 0 0 60px rgba(139,92,246,0.1); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes asciiFlicker { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.25; } }

/* === Welcome Popup === */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 10, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease;
}

.welcome-overlay.hidden { display: none; }

.welcome-card {
  background: var(--surface);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  padding: 56px 60px;
  max-width: 780px;
  width: 92%;
  text-align: center;
  animation: slideUp 0.5s ease;
  box-shadow: 0 0 80px rgba(139, 92, 246, 0.18), 0 24px 80px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

.welcome-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
}

.welcome-ascii {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: #ff85cc;
  opacity: 0.65;
  white-space: pre;
  margin-bottom: 24px;
  user-select: none;
  text-shadow: 0 0 5px #ff85cc, 0 0 14px rgba(255,133,204,0.65), 0 0 28px rgba(255,133,204,0.3);
  position: relative;
  display: inline-block;
  transform: scaleX(1.07);
  transform-origin: left center;
}

.welcome-card h2 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 14px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-card p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.welcome-card .welcome-hint {
  font-size: 14px;
  color: var(--accent);
  opacity: 0.6;
  margin-top: 24px;
}

.welcome-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 28px 0;
  text-align: left;
}

.welcome-feature {
  background: var(--gradient-subtle);
  border: 1px solid rgba(139,92,246,0.15);
  border-radius: 12px;
  padding: 18px 20px;
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.5;
  transition: border-color 0.2s;
}

.welcome-feature:hover {
  border-color: rgba(139,92,246,0.4);
}

.welcome-feature strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

/* === Header === */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  animation: fadeIn 0.6s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-ascii {
  font-family: 'JetBrains Mono', monospace;
  font-size: 7px;
  font-weight: 700;
  line-height: 1.05;
  color: #ff85cc;
  opacity: 0.65;
  white-space: pre;
  user-select: none;
  text-shadow: 0 0 3px #ff85cc, 0 0 8px rgba(255,133,204,0.65), 0 0 16px rgba(255,133,204,0.3);
  margin: 0;
  transform: scaleX(1.07);
  transform-origin: left center;
}

.header h1 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.header h1 span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 400;
}

.header-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

button {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Inter', sans-serif;
}

button:hover { background: var(--border); border-color: rgba(139,92,246,0.3); }
button:disabled { opacity: 0.35; cursor: default; }
button.primary { background: var(--gradient); color: #fff; border-color: var(--accent); }
button.primary:hover { opacity: 0.9; }
button.active { background: var(--green); color: #000; border-color: var(--green); }

#btn-tutorial {
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
}

.file-label {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.file-label:hover { background: var(--border); border-color: rgba(139,92,246,0.3); }
.file-label input { display: none; }

#status {
  font-size: 11px;
  color: var(--text-dim);
  max-width: 300px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

/* === Model Loading Bar === */
.model-loading {
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-loading-track {
  width: 80px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.model-loading-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.model-loading-text {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-bright);
  min-width: 28px;
}

/* === Demo Dropdown === */
.demo-dropdown {
  position: relative;
}

.demo-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 360px;
  max-height: 440px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 30px var(--glow);
  animation: slideUp 0.2s ease;
}

.demo-dropdown:hover .demo-menu,
.demo-menu:hover {
  display: block;
}

.demo-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.demo-item:last-child { border-bottom: none; }
.demo-item:hover { background: var(--gradient-subtle); }

.demo-item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.demo-item-desc {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.4;
}

.demo-item-region {
  display: inline-block;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(139,92,246,0.15);
  color: var(--accent-bright);
  margin-top: 4px;
  font-weight: 600;
}

/* === Main Layout === */
.main {
  display: flex;
  height: calc(100vh - 48px);
}

.brain-panel {
  flex: 0 0 60%;
  position: relative;
  background: var(--bg);
}

#brain-container {
  width: 100%;
  height: 100%;
}

.side-panel {
  flex: 0 0 40%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* === Tabs === */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 9px 4px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tab-btn:hover { color: var(--text); background: rgba(139,92,246,0.06); }
.tab-btn.active {
  color: var(--text);
  background: rgba(139,92,246,0.06);
  border-bottom-color: transparent;
  font-weight: 600;
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

/* === Results === */
.result-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  animation: slideUp 0.4s ease;
}

.result-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.5;
}

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

.coord-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.coord-item:hover { border-color: rgba(139,92,246,0.3); }

.coord-label {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.coord-value {
  font-size: 18px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-bright);
}

/* === Compliance Bar === */
.compliance-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.compliance-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.compliance-high { background: var(--green); }
.compliance-med { background: var(--warn); }
.compliance-low { background: var(--danger); }

.compliance-text { font-size: 12px; margin-bottom: 4px; }
.compliance-detail { font-size: 10px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }

/* === Summary === */
.summary-card {
  border-color: rgba(139, 92, 246, 0.3);
  background: var(--gradient-subtle);
}

.summary-text {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-dim);
}

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

/* === KaTeX Equations === */
.katex-eq .katex {
  font-size: 1.05em;
  color: var(--text);
}

/* === PCA Insights === */
.insights-container { margin-bottom: 14px; }

.insight-card {
  background: var(--gradient-subtle);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: border-color 0.2s;
}

.insight-card:hover { border-color: rgba(139,92,246,0.4); }

.insight-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.insight-body h4 {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--text);
}

.insight-body p {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

.insight-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 5px;
}

.insight-tag.good { background: rgba(34,211,160,0.15); color: var(--green); }
.insight-tag.neutral { background: rgba(139,92,246,0.15); color: var(--accent-bright); }
.insight-tag.warn { background: rgba(245,158,11,0.15); color: var(--warn); }

/* === Progress === */
.progress-container {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  z-index: 5;
  display: none;
  box-shadow: 0 0 30px var(--glow);
}

.progress-bar-track {
  height: 3px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s;
}

.progress-text {
  font-size: 10px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

/* === Tooltip === */
#tooltip {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  pointer-events: none;
  display: none;
  z-index: 20;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(139,92,246,0.2);
}

/* === Hand Preview === */
#hand-preview {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 140px;
  height: 105px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: none;
  z-index: 5;
  opacity: 0.7;
}

/* === How It Works === */
.about-text {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-dim);
}

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

.architecture-diagram {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.arch-block {
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  transition: transform 0.2s;
}

.arch-block:hover { transform: translateY(-2px); }

.arch-block span {
  display: block;
  font-size: 9px;
  font-weight: 400;
  opacity: 0.7;
  margin-top: 2px;
}

.arch-input { background: rgba(139,92,246,0.15); border: 1px solid rgba(139,92,246,0.3); color: var(--accent-bright); }
.arch-pca { background: rgba(192,132,252,0.15); border: 1px solid rgba(192,132,252,0.3); color: var(--accent2); }
.arch-encoder { background: rgba(34,211,160,0.12); border: 1px solid rgba(34,211,160,0.3); color: var(--green); }
.arch-coord { background: rgba(244,63,94,0.15); border: 1px solid rgba(244,63,94,0.3); color: var(--danger); margin-bottom: 4px; }
.arch-phys { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); color: var(--warn); }

.arch-arrow { font-size: 16px; color: var(--text-dim); }
.arch-split { display: flex; flex-direction: column; gap: 4px; }

.equation-list { margin-top: 10px; }

.equation {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 6px;
}

.eq-label {
  display: block;
  font-size: 10px;
  color: var(--accent-bright);
  font-weight: 600;
  margin-bottom: 3px;
}

.equation code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text);
  word-break: break-word;
}

.pipeline-steps { margin-top: 10px; }

.pipe-step {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.pipe-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--gradient);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.pipe-step div {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
}

.pipe-step strong { color: var(--text); }

/* === Upload Guide === */
.format-list {
  list-style: none;
  margin-top: 8px;
}

.format-list li {
  font-size: 11px;
  color: var(--text-dim);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.format-list li:last-child { border-bottom: none; }
.format-list strong { color: var(--text); }

/* === Footer === */
.footer {
  font-size: 10px;
  color: var(--text-dim);
  padding: 6px 14px;
  border-top: 1px solid var(--border);
  text-align: center;
  flex-shrink: 0;
}

.footer a { color: var(--accent-bright); text-decoration: none; }

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-dim);
}

.empty-state h3 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 12px;
  line-height: 1.6;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* === Theme Toggle Button === */
#btn-theme {
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  transition: all 0.2s;
}

#btn-theme:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent);
}

/* === Created By Button (header) === */
.created-by {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  color: var(--accent-bright);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.created-by:hover {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent2);
  border-color: var(--accent-bright);
}

.created-by svg { flex-shrink: 0; }

.footer-sep { margin: 0 6px; opacity: 0.4; }

/* === ASCII label overlay === */
.header-ascii-wrap {
  position: relative;
  display: inline-flex;
  overflow: visible;
}

.ascii-label {
  position: absolute;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  opacity: 0.78;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(139,92,246,0.6), 0 0 3px rgba(255,255,255,0.4);
  letter-spacing: 0.2px;
  line-height: 1;
}

.ascii-label-sm {
  font-size: 5.5px;
  opacity: 0.65;
}

/* Popup ASCII labels: larger inside the bigger art */
.welcome-ascii .ascii-label {
  font-size: 10px;
  opacity: 0.82;
}

/* === Region Badge === */
.region-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 63, 94, 0.10);
  border: 1px solid rgba(244, 63, 94, 0.28);
  color: #f87191;
  border-radius: 20px;
  padding: 4px 12px 4px 10px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
  animation: slideUp 0.4s ease;
}

/* === Gesture Overlay === */
.gesture-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 10, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.gesture-overlay.hidden { display: none; }

.gesture-card {
  background: var(--surface);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 16px;
  padding: 32px 40px 28px;
  max-width: 480px;
  width: 92%;
  position: relative;
  animation: slideUp 0.35s ease;
  box-shadow: 0 0 60px rgba(139, 92, 246, 0.2), 0 20px 60px rgba(0,0,0,0.5);
}

.gesture-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient);
  border-radius: 16px 16px 0 0;
}

.gesture-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gesture-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 22px;
  line-height: 1.5;
}

.gesture-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 28px; height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text-dim);
}

.gesture-close:hover { color: var(--text); background: var(--border); }

.gesture-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gesture-item {
  background: var(--gradient-subtle);
  border: 1px solid rgba(139,92,246,0.15);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: border-color 0.2s;
}

.gesture-item:hover { border-color: rgba(139,92,246,0.35); }

.gesture-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.gesture-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.gesture-desc strong { color: var(--text); display: block; margin-bottom: 2px; }

/* === Light Mode === */
body.light-mode {
  --bg: #f5f3fa;
  --surface: #ffffff;
  --surface2: #f0edf5;
  --border: #e0dcea;
  --text: #1a1830;
  --text-dim: #6b6590;
  --glow: rgba(139, 92, 246, 0.12);
  --gradient-subtle: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(109,40,217,0.04));
}

body.light-mode .header {
  background: #ffffff;
  border-bottom-color: #e0dcea;
}

body.light-mode button {
  background: #f0edf5;
  border-color: #e0dcea;
  color: #1a1830;
}

body.light-mode button:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
}

body.light-mode button.primary {
  background: var(--gradient);
  color: #fff;
  border-color: var(--accent);
}

body.light-mode .side-panel {
  background: #ffffff;
  border-left-color: #e0dcea;
}

body.light-mode .result-card {
  background: #f8f6fc;
  border-color: #e0dcea;
}

body.light-mode .coord-item {
  background: #f0edf5;
  border-color: #e0dcea;
}

body.light-mode .equation {
  background: #f0edf5;
  border-color: #e0dcea;
}

body.light-mode .demo-menu {
  background: #ffffff;
  border-color: #e0dcea;
  box-shadow: 0 12px 40px rgba(0,0,0,0.1), 0 0 20px rgba(139,92,246,0.08);
}

body.light-mode .demo-item {
  border-bottom-color: #e0dcea;
}

body.light-mode .demo-item:hover {
  background: rgba(139, 92, 246, 0.06);
}

body.light-mode .tab-btn:hover,
body.light-mode .tab-btn.active {
  background: rgba(139, 92, 246, 0.08);
}

body.light-mode .tabs {
  border-bottom-color: #e0dcea;
}

body.light-mode .file-label {
  background: #f0edf5;
  border-color: #e0dcea;
  color: #1a1830;
}

body.light-mode .welcome-card {
  background: #ffffff;
  box-shadow: 0 0 80px rgba(139, 92, 246, 0.1), 0 24px 80px rgba(0,0,0,0.1);
}

body.light-mode .welcome-overlay {
  background: rgba(245, 243, 250, 0.85);
}

body.light-mode .welcome-feature {
  background: rgba(139, 92, 246, 0.05);
  border-color: rgba(139, 92, 246, 0.12);
}

body.light-mode .footer {
  border-top-color: #e0dcea;
}

body.light-mode .header-ascii {
  color: #e0408a;
  text-shadow: none;
}

body.light-mode .welcome-ascii {
  color: #e0408a;
  text-shadow: none;
}

body.light-mode #btn-theme:hover {
  background: rgba(139, 92, 246, 0.1);
}

body.light-mode .created-by:hover {
  background: rgba(139, 92, 246, 0.08);
}

body.light-mode .gesture-card {
  background: #ffffff;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.08), 0 20px 40px rgba(0,0,0,0.1);
}

body.light-mode .gesture-overlay {
  background: rgba(245, 243, 250, 0.8);
}

body.light-mode .gesture-item {
  background: rgba(139, 92, 246, 0.05);
  border-color: rgba(139, 92, 246, 0.12);
}

body.light-mode .ascii-label {
  color: var(--accent);
  text-shadow: none;
}

body.light-mode .region-badge {
  background: rgba(244, 63, 94, 0.06);
  border-color: rgba(244, 63, 94, 0.2);
  color: #e11d48;
}

body.light-mode .progress-container {
  background: #ffffff;
  border-color: #e0dcea;
  box-shadow: 0 0 20px rgba(139,92,246,0.08);
}

body.light-mode ::-webkit-scrollbar-track { background: #f5f3fa; }
body.light-mode ::-webkit-scrollbar-thumb { background: #d0cce0; }

/* === Responsive === */
@media (max-width: 900px) {
  .main { flex-direction: column; }
  .brain-panel { flex: 0 0 50vh; }
  .side-panel { flex: 1; }
  .header { flex-wrap: wrap; gap: 8px; }
  .header-controls { flex-wrap: wrap; }
  .demo-menu { min-width: 280px; right: -40px; }
}
