/* ==========================================================================
   Virtual Instrumentation Labs - Virtual Instrumentation Laboratory Design System
   Experiment: Industrial Pressure Transmitter & 4-20 mA Current Loop
   Aesthetic: Clean University Virtual Lab / Technical Engineering Diagram
   ========================================================================== */

:root {
  /* Color Palette - University Virtual Lab */
  --bg-lab: #f4f6f9;
  --bg-card: #ffffff;
  --bg-header: #0f2942;
  --bg-header-accent: #1e3a8a;
  
  --border-light: #e2e8f0;
  --border-main: #cbd5e1;
  --border-dark: #94a3b8;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-header: #ffffff;
  
  --color-primary: #0284c7;
  --color-primary-dark: #0369a1;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-info: #2563eb;
  
  /* LCD Screen Colors */
  --lcd-bg: #121e17;
  --lcd-text: #00ff66;
  --lcd-glow: rgba(0, 255, 102, 0.2);
  --lcd-subtext: #00b347;

  /* Typography */
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Consolas", "Courier New", "Liberation Mono", monospace;
  --font-digital: "Courier New", "Consolas", monospace;

  /* Shadows & Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-lab);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* App Layout Structure */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Navbar */
.lab-header {
  background-color: var(--bg-header);
  color: var(--text-header);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  border-bottom: 3px solid var(--color-primary);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-badge {
  background: #1e3a8a;
  color: #60a5fa;
  font-weight: 700;
  font-size: 16px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #3b82f6;
  letter-spacing: 0.5px;
}

.title-container h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.title-container .sub-title {
  font-size: 12px;
  color: #94a3b8;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.btn-header {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-header:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Main Workspace Grid */
.lab-workspace {
  flex: 1;
  padding: 20px 24px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Top Split Section: Diagram (Left) & Controls (Right) */
.experiment-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 20px;
}

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

/* Card Panel Containers */
.lab-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-header {
  background-color: #f1f5f9;
  border-bottom: 1px solid var(--border-light);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--bg-header);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.status-active {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.status-idle {
  background-color: #f3f4f6;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Left Panel: Dynamic Engineering SVG Schematic */
.schematic-viewport {
  position: relative;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.schematic-svg {
  width: 100%;
  height: 100%;
  min-height: 480px;
}

/* Dynamic Diagram Overlay Labels & Indicators */
.diagram-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
  display: flex;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* Right Panel: Controls & Readouts */
.controls-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Section Group Styling */
.control-group {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Pressure Slider Interface */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #cbd5e1;
  outline: none;
  transition: background 0.15s ease-in-out;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.1s ease, background-color 0.1s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--color-primary-dark);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.btn-preset {
  background: #ffffff;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 6px 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.btn-preset:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0369a1;
}

.btn-preset.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary-dark);
}

/* Digital Readouts Display Grid */
.readout-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.readout-card {
  background: #ffffff;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.readout-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.readout-value-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.readout-number {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--bg-header);
}

.readout-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Highlight Output mA Card */
.readout-card.highlight-ma {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.readout-card.highlight-ma .readout-number {
  color: #1d4ed8;
}

/* Action Buttons & Modes */
.action-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.btn-action {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-main);
  border-color: var(--border-main);
}

.btn-secondary:hover {
  background-color: #f1f5f9;
  border-color: var(--border-dark);
}

.btn-warning {
  background-color: #fffbe6;
  color: #92400e;
  border-color: #fef08a;
}

.btn-warning:hover {
  background-color: #fef3c7;
  border-color: #fde047;
}

/* Calibration Knobs / Advanced Panel */
.collapsible-panel {
  border-top: 1px dashed var(--border-main);
  padding-top: 10px;
  margin-top: 4px;
}

.trim-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.trim-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trim-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.trim-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-step {
  background: #ffffff;
  border: 1px solid var(--border-main);
  width: 26px;
  height: 26px;
  border-radius: 3px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-step:hover {
  background: #e2e8f0;
}

.trim-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  min-width: 45px;
  text-align: center;
}

/* Bottom Section: Observation Graph & Data Table */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 20px;
}

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

.graph-viewport {
  height: 320px;
  position: relative;
  width: 100%;
}

/* Data Table Styling */
.table-viewport {
  max-height: 270px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

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

.obs-table th {
  background-color: #f1f5f9;
  color: var(--bg-header);
  font-weight: 600;
  padding: 8px 10px;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border-main);
  white-space: nowrap;
}

.obs-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-mono);
}

.obs-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.obs-table tr:hover {
  background-color: #e0f2fe;
}

.table-empty-msg {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.table-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

/* Theory Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  background: var(--bg-header);
  color: #ffffff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
}

.formula-box {
  background: #f8fafc;
  border: 1px solid var(--border-main);
  border-left: 4px solid var(--color-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  margin: 12px 0;
  font-size: 13px;
}

/* Footer Section */
.lab-footer {
  background: #e2e8f0;
  border-top: 1px solid var(--border-main);
  padding: 10px 24px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Keyframe Animations for SVGs */
@keyframes flowPulse {
  0% { stroke-dashoffset: 20; }
  100% { stroke-dashoffset: 0; }
}

@keyframes signalBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.animated-pulse {
  animation: flowPulse 1.2s linear infinite;
}

.animated-blink {
  animation: signalBlink 1s ease-in-out infinite;
}

/* ================= RESPONSIVE MEDIA QUERIES ================= */

/* Tablet */
@media screen and (max-width: 1024px) {
  .experiment-grid {
    grid-template-columns: 1fr;
  }
  .bottom-grid {
    grid-template-columns: 1fr;
  }
  .main-content {
    padding: 12px 16px;
    gap: 16px;
  }
  .app-header {
    padding: 10px 16px;
  }
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Mobile Portrait */
@media screen and (max-width: 767px) and (orientation: portrait) {
  .experiment-grid {
    display: flex;
    flex-direction: column;
  }
  .bottom-grid {
    display: flex;
    flex-direction: column;
  }
  .reading-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .controls-grid {
    grid-template-columns: 1fr;
  }
  .action-bar {
    grid-template-columns: 1fr;
  }
  .svg-container svg {
    width: 100%;
    height: auto;
    max-height: 50vh;
  }
  .graph-viewport {
    height: 250px;
  }
  /* Touch-friendly targets */
  .btn, button, select, input[type="range"] {
    min-height: 44px;
    font-size: 16px !important;
  }
  .main-content {
    padding: 8px;
    gap: 12px;
  }
}

/* Mobile Landscape */
@media screen and (max-width: 950px) and (orientation: landscape) {
  .experiment-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 12px;
  }
  .bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .main-content {
    padding: 8px 12px;
    gap: 12px;
  }
}

/* ==========================================================================
   DUAL THEME ENGINE & PRESSURE TRANSMITTER COMPATIBILITY (LIGHT & DARK)
   ========================================================================== */

/* Remove background grid in schematic */
#labGrid,
#labGrid path,
pattern#labGrid,
pattern#labGrid path {
  display: none !important;
  stroke: none !important;
}

/* Light Theme (White Mode) */
html[data-theme="light"],
html.light,
html:not([data-theme="dark"]) {
  --bg-lab: #f8fafc;
  --bg-card: #ffffff;
  --border-light: #e2e8f0;
  --border-main: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
}

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

html[data-theme="light"] .lab-header,
html.light .lab-header,
html:not([data-theme="dark"]) .lab-header {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-bottom: 2px solid #0284c7 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .lab-header h1,
html.light .lab-header h1,
html:not([data-theme="dark"]) .lab-header h1 {
  color: #0f172a !important;
}

html[data-theme="light"] .sub-title,
html.light .sub-title,
html:not([data-theme="dark"]) .sub-title {
  color: #64748b !important;
}

/* Header buttons in Light Mode (Theory & Working Principles, Reset Simulator) */
html[data-theme="light"] .btn-header,
html.light .btn-header,
html:not([data-theme="dark"]) .btn-header {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .btn-header span,
html.light .btn-header span,
html:not([data-theme="dark"]) .btn-header span {
  color: #0f172a !important;
}

html[data-theme="light"] .btn-header:hover,
html.light .btn-header:hover,
html:not([data-theme="dark"]) .btn-header:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
}

/* Schematic Viewport in Light Mode */
html[data-theme="light"] .schematic-viewport,
html.light .schematic-viewport,
html:not([data-theme="dark"]) .schematic-viewport {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
}

/* ==========================================================================
   PT-101 TRANSMITTER & REC-101 RECEIVER HIGH CONTRAST SCHEMATIC THEME
   ========================================================================== */

/* Light Theme (White Mode) */
html[data-theme="light"],
html.light,
html:not([data-theme="dark"]) {
  /* PT-101 Transmitter Housing & LCD Screen */
  #tx-bezel-outer {
    fill: #334155 !important;
    stroke: #0284c7 !important;
  }
  #tx-bezel-inner {
    fill: #1e293b !important;
    stroke: #475569 !important;
  }
  #tx-lcd-screen {
    fill: #064e3b !important;
    stroke: #10b981 !important;
  }
  #tx-lcd-pv {
    fill: #34d399 !important;
    font-weight: 800 !important;
  }
  #tx-lcd-unit {
    fill: #a7f3d0 !important;
    font-weight: 700 !important;
  }
  #tx-lcd-ma {
    fill: #34d399 !important;
    font-weight: 700 !important;
  }

  /* REC-101 Receiver Enclosure */
  #rx-cabinet-outer {
    fill: #f1f5f9 !important;
    stroke: #64748b !important;
  }
  #rx-cabinet-inner {
    fill: #ffffff !important;
    stroke: #cbd5e1 !important;
  }
  #rx-header-bg {
    fill: #0284c7 !important;
  }
  #rx-header-text {
    fill: #ffffff !important;
    font-weight: 700 !important;
  }

  /* REC-101 Digital Screen Display */
  #rx-screen-bg {
    fill: #090d16 !important;
    stroke: #334155 !important;
  }
  #rx-pv-val {
    fill: #38bdf8 !important;
    font-weight: 800 !important;
  }
  #rx-pv-unit {
    fill: #94a3b8 !important;
    font-weight: 600 !important;
  }
  #rx-ma-val {
    fill: #4ade80 !important;
    font-weight: 700 !important;
  }
  #rx-volts-val {
    fill: #facc15 !important;
    font-weight: 700 !important;
  }

  /* REC-101 Resistor Module */
  #rx-resistor-box {
    fill: #f8fafc !important;
    stroke: #cbd5e1 !important;
  }
  #rx-resistor-title {
    fill: #1e293b !important;
    font-weight: 700 !important;
  }
  .rx-led-label {
    fill: #475569 !important;
    font-weight: 600 !important;
  }
}

