/* ═══════════════════════════════════════════════════════════════════
   PRAYOGSETU VIRTUAL LABORATORY — CURRENT DIVIDER SIMULATOR STYLES
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Core Dark Theme Palette */
  --bg-main: #060911;
  --bg-card: #0c1220;
  --bg-card-alt: #111a2e;
  --bg-input: #080d18;
  --bg-hover: #17233d;

  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-active: rgba(56, 189, 248, 0.4);

  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.35);
  --secondary: #818cf8;
  --accent-cyan: #38bdf8;
  --accent-purple: #a78bfa;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-highlight: #38bdf8;

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

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.15);
}

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

body {
  background-color: var(--bg-main);
  background-image: none !important;
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────────
   1. HEADER NAVIGATION BAR
   ───────────────────────────────────────────────────────────── */
.lab-header {
  background: rgba(12, 18, 32, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1540px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.home-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.lab-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(129, 140, 248, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.home-link:hover .lab-icon {
  transform: scale(1.05);
  border-color: var(--primary);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-lab {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.25);
  letter-spacing: 0.05em;
}

.lab-main-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sim-status-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #10b981;
}

.sim-status-pill.paused {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-ring 1.5s infinite;
}

.sim-status-pill.paused .pulse-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: none;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
}

.btn-primary {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
  background: #0369a1;
  border-color: #7dd3fc;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* ─────────────────────────────────────────────────────────────
   2. PRESETS TOOLBAR
   ───────────────────────────────────────────────────────────── */
.presets-toolbar {
  background: #090e1a;
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 1.5rem;
}

.presets-container {
  max-width: 1540px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.presets-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.preset-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
  border-color: rgba(56, 189, 248, 0.3);
}

.preset-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

/* ─────────────────────────────────────────────────────────────
   3. MAIN LABORATORY GRID LAYOUT
   ───────────────────────────────────────────────────────────── */
.lab-main-layout {
  max-width: 1540px;
  width: 100%;
  margin: 1.25rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: start;
}

.left-column, .right-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Panel Card Container */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.circuit-header-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.tag-branches {
  background: rgba(167, 139, 250, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.tag-current {
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.tag-math {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ─────────────────────────────────────────────────────────────
   4. CIRCUIT SCHEMATIC & PARTICLES CANVAS
   ───────────────────────────────────────────────────────────── */
.circuit-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 900 / 520;
  max-height: 540px;
  background: #080d18;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#current-particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

#circuit-svg {
  width: 100%;
  height: 100%;
  z-index: 2;
  user-select: none;
  display: block;
}

/* Circuit Wires */
.circuit-wire {
  stroke-width: 3.5px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

.circuit-wire.high-potential {
  stroke: #38bdf8;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.4));
}

.circuit-wire.branch1-potential {
  stroke: #38bdf8;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.4));
}

.circuit-wire.branch2-potential {
  stroke: #a78bfa;
  filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.4));
}

.circuit-wire.branch3-potential {
  stroke: #f59e0b;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.3));
}

.circuit-wire.ground-potential {
  stroke: #475569;
}

/* Resistor Symbols */
.resistor-zigzag {
  stroke-width: 4px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.25s ease;
}

.resistor-zigzag.r1-color {
  stroke: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.4));
}

.resistor-zigzag.r2-color {
  stroke: #a78bfa;
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.4));
}

.resistor-zigzag.r3-color {
  stroke: #f59e0b;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.4));
}

/* DC Current Source */
.source-circle {
  fill: #0c1220;
  stroke: #ffffff;
  stroke-width: 2.5px;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.polarity-label {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}

.polarity-label.plus { fill: #38bdf8; }

/* Labels in SVG */
.comp-label-box {
  fill: #131d33;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 1px;
}

.r1-badge-box { stroke: rgba(56, 189, 248, 0.4); }
.r2-badge-box { stroke: rgba(167, 139, 250, 0.4); }
.r3-badge-box { stroke: rgba(245, 158, 11, 0.4); }

.comp-label-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}

.r1-text { fill: #7dd3fc; }
.r2-text { fill: #c4b5fd; }
.r3-text { fill: #fcd34d; }

.telemetry-sub-box {
  fill: #0c1220;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1px;
}

.telemetry-sub-text {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: #94a3b8;
}

.branch-arrow-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
}

/* Nodes */
.node-dot-cyan {
  fill: #38bdf8;
  stroke: #ffffff;
  stroke-width: 1.5px;
}

.node-dot-gnd {
  fill: #64748b;
  stroke: #cbd5e1;
  stroke-width: 1.5px;
}

.node-badge-cyan {
  fill: rgba(14, 116, 144, 0.85);
  stroke: #38bdf8;
  stroke-width: 1px;
}

.node-badge-gnd {
  fill: rgba(30, 41, 59, 0.9);
  stroke: #64748b;
  stroke-width: 1px;
}

.node-badge-text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  dominant-baseline: middle;
  fill: #ffffff;
}

.node-tag-box {
  fill: #0f172a;
  stroke: #38bdf8;
  stroke-width: 1.5px;
}

.node-tag-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  dominant-baseline: middle;
  fill: #ffffff;
}

.gnd-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  fill: #64748b;
}

/* ── Knife Switch Physical Animation ── */
.switch-terminal-pivot {
  fill: #f59e0b;
  stroke: #ffffff;
  stroke-width: 1.5px;
}

.switch-terminal-contact {
  fill: #64748b;
  stroke: #334155;
  stroke-width: 1.5px;
  transition: all 0.3s ease;
}

.switch-terminal-contact.active {
  fill: #f59e0b;
  stroke: #ffffff;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.95));
}

.switch-blade-line {
  stroke-width: 4px;
  stroke-linecap: round;
  transition: x2 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), y2 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.25s ease, filter 0.25s ease;
}

