/* ==========================================================================
   Zeroth Law of Thermodynamics - Professional Dark CSS Design System
   Physics Virtual Laboratory — Thermodynamics
   ========================================================================== */

:root {
  /* Core Color Palette */
  --bg-dark: #090d16;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-color: rgba(51, 65, 85, 0.6);
  --border-glow: rgba(0, 240, 255, 0.3);

  --primary-cyan: #00f0ff;
  --primary-blue: #3b82f6;
  --accent-purple: #a855f7;
  --status-green: #10b981;
  --status-amber: #f59e0b;
  --status-red: #ef4444;

  --hot-color: #ff5544;
  --hot-glow: rgba(255, 85, 68, 0.4);
  --cold-color: #4499ff;
  --cold-glow: rgba(68, 153, 255, 0.4);
  --therm-color: #ff5577;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

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

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(0, 240, 255, 0.15);
  --shadow-green-glow: 0 0 20px rgba(16, 185, 129, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(255, 85, 68, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(68, 153, 255, 0.05) 0%, transparent 40%),
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
}

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

/* Card Component (Glassmorphism) */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(0, 240, 255, 0.25);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-header h2, .card-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header h2 svg, .card-header h3 svg {
  color: var(--primary-cyan);
  flex-shrink: 0;
}

/* Badges */
.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge.blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge.purple {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--status-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.mono-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--primary-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* ========== Header ========== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.lab-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary-cyan);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.app-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-header .subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.status-summary-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.85);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background 0.3s, box-shadow 0.3s;
}

.status-dot.green {
  background: var(--status-green);
  box-shadow: 0 0 8px var(--status-green);
}

.status-dot.amber {
  background: var(--status-amber);
  box-shadow: 0 0 8px var(--status-amber);
  animation: pulse-amber 1.5s ease-in-out infinite;
}

.status-dot.red {
  background: var(--status-red);
  box-shadow: 0 0 8px var(--status-red);
}

@keyframes pulse-amber {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ========== Toolbar ========== */
.toolbar-section {
  padding: 1rem 1.25rem;
}

.toolbar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.button-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.divider-v {
  width: 1px;
  height: 50px;
  background: var(--border-color);
  margin: 0 0.25rem;
}

.temp-input-group {
  display: flex;
  gap: 1.25rem;
  align-items: flex-end;
}

.temp-input-control {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 160px;
}

.control-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.temp-input-control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  cursor: pointer;
}

.temp-input-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-cyan);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
  transition: transform 0.15s;
}

.temp-input-control input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.temp-input-control input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-cyan);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

.temp-val-badge {
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

/* Toggle Switch */
.contact-rate-group {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
}

.toggle-control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toggle-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.toggle-switch-btn {
  width: 48px;
  height: 26px;
  border-radius: 13px;
  border: 2px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  padding: 0;
}

.toggle-switch-btn.on {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--primary-cyan);
}

.toggle-knob {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-dim);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 0.3s ease;
}