/* Explicit high-priority overrides for SVG text in schematic viewport so theme.css doesn't turn them black */
html[data-theme="light"] .schematic-viewport #tx-lcd-pv,
html.light .schematic-viewport #tx-lcd-pv,
html:not([data-theme="dark"]) .schematic-viewport #tx-lcd-pv {
  fill: #34d399 !important;
}
html[data-theme="light"] .schematic-viewport #tx-lcd-unit,
html.light .schematic-viewport #tx-lcd-unit,
html:not([data-theme="dark"]) .schematic-viewport #tx-lcd-unit {
  fill: #a7f3d0 !important;
}
html[data-theme="light"] .schematic-viewport #tx-lcd-ma,
html.light .schematic-viewport #tx-lcd-ma,
html:not([data-theme="dark"]) .schematic-viewport #tx-lcd-ma {
  fill: #34d399 !important;
}

html[data-theme="light"] .schematic-viewport #rx-header-text,
html.light .schematic-viewport #rx-header-text,
html:not([data-theme="dark"]) .schematic-viewport #rx-header-text {
  fill: #ffffff !important;
}
html[data-theme="light"] .schematic-viewport #rx-pv-val,
html.light .schematic-viewport #rx-pv-val,
html:not([data-theme="dark"]) .schematic-viewport #rx-pv-val {
  fill: #38bdf8 !important;
}
html[data-theme="light"] .schematic-viewport #rx-pv-unit,
html.light .schematic-viewport #rx-pv-unit,
html:not([data-theme="dark"]) .schematic-viewport #rx-pv-unit {
  fill: #94a3b8 !important;
}
html[data-theme="light"] .schematic-viewport #rx-ma-val,
html.light .schematic-viewport #rx-ma-val,
html:not([data-theme="dark"]) .schematic-viewport #rx-ma-val {
  fill: #4ade80 !important;
}
html[data-theme="light"] .schematic-viewport #rx-volts-val,
html.light .schematic-viewport #rx-volts-val,
html:not([data-theme="dark"]) .schematic-viewport #rx-volts-val {
  fill: #facc15 !important;
}
html[data-theme="light"] .schematic-viewport #rx-resistor-title,
html.light .schematic-viewport #rx-resistor-title,
html:not([data-theme="dark"]) .schematic-viewport #rx-resistor-title {
  fill: #1e293b !important;
}
html[data-theme="light"] .schematic-viewport .rx-led-label,
html.light .schematic-viewport .rx-led-label,
html:not([data-theme="dark"]) .schematic-viewport .rx-led-label {
  fill: #475569 !important;
}