.switch-blade-line.open {
  stroke: #94a3b8;
  filter: none;
}

.switch-blade-line.closed {
  stroke: #f59e0b;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.9));
}

.interactive-switch:hover .switch-blade-line {
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.8));
}

.switch-label-svg {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 800;
  text-anchor: middle;
  fill: #94a3b8;
  letter-spacing: 0.05em;
  transition: fill 0.25s ease;
}

/* Voltmeter */
.voltmeter-bezel {
  fill: #1e293b;
  stroke: #475569;
  stroke-width: 1.5px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.voltmeter-screen {
  fill: #090e17;
  stroke: #0284c7;
  stroke-width: 1px;
}

.meter-lcd-header {
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  fill: #64748b;
}

.meter-lcd-digits {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  fill: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.probe-wire-red {
  stroke: #ef4444;
  stroke-width: 2px;
  stroke-dasharray: 4 2;
  fill: none;
}

.probe-wire-black {
  stroke: #64748b;
  stroke-width: 2px;
  stroke-dasharray: 4 2;
  fill: none;
}

/* Footer Status Strip */
.circuit-footer-strip {
  background: #070c16;
  border-top: 1px solid var(--border);
  padding: 0.6rem 1.1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.footer-metric {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.metric-label {
  font-size: 0.675rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
}

.text-emerald { color: #10b981; }
.text-cyan { color: #38bdf8; }
.text-purple { color: #a78bfa; }
.text-amber { color: #f59e0b; }
.text-highlight { color: #38bdf8; }

/* ─────────────────────────────────────────────────────────────
   5. LIVE BRANCH BARS VISUALIZER
   ───────────────────────────────────────────────────────────── */
.branch-bars-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-desc-sm {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.branch-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.branch-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.775rem;
}

.branch-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}

.r1-badge { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.r2-badge { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.r3-badge { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.it-badge { background: rgba(255, 255, 255, 0.15); color: #ffffff; }

.branch-current-stat {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-percent {
  color: var(--text-secondary);
  font-size: 0.775rem;
  margin-left: 0.25rem;
}

.branch-progress-track {
  width: 100%;
  height: 14px;
  background: #080d18;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.branch-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.25s ease;
}

.fill-cyan {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.fill-purple {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.4);
}

.fill-amber {
  background: linear-gradient(90deg, #d97706, #f59e0b);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.total-current-summary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.total-current-summary b { color: #ffffff; }

.kcl-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: #10b981;
}

/* ─────────────────────────────────────────────────────────────
   6. CALCULATION STEPS & MATH TYPOGRAPHY
   ───────────────────────────────────────────────────────────── */
.formula-body {
  padding: 1.1rem;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.calc-step-card {
  background: rgba(13, 20, 36, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.calc-step-card:hover {
  border-color: var(--border-active);
}

.calc-step-card.highlight {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(15, 25, 45, 0.85);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.08);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.08em;
}

.step-title {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.step-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.math-display-box {
  background: #080d18;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.math-mini-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.15rem 0;
}

.math-mini-row:not(:last-child) {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  padding-bottom: 0.35rem;
}

.math-line {
  margin: 0.15rem 0;
}

.math-line.primary-eq {
  color: #94a3b8;
  font-size: 0.825rem;
  font-weight: 600;
}

.math-line.substitute-eq {
  color: #cbd5e1;
  font-size: 0.8rem;
}

.math-line.result-eq {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(56, 189, 248, 0.25);
}

.math-result-val {
  font-size: 1rem;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.math-val-cyan { color: #38bdf8; font-weight: 700; }
.math-val-purple { color: #c4b5fd; font-weight: 700; }
.math-val-amber { color: #fbbf24; font-weight: 700; }
.math-val-green { color: #34d399; font-weight: 700; }
.math-val-white { color: #ffffff; font-weight: 700; }
.math-val-dim { color: #94a3b8; font-size: 0.725rem; }

/* ─────────────────────────────────────────────────────────────
   7. TELEMETRY HERO & METERS QUAD
   ───────────────────────────────────────────────────────────── */
.telemetry-card {
  background: var(--bg-card);
}

.hero-meter-box {
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.05) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}

.hero-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-subtle {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.hero-val-display {
  font-family: var(--font-mono);
  font-size: 2.35rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.unit-large {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-left: 0.25rem;
}

.hero-bar-track {
  width: 100%;
  height: 8px;
  background: #080d18;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.hero-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
  transition: width 0.2s ease;
}

.hero-sub-stats {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.meters-quad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}

.mini-meter-tile {
  background: var(--bg-card);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mini-meter-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mini-meter-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.mini-meter-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* ─────────────────────────────────────────────────────────────
   8. CIRCUIT CONTROLS & SLIDERS
   ───────────────────────────────────────────────────────────── */
.controls-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.control-row-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label-row label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.label-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.label-badge {
  font-family: var(--font-mono);
  font-size: 0.675rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
}

.direct-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.45rem;
  transition: all 0.2s ease;
}

.direct-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.numeric-input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  width: 75px;
  text-align: right;
  outline: none;
}

.numeric-input::-webkit-inner-spin-button,
.numeric-input::-webkit-outer-spin-button {
  opacity: 1;
}

.input-unit {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.3rem;
  font-weight: 600;
}

/* Custom Sliders */
.slider-wrapper {
  padding: 0.2rem 0;
}

.styled-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: #1e293b;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

.styled-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  border: 2px solid #0284c7;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  transition: transform 0.15s ease, background 0.15s ease;
}

.styled-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #38bdf8;
}

.styled-slider.slider-it::-webkit-slider-thumb { border-color: #38bdf8; }
.styled-slider.slider-r1::-webkit-slider-thumb { border-color: #38bdf8; }
.styled-slider.slider-r2::-webkit-slider-thumb { border-color: #a78bfa; }
.styled-slider.slider-r3::-webkit-slider-thumb { border-color: #f59e0b; }

.quick-chips-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.675rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.chip-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  border-color: var(--primary);
}

/* Branch 3 Sub-Panel Toggle */
.branch3-container {
  background: rgba(13, 20, 36, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.branch3-toggle-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.branch3-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-grow: 1;
}

.branch3-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pill {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
}

.pill-on {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.pill-off {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.pill-live {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pill-active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Switch UI */
.switch-ui {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.switch-ui input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-switch {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 20px;
}

.slider-switch:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.switch-ui input:checked + .slider-switch {
  background-color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.switch-ui input:checked + .slider-switch:before {
  transform: translateX(16px);
}

/* ─────────────────────────────────────────────────────────────
   9. INTERACTIVE PREDICTOR MODE
   ───────────────────────────────────────────────────────────── */
.predictor-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.predictor-instructions {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.predictor-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
}

.pred-input-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pred-input-block label {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pred-num-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  outline: none;
}

.pred-num-input:focus {
  border-color: var(--primary);
}

.pred-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.pred-feedback-box {
  background: #080d18;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}

.pred-feedback-text {
  font-size: 0.8rem;
  line-height: 1.5;
}

.feedback-success { color: #10b981; }
.feedback-partial { color: #f59e0b; }
.feedback-error { color: #ef4444; }

/* ─────────────────────────────────────────────────────────────
   10. OBSERVATION TABLE
   ───────────────────────────────────────────────────────────── */
.table-scroll-wrap {
  max-height: 240px;
  overflow-y: auto;
}

.lab-obs-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.lab-obs-table th {
  background: #090e1a;
  color: var(--text-secondary);
  font-weight: 700;
  text-align: center;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.lab-obs-table td {
  padding: 0.45rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.lab-obs-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.empty-table-row td {
  color: var(--text-muted);
  font-style: italic;
  padding: 1.5rem 0.5rem;
}

/* ─────────────────────────────────────────────────────────────
   11. EDUCATIONAL LAB THEORY SECTION (BOTTOM)
   ───────────────────────────────────────────────────────────── */
.lab-theory-section {
  background: #070b13;
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  margin-top: 2rem;
}

.theory-container {
  max-width: 1540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.section-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.theory-pill {
  font-family: var(--font-mono);
  font-size: 0.675rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.08em;
}

.section-title-wrap h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.section-title-wrap p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.theory-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.theory-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.theory-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theory-icon { font-size: 1.2rem; }

.theory-card-header h3 {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--text-primary);
}

.theory-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.theory-math {
  background: #080d18;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #e2e8f0;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.theory-math-line { display: block; }

.theory-list {
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.theory-list li {
  font-size: 0.785rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.theory-list li strong { color: var(--text-highlight); }

/* ─────────────────────────────────────────────────────────────
   12. LAB FOOTER
   ───────────────────────────────────────────────────────────── */
.lab-footer {
  background: #05080f;
  border-top: 1px solid var(--border);
  padding: 1.5rem;
}

.footer-container {
  max-width: 1540px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-left p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.775rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--primary); }

/* ─────────────────────────────────────────────────────────────
   13. RESPONSIVE BREAKPOINTS
   ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .lab-main-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .meters-quad-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   14. LIGHT THEME COMPREHENSIVE OVERRIDES
   ═══════════════════════════════════════════════════════════════════ */

:root[data-theme="light"],
[data-theme="light"],
html[data-theme="light"],
html:not([data-theme="dark"]) {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;
  --bg-input: #f8fafc;
  --bg-hover: #e2e8f0;

  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-active: #0284c7;

  --primary: #0284c7;
  --primary-glow: rgba(2, 132, 199, 0.2);
  --secondary: #6366f1;
  --accent-cyan: #0284c7;
  --accent-purple: #7c3aed;
  --accent-amber: #d97706;
  --accent-emerald: #059669;
  --accent-rose: #e11d48;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-highlight: #0284c7;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 15px rgba(2, 132, 199, 0.12);
}

[data-theme="light"] body,
html[data-theme="light"] body {
  background-color: #f8fafc !important;
  background-image: none !important;
  color: #0f172a !important;
}

/* Header & Presets */
[data-theme="light"] .lab-header,
html[data-theme="light"] .lab-header {
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom-color: #e2e8f0 !important;
}

[data-theme="light"] .lab-main-title,
html[data-theme="light"] .lab-main-title {
  color: #0f172a !important;
}

[data-theme="light"] .brand-title,
html[data-theme="light"] .brand-title {
  color: #64748b !important;
}

[data-theme="light"] .presets-toolbar,
html[data-theme="light"] .presets-toolbar {
  background: #ffffff !important;
  border-bottom-color: #e2e8f0 !important;
}

[data-theme="light"] .presets-label,
html[data-theme="light"] .presets-label {
  color: #475569 !important;
}

[data-theme="light"] .preset-btn,
html[data-theme="light"] .preset-btn {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light"] .preset-btn:hover,
html[data-theme="light"] .preset-btn:hover {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border-color: #38bdf8 !important;
}

[data-theme="light"] .preset-btn.active,
html[data-theme="light"] .preset-btn.active {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.2) !important;
}

/* Panels */
[data-theme="light"] .panel-card,
html[data-theme="light"] .panel-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .panel-header,
html[data-theme="light"] .panel-header {
  border-bottom-color: #e2e8f0 !important;
  background: #f8fafc !important;
}

[data-theme="light"] .panel-title,
html[data-theme="light"] .panel-title {
  color: #0f172a !important;
}

/* Circuit Schematic & SVG */
[data-theme="light"] .circuit-wrapper,
html[data-theme="light"] .circuit-wrapper {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .circuit-wire.high-potential,
[data-theme="light"] .circuit-wire.branch1-potential,
html[data-theme="light"] .circuit-wire.high-potential,
html[data-theme="light"] .circuit-wire.branch1-potential {
  stroke: #0284c7 !important;
  filter: drop-shadow(0 0 3px rgba(2, 132, 199, 0.35)) !important;
}

[data-theme="light"] .circuit-wire.branch2-potential,
html[data-theme="light"] .circuit-wire.branch2-potential {
  stroke: #7c3aed !important;
  filter: drop-shadow(0 0 3px rgba(124, 58, 237, 0.35)) !important;
}

[data-theme="light"] .circuit-wire.branch3-potential,
html[data-theme="light"] .circuit-wire.branch3-potential {
  stroke: #d97706 !important;
  filter: drop-shadow(0 0 3px rgba(217, 119, 6, 0.35)) !important;
}

[data-theme="light"] .circuit-wire.ground-potential,
html[data-theme="light"] .circuit-wire.ground-potential {
  stroke: #64748b !important;
}

[data-theme="light"] .resistor-zigzag.r1-color,
html[data-theme="light"] .resistor-zigzag.r1-color {
  stroke: #0284c7 !important;
  filter: drop-shadow(0 0 4px rgba(2, 132, 199, 0.3)) !important;
}

[data-theme="light"] .resistor-zigzag.r2-color,
html[data-theme="light"] .resistor-zigzag.r2-color {
  stroke: #7c3aed !important;
  filter: drop-shadow(0 0 4px rgba(124, 58, 237, 0.3)) !important;
}

[data-theme="light"] .resistor-zigzag.r3-color,
html[data-theme="light"] .resistor-zigzag.r3-color {
  stroke: #d97706 !important;
  filter: drop-shadow(0 0 4px rgba(217, 119, 6, 0.3)) !important;
}

[data-theme="light"] .source-circle,
html[data-theme="light"] .source-circle {
  fill: #ffffff !important;
  stroke: #0284c7 !important;
  filter: drop-shadow(0 2px 6px rgba(2, 132, 199, 0.25)) !important;
}

[data-theme="light"] .polarity-label,
html[data-theme="light"] .polarity-label {
  fill: #0284c7 !important;
}

[data-theme="light"] .comp-label-box,
html[data-theme="light"] .comp-label-box {
  fill: #ffffff !important;
  stroke: #cbd5e1 !important;
}

[data-theme="light"] .comp-label-box.r1-badge-box,
html[data-theme="light"] .comp-label-box.r1-badge-box {
  stroke: #0284c7 !important;
  fill: #f0f9ff !important;
}

[data-theme="light"] .comp-label-box.r2-badge-box,
html[data-theme="light"] .comp-label-box.r2-badge-box {
  stroke: #7c3aed !important;
  fill: #faf5ff !important;
}

[data-theme="light"] .comp-label-box.r3-badge-box,
html[data-theme="light"] .comp-label-box.r3-badge-box {
  stroke: #d97706 !important;
  fill: #fffbeb !important;
}

[data-theme="light"] .comp-label-text.r1-text,
html[data-theme="light"] .comp-label-text.r1-text {
  fill: #0369a1 !important;
}

[data-theme="light"] .comp-label-text.r2-text,
html[data-theme="light"] .comp-label-text.r2-text {
  fill: #6d28d9 !important;
}

[data-theme="light"] .comp-label-text.r3-text,
html[data-theme="light"] .comp-label-text.r3-text {
  fill: #b45309 !important;
}

[data-theme="light"] .telemetry-sub-box,
html[data-theme="light"] .telemetry-sub-box {
  fill: #f1f5f9 !important;
  stroke: #cbd5e1 !important;
}

[data-theme="light"] .telemetry-sub-text,
html[data-theme="light"] .telemetry-sub-text {
  fill: #334155 !important;
}

[data-theme="light"] .node-tag-box,
html[data-theme="light"] .node-tag-box {
  fill: #ffffff !important;
  stroke: #0284c7 !important;
}

[data-theme="light"] .node-tag-text,
html[data-theme="light"] .node-tag-text {
  fill: #0369a1 !important;
}

[data-theme="light"] .node-badge-cyan,
html[data-theme="light"] .node-badge-cyan {
  fill: #e0f2fe !important;
  stroke: #0284c7 !important;
}

[data-theme="light"] .node-badge-gnd,
html[data-theme="light"] .node-badge-gnd {
  fill: #f1f5f9 !important;
  stroke: #94a3b8 !important;
}

[data-theme="light"] .node-badge-text,
html[data-theme="light"] .node-badge-text {
  fill: #0f172a !important;
}

[data-theme="light"] .gnd-label,
html[data-theme="light"] .gnd-label {
  fill: #475569 !important;
}

[data-theme="light"] .voltmeter-bezel,
html[data-theme="light"] .voltmeter-bezel {
  fill: #f1f5f9 !important;
  stroke: #cbd5e1 !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08)) !important;
}

[data-theme="light"] .voltmeter-screen,
html[data-theme="light"] .voltmeter-screen {
  fill: #ffffff !important;
  stroke: #0284c7 !important;
}

[data-theme="light"] .meter-lcd-header,
html[data-theme="light"] .meter-lcd-header {
  fill: #64748b !important;
}

[data-theme="light"] .meter-lcd-digits,
html[data-theme="light"] .meter-lcd-digits {
  fill: #0284c7 !important;
  text-shadow: none !important;
}

[data-theme="light"] .circuit-footer-strip,
html[data-theme="light"] .circuit-footer-strip {
  background: #f8fafc !important;
  border-top-color: #e2e8f0 !important;
}

[data-theme="light"] .metric-label,
html[data-theme="light"] .metric-label {
  color: #64748b !important;
}

[data-theme="light"] .metric-val,
html[data-theme="light"] .metric-val {
  color: #0f172a !important;
}

/* Telemetry Card & Right Column Meters */
[data-theme="light"] .telemetry-card,
html[data-theme="light"] .telemetry-card {
  background: #ffffff !important;
}

[data-theme="light"] .hero-meter-box,
html[data-theme="light"] .hero-meter-box {
  background: linear-gradient(180deg, rgba(2, 132, 199, 0.05) 0%, transparent 100%) !important;
  border-bottom-color: #e2e8f0 !important;
}

[data-theme="light"] .hero-label,
html[data-theme="light"] .hero-label {
  color: #475569 !important;
}

[data-theme="light"] .badge-subtle,
html[data-theme="light"] .badge-subtle {
  background: #e2e8f0 !important;
  color: #334155 !important;
}

[data-theme="light"] .hero-val-display,
html[data-theme="light"] .hero-val-display {
  color: #0f172a !important;
  text-shadow: none !important;
}

[data-theme="light"] .unit-large,
html[data-theme="light"] .unit-large {
  color: #0284c7 !important;
}

[data-theme="light"] .hero-bar-track,
html[data-theme="light"] .hero-bar-track {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .hero-sub-stats,
html[data-theme="light"] .hero-sub-stats {
  color: #475569 !important;
}

[data-theme="light"] .meters-quad-grid,
html[data-theme="light"] .meters-quad-grid {
  background: #e2e8f0 !important;
}

[data-theme="light"] .mini-meter-tile,
html[data-theme="light"] .mini-meter-tile {
  background: #ffffff !important;
}

[data-theme="light"] .mini-meter-label,
html[data-theme="light"] .mini-meter-label {
  color: #64748b !important;
}

[data-theme="light"] .mini-meter-value,
html[data-theme="light"] .mini-meter-value {
  color: #0f172a !important;
}

[data-theme="light"] .mini-meter-sub,
html[data-theme="light"] .mini-meter-sub {
  color: #475569 !important;
}

/* Branch Bars Visualizer */
[data-theme="light"] .branch-progress-track,
html[data-theme="light"] .branch-progress-track {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .total-current-summary,
html[data-theme="light"] .total-current-summary {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light"] .total-current-summary b,
html[data-theme="light"] .total-current-summary b {
  color: #0f172a !important;
}

[data-theme="light"] .branch-current-stat,
html[data-theme="light"] .branch-current-stat {
  color: #0f172a !important;
}

[data-theme="light"] .stat-percent,
html[data-theme="light"] .stat-percent {
  color: #64748b !important;
}

/* Calculation Steps */
[data-theme="light"] .calc-step-card,
html[data-theme="light"] .calc-step-card {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .calc-step-card.highlight,
html[data-theme="light"] .calc-step-card.highlight {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.1) !important;
}

[data-theme="light"] .step-title,
html[data-theme="light"] .step-title {
  color: #0f172a !important;
}

[data-theme="light"] .step-desc,
html[data-theme="light"] .step-desc {
  color: #475569 !important;
}

[data-theme="light"] .math-display-box,
html[data-theme="light"] .math-display-box {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

[data-theme="light"] .math-line.primary-eq,
html[data-theme="light"] .math-line.primary-eq {
  color: #334155 !important;
}

[data-theme="light"] .math-line.substitute-eq,
html[data-theme="light"] .math-line.substitute-eq {
  color: #1e293b !important;
}

[data-theme="light"] .math-result-val,
html[data-theme="light"] .math-result-val {
  color: #0284c7 !important;
  text-shadow: none !important;
}

[data-theme="light"] .math-val-white,
html[data-theme="light"] .math-val-white {
  color: #0f172a !important;
}

[data-theme="light"] .math-val-dim,
html[data-theme="light"] .math-val-dim {
  color: #64748b !important;
}

/* Controls & Inputs */
[data-theme="light"] .label-title,
html[data-theme="light"] .label-title {
  color: #0f172a !important;
}

[data-theme="light"] .direct-input-wrap,
html[data-theme="light"] .direct-input-wrap {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .numeric-input,
html[data-theme="light"] .numeric-input {
  color: #0f172a !important;
}

[data-theme="light"] .styled-slider,
html[data-theme="light"] .styled-slider {
  background: #e2e8f0 !important;
}

[data-theme="light"] .chip-btn,
html[data-theme="light"] .chip-btn {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light"] .chip-btn:hover,
html[data-theme="light"] .chip-btn:hover {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border-color: #38bdf8 !important;
}

[data-theme="light"] .chip-btn.active,
html[data-theme="light"] .chip-btn.active {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border-color: #0284c7 !important;
}

[data-theme="light"] .branch3-container,
html[data-theme="light"] .branch3-container {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .branch3-section-title,
html[data-theme="light"] .branch3-section-title {
  color: #0f172a !important;
}

[data-theme="light"] .slider-switch,
html[data-theme="light"] .slider-switch {
  background-color: #cbd5e1 !important;
}

/* Predictor Mode */
[data-theme="light"] .predictor-instructions,
html[data-theme="light"] .predictor-instructions {
  color: #475569 !important;
}

[data-theme="light"] .pred-input-block label,
html[data-theme="light"] .pred-input-block label {
  color: #475569 !important;
}

[data-theme="light"] .pred-num-input,
html[data-theme="light"] .pred-num-input {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .pred-feedback-box,
html[data-theme="light"] .pred-feedback-box {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

/* Observation Table */
[data-theme="light"] .lab-obs-table th,
html[data-theme="light"] .lab-obs-table th {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-bottom-color: #cbd5e1 !important;
}

[data-theme="light"] .lab-obs-table td,
html[data-theme="light"] .lab-obs-table td {
  border-bottom-color: #f1f5f9 !important;
  color: #1e293b !important;
}

[data-theme="light"] .lab-obs-table tr:hover td,
html[data-theme="light"] .lab-obs-table tr:hover td {
  background: #f8fafc !important;
}

/* Theory Section & Cards */
[data-theme="light"] .lab-theory-section,
html[data-theme="light"] .lab-theory-section,
html:not(.dark):not([data-theme="dark"]) .lab-theory-section {
  background: #f1f5f9 !important;
  border-top-color: #e2e8f0 !important;
}

[data-theme="light"] .section-title-wrap h2,
html[data-theme="light"] .section-title-wrap h2,
html:not(.dark):not([data-theme="dark"]) .section-title-wrap h2 {
  color: #0f172a !important;
}

[data-theme="light"] .section-title-wrap p,
html[data-theme="light"] .section-title-wrap p,
html:not(.dark):not([data-theme="dark"]) .section-title-wrap p {
  color: #475569 !important;
}

[data-theme="light"] .theory-pill,
html[data-theme="light"] .theory-pill,
html:not(.dark):not([data-theme="dark"]) .theory-pill {
  color: #0284c7 !important;
}

[data-theme="light"] .theory-card,
html[data-theme="light"] .theory-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .theory-card-header h3,
html[data-theme="light"] .theory-card-header h3 {
  color: #0f172a !important;
}

[data-theme="light"] .theory-card p,
html[data-theme="light"] .theory-card p {
  color: #475569 !important;
}

[data-theme="light"] .theory-math,
html[data-theme="light"] .theory-math {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

[data-theme="light"] .theory-list li,
html[data-theme="light"] .theory-list li {
  color: #475569 !important;
}

[data-theme="light"] .btn-secondary,
html[data-theme="light"] .btn-secondary {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .btn-secondary:hover,
html[data-theme="light"] .btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

[data-theme="light"] .lab-footer,
html[data-theme="light"] .lab-footer {
  background: #f8fafc !important;
  border-top-color: #e2e8f0 !important;
}

[data-theme="light"] .footer-brand,
html[data-theme="light"] .footer-brand {
  color: #0f172a !important;
}

[data-theme="light"] .footer-left p,
html[data-theme="light"] .footer-left p {
  color: #64748b !important;
}

[data-theme="light"] .footer-links a,
html[data-theme="light"] .footer-links a {
  color: #475569 !important;
}

[data-theme="light"] .footer-links a:hover,
html[data-theme="light"] .footer-links a:hover {
  color: #0284c7 !important;
}

