/* ==========================================================================
   BJT TRANSISTOR VIRTUAL LABORATORY — STYLESHEET
   PrayogSetu Design Language (High-Contrast Engineering Lab Glassmorphism)
   ========================================================================== */

:root {
  /* Core Color Palette */
  --bg-base: #060a12;
  --bg-card: rgba(13, 20, 36, 0.85);
  --bg-card-hover: rgba(18, 28, 50, 0.95);
  --bg-input: #0a1020;
  --border: rgba(255, 255, 255, 0.09);
  --border-focus: #38bdf8;

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

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

  /* BJT Color System */
  --color-ib: #38bdf8;       /* Base Current: Cyan/Sky Blue */
  --color-ic: #10b981;       /* Collector Current: Emerald Green */
  --color-ie: #f59e0b;       /* Emitter Current: Amber */
  --color-vce: #a78bfa;      /* VCE Voltage: Purple */
  --color-vcc: #f43f5e;      /* VCC Supply: Rose Red */
  --color-sat: #f59e0b;      /* Saturation: Amber */
  --color-active: #10b981;   /* Active: Emerald */
  --color-cutoff: #64748b;   /* Cutoff: Slate */

  /* UI Tokens */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.55);
  --shadow-glow-cyan: 0 0 15px rgba(56, 189, 248, 0.35);
  --shadow-glow-emerald: 0 0 15px rgba(16, 185, 129, 0.35);
  --shadow-glow-amber: 0 0 15px rgba(245, 158, 11, 0.35);
}

