/* ═══════════════════════════════════════════
   NeuronLab — Shared Stylesheet
   ═══════════════════════════════════════════ */

/* Google Fonts are loaded in HTML */

:root {
  --bg-void: #000000;
  --bg-deep: #03050f;
  --bg-panel: rgba(8, 18, 42, 0.72);
  --bg-card: rgba(12, 26, 58, 0.55);
  --bg-card-hover: rgba(16, 34, 74, 0.7);
  --border-dim: rgba(59, 130, 246, 0.12);
  --border-glow: rgba(96, 165, 250, 0.35);
  --border-bright: rgba(147, 197, 253, 0.55);
  --blue-core: #3b82f6;
  --blue-light: #60a5fa;
  --blue-pale: #93c5fd;
  --blue-whisper: rgba(59, 130, 246, 0.08);
  --teal: #2dd4bf;
  --teal-dim: rgba(45, 212, 191, 0.15);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.12);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, 0.12);
  --purple: #a78bfa;
  --purple-dim: rgba(167, 139, 250, 0.12);
  --text-primary: #e2eaf8;
  --text-secondary: #8eacd4;
  --text-muted: #4a6490;
  --glow-blue: 0 0 30px rgba(59, 130, 246, 0.18), 0 0 80px rgba(59, 130, 246, 0.06);
  --glow-blue-strong: 0 0 20px rgba(96, 165, 250, 0.3), 0 0 60px rgba(59, 130, 246, 0.15);
  --glow-teal: 0 0 25px rgba(45, 212, 191, 0.2);
  --glow-amber: 0 0 25px rgba(251, 191, 36, 0.18);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-void);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(59,130,246,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(45,212,191,0.05) 0%, transparent 50%);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  padding: 0 0.75rem 5rem;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ─── LAYOUT ─── */
.container { max-width: 860px; margin: 0 auto; position: relative; z-index: 1; }

/* ─── GLASS PANELS ─── */
.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  box-shadow: var(--glow-blue), inset 0 1px 0 rgba(147,197,253,0.06);
}
.glass:hover {
  border-color: var(--border-glow);
  box-shadow: var(--glow-blue-strong), inset 0 1px 0 rgba(147,197,253,0.1);
  transition: all 0.4s ease;
}
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
}

/* ─── HEADER ─── */
header {
  text-align: center;
  padding: 2rem 0 2rem;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.2rem;
}
.logo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--blue-light);
  box-shadow: 0 0 12px var(--blue-light), 0 0 30px rgba(96,165,250,0.4);
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}
.logo-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-pale);
}
h1 {
  font-size: clamp(1.6rem, 6vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.7rem;
}
h1 span {
  background: linear-gradient(135deg, var(--blue-pale) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 300;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ─── JOURNEY TRACK ─── */
.journey-track {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 1.2rem 1rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.journey-track::-webkit-scrollbar { display: none; }
.journey-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 50px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}
.journey-step::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  width: 100%;
  height: 1px;
  background: var(--border-dim);
  z-index: 0;
}
.journey-step:last-child::after { display: none; }
.step-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border-dim);
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: all 0.3s;
}
.journey-step.active .step-dot {
  border-color: var(--blue-light);
  background: rgba(59,130,246,0.15);
  color: var(--blue-pale);
  box-shadow: 0 0 16px rgba(96,165,250,0.35);
}
.journey-step.done .step-dot {
  border-color: var(--teal);
  background: var(--teal-dim);
  color: var(--teal);
}
.journey-step.locked .step-dot { opacity: 0.35; cursor: not-allowed; }
.step-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.journey-step.active .step-label { color: var(--blue-pale); }
.journey-step.done .step-label { color: var(--teal); }

