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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #4a1a1a 0%, #2d1b4e 50%, #1a2e3e 100%);
  min-height: 100vh;
  color: #333;
  display: flex;
  flex-direction: column;
}

.app-container {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.header h1 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
}

/* Predictions bar */
.predictions-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 800px) {
  .predictions-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.prediction-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-align: center;
}

.prediction-card.primary {
  background: rgba(231, 76, 60, 0.2);
  border-color: rgba(231, 76, 60, 0.4);
}

.pred-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pred-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.prediction-card.primary .pred-value {
  color: #ff6b6b;
}

.pred-unit {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  margin-top: 0.15rem;
}

/* Main layout */
.main-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

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

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

.thermocouple-section,
.params-section,
.chart-section,
.explainer-section {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

h3 {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h3 .hint {
  font-size: 0.8rem;
  font-weight: normal;
  color: #888;
}

/* Thermocouple */
.thermocouple {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
}

.thermocouple-svg {
  width: 160px;
  height: auto;
}

.heater-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  justify-content: center;
}

.heater-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
}

.heater-indicator.on {
  background: #e74c3c;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.6);
  animation: glow 1s ease-in-out infinite alternate;
}

.heater-indicator.off {
  background: #bdc3c7;
}

@keyframes glow {
  from { box-shadow: 0 0 4px rgba(231, 76, 60, 0.4); }
  to { box-shadow: 0 0 12px rgba(231, 76, 60, 0.8); }
}

/* Parameters */
.param-group {
  margin-bottom: 0.85rem;
}

.param-group label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.2rem;
  font-size: 0.85rem;
}

.param-name {
  color: #555;
  font-weight: 500;
}

.param-value {
  font-weight: 600;
  color: #4a1a1a;
  min-width: 3rem;
  text-align: right;
}

.param-group input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e0e0e0;
  border-radius: 3px;
  outline: none;
}

.param-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e74c3c;
  cursor: pointer;
}

/* Charts */
.chart-section {
  min-height: 300px;
}

.chart-container {
  height: 250px;
  position: relative;
}

.chart-container.short {
  height: 120px;
}

/* Explainer */
.explainer-content {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #555;
}

.explainer-content p { margin-bottom: 0.75rem; }
.explainer-content ul { margin: 0.75rem 0; padding-left: 1.5rem; }
.explainer-content li { margin-bottom: 0.5rem; }
.explainer-content strong { color: #333; }

/* Equations */
.eq-display {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.85rem;
  line-height: 2;
  margin-top: 1rem;
}

.equation {
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.eq-lhs { color: #555; font-weight: 600; }
.eq-heat { color: #e74c3c; font-weight: 600; }
.eq-cool { color: #3498db; font-weight: 600; }
.eq-note { color: #999; font-size: 0.8rem; }
