/* ==========================================================================
   Chapter 14 Simulation 03: Semiconductor Diode Bias & V-I Characteristics
   Theme: Academic Light Theme (Standards 1 to 24 Compliant)
   Color Palette:
     - Slate Base: #0f172a (Primary), #475569 (Secondary), #94a3b8 (Muted)
     - Surfaces: #f8fafc (App BG), #ffffff (Card Surface), #f1f5f9 (Subtle)
     - Borders: #e2e8f0 (Light), #cbd5e1 (Medium)
     - Sky Accent: #0284c7 (Forward Bias, Volts, Silicon)
     - Emerald Accent: #059669 (Conduction Current, Dynamic rd, Equilibrium)
     - Amber Accent: #d97706 (Knee Threshold, Barrier, Resistor)
     - Rose Accent: #dc2626 (Reverse Bias, Breakdown, Power)
   ========================================================================== */

:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-subtle: #f8fafc;
    --bg-hover: #f1f5f9;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent-sky: #0284c7;
    --accent-sky-dark: #0369a1;
    --accent-emerald: #059669;
    --accent-emerald-dark: #047857;
    --accent-amber: #d97706;
    --accent-amber-dark: #b45309;
    --accent-rose: #dc2626;
    --accent-rose-dark: #b91c1c;

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* --------------------------------------------------------------------------
   1. Universal Reset & Baseline
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 1.25rem 1rem 3rem;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   2. Standard 4.1 Top Navigation Bar & Standard 18 Actions
   -------------------------------------------------------------------------- */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.nav-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--accent-sky);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.15s ease;
}

.nav-home-btn:hover {
    color: var(--accent-sky-dark);
}

.nav-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-card-subtle);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-pill-btn:hover {
    background: var(--accent-sky-light);
    border-color: var(--accent-sky);
    color: var(--accent-sky-dark);
}

.nav-dept-tag {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   3. Standard 22 Clean Header Architecture (Zero Badges)
   -------------------------------------------------------------------------- */
.sim-header {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.85rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.sim-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sim-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 1100px;
}

/* --------------------------------------------------------------------------
   4. Main Interactive Simulation Layout (Grid / Flex)
   -------------------------------------------------------------------------- */
.sim-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(360px, 1fr);
    gap: 1.25rem;
    align-items: start;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   5. Visualizer Panel (Left Column)
   -------------------------------------------------------------------------- */
.visualizer-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Mode Selection Tabs */
.mode-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
    touch-action: manipulation;
    min-height: 42px;
}

.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.tab-btn.active {
    background: var(--accent-sky);
    color: #ffffff;
    border-color: var(--accent-sky);
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.tab-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.08);
    font-size: 0.74rem;
    font-weight: 700;
}

.tab-btn.active .tab-num {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Viewport Canvas Wrapper */
.viewport-wrapper {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#main-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 740 / 460;
    background: #ffffff;
    cursor: crosshair;
    touch-action: none;
}

/* Viewport HUD Overlays */
.viewport-hud-top {
    position: absolute;
    top: 10px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}

.hud-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    pointer-events: auto;
}

.hud-chip.status-indicator {
    background: rgba(240, 253, 244, 0.95);
    border-color: rgba(5, 150, 105, 0.3);
    color: var(--accent-emerald-dark);
}

/* Floating Viewport Toolbar */
.viewport-toolbar {
    position: absolute;
    bottom: 10px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    z-index: 5;
}

.v-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.v-tool-btn:hover {
    background: #ffffff;
    border-color: var(--accent-sky);
    color: var(--accent-sky);
}

.v-tool-btn.paused {
    background: #fffbeb;
    border-color: var(--accent-amber);
    color: var(--accent-amber-dark);
}

/* --------------------------------------------------------------------------
   6. Live Telemetry Stats Bar
   -------------------------------------------------------------------------- */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.15rem;
    box-shadow: var(--shadow-sm);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

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

.stat-value {
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.highlight-sky { color: var(--accent-sky); }
.highlight-emerald { color: var(--accent-emerald); }
.highlight-amber { color: var(--accent-amber); }
.highlight-rose { color: var(--accent-rose); }

/* --------------------------------------------------------------------------
   7. Auxiliary Graph Panel
   -------------------------------------------------------------------------- */
.aux-graph-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.aux-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.aux-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.aux-badge {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--accent-sky-dark);
    background: rgba(2, 132, 199, 0.08);
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
}

#aux-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 740 / 180;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    touch-action: none;
}

/* --------------------------------------------------------------------------
   8. Predict-Observe-Explain (POE) Challenge Card
   -------------------------------------------------------------------------- */
