/* ==========================================================================
   Plus Two Physics Simulation Suite — Academic Light Theme
   Chapter 14: Semiconductor Electronics
   Simulation 01: Energy Bands & Intrinsic-Extrinsic Semiconductors
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Reset & Global Theme Custom Properties
   -------------------------------------------------------------------------- */
:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-subtle: #f1f5f9;
    --bg-card-inset: #f8fafc;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --border-light: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-focus: #0284c7;

    --accent-sky: #0284c7;
    --accent-sky-dark: #0369a1;
    --accent-sky-light: #e0f2fe;
    
    --accent-emerald: #059669;
    --accent-emerald-dark: #047857;
    --accent-emerald-light: #d1fae5;

    --accent-amber: #d97706;
    --accent-amber-dark: #b45309;
    --accent-amber-light: #fef3c7;

    --accent-rose: #dc2626;
    --accent-rose-dark: #b91c1c;
    --accent-rose-light: #fee2e2;

    --accent-violet: #7c3aed;
    --accent-violet-light: #ede9fe;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Fira Code', Menlo, Monaco, Consolas, monospace;
}

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

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding: 1rem 0.75rem 2.5rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   2. Standard 4.1 Top Navigation Bar
   -------------------------------------------------------------------------- */
.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 Badge Rows)
   -------------------------------------------------------------------------- */
.sim-header {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.75rem;
    box-shadow: var(--shadow-sm);
}

.sim-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 0.45rem;
}

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

/* --------------------------------------------------------------------------
   4. Main Interactive Simulation Layout (Canvas-First)
   -------------------------------------------------------------------------- */
.sim-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    width: 100%;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   5. Visualizer Panel & Mode Tabs
   -------------------------------------------------------------------------- */
.visualizer-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    align-items: stretch;
}

.mode-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
    background: var(--bg-card);
    padding: 0.4rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.25;
}

.tab-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-card-subtle);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

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

.tab-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: var(--shadow-sm);
}

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

/* --------------------------------------------------------------------------
   6. Primary 2D Canvas Viewport Wrapper & Runtime Toolbar
   -------------------------------------------------------------------------- */
.viewport-wrapper {
    position: relative;
    width: 100%;
    min-width: 0;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    aspect-ratio: 740 / 460;
    display: flex;
}

#main-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    touch-action: none;
    cursor: crosshair;
}

.viewport-hud-overlay {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    right: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.hud-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
}

.hud-chip.mode-indicator {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.hud-chip.status-indicator {
    background: rgba(2, 132, 199, 0.92);
    border: 1px solid rgba(2, 132, 199, 0.5);
    color: #ffffff;
}

.viewport-toolbar {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    backdrop-filter: blur(6px);
}

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

.toolbar-btn.paused {
    background: var(--accent-amber-light);
    border-color: var(--accent-amber);
    color: var(--accent-amber-dark);
}

/* --------------------------------------------------------------------------
   7. Invariant 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);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.stat-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value.highlight { color: var(--accent-sky); }
.stat-value.highlight-emerald { color: var(--accent-emerald); }
.stat-value.highlight-amber { color: var(--accent-amber); }
.stat-value.highlight-sky { color: #0284c7; }
.stat-value.highlight-rose { color: var(--accent-rose); }

/* --------------------------------------------------------------------------
   8. Auxiliary 2D Diagnostics Viewport
   -------------------------------------------------------------------------- */
.aux-viewport-wrapper {
    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);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

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

.aux-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    background: var(--accent-sky-light);
    color: var(--accent-sky-dark);
    border-radius: var(--radius-full);
}

#aux-canvas {
    width: 100% !important;
    height: 130px;
    display: block;
    border-radius: var(--radius-sm);
    background: #ffffff;
}

/* --------------------------------------------------------------------------
   9. Pedagogical Predict-Observe-Explain (POE) Challenge Card
   -------------------------------------------------------------------------- */
.poe-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent-sky);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.35rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.poe-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.poe-badge {
    background: var(--accent-sky);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
}

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

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

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

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

.poe-option:hover {
    background: #ffffff;
    border-color: var(--accent-sky);
}

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