/* Readout Cards in Light Mode */
html[data-theme="light"] .readout-card,
html.light .readout-card,
html:not([data-theme="dark"]) .readout-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

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

html[data-theme="light"] .readout-card.highlight-ma,
html.light .readout-card.highlight-ma,
html:not([data-theme="dark"]) .readout-card.highlight-ma {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}

html[data-theme="light"] .readout-card.highlight-ma .readout-number,
html.light .readout-card.highlight-ma .readout-number,
html:not([data-theme="dark"]) .readout-card.highlight-ma .readout-number {
  color: #1d4ed8 !important;
}

/* Dark Theme Overrides */
html[data-theme="dark"] body,
html.dark body {
  background-color: #0b0f19 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .lab-header,
html.dark .lab-header {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-bottom: 2px solid #0284c7 !important;
}

html[data-theme="dark"] .lab-header h1,
html.dark .lab-header h1 {
  color: #f8fafc !important;
}

html[data-theme="dark"] .btn-header,
html.dark .btn-header {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="dark"] .btn-header span,
html.dark .btn-header span {
  color: #ffffff !important;
}

html[data-theme="dark"] .btn-header:hover,
html.dark .btn-header:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="dark"] .schematic-viewport,
html.dark .schematic-viewport {
  background-color: #090d16 !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] #tx-bezel-outer,
html.dark #tx-bezel-outer {
  fill: #1e293b !important;
  stroke: #0284c7 !important;
}
html[data-theme="dark"] #tx-bezel-inner,
html.dark #tx-bezel-inner {
  fill: #0f172a !important;
  stroke: #475569 !important;
}
html[data-theme="dark"] #tx-lcd-screen,
html.dark #tx-lcd-screen {
  fill: #121e17 !important;
  stroke: #00ff66 !important;
}
html[data-theme="dark"] #tx-lcd-pv,
html.dark #tx-lcd-pv {
  fill: #00ff66 !important;
}
html[data-theme="dark"] #tx-lcd-unit,
html.dark #tx-lcd-unit {
  fill: #00b347 !important;
}
html[data-theme="dark"] #tx-lcd-ma,
html.dark #tx-lcd-ma {
  fill: #00ff66 !important;
}

