/* ───────────────────────────────────────────
   TOKENS
─────────────────────────────────────────── */
:root {
  --bg:         #f7f6ff;
  --surface:    #ffffff;
  --surface2:   #f0effe;
  --border:     #e2dffe;
  --shadow:     0 2px 16px rgba(100,80,220,.10);
  --shadow-lg:  0 6px 32px rgba(100,80,220,.15);

  --purple:     #6c47ff;
  --purple-lt:  #ede9ff;
  --purple-glow:rgba(108,71,255,.18);
  --orange:     #ff6b35;
  --orange-lt:  #fff1eb;
  --green:      #00c896;
  --green-lt:   #e6fff9;
  --yellow:     #ffbe00;
  --red:        #ff4d6d;

  --text:       #1a1733;
  --text-mid:   #5a5375;
  --text-muted: #9b94b8;

  --bar:        linear-gradient(90deg, #6c47ff, #a78bfa);
  --bar-top:    #6c47ff;

  --radius:     16px;
  --radius-sm:  10px;
  --font:       'Nunito', 'Nunito Sans', system-ui, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  min-height: 100vh;
  line-height: 1.5;
}

/* ───────────────────────────────────────────
   HEADER
─────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 0 28px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

h1 {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.3px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 600;
}

.settings-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.settings-btn:hover { background: var(--purple-lt); }

.settings-panel {
  display: none;
  padding: 12px 0 16px;
  border-top: 1px solid var(--border);
}
.settings-panel.open { display: block; }

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-mid);
}

.settings-row input {
  flex: 1;
  max-width: 320px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--text);
}

/* ───────────────────────────────────────────
   LAYOUT
─────────────────────────────────────────── */
main {
  display: flex;
  gap: 24px;
  padding: 24px 28px;
  max-width: 1060px;
  margin: 0 auto;
}

/* ───────────────────────────────────────────
   DRAW PANEL
─────────────────────────────────────────── */
.draw-panel {
  flex-shrink: 0;
  width: 316px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.draw-panel-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--purple);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.canvas-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  border: 3px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: crosshair;
  touch-action: none;
  transition: border-color .2s, box-shadow .2s;
}
.canvas-wrap.drawing {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px var(--purple-glow), var(--shadow-lg);
}

#draw, #overlay {
  position: absolute; top: 0; left: 0;
}
#overlay { pointer-events: none; z-index: 2; }

.canvas-hint {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; z-index: 3;
  text-align: center;
  transition: opacity .3s;
}
.canvas-hint.hidden { opacity: 0; }
.hint-icon { font-size: 38px; }
.canvas-hint > div:nth-child(2) {
  font-size: 17px; font-weight: 800; color: var(--text-mid);
}
.hint-sub {
  font-size: 13px; color: var(--text-muted); font-weight: 600;
}

.sal-legend {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ───────────────────────────────────────────
   BUTTONS
─────────────────────────────────────────── */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 50px;
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--purple);
  color: #fff;
  padding: 10px 22px;
  font-size: 14px;
  box-shadow: 0 4px 14px var(--purple-glow);
}
.btn-primary:hover:not(:disabled) {
  background: #5535e0;
  box-shadow: 0 6px 20px var(--purple-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface2);
  color: var(--text-mid);
  padding: 10px 18px;
  font-size: 14px;
  border: 1.5px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--purple-lt);
  color: var(--purple);
  border-color: var(--purple);
}

.btn-nav {
  background: var(--surface);
  color: var(--text-mid);
  padding: 8px 16px;
  font-size: 13px;
  border: 1.5px solid var(--border);
}
.btn-nav:hover:not(:disabled) {
  background: var(--purple-lt);
  color: var(--purple);
  border-color: var(--purple);
}

.btn-play {
  background: var(--orange);
  color: #fff;
  padding: 8px 18px;
  font-size: 13px;
  box-shadow: 0 2px 10px rgba(255,107,53,.22);
}
.btn-play:hover:not(:disabled) {
  background: #e85a27;
  transform: translateY(-1px);
}