/* ─── SECTIONS / STAGE CARDS ─── */
.section { margin-bottom: 1.25rem; }
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.badge-blue   { background: rgba(59,130,246,0.15);  color: var(--blue-pale); border: 1px solid rgba(59,130,246,0.3); }
.badge-teal   { background: var(--teal-dim);          color: var(--teal);      border: 1px solid rgba(45,212,191,0.3); }
.badge-amber  { background: var(--amber-dim);         color: var(--amber);     border: 1px solid rgba(251,191,36,0.3); }
.badge-red    { background: var(--red-dim);           color: var(--red);       border: 1px solid rgba(248,113,113,0.3); }
.badge-green  { background: var(--green-dim);         color: var(--green);     border: 1px solid rgba(74,222,128,0.3); }
.badge-purple { background: var(--purple-dim);        color: var(--purple);    border: 1px solid rgba(167,139,250,0.3); }

.section-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }

/* ─── INSIGHT BOX ─── */
.insight-box {
  background: rgba(59,130,246,0.05);
  border: 1px solid rgba(59,130,246,0.15);
  border-left: 3px solid var(--blue-core);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin: 0.9rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.insight-box strong { color: var(--blue-pale); font-weight: 600; }
.insight-box.warning { border-left-color: var(--amber); background: var(--amber-dim); }
.insight-box.success { border-left-color: var(--teal);  background: var(--teal-dim);  }

/* ─── CONTROLS ─── */
.control-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}
select, input[type="text"] {
  background: rgba(6, 14, 35, 0.8);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.6rem 0.9rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px; /* touch-friendly */
}
select:hover, input[type="text"]:hover { border-color: var(--border-glow); }
select:focus, input[type="text"]:focus { border-color: var(--blue-light); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
select {
  cursor: pointer;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a6490' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  white-space: nowrap;
  min-height: 44px; /* touch-friendly */
  touch-action: manipulation;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--blue-core);
  color: white;
  box-shadow: 0 0 20px rgba(59,130,246,0.3);
}
.btn-primary:hover:not(:disabled) { background: var(--blue-light); box-shadow: 0 0 30px rgba(96,165,250,0.45); transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-dim);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-card-hover); border-color: var(--border-glow); color: var(--text-primary); }
.btn-teal {
  background: rgba(45,212,191,0.15);
  color: var(--teal);
  border: 1px solid rgba(45,212,191,0.3);
}
.btn-teal:hover:not(:disabled) { background: rgba(45,212,191,0.25); box-shadow: var(--glow-teal); }
.btn-ghost {
  background: transparent;
  color: var(--blue-pale);
  border: 1px solid var(--border-glow);
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
}
.btn-ghost:hover { background: rgba(96,165,250,0.08); }

/* ─── SPINNER ─── */
.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── STATS GRID ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 1rem;
}
@media (max-width: 600px) { .stats-grid { grid-template-columns: 1fr; } }
.stat-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 0.9rem;
}
.stat-panel-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}
.stat-bar-row { margin-bottom: 7px; }
.stat-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
  margin-bottom: 3px;
}
.stat-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── OUTPUT BOX ─── */
.output-box {
  background: rgba(3, 8, 22, 0.7);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text-secondary);
  min-height: 75px;
  position: relative;
  overflow-wrap: break-word;
  word-break: break-word;
}
.output-box.active { border-color: rgba(59,130,246,0.25); box-shadow: inset 0 0 30px rgba(59,130,246,0.04); }

/* ─── TOKEN COLORS ─── */
.tok-prompt { color: var(--blue-pale); font-weight: 500; }
.tok-char { animation: tokIn 0.06s ease-out forwards; }
.tok-word { animation: tokIn 0.09s ease-out forwards; }
@keyframes tokIn { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: blur(0); } }

/* ─── CURSOR ─── */
.cursor {
  display: inline-block;
  width: 2px; height: 1.1em;
  background: var(--blue-light);
  vertical-align: middle;
  margin-left: 2px;
  border-radius: 1px;
  box-shadow: 0 0 8px var(--blue-light);
  animation: blink 0.9s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ─── PROGRESS BAR ─── */
.progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.65rem;
}
.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.06s linear;
  background: linear-gradient(90deg, var(--blue-core), var(--blue-pale));
}