.opt-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--border-light);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.opt-text {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.poe-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.btn-poe-check {
    background: var(--accent-sky);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1.15rem;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.btn-poe-reset {
    background: var(--bg-card-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-poe-reset:hover {
    background: #ffffff;
    color: var(--text-primary);
}

.poe-feedback {
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.15rem;
    font-size: 0.88rem;
    line-height: 1.55;
}

.feedback-correct {
    background: var(--accent-emerald-light);
    border: 1px solid var(--accent-emerald);
    color: var(--accent-emerald-dark);
}

.feedback-incorrect {
    background: var(--accent-rose-light);
    border: 1px solid var(--accent-rose);
    color: var(--accent-rose-dark);
}

.feedback-neutral {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   10. Controls Panel & Interactive Parameter Steppers
   -------------------------------------------------------------------------- */
.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;
    overflow-y: visible;
    max-height: none;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.45rem;
}

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

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

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

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

.label-with-val {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.control-label, .label-with-val label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
}

.val-display {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-sky);
    background: var(--accent-sky-light);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* Stepper Composite (Minus, Slider, Plus) */
.stepper-composite {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.55rem;
    align-items: center;
}

.stepper-btn {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 0.65rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

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

/* Range Inputs */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

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

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

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-sky);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* Pill Preset Groups */
.pill-group {
    display: grid;
    grid-template-columns: repeat(2, 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.2s ease;
    text-align: left;
}

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

.preset-pill small {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.25;
}

.preset-pill:hover {
    background: #ffffff;
    border-color: var(--accent-sky);
}

.preset-pill.active {
    background: var(--accent-sky-light);
    border-color: var(--accent-sky);
}

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

/* Physics Cards in Controls */
.physics-card {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

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

.p-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 0.85rem;
}

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

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

.p-val {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

.speed-control-row {
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   11. Standard 7.4 (Option A) Dedicated Full-Width Theory Section
   -------------------------------------------------------------------------- */
.concepts-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem 2.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    user-select: text;
}

.concepts-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.concepts-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.theory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.35rem;
}

.theory-card {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

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

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

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

.theory-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

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

.theory-points li::before {
    content: "•";
    position: absolute;
    left: 0.25rem;
    color: var(--accent-sky);
    font-weight: 800;
}

.formula-block {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    margin: 0.4rem 0;
}

/* --------------------------------------------------------------------------
   12. Standard 11 MathJax Dynamic Lifecycle & Dual-Rule Architecture
   -------------------------------------------------------------------------- */
.math-display mjx-container,
mjx-container[display="true"] {
    display: block !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    margin: 0.4rem auto !important;
    text-align: center;
}

mjx-container:not([display="true"]) {
    display: inline-block !important;
    max-width: 100% !important;
    overflow: visible !important;
    margin: 0 0.12em !important;
    vertical-align: -0.15em !important;
    line-height: 0;
}

mjx-container svg {
    max-width: 100% !important;
    height: auto !important;
    display: inline-block;
    vertical-align: middle;
}

/* --------------------------------------------------------------------------
   13. 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.85rem;
    box-shadow: var(--shadow-sm);
    user-select: text;
}

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

.series-tagline {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-sky);
    margin-bottom: 0.5rem;
}

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

/* --------------------------------------------------------------------------
   14. 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);
}

.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);
}

/* --------------------------------------------------------------------------
   15. 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;
}

.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);
}

/* --------------------------------------------------------------------------
   16. Standard 4.5 Standard Series Footer
   -------------------------------------------------------------------------- */
.series-footer {
    text-align: center;
    padding: 1.25rem 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   17. 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;
    gap: 0.15rem !important;
    height: auto !important;
}

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

.modal-admission .program-card span,
.modal-admission .program-card small {
    font-size: 0.68rem !important;
    line-height: 1.3 !important;
}

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

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

.modal-series-card {
    box-shadow: none !important;
    border: 1px solid var(--border-light) !important;
    padding: 1.15rem 1.35rem !important;
    background: var(--bg-card-subtle);
    border-radius: var(--radius-md);
}

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

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

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

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

/* --------------------------------------------------------------------------
   18. Responsive Multi-Viewport Media Queries
   -------------------------------------------------------------------------- */

/* Laptop Standard (max-width: 1200px) */
@media (max-width: 1200px) {
    .theory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Portrait (max-width: 900px) — Option A Stacked Layout */
@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);
    }

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

/* 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: repeat(2, 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-admission {
        order: -1 !important;
        padding: 0.85rem 1rem !important;
    }

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

    .modal-admission .program-card {
        padding: 0.45rem 0.6rem !important;
    }

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

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

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

/* Readouts, status lines and labels wrap instead of being cut off. */
.stat-label,
.stat-value {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}
