/* ============================================================
   ADC Demo — style.css
   Dark-mode, glassmorphic, premium educational UI
   Matches the demodulation demo design system
   ============================================================ */

/* ── Tokens ── */
:root {
  --bg:       #0b0d14;
  --surface:  #12151f;
  --surface2: #1a1e2e;
  --surface3: #222740;
  --border:              rgba(255,255,255,0.07);
  --border-glow:         rgba(240,165,0,0.35);

  /* ADC step colors */
  --adc-in:  #a78bfa;   /* violet  — analog input */
  --adc-s1:  #38bdf8;   /* sky     — sampling */
  --adc-s2:  #f59e0b;   /* amber   — quantization */
  --adc-s3:  #34d399;   /* emerald — encoding */
  --adc-cond:#e879f9;   /* fuchsia — signal conditioning */

  --adc-in-glow:   rgba(167,139,250,0.25);
  --adc-s1-glow:   rgba(56,189,248,0.25);
  --adc-s2-glow:   rgba(245,158,11,0.25);
  --adc-s3-glow:   rgba(52,211,153,0.25);
  --adc-cond-glow: rgba(232,121,249,0.25);

  --accent:       #f0a500;
  --accent-light: #fbbf24;
  --accent-glow:  rgba(240,165,0,0.3);

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  --green: #22c55e;
  --amber: #f59e0b;
  --red:   #ef4444;

  --radius:    14px;
  --radius-sm: 8px;
  --radius-xs: 5px;

  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --sidebar-w: 374px;
  --header-h:  54px;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 99px; }

/* ════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════ */
.app-header {
  height: var(--header-h);
  background: linear-gradient(180deg, #142233, #0d1620);
  border-bottom: 1px solid #22303f;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

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

.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.header-title h1 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: 0;
}

.header-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
  display: block;
}

/* ── Back button ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.back-btn:hover {
  color: var(--text-primary);
  border-color: var(--border);
  background: var(--surface2);
}
.back-btn svg { flex-shrink: 0; opacity: 0.7; }

/* ── Step Tab Toggle (header center) ── */
.step-toggle-wrap {
  display: flex;
  justify-content: center;
}

.step-toggle {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
}

.step-btn {
  background: transparent;
  border: none;
  border-radius: 99px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.2px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-btn:hover { color: var(--text-secondary); }

.step-btn.active[data-step="1"] {
  background: var(--adc-s1);
  color: #0b0d14;
  box-shadow: 0 0 14px var(--adc-s1-glow);
}
.step-btn.active[data-step="2"] {
  background: var(--adc-s2);
  color: #0b0d14;
  box-shadow: 0 0 14px var(--adc-s2-glow);
}
.step-btn.active[data-step="3"] {
  background: var(--adc-s3);
  color: #0b0d14;
  box-shadow: 0 0 14px var(--adc-s3-glow);
}

.step-circle {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Metrics strip (header right) ── */
.metrics-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.metric-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: var(--transition);
}

.metric-pill span.metric-val {
  color: var(--accent-light);
  font-weight: 600;
}

/* ════════════════════════════════════════════
   MAIN LAYOUT
   ════════════════════════════════════════════ */
.app-main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 11px;
  overflow-y: auto;
  animation: fadeInUp 0.4s ease both;
}

/* ── Plot panel ── */
.plot-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  animation: fadeInUp 0.4s 0.1s ease both;
}

/* ════════════════════════════════════════════
   SIDEBAR CONTROLS
   ════════════════════════════════════════════ */
.controls-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.section-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-in   { background: var(--adc-in);   box-shadow: 0 0 6px var(--adc-in-glow); }
.dot-s1   { background: var(--adc-s1);   box-shadow: 0 0 6px var(--adc-s1-glow); }
.dot-s2   { background: var(--adc-s2);   box-shadow: 0 0 6px var(--adc-s2-glow); }
.dot-s3   { background: var(--adc-s3);   box-shadow: 0 0 6px var(--adc-s3-glow); }
.dot-cond { background: var(--adc-cond); box-shadow: 0 0 6px var(--adc-cond-glow); }

/* ── Sliders ── */
.slider-group { display: flex; flex-direction: column; gap: 4px; }

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-header label {
  font-size: 11.5px;
  color: var(--text-secondary);
  cursor: pointer;
}
.slider-header label sub { font-size: 8.5px; vertical-align: sub; }

.slider-val {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent-light);
  font-weight: 600;
  min-width: 72px;
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: var(--surface3);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 10px var(--accent-glow);
  cursor: pointer;
  transition: var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 16px var(--accent);
}