/* ─── STAGE CARD ─── */
.stage-card {
  padding: 1.2rem 1.3rem;
  margin-bottom: 1rem;
  position: relative;
  transition: all 0.3s;
}
.stage-card.locked {
  opacity: 0.4;
  pointer-events: none;
  filter: blur(0.5px);
}
.stage-card .locked-overlay {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: rgba(3,8,22,0.6);
  backdrop-filter: blur(4px);
  z-index: 10;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}
.stage-card.locked .locked-overlay { display: flex; }
.lock-icon { font-size: 1.8rem; opacity: 0.5; }
.lock-msg { font-size: 0.82rem; color: var(--text-muted); text-align: center; }

/* ─── RANGE SLIDER ─── */
.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0.5rem 0;
}
.range-label { font-size: 0.8rem; color: var(--text-secondary); min-width: 70px; }
.range-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--blue-pale);
  min-width: 38px;
  text-align: right;
}
input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  outline: none;
  cursor: pointer;
  min-height: 20px; /* touch area */
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px; /* larger for touch */
  border-radius: 50%;
  background: var(--blue-light);
  box-shadow: 0 0 8px rgba(96,165,250,0.5);
  transition: box-shadow 0.2s;
}
input[type="range"]:hover::-webkit-slider-thumb { box-shadow: 0 0 14px rgba(96,165,250,0.8); }

/* ─── METRIC ROW ─── */
.metric-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0.65rem 0;
}
.metric-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.metric-chip .mk { color: var(--text-muted); }
.metric-chip .mv { color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-weight: 500; }

/* ─── TAB BAR ─── */
.tab-bar {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: rgba(6,12,30,0.6);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  background: none;
  border: none;
  font-family: 'Outfit', sans-serif;
  text-align: center;
  white-space: nowrap;
  min-height: 40px;
  touch-action: manipulation;
}
.tab-btn.active { background: var(--bg-card); color: var(--blue-pale); border: 1px solid var(--border-glow); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ─── QUIZ ─── */
.quiz-question {
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 0.9rem;
  line-height: 1.5;
}
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  touch-action: manipulation;
}
.quiz-opt:hover { border-color: var(--border-glow); color: var(--text-primary); }
.quiz-opt:active { transform: scale(0.99); }
.quiz-opt.correct { border-color: var(--teal); color: var(--teal); background: var(--teal-dim); }
.quiz-opt.wrong   { border-color: var(--red);  color: var(--red);  background: var(--red-dim);  }

/* ─── COMPARE GRID ─── */
.compare-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 580px) { .compare-grid { grid-template-columns: 1fr; } }
.cmp-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }

/* ─── TEMPERATURE ─── */
.temp-low  { color: var(--blue-pale); }
.temp-high { color: var(--red); }

/* ─── UNLOCK TOAST ─── */
.unlock-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: #061830;
  border: 1px solid var(--teal);
  border-radius: var(--radius-md);
  padding: 11px 18px;
  font-size: 0.85rem;
  color: var(--teal);
  box-shadow: var(--glow-teal);
  z-index: 200;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
  text-align: center;
}
.unlock-toast.show { transform: translateX(-50%) translateY(0); }

/* ─── SOURCE SELECTOR ─── */
.source-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 1rem 0;
}
@media (max-width: 420px) { .source-selector { grid-template-columns: 1fr; } }
.source-card {
  background: var(--bg-card);
  border: 2px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1.2rem 1rem;
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
}
.source-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: calc(var(--radius-md) - 2px);
}
.source-card.pretrained::before { background: radial-gradient(ellipse at center, rgba(59,130,246,0.08), transparent 70%); }
.source-card.custom::before     { background: radial-gradient(ellipse at center, rgba(45,212,191,0.08), transparent 70%); }
.source-card:hover::before      { opacity: 1; }
.source-card:hover { transform: translateY(-2px); }
.source-card.selected.pretrained { border-color: var(--blue-light); box-shadow: 0 0 20px rgba(59,130,246,0.25); }
.source-card.selected.custom     { border-color: var(--teal);       box-shadow: 0 0 20px rgba(45,212,191,0.25); }
.source-icon { font-size: 2rem; margin-bottom: 0.6rem; display: block; }
.source-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.3rem; }
.source-card.pretrained .source-title { color: var(--blue-pale); }
.source-card.custom .source-title     { color: var(--teal); }
.source-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }

