/* ==========================================================================
   Photons, Radiation Pressure & Wave-Particle Duality — Stylesheet
   Chapter 11 Simulation 03 | 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)
   ========================================================================== */
.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.65);
    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;
    z-index: 2;
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.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: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
    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;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    color: var(--text-sub);
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal-body .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;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.25);
}

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

.series-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.series-pill {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-sub);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

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

.series-pill.current {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

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

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

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

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

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

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

.mode-tag-badge {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

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

.sim-subtitle {
    font-size: 0.98rem;
    color: var(--text-sub);
    line-height: 1.6;
    max-width: 1080px;
}

/* ==========================================================================
   4. Workbench Dual-Column Layout (Section 7)
   ========================================================================== */
.sim-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr);
    gap: 1.6rem;
    align-items: start;
}

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

.visualizer-panel {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
}

/* Main Canvas Viewport Wrapper */
.viewport-wrapper {
    position: relative;
    background: #090e17;
    border: 1px solid #1e293b;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    width: 100%;
    aspect-ratio: 740 / 460;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewport-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.viewport-wrapper.canvas-expanded {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: calc(100vw - 2rem);
    height: calc(100vh - 2rem);
    aspect-ratio: auto;
    z-index: 9999;
    border-radius: var(--radius-md);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.85);
}

/* Viewport Overlay Toolbar */
.viewport-overlay-toolbar {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    display: flex;
    gap: 0.45rem;
    z-index: 10;
}

.icon-btn {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.icon-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Dynamic Status Badge Overlay */
.canvas-badge-overlay {
    position: absolute;
    bottom: 0.85rem;
    left: 0.85rem;
    right: 0.85rem;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-sm);
    color: #f8fafc;
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    z-index: 5;
    box-sizing: border-box;
}

/* ==========================================================================
   5. Telemetry Stats Bar (Standard 7.3)
   ========================================================================== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    width: 100%;
}

.stat-item {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    border-left: 3.5px solid var(--primary-color);
}

.stat-item:nth-child(2) { border-left-color: #8b5cf6; }
.stat-item:nth-child(3) { border-left-color: var(--accent-color); }
.stat-item:nth-child(4) { border-left-color: var(--success-color); }

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

.stat-data {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================================================
   6. Auxiliary Diagnostic Visualizer Panel
   ========================================================================== */
.aux-panel {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

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

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

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

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

.aux-canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 740 / 220;
    background: #090e17;
}

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

/* ==========================================================================
   7. Controls Panel: Tabs, Groups & Sliders
   ========================================================================== */
.controls-panel {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    box-shadow: var(--shadow-sm);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.control-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

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

.group-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--primary-light);
    color: var(--primary-hover);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
}

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

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

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

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.6rem 0.8rem;
    background: #f8fafc;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.mode-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

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

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

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

.mode-btn .tab-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    margin-top: 0.15rem;
}

.mode-btn.active .tab-label {
    color: #0369a1;
}

/* Mode Focus Callout Group */
#mode-focus-group {
    background: #f0f9ff;
    border: 1.5px solid #7dd3fc;
    border-radius: var(--radius-md);
    padding: 1.1rem;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.08);
}

#mode-focus-group .group-header h3 {
    color: #0369a1;
}

.mode-focus-badge {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-size: 0.72rem;
}

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

.preset-pill {
    background: #ffffff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.preset-pill:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

/* Control Sliders & Steppers */
.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.82rem;
    font-weight: 700;
    color: var(--primary-hover);
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
}

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

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

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

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

.step-btn {
    width: 30px;
    height: 30px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.step-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

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

.control-actions {
    margin-top: 0.3rem;
}

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

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

/* ==========================================================================
   8. Predict-Observe-Explain (POE) Card
   ========================================================================== */
.poe-card {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 1.15rem;
}

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

.poe-badge {
    align-self: flex-start;
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
}

.poe-header h4 {
    font-size: 0.94rem;
    font-weight: 800;
    color: #92400e;
}

.poe-prompt {
    font-size: 0.84rem;
    color: #78350f;
    line-height: 1.5;
}

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

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

.poe-btn:hover {
    background: #fffdf5;
    border-color: #f59e0b;
}

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

/* ==========================================================================
   9. 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.4rem;
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.45;
}

/* ==========================================================================
   10. Retained Bottom Series Card (Standard 4.2)
   ========================================================================== */
.series-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

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

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

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

/* ==========================================================================
   11. Institutional Admission Callout Card (Standard 4.3)
   ========================================================================== */
.admission-card {
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2.2rem 2.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.4);
    position: relative;
    overflow: hidden;
}

.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: 1.5px solid transparent;
    }
    50% {
        box-shadow: 0 0 25px 6px rgba(251, 191, 36, 0.5);
        border: 1.5px solid rgba(251, 191, 36, 0.8);
    }
    100% {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        border: 1.5px solid transparent;
    }
}

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

.promo-kicker {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #93c5fd;
    font-weight: 800;
}

.promo-lead {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fbbf24;
}

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

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

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

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

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

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

.promo-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

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

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

.promo-button.main-cta:hover {
    background: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(251, 191, 36, 0.4);
}

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

.promo-button.sub-cta:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
}

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

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

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

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