/* Per-slider accent colors */
#sig-freq::-webkit-slider-thumb { background: var(--adc-in); box-shadow: 0 0 10px var(--adc-in-glow); }
#sig-amp::-webkit-slider-thumb  { background: var(--adc-in); box-shadow: 0 0 10px var(--adc-in-glow); }
#sig-dc::-webkit-slider-thumb   { background: var(--adc-cond); box-shadow: 0 0 10px var(--adc-cond-glow); }
#sig-noise::-webkit-slider-thumb { background: var(--adc-s2); box-shadow: 0 0 10px var(--adc-s2-glow); }
#adc-vmin::-webkit-slider-thumb { background: var(--adc-cond); box-shadow: 0 0 10px var(--adc-cond-glow); }
#adc-vmax::-webkit-slider-thumb { background: var(--adc-cond); box-shadow: 0 0 10px var(--adc-cond-glow); }
#adc-fs::-webkit-slider-thumb   { background: var(--adc-s1); box-shadow: 0 0 10px var(--adc-s1-glow); }
#lpf-cut::-webkit-slider-thumb  { background: var(--adc-s1); box-shadow: 0 0 10px var(--adc-s1-glow); }
#adc-bits::-webkit-slider-thumb { background: var(--adc-s2); box-shadow: 0 0 10px var(--adc-s2-glow); }

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
  padding: 0 1px;
}

/* ── Toggle row ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.toggle-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

/* Custom checkbox toggle */
.toggle-switch {
  position: relative;
  width: 34px; height: 18px;
  flex-shrink: 0;
}

.toggle-switch input { display: none; }

.toggle-switch .track {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--surface3);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}

.toggle-switch .track::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}

.toggle-switch input:checked + .track {
  background: var(--adc-s1);
  border-color: var(--adc-s1);
  box-shadow: 0 0 8px var(--adc-s1-glow);
}
.toggle-switch input:checked + .track::after {
  left: calc(100% - 14px);
  background: #fff;
}

.toggle-switch.s2 input:checked + .track {
  background: var(--adc-s2);
  border-color: var(--adc-s2);
  box-shadow: 0 0 8px var(--adc-s2-glow);
}

/* ════════════════════════════════════════════
   FORMULA CARDS
   ════════════════════════════════════════════ */
.formula-card {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.formula-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
}

.formula-row .formula-lhs {
  color: var(--text-muted);
  font-family: var(--mono);
  white-space: nowrap;
}

.formula-row .formula-rhs {
  color: var(--accent-light);
  font-family: var(--mono);
  font-weight: 600;
  text-align: right;
}

.formula-row .formula-rhs.clipped { color: var(--red); }
.formula-row .formula-rhs.good    { color: var(--green); }

/* ════════════════════════════════════════════
   ALIASING WARNING BANNER
   ════════════════════════════════════════════ */
.warn-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 11px;
  line-height: 1.45;
  border: 1px solid;
  flex-shrink: 0;
  transition: var(--transition);
}
.warn-banner svg { flex-shrink: 0; margin-top: 1px; }
.alias-detail { opacity: 0.75; font-size: 10.5px; }

/* Conditioning formula live display */
.cond-formula-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 6px;
  text-align: center;
  font-size: 11px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.warn-ok {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.3);
  color: var(--green);
}
.warn-caution {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.3);
  color: var(--amber);
}
.warn-bad {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.35);
  color: var(--red);
  animation: warnPulse 1.4s infinite;
}