.poe-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.6rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.poe-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.poe-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-sky-dark);
    background: rgba(2, 132, 199, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    align-self: flex-start;
}

.poe-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
}

.poe-prompt {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.poe-options {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.poe-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.poe-option:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

.poe-option input[type="radio"] {
    margin-top: 0.2rem;
    accent-color: var(--accent-sky);
}

.option-marker {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent-sky);
    min-width: 18px;
}

.option-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.poe-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.poe-btn {
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    touch-action: manipulation;
}

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

.poe-btn.primary:hover {
    background: var(--accent-sky-dark);
}

.poe-btn.secondary {
    background: var(--bg-card-subtle);
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

.poe-btn.secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.poe-feedback {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.55;
    margin-top: 0.45rem;
}

.feedback-correct {
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid var(--accent-emerald);
    color: #065f46;
}

.feedback-incorrect {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid var(--accent-rose);
    color: #991b1b;
}

/* --------------------------------------------------------------------------
   9. Controls Panel (Right Column)
   -------------------------------------------------------------------------- */
.controls-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

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

.group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.65rem;
}

.group-icon {
    font-size: 1.25rem;
}

.group-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.control-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.control-row {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.control-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.label-with-val {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.val-display {
    color: var(--accent-sky);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Stepper Composite Controls */
.stepper-composite {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stepper-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    touch-action: manipulation;
    flex-shrink: 0;
}

.stepper-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 9999px;
    background: var(--border-light);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-sky);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease;
}

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

/* Pill Group Selector */
.pill-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.45rem;
}

.preset-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.55rem 0.75rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    touch-action: manipulation;
}