.toggle-switch-btn.on .toggle-knob {
  left: 24px;
  background: var(--primary-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.toggle-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.toggle-switch-btn.on + .toggle-label {
  color: var(--primary-cyan);
}

/* Rate Buttons */
.rate-control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rate-buttons {
  display: flex;
  gap: 0.35rem;
}

.btn-rate {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-rate:hover {
  border-color: var(--primary-cyan);
  color: var(--text-main);
}

.btn-rate.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

/* Action Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn svg {
  flex-shrink: 0;
}

.btn-accent {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(59, 130, 246, 0.2));
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--primary-cyan);
}

.btn-accent:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(59, 130, 246, 0.3));
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

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

.btn-secondary:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--status-red);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}

/* ========== Banner Section (Live Temperatures) ========== */
.banner-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.counter-display-card {
  text-align: center;
  padding: 1rem;
}

.display-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.large-val {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
}

.temp-card-a .large-val { color: var(--hot-color); }
.temp-card-b .large-val { color: var(--cold-color); }
.temp-card-c .large-val { color: var(--therm-color); }
.temp-card-diff .large-val { color: var(--status-amber); }

.temp-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.temp-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.15s ease;
}

.temp-bar-a { background: linear-gradient(90deg, #cc3322, #ff5544); }
.temp-bar-b { background: linear-gradient(90deg, #2266cc, #4499ff); }
.temp-bar-c { background: linear-gradient(90deg, #cc2244, #ff5577); }

.eq-status-mini {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--status-amber);
  margin-top: 0.4rem;
  letter-spacing: 0.5px;
}

.eq-status-mini.equilibrium {
  color: var(--status-green);
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* ========== Workspace Grid ========== */
.workspace-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 1rem;
  align-items: start;
}

.schematic-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.monitors-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Experiment Visualization */
.experiment-viz-container {
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.5rem;
  margin-bottom: 0.75rem;
}

.experiment-viz-container svg {
  display: block;
  width: 100%;
  height: auto;
}

.schematic-footnote {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0.75rem;
  background: rgba(0, 240, 255, 0.03);
  border-radius: var(--radius-sm);
  border-left: 3px solid rgba(0, 240, 255, 0.3);
}

/* ========== Graph ========== */
.graph-container {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.75rem;
  overflow: hidden;
}

.graph-container canvas {
  display: block;
  width: 100%;
  height: auto;
}

.graph-legend {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

/* ========== Monitor Cards ========== */
.monitor-card {
  padding: 1rem 1.25rem;
}

.obs-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.probe-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
}

.probe-name {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.probe-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.probe-badge.high {
  color: var(--primary-cyan);
  background: rgba(0, 240, 255, 0.1);
}

.probe-badge.hot {
  color: var(--hot-color);
  background: rgba(255, 85, 68, 0.12);
}

.probe-badge.cold {
  color: var(--cold-color);
  background: rgba(68, 153, 255, 0.12);
}

.probe-badge.therm {
  color: var(--therm-color);
  background: rgba(255, 85, 119, 0.12);
}

.probe-badge.on {
  color: var(--status-green);
  background: rgba(16, 185, 129, 0.12);
}

.probe-badge.off {
  color: var(--text-dim);
  background: rgba(100, 116, 139, 0.12);
}

.probe-badge.amber-badge {
  color: var(--status-amber);
  background: rgba(245, 158, 11, 0.12);
}

/* ========== Zeroth Law Verification ========== */
.zeroth-verify-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.verify-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.verify-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.verify-status {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
}

.verify-status.verified {
  color: var(--status-green);
  text-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.verify-status.not-verified {
  color: var(--status-amber);
}

.conclusion-row {
  border-color: rgba(0, 240, 255, 0.15);
  background: rgba(0, 240, 255, 0.03);
}

.conclusion-row.verified {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

/* ========== Educational Theory ========== */
.theory-section {
  padding: 1.5rem;
}

.theory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.theory-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: border-color 0.2s, background 0.2s;
}

.theory-card:hover {
  border-color: rgba(0, 240, 255, 0.2);
  background: rgba(255, 255, 255, 0.035);
}

.theory-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-cyan);
  margin-bottom: 0.6rem;
}

.theory-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

.theory-card p:last-child {
  margin-bottom: 0;
}

.theory-card.full-width {
  grid-column: 1 / -1;
}

/* Application Chips */
.app-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.app-chip {
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  transition: border-color 0.2s, transform 0.15s;
}

.app-chip:hover {
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
}

.app-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-cyan);
  margin-bottom: 0.25rem;
}

.app-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.45;
}

/* ========== Footer ========== */
.app-footer {
  text-align: center;
  padding: 1.25rem 0 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.app-footer p {
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* ========== Heat Flow Particle Animation ========== */
@keyframes flowParticleRight {
  0% { transform: translateX(0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateX(300px); opacity: 0; }
}

@keyframes flowParticleLeft {
  0% { transform: translateX(0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateX(-300px); opacity: 0; }
}

.heat-particle {
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* ========== SVG Animations ========== */
@keyframes ripple {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ========== Responsive ========== */
@media (max-width: 1200px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .banner-section {
    grid-template-columns: repeat(2, 1fr);
  }
  .toolbar-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .temp-input-group {
    flex-direction: column;
  }
  .divider-v {
    display: none;
  }
  .app-header h1 {
    font-size: 1.35rem;
  }
}

@media (max-width: 600px) {
  .banner-section {
    grid-template-columns: 1fr;
  }
  .theory-grid {
    grid-template-columns: 1fr;
  }
  .app-badges-grid {
    grid-template-columns: 1fr;
  }
  .app-container {
    padding: 0.75rem;
  }
  .large-val {
    font-size: 1.4rem;
  }
}

/* ==========================================================================
   Light Theme Adaptations & Complete White Mode Overrides
   ========================================================================== */
html[data-theme="light"],
html:not(.dark):not([data-theme="dark"]) {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-glow: rgba(2, 132, 199, 0.2);

  --primary-cyan: #0284c7;
  --primary-blue: #2563eb;
  --accent-purple: #9333ea;
  --status-green: #16a34a;
  --status-amber: #d97706;
  --status-red: #dc2626;

  --hot-color: #dc2626;
  --hot-glow: rgba(220, 38, 38, 0.2);
  --cold-color: #2563eb;
  --cold-glow: rgba(37, 99, 235, 0.2);
  --therm-color: #e11d48;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --shadow-sm: 0 4px 6px -1px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.12);
  --shadow-green-glow: 0 0 20px rgba(22, 163, 74, 0.2);
}

html[data-theme="light"] body,
html:not(.dark):not([data-theme="dark"]) body {
  background-color: #f8fafc;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(220, 38, 38, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(37, 99, 235, 0.04) 0%, transparent 40%),
    linear-gradient(to right, rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
}

html[data-theme="light"] .card,
html:not(.dark):not([data-theme="dark"]) .card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(15, 23, 42, 0.03);
}

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

html[data-theme="light"] .app-header h1,
html:not(.dark):not([data-theme="dark"]) .app-header h1 {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

html[data-theme="light"] .experiment-viz-container,
html:not(.dark):not([data-theme="dark"]) .experiment-viz-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.02);
}

html[data-theme="light"] .graph-container,
html:not(.dark):not([data-theme="dark"]) .graph-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

/* SVG Elements in Light Mode */
html[data-theme="light"] .svg-grid-lines line,
html:not(.dark):not([data-theme="dark"]) .svg-grid-lines line {
  stroke: #cbd5e1;
  opacity: 0.6;
}

html[data-theme="light"] .tank-shell-a,
html:not(.dark):not([data-theme="dark"]) .tank-shell-a {
  stroke: #ef4444;
  opacity: 0.9;
}

html[data-theme="light"] .tank-bg-a,
html:not(.dark):not([data-theme="dark"]) .tank-bg-a {
  opacity: 0.12;
}

html[data-theme="light"] .svg-label-a,
html:not(.dark):not([data-theme="dark"]) .svg-label-a {
  fill: #dc2626;
  font-weight: 800;
}

html[data-theme="light"] .svg-temp-a,
html:not(.dark):not([data-theme="dark"]) .svg-temp-a {
  fill: #b91c1c;
  font-weight: 700;
}

html[data-theme="light"] .tank-shell-b,
html:not(.dark):not([data-theme="dark"]) .tank-shell-b {
  stroke: #3b82f6;
  opacity: 0.9;
}

html[data-theme="light"] .tank-bg-b,
html:not(.dark):not([data-theme="dark"]) .tank-bg-b {
  opacity: 0.12;
}

html[data-theme="light"] .svg-label-b,
html:not(.dark):not([data-theme="dark"]) .svg-label-b {
  fill: #2563eb;
  font-weight: 800;
}

html[data-theme="light"] .svg-temp-b,
html:not(.dark):not([data-theme="dark"]) .svg-temp-b {
  fill: #1d4ed8;
  font-weight: 700;
}

html[data-theme="light"] .svg-label-c,
html:not(.dark):not([data-theme="dark"]) .svg-label-c {
  fill: #0284c7;
  font-weight: 800;
}

html[data-theme="light"] .therm-body,
html:not(.dark):not([data-theme="dark"]) .therm-body {
  fill: #e2e8f0;
  stroke: #cbd5e1;
}

html[data-theme="light"] .therm-scale text,
html:not(.dark):not([data-theme="dark"]) .therm-scale text {
  fill: #475569;
  font-weight: 600;
}

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

html[data-theme="light"] .therm-readout-bg,
html:not(.dark):not([data-theme="dark"]) .therm-readout-bg {
  fill: #ffffff;
  stroke: #cbd5e1;
}

html[data-theme="light"] .therm-readout-text,
html:not(.dark):not([data-theme="dark"]) .therm-readout-text {
  fill: #e11d48;
  font-weight: 700;
}

html[data-theme="light"] .bridge-rect,
html:not(.dark):not([data-theme="dark"]) .bridge-rect {
  fill: rgba(2, 132, 199, 0.05);
  stroke: #0284c7;
}

html[data-theme="light"] .bridge-text,
html:not(.dark):not([data-theme="dark"]) .bridge-text {
  fill: #0284c7;
  font-weight: 700;
}

html[data-theme="light"] .zeroth-arrow-line,
html:not(.dark):not([data-theme="dark"]) .zeroth-arrow-line {
  stroke: #0284c7;
}

html[data-theme="light"] .zeroth-arrow-poly,
html:not(.dark):not([data-theme="dark"]) .zeroth-arrow-poly {
  fill: #0284c7;
}

html[data-theme="light"] .zeroth-arrow-text,
html:not(.dark):not([data-theme="dark"]) .zeroth-arrow-text {
  fill: #0284c7;
  font-weight: 600;
}

html[data-theme="light"] .zeroth-stmt-bg,
html:not(.dark):not([data-theme="dark"]) .zeroth-stmt-bg {
  fill: rgba(22, 163, 74, 0.1);
  stroke: #16a34a;
}

html[data-theme="light"] .zeroth-stmt-text,
html:not(.dark):not([data-theme="dark"]) .zeroth-stmt-text {
  fill: #15803d;
  font-weight: 700;
}

html[data-theme="light"] .schematic-footnote,
html:not(.dark):not([data-theme="dark"]) .schematic-footnote {
  background: #f1f5f9;
  color: #334155;
  border-left-color: #0284c7;
}

/* Controls & UI Elements */
html[data-theme="light"] .temp-input-control input[type="range"],
html:not(.dark):not([data-theme="dark"]) .temp-input-control input[type="range"] {
  background: #e2e8f0;
}

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

html[data-theme="light"] .mono-badge,
html:not(.dark):not([data-theme="dark"]) .mono-badge {
  background: #e0f2fe;
  color: #0369a1;
}

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

html[data-theme="light"] .toggle-switch-btn.on,
html:not(.dark):not([data-theme="dark"]) .toggle-switch-btn.on {
  background: #bae6fd;
  border-color: #0284c7;
}

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

html[data-theme="light"] .btn-rate:hover,
html:not(.dark):not([data-theme="dark"]) .btn-rate:hover {
  border-color: #0284c7;
  color: #0284c7;
  background: #e0f2fe;
}

html[data-theme="light"] .btn-rate.active,
html:not(.dark):not([data-theme="dark"]) .btn-rate.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0284c7;
}

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

html[data-theme="light"] .btn-accent:hover,
html:not(.dark):not([data-theme="dark"]) .btn-accent:hover {
  background: #0369a1;
  color: #ffffff;
}

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

html[data-theme="light"] .btn-secondary:hover:not(:disabled),
html:not(.dark):not([data-theme="dark"]) .btn-secondary:hover:not(:disabled) {
  border-color: #94a3b8;
  color: #0f172a;
}

html[data-theme="light"] .btn-danger,
html:not(.dark):not([data-theme="dark"]) .btn-danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

html[data-theme="light"] .btn-danger:hover,
html:not(.dark):not([data-theme="dark"]) .btn-danger:hover {
  background: #fecaca;
}

html[data-theme="light"] .probe-badge.high,
html:not(.dark):not([data-theme="dark"]) .probe-badge.high {
  color: #0284c7;
  background: #e0f2fe;
}

html[data-theme="light"] .probe-badge.hot,
html:not(.dark):not([data-theme="dark"]) .probe-badge.hot {
  color: #dc2626;
  background: #fee2e2;
}

html[data-theme="light"] .probe-badge.cold,
html:not(.dark):not([data-theme="dark"]) .probe-badge.cold {
  color: #2563eb;
  background: #dbeafe;
}

html[data-theme="light"] .probe-badge.therm,
html:not(.dark):not([data-theme="dark"]) .probe-badge.therm {
  color: #e11d48;
  background: #ffe4e6;
}

html[data-theme="light"] .probe-badge.on,
html:not(.dark):not([data-theme="dark"]) .probe-badge.on {
  color: #16a34a;
  background: #dcfce7;
}

html[data-theme="light"] .probe-badge.off,
html:not(.dark):not([data-theme="dark"]) .probe-badge.off {
  color: #64748b;
  background: #f1f5f9;
}

html[data-theme="light"] .probe-badge.amber-badge,
html:not(.dark):not([data-theme="dark"]) .probe-badge.amber-badge {
  color: #d97706;
  background: #fef3c7;
}

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

html[data-theme="light"] .conclusion-row,
html:not(.dark):not([data-theme="dark"]) .conclusion-row {
  border-color: #bae6fd;
  background: #f0f9ff;
}

html[data-theme="light"] .conclusion-row.verified,
html:not(.dark):not([data-theme="dark"]) .conclusion-row.verified {
  border-color: #86efac;
  background: #f0fdf4;
}

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

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

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

html[data-theme="light"] .app-chip:hover,
html:not(.dark):not([data-theme="dark"]) .app-chip:hover {
  border-color: #0284c7;
}

html[data-theme="light"] .app-footer,
html:not(.dark):not([data-theme="dark"]) .app-footer {
  border-top-color: #e2e8f0;
}