/* ── Nyquist pill ── */
.ratio-pill {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.2px;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ratio-ok      { background: rgba(34,197,94,0.12);  color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.ratio-caution { background: rgba(245,158,11,0.12); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.ratio-bad     { background: rgba(239,68,68,0.12);  color: var(--red);   border: 1px solid rgba(239,68,68,0.4); animation: warnPulse 1.4s infinite; }

/* ════════════════════════════════════════════
   DYNAMIC RANGE MATCH INDICATOR
   ════════════════════════════════════════════ */
.dr-match {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dr-bar-wrap {
  position: relative;
  height: 22px;
  background: var(--surface3);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  overflow: hidden;
}

.dr-adc-range {
  position: absolute;
  inset: 0;
  background: rgba(232,121,249,0.12);
  border-right: 2px solid var(--adc-cond);
  border-left: 2px solid var(--adc-cond);
}

.dr-sig-range {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 3px;
  background: var(--adc-in);
  opacity: 0.7;
  transition: left 0.2s, width 0.2s, background 0.2s;
}

.dr-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.dr-status {
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
  padding: 3px 0;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}
.dr-status.good     { color: var(--green); }
.dr-status.clipping { color: var(--red);   }
.dr-status.underuse { color: var(--amber); }

/* ════════════════════════════════════════════
   ENCODING: BINARY CODE TABLE
   ════════════════════════════════════════════ */
.code-table-wrap {
  overflow-y: auto;
  max-height: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.code-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 11px;
}

.code-table th {
  background: var(--surface3);
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 6px 10px;
  text-align: left;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border);
}

.code-table td {
  padding: 4px 10px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.1s;
}

.code-table tr:hover td { background: var(--surface3); }
.code-table .td-n    { color: var(--text-muted); }
.code-table .td-volt { color: var(--adc-in); }
.code-table .td-ql   { color: var(--adc-s2); }
.code-table .td-bin  { color: var(--adc-s3); letter-spacing: 0.5px; }
.code-table .td-clip { color: var(--red) !important; }

/* ════════════════════════════════════════════
   STORAGE CALCULATOR
   ════════════════════════════════════════════ */
.storage-calc {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.storage-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.storage-row label {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 68px;
}

.storage-input {
  flex: 1;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 9px;
  outline: none;
  transition: border-color var(--transition);
  min-width: 0;
}
.storage-input:focus { border-color: var(--accent); }

.storage-select {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 12px;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.storage-select:focus { border-color: var(--accent); }

.storage-result {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--adc-s3);
  line-height: 1.7;
}

/* ════════════════════════════════════════════
   CHART AREA (right panel)
   ════════════════════════════════════════════ */
.chart-area {
  flex: 1;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  overflow: hidden;
  height: 100%;

  /* Overridden per step */
  grid-template-rows: 1fr 1fr 1fr;
}

.chart-area.step1-layout { grid-template-rows: 1fr 1fr 1fr; }
.chart-area.step2-layout { grid-template-rows: 1fr 1fr 1fr; }
.chart-area.step3-layout { grid-template-rows: 1fr 1fr; }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  transition: border-color 0.2s;
}
.chart-card:hover { border-color: var(--border-glow); }

.chart-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.chart-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
}

.badge-s1 { background: rgba(56,189,248,0.15);  color: var(--adc-s1); border: 1px solid rgba(56,189,248,0.3); }
.badge-s2 { background: rgba(245,158,11,0.15);  color: var(--adc-s2); border: 1px solid rgba(245,158,11,0.3); }
.badge-s3 { background: rgba(52,211,153,0.12);  color: var(--adc-s3); border: 1px solid rgba(52,211,153,0.3); }
.badge-warn { background: rgba(239,68,68,0.12); color: var(--red);    border: 1px solid rgba(239,68,68,0.3); }

.chart-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Hidden chart card placeholder */
.chart-card.hidden { display: none; }

/* ════════════════════════════════════════════
   ENCODING: TABLE PANEL
   ════════════════════════════════════════════ */
.enc-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
  height: 100%;
}

.enc-left {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  min-width: 0;
}

.enc-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
}

/* ════════════════════════════════════════════
   RESET BUTTON
   ════════════════════════════════════════════ */
.reset-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 11.5px;
  padding: 8px 14px;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  letter-spacing: 0.3px;
  margin-top: auto;
  flex-shrink: 0;
}
.reset-btn:hover {
  background: var(--surface3);
  color: var(--text-primary);
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}

/* ════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes warnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
  50%       { box-shadow: 0 0 14px 3px rgba(239,68,68,0.35); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.sidebar-section-animate {
  animation: slideIn 0.25s ease both;
}

/* ══════════════════════════════════════════════════════════════
   STEP 4 — SPINNING WHEEL VISUAL DEMO
   ════════════════════════════════════════════════════════════ */

.wheel-demo-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px;
  height: 100%;
  overflow-y: auto;
}

.wheel-demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 1;
}

.wheel-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px;
}

.wheel-panel-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.wheel-dot-analog  { width: 8px; height: 8px; border-radius: 50%; background: #60a5fa; flex-shrink: 0; }
.wheel-dot-digital { width: 8px; height: 8px; border-radius: 50%; background: #a78bfa; flex-shrink: 0; }

#wheel-analog, #wheel-digital {
  width: 100%;
  height: auto;
  aspect-ratio: 600 / 480;
  border-radius: 8px;
  background: #06091a;
  display: block;
}

#trace-analog, #trace-digital {
  width: 100%;
  height: auto;
  aspect-ratio: 600 / 160;
  border-radius: 6px;
  background: #06091a;
  display: block;
}

.wheel-status-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 0;
}

.wheel-pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.wheel-pill-ok   { background: rgba(34,197,94,0.12);  border: 1px solid rgba(34,197,94,0.35);  color: #4ade80; }
.wheel-pill-warn { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.45);  color: #f87171; animation: warnPulse 1.8s infinite; }
.wheel-pill-info { background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.35); color: #a5b4fc; }


/* Step 4 circle icon */
.step-circle:has(~ .step-btn) { font-size: 11px; }
#step-btn-4 .step-circle { font-size: 12px; }

.dot-s4 {
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
}