/* Live label */
.live-label {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 700; color: var(--text-muted);
}
.live-label input { display: none; }
.live-label input:checked ~ * { color: var(--green); }
.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-muted); transition: background .2s; flex-shrink: 0;
}
.live-label input:checked ~ .live-dot { background: var(--green); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
#liveToggle:checked ~ .live-dot { animation: pulse 1.6s ease infinite; }

/* Status */
.status {
  font-size: 13px; font-weight: 700;
  color: var(--text-muted); min-height: 18px;
}
.status.live { color: var(--purple); }

/* Tip box */
.tip-box {
  background: var(--purple-lt);
  border: 1.5px solid #c5b8ff;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.6;
}

/* ───────────────────────────────────────────
   RESULT PANEL
─────────────────────────────────────────── */
.result-panel {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 16px;
}

/* Prediction card */
.prediction-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow);
}

.pred-left { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.pred-label {
  font-size: 12px; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .07em;
}

.pred-digit {
  font-size: 88px;
  font-weight: 900;
  line-height: 1;
  color: var(--purple);
  min-width: 88px;
  text-align: center;
  transition: all .3s;
}

.pred-meta {
  flex: 1;
  display: flex; flex-direction: column; gap: 8px;
}

.pred-confidence {
  font-size: 16px; font-weight: 700; color: var(--text-mid);
}

/* Confidence badge */
.conf-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 13px; font-weight: 800;
  letter-spacing: .02em;
}
.conf-high {
  background: var(--green-lt); color: #008f6a;
  border: 1.5px solid #80e8cc;
}
.conf-mid {
  background: #eef0ff; color: var(--purple);
  border: 1.5px solid #b8bfff;
}
.conf-low {
  background: #fff8e0; color: #b38600;
  border: 1.5px solid #ffe566;
}

/* Pop animation */
@keyframes pred-pop {
  0%   { transform: scale(.4) rotate(-10deg); opacity: 0; }
  65%  { transform: scale(1.18) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.pred-pop { animation: pred-pop .5s cubic-bezier(.34,1.56,.64,1); }

/* ───────────────────────────────────────────
   PROBS BARS
─────────────────────────────────────────── */
.probs-section { }

.section-head {
  font-size: 12px; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 10px;
}

.probs-grid { display: flex; flex-direction: column; gap: 6px; }

.prob-row {
  display: flex; align-items: center; gap: 10px;
}
.prob-label {
  width: 18px; text-align: right;
  font-size: 13px; font-weight: 800; color: var(--text-muted);
}
.prob-bar-wrap {
  flex: 1; height: 12px;
  background: var(--surface2); border-radius: 6px; overflow: hidden;
}
.prob-bar {
  height: 100%; border-radius: 6px;
  background: var(--bar);
  width: 0%;
  transition: width .45s cubic-bezier(.4,0,.2,1);
}
.prob-bar.top {
  background: var(--purple);
  box-shadow: 0 0 10px var(--purple-glow);
}
.prob-pct {
  width: 42px; text-align: right;
  font-size: 12px; font-weight: 700; color: var(--text-mid);
}

/* ───────────────────────────────────────────
   NN DIAGRAM SECTION
─────────────────────────────────────────── */
.nn-diagram-section {
  max-width: 1060px;
  margin: 0 auto 28px;
  padding: 0 28px;
}

.nn-diagram-wrap {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px 12px;
  overflow-x: auto;
  display: flex;
  justify-content: center;
}

#nn-diagram {
  display: block;
  max-width: 100%;
}

/* ───────────────────────────────────────────
   PIPELINE / STEPS
─────────────────────────────────────────── */
.pipeline-section {
  max-width: 1060px;
  margin: 0 auto 40px;
  padding: 0 28px;
}

.pipeline-title {
  font-size: 18px; font-weight: 900; color: var(--text);
  margin-bottom: 4px;
}
.pipeline-subtitle {
  font-size: 13px; color: var(--text-muted); font-weight: 600; margin-bottom: 18px;
}

#network-flow {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px;
}

