/* Shared design system loaded via shared.css */

body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: #f4f7f6;
            color: #333;
            max-width: 1000px;
            margin: 0 auto;
            padding: 20px;
        }

        h1 {
            text-align: center;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        p.subtitle {
            text-align: center;
            color: #7f8c8d;
            margin-bottom: 25px;
        }

        .controls {
            background: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-bottom: 20px;
            align-items: flex-end;
            justify-content: space-between;
        }

        .control-group {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-width: 150px;
        }

        .slider-group {
            flex: 2;
            min-width: 250px;
            display: flex;
            flex-direction: column;
        }

        label {
            font-weight: bold;
            margin-bottom: 8px;
            font-size: 14px;
            color: #34495e;
        }

        select,
        input[type="range"] {
            padding: 8px;
            border: 1px solid #bdc3c7;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
        }

        .slider-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        input[type="range"] {
            flex-grow: 1;
        }

        .slider-value {
            font-weight: bold;
            color: #e74c3c;
            display: inline-block;
            width: 30px;
            text-align: right;
        }

        button {
            padding: 8px 15px;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            font-weight: bold;
            cursor: pointer;
            transition: background 0.2s;
        }

        button:hover {
            background-color: #2980b9;
        }

        .live-math {
            background: #e8f4f8;
            padding: 10px 15px;
            border-radius: 6px;
            border-left: 4px solid #3498db;
            margin-bottom: 20px;
            font-family: monospace;
            font-size: 16px;
            display: flex;
            justify-content: space-between;
        }

        .live-math span.result-val {
            font-weight: bold;
            color: #c0392b;
            font-size: 18px;
        }

        .chart-container {
            background: #fff;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            margin-bottom: 20px;
            height: 250px;
        }




/* Ensure the body allows absolute positioning */



/* ================================================================
   DESIGN SYSTEM OVERRIDE — Applied via shared.css variables
   These overrides unify all pages to the shared dark-lab aesthetic
   ================================================================ */

/* Reset old colors to use CSS variables from shared.css */
body {
  font-family: var(--font-sans) !important;
  background-color: var(--bg) !important;
  color: var(--text-primary) !important;
  padding-top: 72px !important;
}

h1, h2, h3 {
  font-family: var(--font-mono) !important;
}

h1 { color: var(--text-primary) !important; }
h2 { color: var(--cyan) !important; }

/* Panel backgrounds */
.controls-panel, .panel, .dashboard > *, .grid-container > *,
.info-panel, .visualizer-panel, aside, section.panel {
  background: var(--panel) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-panel) !important;
  color: var(--text-primary) !important;
}

.panel-header, header.panel-header {
  background: var(--panel-2) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 12px 16px !important;
}

/* Inputs */
input[type="text"], input[type="number"], select, textarea {
  background: var(--bg-2) !important;
  border: 1px solid var(--border-2) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-mono) !important;
  border-radius: var(--radius-sm) !important;
}

label {
  color: var(--text-secondary) !important;
  font-family: var(--font-mono) !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
}

/* Buttons */
button {
  font-family: var(--font-mono) !important;
  border-radius: var(--radius-sm) !important;
}

/* Canvas containers */
.canvas-container, .canvas-wrapper {
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
}

/* Metrics / data boxes */
.metrics-box, .data-box, .explanation-panel,
.instruction-box, .dynamic-explanation {
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-secondary) !important;
  font-size: 0.85rem !important;
}

/* Highlights */
.highlight, .highlight-k { color: var(--amber) !important; }
span[style*="color: #89b4fa"], .text-blue { color: var(--cyan) !important; }

/* Subtitles */
.subtitle, .page-subtitle, p.subtitle {
  color: var(--text-secondary) !important;
  font-family: var(--font-mono) !important;
  font-size: 0.82rem !important;
}

/* Fix dashboard flex → still works but adds top padding spacing */
.dashboard {
  padding-top: 8px;
}

/* ── DARK THEME + SCROLL + HOME-BTN FIX ── */
body {
  padding: 72px 20px 20px !important;
  background-color: var(--bg) !important;
  color: var(--text-primary) !important;
  max-width: 1100px !important;
  margin: 0 auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  font-family: var(--font-sans) !important;
}
h1 { color: var(--cyan) !important; font-family: var(--font-mono) !important; text-align: center !important; }
p.subtitle { color: var(--text-secondary) !important; }
.controls {
  background: var(--panel) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-panel) !important;
  color: var(--text-primary) !important;
}
label { color: var(--text-secondary) !important; font-family: var(--font-mono) !important; font-size: 0.78rem !important; }
select {
  background: var(--bg-2) !important;
  border: 1px solid var(--border-2) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
}
.canvas-container {
  background: var(--panel) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  margin-bottom: 16px !important;
  overflow: hidden !important;
}
canvas { display: block !important; width: 100% !important; }
.slider-value { color: var(--amber) !important; }
button {
  background: var(--panel-2) !important;
  color: var(--cyan) !important;
  border: 1px solid var(--border-2) !important;
  font-family: var(--font-mono) !important;
  border-radius: var(--radius-sm) !important;
}
button:hover { background: var(--cyan) !important; color: var(--bg) !important; }
@media (max-width: 600px) {
  .controls { flex-direction: column !important; }
  .control-group { min-width: 0 !important; }
}

