/* ==========================================================================
   Matter Waves & The Davisson-Germer Experiment — Stylesheet
   Chapter 11 Simulation 04 | PlusPhysics Suite
   Department of Physics, D B Pampa College, Parumala
   ========================================================================== */

/* --- CSS Root Variables & Design Tokens --- */
:root {
    --primary-color: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    --primary-border: #bae6fd;
    --accent-color: #f59e0b;
    --accent-hover: #d97706;
    --accent-light: #fef3c7;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #090e17;
    --text-main: #0f172a;
    --text-sub: #334155;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --border-subtle: #e2e8f0;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

/* Base Reset & Typography */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.55;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Master Container */
.container {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 3.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* ==========================================================================
   1. Top Navigation Bar (Standard 4.1)
   ========================================================================== */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 1.15rem;
    box-shadow: var(--shadow-sm);
}

.nav-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    transition: color 0.15s ease;
}

.nav-home-btn:hover {
    color: var(--primary-hover);
}

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

.nav-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f1f5f9;
    color: var(--text-sub);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

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

/* ==========================================================================
   2. Series Modal Dialog (Refined Architecture: No Links, Only Admit Card)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
}

.modal-window {
    position: relative;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 760px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10001;
    animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    background: #f8fafc;
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    transition: all 0.15s ease;
}

.modal-close-btn:hover {
    color: var(--text-main);
    background: #e2e8f0;
}

.modal-body {
    flex: 1 1 auto;
    padding: 0.85rem 1.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.5;
}

.series-tagline {
    font-weight: 700;
    color: var(--primary-hover);
    font-size: 0.94rem;
}

/* 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;
    line-height: 1.25;
}

.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.84rem;
}

.modal-admission .program-card span {
    font-size: 0.74rem;
    line-height: 1.25;
}

.modal-admission .program-card small {
    font-size: 0.68rem;
    margin-top: 0.1rem;
}

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

.modal-admission .promo-button {
    padding: 0.4rem 1.1rem !important;
    font-size: 0.8rem !important;
    border-radius: var(--radius-sm);
}

.modal-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    padding: 0.65rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    background: #f8fafc;
}

.modal-btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0.42rem 1.15rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

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

/* ==========================================================================
   3. Simulation Header
   ========================================================================== */
.sim-header {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.header-badges {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.22rem 0.65rem;
    border-radius: 9999px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.primary-badge {
    background: var(--primary-light);
    color: var(--primary-hover);
    border: 1px solid var(--primary-border);
}

.mode-tag-badge {
    background: var(--accent-light);
    color: var(--accent-hover);
    border: 1px solid #fde68a;
}

.sim-title {
    font-size: 2.15rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.sim-subtitle {
    font-size: 1.02rem;
    color: var(--text-sub);
    line-height: 1.55;
    max-width: 1050px;
}

/* ==========================================================================
   4. Main Simulation Layout (Option A Standard: Visualizer + Controls Side-by-Side)
   ========================================================================== */
.sim-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    align-items: start;
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   5. Visualizer Column
   ========================================================================== */
.visualizer-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
    overflow: hidden;
}

/* Primary Canvas Viewport Wrapper */
.viewport-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 740 / 460;
    background: #060b14;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid #1e293b;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.viewport-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Viewport Overlay Toolbar */
.viewport-overlay-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 10;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #e2e8f0;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

/* Dynamic Canvas Status Badge Overlay */
.canvas-badge-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(6px);
    color: #f1f5f9;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    border-left: 3.5px solid var(--accent-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    z-index: 10;
    pointer-events: none;
}

/* Live Physical Telemetry Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    width: 100%;
}

.stat-item {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    transition: border-color 0.15s ease;
}

.stat-item:hover {
    border-color: var(--primary-border);
}

.stat-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-data {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-hover);
    line-height: 1.2;
}

.stat-sub {
    font-size: 0.74rem;
    color: var(--text-sub);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Auxiliary Scientific Visualizer Panel */
.aux-panel {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

.aux-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.aux-icon {
    font-size: 1.05rem;
}

.aux-header h4 {
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--text-main);
}

.aux-badge {
    background: #e2e8f0;
    color: var(--text-sub);
    font-size: 0.72rem;
}

.aux-canvas-wrapper {
    width: 100%;
    aspect-ratio: 740 / 220;
    background: #090e17;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid #1e293b;
}

.aux-canvas-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   6. Controls Column
   ========================================================================== */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
}

.control-group {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

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

.group-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 800;
    border-radius: 50%;
    flex-shrink: 0;
}

.group-header h2,
.group-header h3 {
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--text-main);
    flex-grow: 1;
}

.mode-focus-badge {
    background: var(--accent-light);
    color: var(--accent-hover);
    font-size: 0.7rem;
    border: 1px solid #fde68a;
}

