/* ==========================================================================
   Kirchhoff's Voltage Law (KVL) Virtual Laboratory Stylesheet
   Brand: Virtual Instrumentation Labs
   ========================================================================== */

:root {
  --bg-dark: #090d16;
  --bg-card: #131b2e;
  --bg-card-hover: #1c2742;
  --bg-card-border: #233152;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.35);
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.35);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.35);
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', Consolas, monospace;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* App Wrapper */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header Bar */
.header-bar {
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-card);
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.brand-title-group h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
}

.status-badge.warning {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* Main Workspace Grid */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
}

@media (max-width: 1080px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Section Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--bg-card-border);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title svg {
  color: var(--accent-cyan);
}

/* Hero Circuit Viewer Area */
.circuit-hero-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.circuit-controls-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-card-border);
}

.button-group {
  display: flex;
  gap: 0.5rem;
}

.btn-toggle {
  background: #1e293b;
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.btn-toggle.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.btn-toggle.active-loop1 {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-toggle.active-loop2 {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.btn-toggle.active-outer {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.circuit-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 400px;
  background: radial-gradient(circle at center, #111a2e 0%, #0a0f1d 100%);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* SVG Schematic Layer */
#circuit-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Component Styling inside SVG */
.wire-line {
  stroke: #475569;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s;
}

.wire-line.highlighted-loop1 {
  stroke: var(--accent-cyan);
  stroke-width: 5;
  filter: drop-shadow(0 0 6px var(--accent-cyan));
}

.wire-line.highlighted-loop2 {
  stroke: var(--accent-amber);
  stroke-width: 5;
  filter: drop-shadow(0 0 6px var(--accent-amber));
}

.wire-line.highlighted-outer {
  stroke: var(--accent-emerald);
  stroke-width: 5;
  filter: drop-shadow(0 0 6px var(--accent-emerald));
}

.node-dot {
  fill: #38bdf8;
  stroke: #090d16;
  stroke-width: 2.5;
  cursor: pointer;
  transition: transform 0.2s;
}

.node-dot:hover {
  transform: scale(1.3);
  fill: #7dd3fc;
}

.node-text {
  fill: #cbd5e1;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  user-select: none;
}

.component-label {
  fill: #ffffff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  user-select: none;
}

.component-sublabel {
  fill: #94a3b8;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  user-select: none;
}

.polarity-text {
  font-size: 14px;
  font-weight: 800;
  user-select: none;
}

.polarity-plus {
  fill: var(--accent-rose);
}

.polarity-minus {
  fill: var(--accent-cyan);
}

/* Particle Canvas Layer */
#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Floating Node Voltage Badge Overlay */
.node-voltage-badge {
  position: absolute;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  pointer-events: none;
  transform: translate(-50%, -120%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

/* Sidebar Controls */
.controls-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.control-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--bg-card-border);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.control-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tag-badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-size: 0.725rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.tag-badge.resistor {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.control-val-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.num-input {
  background: #0f172a;
  border: 1px solid var(--bg-card-border);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  width: 70px;
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius-sm);
  text-align: right;
}

.num-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.unit-label {
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.range-slider {
  width: 100%;
  accent-color: var(--accent-cyan);
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  cursor: pointer;
}

.polarity-toggle-btn {
  background: #1e293b;
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 0.2rem;
}

.polarity-toggle-btn:hover {
  color: #fff;
  border-color: var(--accent-cyan);
}

/* Secondary Panels Grid */
.secondary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .secondary-grid {
    grid-template-columns: 1fr;
  }
}

/* KVL Step Breakdown & Table */
.kvl-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.kvl-step-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  border-left: 4px solid var(--bg-card-border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
}

.kvl-step-item.rise {
  border-left-color: var(--accent-emerald);
}

.kvl-step-item.drop {
  border-left-color: var(--accent-rose);
}

.kvl-step-item.zero {
  border-left-color: var(--text-dim);
}

.step-elem {
  font-weight: 600;
  color: #e2e8f0;
}

.step-val {
  font-family: var(--font-mono);
  font-weight: 700;
}

.step-val.rise {
  color: var(--accent-emerald);
}

.step-val.drop {
  color: var(--accent-rose);
}

.kvl-sum-box {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
  border: 1px solid var(--bg-card-border);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kvl-formula-row {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.kvl-final-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* Digital Readouts Grid */
.readouts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.readout-card {
  background: #0f172a;
  border: 1px solid var(--bg-card-border);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

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

.readout-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

/* Live Voltage Profile Graph Canvas */
.graph-container {
  width: 100%;
  height: 220px;
  background: #0b1326;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

#profile-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Probe Measurement Section */
.probes-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.probe-select-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.probe-select-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

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

.probe-select {
  background: #0f172a;
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.probe-lcd-display {
  background: #06111e;
  border: 1px solid #1e3a5f;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.probe-lcd-title {
  font-size: 0.8rem;
  color: #64748b;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.probe-lcd-val {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 0 10px var(--accent-cyan-glow);
}

/* Challenge Mode Card */
.challenge-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.8));
  border-color: rgba(56, 189, 248, 0.3);
}

.challenge-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.challenge-select {
  background: #0f172a;
  border: 1px solid var(--bg-card-border);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.challenge-desc {
  font-size: 0.875rem;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-cyan);
}

.challenge-result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--font-mono);
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
}

.challenge-result-badge.success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald);
}

.challenge-result-badge.fail {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose);
}

/* Observation Log Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.obs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  text-align: left;
}

.obs-table th {
  background: #0f172a;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--bg-card-border);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.obs-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--bg-card-border);
  font-family: var(--font-mono);
  color: #cbd5e1;
  white-space: nowrap;
}

.obs-table tr:hover td {
  background: rgba(30, 41, 59, 0.5);
}

.btn-action {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-action:hover {
  background: #2563eb;
}

.btn-action.secondary {
  background: #1e293b;
  color: var(--text-muted);
  border: 1px solid var(--bg-card-border);
}

.btn-action.secondary:hover {
  background: #334155;
  color: #fff;
}

/* Guided Procedure & Theory Accordion */
.procedure-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  counter-reset: proc-counter;
}

.procedure-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #cbd5e1;
}

.procedure-num {
  counter-increment: proc-counter;
  background: var(--bg-card-border);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.theory-text {
  font-size: 0.875rem;
  color: #cbd5e1;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.formula-box {
  background: #0f172a;
  border-left: 3px solid var(--accent-cyan);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent-cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .app-container {
    padding: 0.75rem;
    gap: 1rem;
  }

  .header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
  }

  .circuit-canvas-wrapper {
    height: 320px;
  }

  .readouts-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- LIGHT THEME SPECIFIC OVERRIDES --- */
html[data-theme="light"] body,
html:not(.dark):not([data-theme="dark"]) body {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .header-bar,
html:not(.dark):not([data-theme="dark"]) .header-bar {
  background: #ffffff;
  border-color: #e2e8f0;
}

html[data-theme="light"] .brand-title-group h1,
html:not(.dark):not([data-theme="dark"]) .brand-title-group h1,
html[data-theme="light"] .card-title,
html:not(.dark):not([data-theme="dark"]) .card-title,
html[data-theme="light"] .control-name,
html:not(.dark):not([data-theme="dark"]) .control-name,
html[data-theme="light"] .step-elem,
html:not(.dark):not([data-theme="dark"]) .step-elem,
html[data-theme="light"] .readout-value,
html:not(.dark):not([data-theme="dark"]) .readout-value,
html[data-theme="light"] .challenge-desc,
html:not(.dark):not([data-theme="dark"]) .challenge-desc,
html[data-theme="light"] .procedure-item,
html:not(.dark):not([data-theme="dark"]) .procedure-item,
html[data-theme="light"] .theory-text,
html:not(.dark):not([data-theme="dark"]) .theory-text {
  color: #0f172a !important;
}

html[data-theme="light"] .circuit-controls-toolbar,
html:not(.dark):not([data-theme="dark"]) .circuit-controls-toolbar {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

html[data-theme="light"] .btn-toggle,
html:not(.dark):not([data-theme="dark"]) .btn-toggle {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}

html[data-theme="light"] .btn-toggle:hover,
html:not(.dark):not([data-theme="dark"]) .btn-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
}

html[data-theme="light"] .circuit-canvas-wrapper,
html:not(.dark):not([data-theme="dark"]) .circuit-canvas-wrapper {
  background: #ffffff;
  border-color: #cbd5e1;
}

html[data-theme="light"] .wire-line,
html:not(.dark):not([data-theme="dark"]) .wire-line {
  stroke: #94a3b8;
}

html[data-theme="light"] .component-label,
html:not(.dark):not([data-theme="dark"]) .component-label {
  fill: #0f172a;
}

html[data-theme="light"] .node-text,
html:not(.dark):not([data-theme="dark"]) .node-text {
  fill: #475569;
}

html[data-theme="light"] .component-sublabel,
html:not(.dark):not([data-theme="dark"]) .component-sublabel {
  fill: #64748b;
}

html[data-theme="light"] .node-voltage-badge,
html:not(.dark):not([data-theme="dark"]) .node-voltage-badge {
  background: #ffffff;
  border-color: #38bdf8;
  color: #0284c7;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .control-item,
html:not(.dark):not([data-theme="dark"]) .control-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .num-input,
html:not(.dark):not([data-theme="dark"]) .num-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0284c7;
}

html[data-theme="light"] .range-slider,
html:not(.dark):not([data-theme="dark"]) .range-slider {
  background: #e2e8f0;
}

html[data-theme="light"] .polarity-toggle-btn,
html:not(.dark):not([data-theme="dark"]) .polarity-toggle-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

html[data-theme="light"] .kvl-step-item,
html:not(.dark):not([data-theme="dark"]) .kvl-step-item {
  background: #f8fafc;
}

html[data-theme="light"] .kvl-sum-box,
html:not(.dark):not([data-theme="dark"]) .kvl-sum-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .readout-card,
html:not(.dark):not([data-theme="dark"]) .readout-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .graph-container,
html:not(.dark):not([data-theme="dark"]) .graph-container {
  background: #ffffff;
  border-color: #cbd5e1;
}

html[data-theme="light"] .probe-select,
html:not(.dark):not([data-theme="dark"]) .probe-select,
html[data-theme="light"] .challenge-select,
html:not(.dark):not([data-theme="dark"]) .challenge-select {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .probe-lcd-display,
html:not(.dark):not([data-theme="dark"]) .probe-lcd-display {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .challenge-card,
html:not(.dark):not([data-theme="dark"]) .challenge-card {
  background: #f8fafc;
  border-color: rgba(56, 189, 248, 0.4);
}

html[data-theme="light"] .challenge-desc,
html:not(.dark):not([data-theme="dark"]) .challenge-desc {
  background: #ffffff;
  border-color: #e2e8f0;
  border-left-color: #0284c7;
  color: #0f172a;
}

html[data-theme="light"] .obs-table th,
html:not(.dark):not([data-theme="dark"]) .obs-table th {
  background: #f1f5f9;
  color: #475569;
  border-bottom-color: #cbd5e1;
}

html[data-theme="light"] .obs-table td,
html:not(.dark):not([data-theme="dark"]) .obs-table td {
  border-bottom-color: #e2e8f0;
  color: #0f172a;
}

html[data-theme="light"] .obs-table tr:hover td,
html:not(.dark):not([data-theme="dark"]) .obs-table tr:hover td {
  background: #f1f5f9;
}

html[data-theme="light"] .btn-action.secondary,
html:not(.dark):not([data-theme="dark"]) .btn-action.secondary {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

html[data-theme="light"] .procedure-item,
html:not(.dark):not([data-theme="dark"]) .procedure-item {
  background: #f8fafc;
  color: #0f172a;
}

html[data-theme="light"] .procedure-num,
html:not(.dark):not([data-theme="dark"]) .procedure-num {
  background: #e2e8f0;
  color: #0284c7;
}

html[data-theme="light"] .formula-box,
html:not(.dark):not([data-theme="dark"]) .formula-box {
  background: #f8fafc;
  border-color: #e2e8f0;
  border-left-color: #0284c7;
}