/* ─── CUSTOM TEXTAREA ─── */
.custom-input-area { display: none; margin-top: 0.9rem; }
.custom-input-area.visible { display: block; }
textarea {
  width: 100%;
  background: rgba(3,8,22,0.9);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  padding: 0.9rem;
  resize: vertical;
  min-height: 140px;
  outline: none;
  line-height: 1.6;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
textarea:focus { border-color: var(--blue-light); }

/* ─── TRAINING OVERLAY ─── */
.training-overlay {
  display: none;
  margin-top: 0.9rem;
  background: rgba(3,8,22,0.8);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1.2rem;
}
.training-overlay.visible { display: block; }
.training-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.training-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 1rem; }
.training-steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1rem; }
.training-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(6,14,35,0.6);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  transition: all 0.3s;
}
.training-step.active  { border-color: rgba(59,130,246,0.35); background: rgba(59,130,246,0.08); color: var(--blue-pale); }
.training-step.done    { border-color: rgba(45,212,191,0.3);  background: rgba(45,212,191,0.07); color: var(--teal); }
.training-step.pending { color: var(--text-muted); }
.ts-icon { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }
.ts-label { flex: 1; }
.ts-status { font-family: 'JetBrains Mono', monospace; font-size: 0.73rem; }
.training-main-bar {
  height: 7px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.training-main-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--blue-core), var(--teal));
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}
.training-main-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { left: 100%; } }
.training-eta { font-size: 0.76rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; text-align: right; }

/* ─── NEURAL VIZ ─── */
.neural-viz { display: flex; justify-content: center; gap: 5px; margin: 0.8rem 0 0.4rem; }
.nv-col { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.nv-node {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(59,130,246,0.2);
  border: 1px solid rgba(59,130,246,0.3);
  transition: all 0.3s;
}
.nv-node.lit { background: var(--blue-light); box-shadow: 0 0 8px rgba(96,165,250,0.8); border-color: var(--blue-light); }
.nv-connector { width: 18px; height: 1px; background: rgba(59,130,246,0.15); align-self: center; transition: background 0.3s; }
.nv-connector.lit { background: rgba(96,165,250,0.6); }

/* ─── TEMPERATURE SPLIT VIEW ─── */
.temp-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 500px) { .temp-split { grid-template-columns: 1fr; } }