/* Mode Selection Tabs Grid */
.mode-tabs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
}

.mode-btn {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.mode-btn:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
}

.mode-btn.active {
    background: #f0f9ff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1.5px var(--primary-color);
}

.tab-num {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mode-btn.active .tab-num {
    color: var(--primary-hover);
}

.tab-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
}

/* Mode Focus Description & Presets */
.group-description {
    font-size: 0.82rem;
    color: var(--text-sub);
    line-height: 1.45;
}

.mode-presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
}

.preset-pill-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preset-pill-btn:hover {
    background: var(--primary-light);
    color: var(--primary-hover);
    border-color: var(--primary-border);
}

.preset-pill-btn.active-preset {
    background: var(--primary-hover);
    color: #ffffff;
    border-color: var(--primary-hover);
}

/* Parameter Sliders */
.control-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.slider-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-header-wrap label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}

.slider-val-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-hover);
    background: #ffffff;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.slider-stepper-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.step-btn {
    width: 28px;
    height: 28px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.12s ease;
}

.step-btn:hover {
    background: var(--primary-light);
    color: var(--primary-hover);
    border-color: var(--primary-border);
}

.slider-stepper-wrap input[type="range"] {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #cbd5e1;
    border-radius: 9999px;
    outline: none;
}

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

.slider-stepper-wrap input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.15);
}

.slider-scale-limits {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.control-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.action-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-btn-secondary:hover {
    background: #f1f5f9;
    color: var(--text-main);
    border-color: #94a3b8;
}

/* ==========================================================================
   7. Predict-Observe-Explain (POE) Card
   ========================================================================== */
.poe-card {
    border-left: 3.5px solid var(--accent-color);
    background: #fffdf5;
}

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

.poe-badge {
    align-self: flex-start;
    background: var(--accent-light);
    color: var(--accent-hover);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid #fde68a;
}

.poe-header h4 {
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--text-main);
}

.poe-prompt {
    font-size: 0.82rem;
    color: var(--text-sub);
    line-height: 1.45;
}

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

.poe-btn {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.poe-btn:hover {
    border-color: var(--accent-color);
    background: #fffdf5;
}

.poe-btn.correct {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

.poe-btn.incorrect {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.opt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #fef3c7;
    color: #b45309;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.74rem;
    flex-shrink: 0;
}

.poe-btn.correct .opt-letter {
    background: #10b981;
    color: #ffffff;
}

.poe-btn.incorrect .opt-letter {
    background: #ef4444;
    color: #ffffff;
}

.opt-text {
    font-size: 0.8rem;
    color: var(--text-main);
    line-height: 1.35;
}

.poe-feedback {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: #ffffff;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    border-left: 3.5px solid #10b981;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-sub);
}

.feedback-badge {
    align-self: flex-start;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.feedback-badge.badge-correct {
    background: #d1fae5;
    color: #065f46;
}

.feedback-badge.badge-incorrect {
    background: #fee2e2;
    color: #991b1b;
}

/* ==========================================================================
   8. Foundational Theory & Concepts Section (Option A Standard)
   ========================================================================== */
.concepts-box.full-width-theory {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.theory-header {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.theory-tag {
    align-self: flex-start;
    background: var(--primary-light);
    color: var(--primary-hover);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.theory-header h2 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.theory-intro {
    font-size: 0.92rem;
    color: var(--text-sub);
    line-height: 1.55;
    max-width: 900px;
}

.theory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1.25rem;
    width: 100%;
}

.theory-card {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    position: relative;
    border-top: 3.5px solid var(--primary-color);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.theory-card.highlight-card {
    background: #fffdf5;
    border-color: #fde68a;
    border-top-color: var(--accent-color);
}

.card-icon {
    font-size: 1.35rem;
}

.theory-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}

.theory-card p {
    font-size: 0.88rem;
    color: var(--text-sub);
    line-height: 1.55;
    word-break: break-word;
}

.math-display {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    margin: 0.35rem 0;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    font-size: 0.92rem;
}

/* Display Math Blocks (Centered, block-level, horizontally scrollable) */
.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;
}

/* Inline Math (Seamlessly inline with surrounding text, no line break jumps) */
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;
    display: inline-block;
    vertical-align: middle;
}

mjx-assistive-mml {
    clip: rect(1px, 1px, 1px, 1px) !important;
    user-select: none !important;
    position: absolute !important;
    padding: 0 !important;
    border: 0 !important;
    height: 1px !important;
    width: 1px !important;
    overflow: hidden !important;
}

.theory-card ul {
    margin-left: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.theory-card li {
    font-size: 0.86rem;
    color: var(--text-sub);
    line-height: 1.5;
}

/* ==========================================================================
   9. Series Card (Standard 4.2: Full Static Context, No Simulation Links)
   ========================================================================== */
.series-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.series-card h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}

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

/* ==========================================================================
   10. Institutional Admission Card (Standard 4.3: Dark Gradient & Pulsing Gold Border)
   ========================================================================== */
.admission-card.attention-flash {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 2.2rem 2rem;
    background: radial-gradient(circle at 85% 15%, rgba(245, 158, 11, 0.18) 0%, transparent 45%),
                linear-gradient(135deg, #090e17 0%, #0f172a 50%, #1e293b 100%);
    color: #f8fafc;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow: hidden;
    animation: goldPulseBorder 3.5s infinite ease-in-out;
}

@keyframes goldPulseBorder {
    0%, 100% {
        border: 2px solid rgba(245, 158, 11, 0.45);
        box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.4), 0 0 15px rgba(245, 158, 11, 0.2);
    }
    50% {
        border: 2px solid rgba(245, 158, 11, 0.95);
        box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.4), 0 0 25px rgba(245, 158, 11, 0.45);
    }
}

.promo-copy {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.promo-kicker {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.promo-lead {
    font-size: 1.15rem;
    font-weight: 600;
    color: #e2e8f0;
}

.promo-headline {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.program-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    backdrop-filter: blur(4px);
    transition: transform 0.15s ease, background 0.15s ease;
}

.program-card:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-2px);
}

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

.program-card span {
    font-size: 0.85rem;
    color: #94a3b8;
}

.program-card small {
    font-size: 0.78rem;
    color: #fde68a;
    font-weight: 600;
    margin-top: 0.2rem;
}

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

.promo-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.65rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    transition: all 0.18s ease;
}

.promo-button.main-cta {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.promo-button.main-cta:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
}

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

.promo-button.sub-cta:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   11. Feedback & Suggestions Channel (Standard 4.4)
   ========================================================================== */
.feedback-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
}

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

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