.preset-pill strong {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.preset-pill small {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.preset-pill:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

.preset-pill.active {
    background: rgba(2, 132, 199, 0.08);
    border-color: var(--accent-sky);
}

.preset-pill.active strong {
    color: var(--accent-sky-dark);
}

/* Physics Insight Card inside Controls */
.physics-card {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.p-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.84rem;
    color: var(--text-primary);
}

.p-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.p-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

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

.p-val {
    font-size: 0.92rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.p-verdict {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
    border-top: 1px solid var(--border-light);
    padding-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   10. Standard 7.4 Dedicated Full-Width Theory Section (Option A Layout)
   -------------------------------------------------------------------------- */
.concepts-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    box-shadow: var(--shadow-sm);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--accent-sky);
    padding-bottom: 0.45rem;
    display: inline-block;
}

.theory-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.theory-card {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.t-icon {
    font-size: 1.45rem;
}

.theory-card h3 {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
}

.theory-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.theory-points {
    padding-left: 1.15rem;
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.theory-points li {
    margin-bottom: 0.35rem;
}

.math-block {
    margin: 0.45rem 0;
    padding: 0.45rem 0.65rem;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.math-block mjx-container {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

/* --------------------------------------------------------------------------
   11. Standard 4.2 Series Overview Card
   -------------------------------------------------------------------------- */
.series-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.series-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.series-tagline {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--accent-sky-dark);
}

.series-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   12. Standard 4.3 Institutional Admission Callout Card
   -------------------------------------------------------------------------- */
.admission-card {
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(251, 191, 36, 0.4);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.attention-flash {
    animation: bannerGlowPulse 3s infinite ease-in-out;
}

@keyframes bannerGlowPulse {
    0% {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        border-color: rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 0 24px 6px rgba(251, 191, 36, 0.45);
        border-color: rgba(251, 191, 36, 0.85);
    }
    100% {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        border-color: rgba(251, 191, 36, 0.3);
    }
}

.promo-kicker {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fbbf24;
}

.promo-lead {
    font-size: 1.05rem;
    font-weight: 500;
    color: #e2e8f0;
}

.promo-headline {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

.program-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    backdrop-filter: blur(4px);
}

.program-card strong {
    font-size: 1.05rem;
    color: #ffffff;
}

.program-card span {
    font-size: 0.82rem;
    color: #cbd5e1;
}

.program-card small {
    font-size: 0.74rem;
    color: #fbbf24;
    font-weight: 600;
}

.promo-actions {
    display: flex;
    gap: 0.85rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.promo-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.promo-button.main-cta {
    background: #fbbf24;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);
}

.promo-button.main-cta:hover {
    background: #f59e0b;
    transform: translateY(-1px);
}

.promo-button.sub-cta {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.promo-button.sub-cta:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* --------------------------------------------------------------------------
   13. Standard 4.4 Feedback & Suggestions Channel
   -------------------------------------------------------------------------- */
.feedback-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.feedback-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.feedback-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-sky-light);
    color: var(--accent-sky);
    flex-shrink: 0;
}

.feedback-text h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.feedback-text p {
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-card-subtle);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: 0.55rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.feedback-btn:hover {
    background: var(--accent-sky-light);
    border-color: var(--accent-sky);
    color: var(--accent-sky-dark);
}

/* --------------------------------------------------------------------------
   14. Standard 4.5 Standard Series Footer
   -------------------------------------------------------------------------- */
.series-footer {
    text-align: center;
    padding: 1.25rem 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    width: 100%;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   15. Standard 4.2 & 19 Accessible Series Modal Dialog
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-window {
    position: relative;
    background: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 760px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 10;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Compact Admission Callout Card inside Modal (Standard 19: 100% visible) */
.modal-admission {
    flex-shrink: 0 !important;
    min-height: fit-content !important;
    height: auto !important;
    margin-top: 0.25rem;
    padding: 0.85rem 1.15rem !important;
    gap: 0.6rem !important;
    border-radius: var(--radius-md) !important;
}

.modal-admission .promo-copy {
    gap: 0.1rem;
}

.modal-admission .promo-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
}

.modal-admission .promo-lead {
    font-size: 0.82rem;
    font-weight: 600;
}

.modal-admission .promo-headline {
    font-size: 1.05rem !important;
    line-height: 1.25 !important;
}

.modal-admission .program-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.55rem !important;
}

.modal-admission .program-card {
    padding: 0.5rem 0.75rem !important;
}

.modal-admission .program-card strong {
    font-size: 0.88rem !important;
}

.modal-admission .program-card span {
    font-size: 0.72rem !important;
}

.modal-admission .program-card small {
    font-size: 0.65rem !important;
}

.modal-admission .promo-actions {
    gap: 0.55rem !important;
    margin-top: 0.15rem !important;
}

.modal-admission .promo-button {
    padding: 0.4rem 1.1rem !important;
    font-size: 0.78rem !important;
}

.modal-series-card {
    padding: 0.85rem 1.15rem;
    gap: 0.45rem;
}

.modal-series-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-series-card p {
    font-size: 0.82rem;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.modal-dismiss-btn {
    padding: 0.45rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-medium);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-dismiss-btn:hover {
    background: var(--bg-hover);
}

/* --------------------------------------------------------------------------
   16. Responsive Multi-Viewport Media Queries (Standard 17)
   -------------------------------------------------------------------------- */
/* Laptop Standard (max-width: 1300px) */
@media (max-width: 1300px) {
    .theory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Tablet Screens (max-width: 900px) - Canvas First Ordering */
@media (max-width: 900px) {
    .sim-layout {
        grid-template-columns: 1fr;
    }

    .visualizer-panel {
        order: 1;
    }

    .controls-panel {
        order: 2;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .mode-tabs {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .concepts-box {
        padding: 1.25rem 1.35rem;
    }
}

/* Mobile Screens (max-width: 600px) */
@media (max-width: 600px) {
    body {
        padding: 0.5rem 0.4rem 2rem;
    }

    .sim-header {
        padding: 1rem 1.15rem;
    }

    .sim-title {
        font-size: 1.45rem;
    }

    .mode-tabs {
        grid-template-columns: 1fr;
    }

    .tab-btn {
        padding: 0.5rem 0.35rem;
        font-size: 0.74rem;
    }

    /* Standard 21: Hide Mode Chip on Mobile */
    #hud-mode-chip {
        display: none !important;
    }

    .hud-chip.status-indicator {
        font-size: 0.68rem;
        padding: 0.2rem 0.55rem;
    }

    .top-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .nav-actions {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .stats-bar {
        grid-template-columns: 1fr 1fr;
        padding: 0.65rem 0.85rem;
        gap: 0.5rem;
    }

    .stat-value {
        font-size: 0.92rem;
    }

    .pill-group {
        grid-template-columns: 1fr;
    }

    .p-metrics {
        grid-template-columns: 1fr;
    }

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

    .concepts-box {
        padding: 1.25rem 1.15rem;
    }

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

    .admission-card {
        padding: 1.25rem 1.35rem;
    }

    /* Standard 19: Priority Admission in Modal on Mobile */
    .modal-overlay {
        padding: 0.65rem;
    }

    .modal-window {
        max-height: 90vh;
    }

    .modal-body {
        padding: 0.75rem 0.85rem;
        gap: 0.6rem;
    }

    .modal-admission {
        order: -1 !important;
        margin-top: 0 !important;
        margin-bottom: 0.5rem !important;
        padding: 0.75rem 0.85rem !important;
        gap: 0.45rem !important;
        height: auto !important;
        min-height: fit-content !important;
    }

    .modal-admission .program-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.35rem !important;
    }
}