/* ─── STEP 0 ACTIONS ─── */
.step0-actions {
  margin-top: 1rem;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── ADMIN PAGE STYLES ─── */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.2rem;
}
.admin-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 0;
}
.admin-card {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: 0 0 40px rgba(59,130,246,0.1), 0 0 100px rgba(59,130,246,0.04);
}
.admin-card h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.admin-card .subtitle { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 1.5rem; }
.info-box {
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.18);
  border-left: 3px solid var(--blue-core);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.2rem;
}
.info-box strong { color: var(--blue-pale); }
.info-box.warn { border-left-color: var(--amber); background: rgba(251,191,36,0.06); }
.info-box.success { border-left-color: var(--teal); background: rgba(45,212,191,0.06); }
.info-box.error-box { border-left-color: var(--red); background: rgba(248,113,113,0.06); }
.file-status {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.8rem;
}
.fs-icon { font-size: 1.3rem; flex-shrink: 0; }
.fs-info { flex: 1; min-width: 0; }
.fs-name { font-size: 0.85rem; font-weight: 600; font-family: 'JetBrains Mono', monospace; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-detail { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.fs-badge { font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 100px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.fs-badge.found   { background: rgba(74,222,128,0.12); color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
.fs-badge.missing { background: rgba(248,113,113,0.12); color: var(--red);   border: 1px solid rgba(248,113,113,0.3); }
.fs-badge.cached  { background: rgba(45,212,191,0.12); color: var(--teal);  border: 1px solid rgba(45,212,191,0.3); }
.btn-train {
  width: 100%;
  padding: 0.85rem;
  background: var(--blue-core);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 0 24px rgba(59,130,246,0.35);
  transition: all 0.2s;
  margin-bottom: 0.8rem;
  min-height: 48px;
  touch-action: manipulation;
}
.btn-train:hover:not(:disabled) { background: #60a5fa; box-shadow: 0 0 36px rgba(96,165,250,0.5); transform: translateY(-1px); }
.btn-train:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-check {
  width: 100%;
  padding: 0.65rem;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1.2rem;
  min-height: 44px;
  touch-action: manipulation;
}
.btn-check:hover { border-color: var(--border-glow); color: var(--text-primary); }
.progress-section { display: none; margin-bottom: 1.2rem; }
.progress-section.visible { display: block; }
.prog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.prog-label { font-size: 0.82rem; font-weight: 600; }
.prog-pct { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: var(--blue-pale); }
.prog-bar { height: 8px; background: rgba(255,255,255,0.04); border-radius: 4px; overflow: hidden; margin-bottom: 0.9rem; }
.prog-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--blue-core), var(--teal));
  transition: width 0.5s ease;
  position: relative; overflow: hidden;
}
.prog-fill::after {
  content: ''; position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 1.4s infinite;
}
.step-list { display: flex; flex-direction: column; gap: 7px; }
.step-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: rgba(6,14,35,0.5);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  font-size: 0.8rem;
  transition: all 0.3s;
}
.step-item.active  { border-color: rgba(59,130,246,0.4);  background: rgba(59,130,246,0.08); color: var(--blue-pale); }
.step-item.done    { border-color: rgba(45,212,191,0.35); background: rgba(45,212,191,0.07); color: var(--teal); }
.step-item.pending { color: var(--text-muted); }
.si-icon { flex-shrink: 0; font-size: 1rem; width: 20px; text-align: center; }
.si-text { flex: 1; }
.si-st   { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; flex-shrink: 0; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 0.9rem; }
.r-chip { background: var(--bg-card); border: 1px solid var(--border-dim); border-radius: 10px; padding: 9px 12px; font-size: 0.78rem; }
.r-chip .rk { color: var(--text-muted); margin-bottom: 3px; }
.r-chip .rv { font-family: 'JetBrains Mono', monospace; font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.link-back { display: inline-flex; align-items: center; gap: 6px; font-size: 0.83rem; color: var(--text-muted); text-decoration: none; margin-top: 1rem; transition: color 0.2s; }
.link-back:hover { color: var(--blue-pale); }
.log-box {
  background: rgba(3,8,22,0.8);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-height: 110px;
  overflow-y: auto;
  margin-top: 0.9rem;
  display: none;
}
.log-box.visible { display: block; }
.log-line { color: var(--text-secondary); }
.log-line.ok  { color: var(--teal); }
.log-line.err { color: var(--red); }

/* ─── UTILITIES ─── */
.hidden { display: none !important; }

/* ─── MOBILE OVERRIDES ─── */
@media (max-width: 480px) {
  body { padding: 0 0.5rem 4rem; }
  .stage-card { padding: 1rem; }
  .control-row { flex-direction: column; }
  .control-row input[type="text"],
  .control-row select,
  .control-row .btn { width: 100%; }
  .temp-split { grid-template-columns: 1fr; }
  .range-label { min-width: 60px; font-size: 0.76rem; }
  h1 { font-size: 1.5rem; }
  .header-sub { font-size: 0.88rem; }
}