.feedback-text h4 {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-main);
}

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

.feedback-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.35rem;
    background: #f8fafc;
    color: var(--text-main);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

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

/* ==========================================================================
   12. Standard Series Footer (Standard 4.5)
   ========================================================================== */
.series-footer {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   13. Responsive Layout & Mobile Drawer (Standard Section 7)
   ========================================================================== */
.mobile-controls-bar {
    display: none;
}

@media (max-width: 900px) {
    .container {
        padding: 0.85rem 0.85rem 2.5rem;
        gap: 1.25rem;
    }

    .sim-layout {
        display: flex;
        flex-direction: column;
        gap: 1.15rem;
    }

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

    .mobile-controls-bar {
        display: block;
        width: 100%;
    }

    .mobile-controls-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background: var(--primary-color);
        color: #ffffff;
        border: none;
        border-radius: var(--radius-md);
        padding: 0.75rem 1rem;
        font-weight: 700;
        font-size: 0.9rem;
        cursor: pointer;
        box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.25);
        touch-action: manipulation;
    }

    .toggle-arrow {
        transition: transform 0.2s ease;
    }

    .controls-panel {
        display: none;
        width: 100%;
    }

    .controls-panel.mobile-open,
    .controls-panel.drawer-open {
        display: flex !important;
        animation: drawerSlideDown 0.2s ease-out;
    }

    @keyframes drawerSlideDown {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .admission-card {
        padding: 1.6rem 1.4rem;
    }

    .promo-headline {
        font-size: 1.45rem;
    }

    .feedback-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .feedback-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 600px) {
    /* Standard 19 Option A: Priority Admission Placement, Flexible Height & Smooth Modal Scroll */
    .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 .promo-kicker {
        font-size: 0.65rem !important;
    }

    .modal-admission .promo-lead {
        font-size: 0.82rem !important;
    }

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

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

    .modal-admission .program-card {
        padding: 0.38rem 0.5rem !important;
        gap: 0.15rem !important;
        height: auto !important;
    }

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

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

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

    .modal-admission .promo-button {
        padding: 0.38rem 0.85rem !important;
        font-size: 0.76rem !important;
    }

    html {
        font-size: 15px;
    }

    .container {
        padding: 0.65rem 0.65rem 2rem;
        gap: 1rem;
    }

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

    .nav-actions {
        width: 100%;
        justify-content: space-between;
    }

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

    .stats-bar {
        grid-template-columns: 1fr;
    }

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

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

    .concepts-box.full-width-theory {
        padding: 1.25rem 0.85rem;
    }

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

    .viewport-wrapper {
        aspect-ratio: 4 / 3;
        max-height: 48vh;
    }

    .aux-canvas-wrapper {
        aspect-ratio: 16 / 9;
    }

    .promo-actions {
        flex-direction: column;
        width: 100%;
    }

    .promo-button {
        width: 100%;
    }
}

/* Readouts, status lines and labels wrap instead of being cut off. */
.stat-sub,
.preset-pill-btn {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}
.preset-pill-btn { line-height: 1.25; height: auto; }