.net-step {
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; text-align: center; user-select: none;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
  box-shadow: var(--shadow);
}
.net-step:hover {
  border-color: var(--purple);
  background: var(--purple-lt);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.net-step.visited {
  border-color: #c5b8ff;
  background: #f5f3ff;
}
.net-step.active {
  border-color: var(--purple);
  background: var(--purple-lt);
  box-shadow: 0 0 0 4px var(--purple-glow), var(--shadow-lg);
  transform: translateY(-3px);
}

.step-emoji { font-size: 22px; line-height: 1; }
.step-num {
  font-size: 11px; font-weight: 900; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .07em;
}
.net-step.active .step-num,
.net-step.visited .step-num { color: var(--purple); }

.step-name {
  font-size: 12px; font-weight: 800; color: var(--text);
  line-height: 1.3;
}
.net-step.active .step-name { color: var(--purple); }

.step-tech {
  font-size: 10px; color: var(--text-muted); font-family: 'Courier New', monospace;
  background: var(--surface2); border-radius: 4px; padding: 1px 6px;
}

.net-arrow {
  font-size: 20px; color: var(--text-muted); flex-shrink: 0;
}

/* Layer nav */
.layer-nav {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.layer-label {
  flex: 1; text-align: center;
  font-size: 14px; font-weight: 800; color: var(--purple);
}

/* ───────────────────────────────────────────
   LAYER CARD
─────────────────────────────────────────── */
.layer-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-top: 4px solid var(--lc, var(--purple));
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.layer-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 6px;
}
.layer-title-block { }
.layer-step {
  font-size: 11px; color: var(--text-muted);
  font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px;
}
.layer-tagline {
  font-size: 13px; color: var(--text-muted); font-weight: 600;
  font-style: italic; margin-bottom: 4px;
}
.layer-name {
  font-size: 22px; font-weight: 900;
  color: var(--lc, var(--purple)); line-height: 1.1;
}
.layer-tech {
  font-size: 11px; color: var(--text-muted);
  font-family: 'Courier New', monospace;
  background: var(--surface2); border-radius: 4px; padding: 1px 7px;
  display: inline-block; margin-top: 4px;
}

.thumb-wrap { text-align: center; flex-shrink: 0; }
.layer-thumb {
  display: block; width: 52px; height: 52px;
  image-rendering: pixelated;
  border: 2px solid var(--border); border-radius: 8px;
}
.thumb-label { font-size: 10px; color: var(--text-muted); margin-top: 3px; font-weight: 700; }

.layer-headline {
  font-size: 16px; font-weight: 800;
  color: var(--lc, var(--purple));
  line-height: 1.4; margin: 12px 0 10px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.layer-sep { height: 2px; background: var(--border); margin: 14px 0; border-radius: 2px; }

.viz-head {
  font-size: 11px; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px;
}

/* ───────────────────────────────────────────
   BULLET LIST
─────────────────────────────────────────── */
.bullet-list {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.bullet-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: var(--text); line-height: 1.55;
}
.bullet-icon {
  font-size: 18px; flex-shrink: 0; width: 26px; text-align: center; margin-top: 1px;
}
.bullet-text { flex: 1; }

/* Jargon tooltips */
.jargon {
  border-bottom: 2px dashed var(--purple);
  cursor: help; color: var(--purple); font-weight: 700;
  position: relative; display: inline;
}
.jargon::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%; transform: translateX(-50%);
  background: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #fff;
  width: 240px;
  line-height: 1.55;
  display: none;
  white-space: normal;
  z-index: 200;
  pointer-events: none;
  text-align: left;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  font-style: normal;
  font-weight: 600;
}
.jargon:hover::after { display: block; }

/* ───────────────────────────────────────────
   HERO COMPARISON
─────────────────────────────────────────── */
.hero-comparison {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 14px;
  flex-wrap: wrap;
}
.comp-side { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.comp-side-label { font-size: 11px; font-weight: 800; color: var(--text-muted); }
.comp-canvas {
  image-rendering: pixelated; width: 84px; height: 84px;
  border: 2px solid var(--border); border-radius: 8px; display: block;
  background: #fff;
}
.comp-canvas.highlight { border-color: var(--lc, var(--purple)); }
.comp-arrow-block {
  display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0;
}
.comp-arrow-label { font-size: 11px; color: var(--text-muted); text-align: center; max-width: 80px; font-weight: 700; line-height: 1.4; }
.comp-arrow-sym { font-size: 24px; color: var(--lc, var(--purple)); }
.hero-caption {
  font-size: 11px; color: var(--text-muted);
  text-align: center; margin-top: 8px; font-style: italic;
  width: 100%; font-weight: 600;
}

/* ───────────────────────────────────────────
   BARS (filter strength)
─────────────────────────────────────────── */
.bars { display: flex; flex-wrap: wrap; gap: 3px; align-items: flex-end; }
.act-bar {
  border-radius: 3px; background: var(--bar);
  transition: width .32s cubic-bezier(.4,0,.2,1); min-width: 3px;
}
.act-bar.top { background: var(--purple); box-shadow: 0 0 6px var(--purple-glow); }
.bars-note { font-size: 11px; color: var(--text-muted); margin-top: 6px; font-style: italic; font-weight: 600; }

/* ───────────────────────────────────────────
   FEATURE MAPS GRID
─────────────────────────────────────────── */
.maps-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.map-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.map-label { font-size: 9px; color: var(--text-muted); text-align: center; font-weight: 700; }
.map-wrap.map-top .small-map { border-color: var(--lc, var(--purple)); }
.map-wrap.map-top .map-label { color: var(--lc, var(--purple)); font-weight: 900; }
.small-map {
  image-rendering: pixelated; border: 2px solid var(--border);
  border-radius: 4px; width: 38px; height: 38px; display: block;
  transition: transform .15s, border-color .15s;
}
.small-map:hover { transform: scale(2.6); border-color: var(--purple); z-index: 10; position: relative; }

/* ───────────────────────────────────────────
   FC GROUPED NEURONS
─────────────────────────────────────────── */
.active-badge {
  display: flex; align-items: baseline; gap: 12px;
  padding: 14px 18px; background: var(--surface2);
  border: 2px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 14px;
}
.badge-num {
  font-size: 48px; font-weight: 900;
  color: var(--lc, var(--purple)); line-height: 1;
}
.badge-sub { display: flex; flex-direction: column; gap: 2px; }
.badge-label { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.4; }
.badge-note  { font-size: 12px; color: var(--text-muted); font-weight: 600; }

.neurons-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.neurons-section-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin-bottom: 8px; font-weight: 800;
}
.neurons-section-head.active-head { color: var(--lc, var(--purple)); }
.neurons-silent .act-bar { background: var(--border) !important; opacity: .4 !important; }

/* ───────────────────────────────────────────
   LOGITS SPOTLIGHT
─────────────────────────────────────────── */
.logits-spotlight { display: flex; gap: 10px; margin: 10px 0 12px; }
.logit-candidate {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 14px 8px; background: var(--surface2);
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  text-align: center; transition: border-color .2s;
}
.logit-candidate.place-gold {
  border-color: var(--purple);
  background: var(--purple-lt);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.logit-candidate.place-silver { border-color: #a78bfa; background: #f5f3ff; }
.logit-candidate.place-bronze { border-color: #c4b5fd; }

.cand-rank { font-size: 11px; color: var(--text-muted); font-weight: 800; margin-bottom: 4px; }
.place-gold .cand-rank { color: var(--purple); }
.cand-digit { font-size: 40px; font-weight: 900; color: var(--text); line-height: 1.1; }
.place-gold .cand-digit { color: var(--purple); }
.cand-pct { font-size: 14px; color: var(--text-muted); font-weight: 700; margin-top: 3px; }
.place-gold .cand-pct { color: var(--text); font-weight: 900; }
.cand-bar-wrap { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.cand-bar { height: 100%; border-radius: 3px; background: var(--bar); width: 0%; transition: width .5s cubic-bezier(.4,0,.2,1); }
.place-gold .cand-bar { background: var(--purple); }
.place-silver .cand-bar { background: #a78bfa; }

.logits-rest {
  font-size: 12px; color: var(--text-muted); font-weight: 600;
  padding: 8px 12px; background: var(--surface2);
  border-radius: var(--radius-sm); line-height: 2; margin-bottom: 12px;
}

.logit-row {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px; border-radius: 7px; margin: 2px 0;
  border: 1.5px solid transparent;
}
.logit-row.winner {
  border-color: rgba(108,71,255,.25); background: var(--purple-lt); padding: 6px 8px;
}
.logit-digit {
  width: 18px; text-align: right; font-size: 15px; font-weight: 900;
  color: var(--text-muted); flex-shrink: 0;
}
.logit-row.winner .logit-digit { color: var(--purple); }
.logit-bar-wrap { flex: 1; height: 14px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.logit-bar-fill { height: 100%; border-radius: 4px; background: var(--bar); width: 0%; transition: width .42s cubic-bezier(.4,0,.2,1); }
.logit-bar-fill.top { background: var(--purple); box-shadow: 0 0 8px var(--purple-glow); }
.logit-score { font-size: 12px; color: var(--text-muted); width: 70px; flex-shrink: 0; font-weight: 700; }
.logit-row.winner .logit-score { color: var(--text); }
.logit-winner-tag { font-size: 11px; color: var(--purple); margin-left: 4px; font-weight: 800; }

/* ───────────────────────────────────────────
   MATH PANEL
─────────────────────────────────────────── */
.math-toggle {
  display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 700;
  color: var(--text-muted); background: none; border: none; padding: 0;
  cursor: pointer; font-family: var(--font);
}
.math-toggle:hover { color: var(--purple); }

.math-panel-wrap {
  margin-top: 12px; padding: 16px; background: var(--surface2);
  border: 2px solid var(--border); border-radius: var(--radius-sm);
}
.math-specs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.math-tag {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 50px; padding: 3px 12px; font-size: 12px; font-weight: 700; color: var(--text);
}
.math-formula {
  font-size: 13px; color: var(--purple); background: #fff;
  padding: 10px 14px; border-radius: 8px;
  border-left: 4px solid var(--purple); margin-bottom: 12px; line-height: 1.7;
  font-family: 'Courier New', monospace;
}
.math-formula-note { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-style: italic; }
.math-note { font-size: 13px; color: var(--text-mid); line-height: 1.7; margin-top: 8px; font-weight: 600; }

/* Filter kernel grid */
.filter-kernel-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.filter-kernel-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.filter-kernel-label { font-size: 10px; color: var(--text-muted); font-weight: 700; }
.kernel-canvas { border: 2px solid var(--border); border-radius: 4px; display: block; }

/* Conv animation */
.anim-area { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.anim-cv-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.anim-canvas { border: 2px solid var(--border); border-radius: 8px; display: block; }
.anim-label { font-size: 10px; color: var(--text-muted); text-align: center; max-width: 100px; font-weight: 700; }
.anim-op { font-size: 24px; color: var(--text-muted); flex-shrink: 0; align-self: center; }
.anim-info { font-size: 12px; color: var(--purple); min-height: 20px; margin: 6px 0 4px; line-height: 1.5; font-weight: 700; }
.anim-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.anim-btn { font-size: 12px; padding: 6px 14px; }
.anim-select {
  background: var(--surface); border: 1.5px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 5px 10px; font-family: var(--font); font-size: 12px; font-weight: 700;
}
.anim-comp { margin-top: 10px; }
.comp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comp-grid-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.comp-grid-label { font-size: 10px; color: var(--text-muted); font-weight: 700; }
.comp-grid { display: grid; grid-template-columns: repeat(3, 36px); gap: 2px; }
.comp-cell {
  width: 36px; height: 24px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; background: var(--surface2); border-radius: 3px; color: var(--text);
  font-weight: 600;
}
.comp-op { font-size: 18px; color: var(--text-muted); flex-shrink: 0; }
.comp-result { font-size: 12px; color: var(--text); line-height: 2; font-weight: 700; }
.comp-zeroed { color: var(--text-muted); }

/* Softmax table */
.softmax-table { margin-top: 8px; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; }
.softmax-row { display: grid; grid-template-columns: 60px 1fr 1fr 1fr; border-bottom: 1px solid var(--border); }
.softmax-row:last-child { border-bottom: none; }
.softmax-cell { padding: 6px 10px; font-size: 12px; color: var(--text); font-weight: 600; }
.softmax-header .softmax-cell { color: var(--text-muted); font-size: 11px; background: var(--surface2); font-weight: 800; }
.softmax-winner { background: var(--purple-lt); }
.softmax-winner .softmax-cell { color: var(--purple); font-weight: 800; }
.softmax-sum .softmax-cell { color: var(--text-muted); border-top: 1px solid var(--border); font-style: italic; }

/* ───────────────────────────────────────────
   ONBOARDING
─────────────────────────────────────────── */
.onboarding {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.ob-title { font-size: 20px; font-weight: 900; color: var(--text); margin-bottom: 8px; }
.ob-subtitle { font-size: 14px; color: var(--text-mid); margin-bottom: 24px; line-height: 1.65; font-weight: 600; }

.ob-journey {
  display: flex; gap: 0; margin-bottom: 24px;
  border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.ob-step {
  flex: 1; padding: 16px 14px; border-right: 2px solid var(--border);
  display: flex; flex-direction: column; gap: 7px;
}
.ob-step:last-child { border-right: none; }
.ob-step-emoji { font-size: 26px; }
.ob-step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface2); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900;
}
.ob-step-name { font-size: 13px; font-weight: 800; color: var(--text); }
.ob-step-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; font-weight: 600; }

.ob-cta {
  font-size: 14px; font-weight: 700;
  color: var(--purple);
  padding: 14px 18px;
  border: 2px dashed #c5b8ff;
  border-radius: var(--radius-sm);
  background: var(--purple-lt); text-align: center; line-height: 1.6;
}

/* Suggestion box */
.layer-suggestion {
  margin-top: 16px; padding: 13px 16px;
  background: var(--orange-lt);
  border: 2px solid #ffc4a8;
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text); line-height: 1.6; font-weight: 600;
}

/* ───────────────────────────────────────────
   RESPONSIVE
─────────────────────────────────────────── */
@media (max-width: 720px) {
  header { padding: 0 16px; }
  h1 { font-size: 16px; }
  .subtitle { font-size: 12px; }
  main { flex-direction: column; padding: 16px; gap: 16px; }
  .draw-panel { width: 100%; }
  .pipeline-section { padding: 0 16px; }
  #network-flow { flex-wrap: wrap; }
  .net-arrow { display: none; }
  .net-step { min-width: 70px; }
  .logits-spotlight { flex-wrap: wrap; }
  .logit-candidate { min-width: 90px; }
  .hero-comparison { flex-wrap: wrap; }
  .neurons-sections { grid-template-columns: 1fr; }
  .ob-journey { flex-direction: column; }
  .ob-step { border-right: none; border-bottom: 2px solid var(--border); }
  .ob-step:last-child { border-bottom: none; }
  .layer-nav { justify-content: center; }
}