/* Base Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

/* Utility Classes */
.text-cyan { color: #38bdf8 !important; }
.text-emerald { color: #10b981 !important; }
.text-amber { color: #f59e0b !important; }
.text-purple { color: #a78bfa !important; }
.text-rose { color: #f43f5e !important; }
.text-highlight { color: #38bdf8; font-weight: 700; }

/* ── Top Navigation Bar ── */
.lab-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 10, 18, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.back-link:hover {
  background: rgba(56, 189, 248, 0.12);
  color: var(--text-highlight);
  border-color: rgba(56, 189, 248, 0.4);
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

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

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.badge-lab {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  border-radius: var(--radius-sm);
  letter-spacing: 0.06em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

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

.preset-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.preset-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-select:hover, .preset-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.sim-btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-action {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

.btn-action:hover {
  background: linear-gradient(135deg, #0369a1, #0284c7);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
}

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

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

.btn-primary {
  background: #0284c7;
  color: #fff;
  border-color: #38bdf8;
}

.btn-primary:hover {
  background: #0369a1;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.7rem;
}

/* ── Main Workspace Layout ── */
.lab-workspace {
  max-width: 1560px;
  width: 100%;
  margin: 1.25rem auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 1.25rem;
  flex: 1;
}

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

/* ── Panel Cards ── */
.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-region-indicator {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.tag-region-indicator.cutoff {
  background: rgba(100, 116, 139, 0.15);
  border-color: rgba(100, 116, 139, 0.4);
  color: #94a3b8;
}

.tag-region-indicator.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.tag-region-indicator.saturation {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

.tag-beta {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

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

.pill-live {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.pill-active {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}

/* ── Circuit Schematic Canvas & SVG ── */
.circuit-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 900 / 520;
  max-height: 520px;
  background: #080d18;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

#circuit-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  user-select: none;
}

/* SVG Circuit Diagram Styles */
.circuit-wire {
  stroke-width: 3.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

.vcc-rail { stroke: #f43f5e; }
.collector-wire { stroke: #10b981; }
.base-feed-wire { stroke: #38bdf8; }
.base-lead-wire { stroke: #38bdf8; }
.emitter-wire { stroke: #f59e0b; }
.gnd-wire { stroke: #475569; }

.resistor-zigzag, .resistor-zigzag-vert {
  fill: none;
  stroke-width: 3.5px;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.rc-color { stroke: #10b981; }
.rb-color { stroke: #38bdf8; }

/* DC Source Circle */
.source-circle {
  fill: #0c1527;
  stroke-width: 2.5px;
}

.vin-circle { stroke: #38bdf8; }

.source-sign {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 800;
  fill: #f8fafc;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* Component Boxes & Badges */
.comp-label-box {
  fill: #0c1527;
  stroke-width: 1px;
}

.vcc-badge-box { stroke: rgba(244, 63, 94, 0.4); }
.rc-badge-box { stroke: rgba(16, 185, 129, 0.4); }
.vin-badge-box { stroke: rgba(56, 189, 248, 0.4); }
.rb-badge-box { stroke: rgba(56, 189, 248, 0.4); }

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

.vcc-text { fill: #fda4af; }
.rc-text { fill: #6ee7b7; }
.vin-text { fill: #7dd3fc; }
.rb-text { fill: #7dd3fc; }

.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;
}

.ic-text { fill: #6ee7b7; }
.ib-text { fill: #7dd3fc; }
.ie-text { fill: #fcd34d; }

/* Transistor Symbol Styles */
.transistor-bezel {
  fill: #0c1527;
  stroke: #334155;
  stroke-width: 2px;
  transition: all 0.3s ease;
}

.transistor-bezel.active-bezel {
  stroke: #10b981;
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

.transistor-bezel.sat-bezel {
  stroke: #f59e0b;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5));
}

.transistor-bezel.cutoff-bezel {
  stroke: #475569;
  filter: none;
}

.transistor-bar {
  stroke: #f8fafc;
  stroke-width: 4.5px;
  stroke-linecap: round;
}

.transistor-lead {
  stroke: #f8fafc;
  stroke-width: 3px;
  stroke-linecap: round;
}

.terminal-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}

.terminal-sub {
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: #64748b;
}

.base-tag { fill: #38bdf8; }
.coll-tag { fill: #10b981; }
.emit-tag { fill: #f59e0b; }

.transistor-type-text {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  fill: #475569;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* Collector Output Lamp */
.lamp-bulb {
  fill: #0c1527;
  stroke: #38bdf8;
  stroke-width: 2px;
  transition: all 0.3s ease;
}

.lamp-filament {
  stroke: #94a3b8;
  stroke-width: 1.8px;
}

.lamp-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  fill: #38bdf8;
  dominant-baseline: middle;
  transition: fill 0.3s ease;
}

/* Voltmeter */
.voltmeter-badge-box {
  fill: #111a2e;
  stroke: #a78bfa;
  stroke-width: 1.2px;
}

.voltmeter-title-text {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  fill: #c4b5fd;
  text-anchor: middle;
}

.voltmeter-val-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  fill: #ffffff;
  text-anchor: middle;
}

/* Nodes & GND */
.node-dot-vcc { fill: #f43f5e; stroke: #fff; stroke-width: 1.5px; }
.node-dot-cyan { fill: #38bdf8; stroke: #fff; stroke-width: 1.5px; }
.node-dot-emerald { fill: #10b981; stroke: #fff; stroke-width: 1.5px; }
.node-dot-amber { fill: #f59e0b; stroke: #fff; stroke-width: 1.5px; }

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

/* ── Circuit Status Footer Strip ── */
.circuit-footer-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border);
}

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

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

.metric-val {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── DC Load Line Canvas Container ── */
.loadline-container {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.loadline-canvas-wrap {
  width: 100%;
  background: #080d18;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  display: flex;
  justify-content: center;
}

#loadline-canvas {
  width: 100%;
  max-height: 240px;
  display: block;
}

.loadline-legend {
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.cut-off { background: #64748b; }
.legend-dot.active { background: #10b981; box-shadow: 0 0 8px #10b981; }
.legend-dot.saturation { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }

/* ── Mathematical Solver Steps ── */
.solver-body {
  padding: 1.1rem;
}

.calc-steps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.calc-step-card {
  background: rgba(10, 16, 32, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calc-step-card.highlight {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.04);
}

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

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

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

.math-display-box {
  margin-top: 0.35rem;
  padding: 0.55rem 0.75rem;
  background: #060a12;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.math-val-blue { color: #38bdf8; font-weight: 700; }
.math-val-green { color: #10b981; font-weight: 700; }
.math-val-amber { color: #f59e0b; font-weight: 700; }
.math-val-purple { color: #a78bfa; font-weight: 700; }
.math-val-white { color: #ffffff; font-weight: 700; }

/* ── RIGHT COLUMN: Telemetry Hero & Controls ── */
.telemetry-card {
  display: flex;
  flex-direction: column;
}

/* Operating Region Hero Banner */
.hero-region-banner {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: all 0.3s ease;
}

.hero-region-banner.cutoff-mode {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
  border-left: 4px solid #64748b;
}

.hero-region-banner.active-mode {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.5), rgba(13, 20, 36, 0.8));
  border-left: 4px solid #10b981;
}

.hero-region-banner.saturation-mode {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.5), rgba(13, 20, 36, 0.8));
  border-left: 4px solid #f59e0b;
}

.region-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.region-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.06em;
}

.cutoff-mode .region-badge { background: #334155; color: #cbd5e1; }
.active-mode .region-badge { background: rgba(16, 185, 129, 0.25); color: #34d399; border: 1px solid #10b981; }
.saturation-mode .region-badge { background: rgba(245, 158, 11, 0.25); color: #fbbf24; border: 1px solid #f59e0b; }

.region-mode-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.region-desc-text {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Quad Meters Grid */
.meters-quad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  padding: 1.1rem;
}

.mini-meter-tile {
  background: rgba(10, 16, 32, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

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

.mini-meter-value {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

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

/* ── Circuit Controls Panel ── */
.controls-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.control-row-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.control-row-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.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-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-sm);
}

.vin-badge { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.vcc-badge { background: rgba(244, 63, 94, 0.15); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.4); }
.rb-badge { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.rc-badge { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.beta-badge { background: rgba(167, 139, 250, 0.15); color: #a78bfa; border: 1px solid rgba(167, 139, 250, 0.4); }

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

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

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

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

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

/* Sliders */
.slider-wrapper {
  width: 100%;
}

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

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

.styled-slider.slider-vcc::-webkit-slider-thumb { border-color: #f43f5e; box-shadow: 0 0 10px rgba(244, 63, 94, 0.6); }
.styled-slider.slider-rc::-webkit-slider-thumb { border-color: #10b981; box-shadow: 0 0 10px rgba(16, 185, 129, 0.6); }
.styled-slider.slider-beta::-webkit-slider-thumb { border-color: #a78bfa; box-shadow: 0 0 10px rgba(167, 139, 250, 0.6); }

.styled-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Quick Chips Row */
.quick-chips-row {
  display: flex;
  gap: 0.4rem;
  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.68rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.chip-btn.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

/* ── Observation Table ── */
.table-card {
  display: flex;
  flex-direction: column;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.table-scroll-wrap {
  max-height: 220px;
  overflow-y: auto;
}

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

.lab-obs-table th {
  position: sticky;
  top: 0;
  background: #0b1222;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--border);
}

.lab-obs-table td {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

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

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

/* ── Academic Theory Section ── */
.lab-theory-section {
  max-width: 1560px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
}

.theory-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.theory-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theory-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.theory-module {
  background: rgba(10, 16, 32, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.theory-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.theory-num {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-highlight);
  letter-spacing: 0.08em;
}

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

.theory-text {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.theory-list {
  font-size: 0.74rem;
  color: var(--text-secondary);
  padding-left: 1.1rem;
  line-height: 1.5;
}

.theory-list li {
  margin-bottom: 0.35rem;
}

.theory-equation {
  background: #060a12;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #38bdf8;
  text-align: center;
  font-weight: 700;
}

/* ── Footer ── */
.lab-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: rgba(6, 10, 18, 0.95);
  padding: 1.1rem 1.5rem;
}

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

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

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

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tag-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  border-radius: var(--radius-sm);
}

/* ── Responsive Media Queries ── */
@media (max-width: 1200px) {
  .lab-workspace {
    grid-template-columns: 1fr;
  }
  .theory-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .circuit-footer-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .calc-steps-grid {
    grid-template-columns: 1fr;
  }
  .meters-quad-grid {
    grid-template-columns: 1fr;
  }
  .theory-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   LIGHT THEME DESIGN SYSTEM OVERRIDES (BJT TRANSISTOR)
   ========================================================================== */
[data-theme="light"],
html[data-theme="light"],
html:not(.dark) {
  --bg-base: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border: rgba(203, 213, 225, 0.8);
  --border-focus: #0284c7;

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

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ── Top Navbar ── */
[data-theme="light"] .lab-navbar,
html[data-theme="light"] .lab-navbar {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom-color: #cbd5e1 !important;
}

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

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

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

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

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

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

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

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

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

[data-theme="light"] #circuit-svg rect[fill="url(#grid-pattern)"],
html[data-theme="light"] #circuit-svg rect[fill="url(#grid-pattern)"] {
  fill: #ffffff !important;
}

/* Transistor Bezel & Symbol */
[data-theme="light"] .transistor-bezel,
html[data-theme="light"] .transistor-bezel {
  fill: #f0fdf4 !important;
  stroke: #10b981 !important;
}

[data-theme="light"] .transistor-bezel.active-bezel,
html[data-theme="light"] .transistor-bezel.active-bezel {
  fill: #ecfdf5 !important;
  stroke: #059669 !important;
}

[data-theme="light"] .transistor-bezel.sat-bezel,
html[data-theme="light"] .transistor-bezel.sat-bezel {
  fill: #fffbeb !important;
  stroke: #d97706 !important;
}

[data-theme="light"] .transistor-bezel.cutoff-bezel,
html[data-theme="light"] .transistor-bezel.cutoff-bezel {
  fill: #f8fafc !important;
  stroke: #64748b !important;
}

[data-theme="light"] .transistor-bar,
[data-theme="light"] .transistor-lead,
html[data-theme="light"] .transistor-bar,
html[data-theme="light"] .transistor-lead {
  stroke: #0f172a !important;
}

[data-theme="light"] .transistor-type-text,
html[data-theme="light"] .transistor-type-text {
  fill: #0f172a !important;
  font-weight: 800 !important;
}

/* Source Vin Circle */
[data-theme="light"] .source-circle,
html[data-theme="light"] .source-circle {
  fill: #f0f9ff !important;
  stroke: #0284c7 !important;
}

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

/* Component Boxes & Badges in Schematic */
[data-theme="light"] .comp-label-box,
html[data-theme="light"] .comp-label-box {
  fill: #f8fafc !important;
  stroke: #cbd5e1 !important;
}

[data-theme="light"] .vcc-badge-box,
html[data-theme="light"] .vcc-badge-box {
  fill: #fff1f2 !important;
  stroke: #f43f5e !important;
}

[data-theme="light"] .vcc-text,
html[data-theme="light"] .vcc-text {
  fill: #e11d48 !important;
  font-weight: 800 !important;
}

[data-theme="light"] .rc-badge-box,
html[data-theme="light"] .rc-badge-box {
  fill: #f0fdf4 !important;
  stroke: #10b981 !important;
}

[data-theme="light"] .rc-text,
html[data-theme="light"] .rc-text {
  fill: #047857 !important;
  font-weight: 800 !important;
}

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

[data-theme="light"] .vin-text,
html[data-theme="light"] .vin-text {
  fill: #0369a1 !important;
  font-weight: 800 !important;
}

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

[data-theme="light"] .rb-text,
html[data-theme="light"] .rb-text {
  fill: #0369a1 !important;
  font-weight: 800 !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;
  font-weight: 700 !important;
}

[data-theme="light"] .branch-arrow-label.ic-text,
html[data-theme="light"] .branch-arrow-label.ic-text {
  fill: #047857 !important;
  font-weight: 800 !important;
}

[data-theme="light"] .branch-arrow-label.ib-text,
html[data-theme="light"] .branch-arrow-label.ib-text {
  fill: #0369a1 !important;
  font-weight: 800 !important;
}

[data-theme="light"] .branch-arrow-label.ie-text,
html[data-theme="light"] .branch-arrow-label.ie-text {
  fill: #b45309 !important;
  font-weight: 800 !important;
}

/* Voltmeter */
[data-theme="light"] .voltmeter-badge-box,
html[data-theme="light"] .voltmeter-badge-box {
  fill: #faf5ff !important;
  stroke: #9333ea !important;
}

[data-theme="light"] .voltmeter-title-text,
html[data-theme="light"] .voltmeter-title-text {
  fill: #7e22ce !important;
  font-weight: 700 !important;
}

[data-theme="light"] .voltmeter-val-text,
html[data-theme="light"] .voltmeter-val-text {
  fill: #581c87 !important;
  font-weight: 800 !important;
}

/* Lamp & GND */
[data-theme="light"] .lamp-bulb,
html[data-theme="light"] .lamp-bulb {
  stroke: #0284c7 !important;
}

[data-theme="light"] .lamp-bulb[style*="#0c1527"],
html[data-theme="light"] .lamp-bulb[style*="#0c1527"] {
  fill: #f1f5f9 !important;
}

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

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

/* ── Circuit Status Footer Strip ── */
[data-theme="light"] .circuit-footer-strip,
html[data-theme="light"] .circuit-footer-strip {
  background: #f8fafc !important;
  border-top-color: #cbd5e1 !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;
}

/* ── Hero Banner & Telemetry Meters (Right Column) ── */
[data-theme="light"] .hero-region-banner.active-mode,
html[data-theme="light"] .hero-region-banner.active-mode {
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  border-left: 4px solid #10b981 !important;
}

[data-theme="light"] .hero-region-banner.cutoff-mode,
html[data-theme="light"] .hero-region-banner.cutoff-mode {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  border-left: 4px solid #64748b !important;
}

[data-theme="light"] .hero-region-banner.saturation-mode,
html[data-theme="light"] .hero-region-banner.saturation-mode {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  border-left: 4px solid #f59e0b !important;
}

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

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

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

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

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

[data-theme="light"] .mini-meter-value.text-cyan,
html[data-theme="light"] .mini-meter-value.text-cyan {
  color: #0284c7 !important;
}

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

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

[data-theme="light"] .mini-meter-value.text-purple,
html[data-theme="light"] .mini-meter-value.text-purple {
  color: #7e22ce !important;
}

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

/* ── Parameters & Controls & Math Solver ── */
[data-theme="light"] .direct-input-wrap,
html[data-theme="light"] .direct-input-wrap {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

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

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

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

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

[data-theme="light"] .chip-btn.active,
html[data-theme="light"] .chip-btn.active {
  background: rgba(2, 132, 199, 0.15) !important;
  color: #0284c7 !important;
  border-color: #0284c7 !important;
}

[data-theme="light"] .control-row-group,
html[data-theme="light"] .control-row-group {
  border-bottom-color: #e2e8f0 !important;
}

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

/* ── Solver & Charts & Theory ── */
[data-theme="light"] .loadline-container,
[data-theme="light"] .loadline-canvas-wrap,
html[data-theme="light"] .loadline-container,
html[data-theme="light"] .loadline-canvas-wrap {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .loadline-legend,
html[data-theme="light"] .loadline-legend {
  border-top-color: #cbd5e1 !important;
  color: #334155 !important;
}

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

[data-theme="light"] .calc-step-card.highlight,
html[data-theme="light"] .calc-step-card.highlight {
  background: rgba(2, 132, 199, 0.06) !important;
  border-color: #0284c7 !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"] .step-num,
html[data-theme="light"] .step-num {
  color: #0284c7 !important;
}

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

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

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

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

[data-theme="light"] .math-val-purple,
html[data-theme="light"] .math-val-purple {
  color: #7e22ce !important;
}

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

/* ── Theory ── */
[data-theme="light"] .theory-module,
html[data-theme="light"] .theory-module {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

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

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

[data-theme="light"] .theory-equation,
html[data-theme="light"] .theory-equation {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0284c7 !important;
}

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

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

/* ── Footer ── */
[data-theme="light"] .lab-footer,
html[data-theme="light"] .lab-footer {
  background: #ffffff !important;
  border-top-color: #cbd5e1 !important;
}

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