html[data-theme="dark"] #rx-cabinet-outer,
html.dark #rx-cabinet-outer {
  fill: #1e293b !important;
  stroke: #0f172a !important;
}
html[data-theme="dark"] #rx-cabinet-inner,
html.dark #rx-cabinet-inner {
  fill: #0f172a !important;
}
html[data-theme="dark"] #rx-header-bg,
html.dark #rx-header-bg {
  fill: #1e3a8a !important;
}
html[data-theme="dark"] #rx-header-text,
html.dark #rx-header-text {
  fill: #ffffff !important;
}
html[data-theme="dark"] #rx-screen-bg,
html.dark #rx-screen-bg {
  fill: #020617 !important;
  stroke: #334155 !important;
}
html[data-theme="dark"] #rx-pv-val,
html.dark #rx-pv-val {
  fill: #38bdf8 !important;
}
html[data-theme="dark"] #rx-pv-unit,
html.dark #rx-pv-unit {
  fill: #94a3b8 !important;
}
html[data-theme="dark"] #rx-ma-val,
html.dark #rx-ma-val {
  fill: #4ade80 !important;
}
html[data-theme="dark"] #rx-volts-val,
html.dark #rx-volts-val {
  fill: #facc15 !important;
}
html[data-theme="dark"] #rx-resistor-box,
html.dark #rx-resistor-box {
  fill: #1e293b !important;
  stroke: #475569 !important;
}
html[data-theme="dark"] #rx-resistor-title,
html.dark #rx-resistor-title {
  fill: #cbd5e1 !important;
}
html[data-theme="dark"] .rx-led-label,
html.dark .rx-led-label {
  fill: #94a3b8 !important;
}

html[data-theme="dark"] .readout-card,
html.dark .readout-card {
  background: #172033 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .readout-number,
html.dark .readout-number {
  color: #f8fafc !important;
}

html[data-theme="dark"] .readout-card.highlight-ma,
html.dark .readout-card.highlight-ma {
  background: rgba(30, 58, 138, 0.3) !important;
  border-color: #3b82f6 !important;
}

html[data-theme="dark"] .readout-card.highlight-ma .readout-number,
html.dark .readout-card.highlight-ma .readout-number {
  color: #60a5fa !important;
}

html[data-theme="dark"] .diagram-legend,
html.dark .diagram-legend {
  background: rgba(15, 23, 42, 0.92) !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .obs-table th,
html.dark .obs-table th {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .obs-table td,
html.dark .obs-table td {
  color: #f8fafc !important;
  border-bottom: 1px solid #1e293b !important;
}

