/*
 * Radioactive Decay Laws & Nuclear Disintegration Chains
 * PlusPhysics — Interactive Nuclear Physics Laboratory (Light Theme)
 *
 * Department of Physics, D B Pampa College, Parumala
 * Dr. Ajith S Kumar (ajithsalimkumar@gmail.com)
 *
 * Standards Compliant: Standards 1 to 24
 */

/* ==========================================================================
   1. CSS VARIABLES & THEME DEFINITION (ACADEMIC LIGHT THEME)
   ========================================================================== */
:root {
    --bg-main: #f8fafc;           /* Clean soft light slate background */
    --bg-panel: #ffffff;          /* Crisp pure white panel */
    --bg-card: #f8fafc;           /* Subtle card background */
    --bg-card-hover: #f1f5f9;
    --bg-input: #ffffff;

    --border-subtle: #e2e8f0;      /* Soft elegant border */
    --border-focus: #0284c7;       /* Royal sky blue */
    --border-accent: #6366f1;

    --text-primary: #0f172a;       /* Deep slate / navy text */
    --text-secondary: #475569;     /* Medium slate text */
    --text-muted: #64748b;         /* Muted caption text */

    --accent-emerald: #059669;     /* Radioactive emerald green (decay active) */
    --accent-sky: #0284c7;         /* High-contrast royal sky */
    --accent-crimson: #dc2626;     /* Alpha radiation crimson */
    --accent-amber: #d97706;       /* Activity amber */
    --accent-purple: #7c3aed;      /* Gamma radiation violet */

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, monospace;

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

    --shadow-panel: 0 4px 20px rgba(15, 23, 42, 0.06);
    --shadow-card: 0 2px 10px rgba(15, 23, 42, 0.04);
}

/* ==========================================================================
   2. GLOBAL RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 2rem;
}

.container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    min-width: 0;
    box-sizing: border-box;
}

/* MathJax Custom Dual Rule */
mjx-container:not([display="true"]) {
    display: inline-block !important;
    vertical-align: middle;
    margin: 0 0.15em;
    color: var(--text-primary);
}

.math-display {
    overflow-x: auto;
    max-width: 100%;
    margin: 0.85rem 0;
    padding: 0.65rem 0.85rem;
    background: #f1f5f9;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.math-display mjx-container {
    display: block !important;
    text-align: center;
}

/* ==========================================================================
   3. TOP NAVIGATION BAR (STANDARD 4.1)
   ========================================================================== */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    gap: 1rem;
    box-shadow: var(--shadow-panel);
}

.nav-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-sky);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: color 0.2s, transform 0.2s;
}

.nav-home-btn:hover {
    color: var(--text-primary);
    transform: translateX(-2px);
}

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

.nav-pill-btn {
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(2, 132, 199, 0.25);
    color: var(--accent-sky);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.nav-pill-btn:hover {
    background: rgba(2, 132, 199, 0.16);
    border-color: var(--accent-sky);
    transform: translateY(-1px);
}

.nav-dept-tag {
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ==========================================================================
   4. MODAL DIALOG & OPTION A ADMISSION CALLOUT (STANDARD 4.1 & 19)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

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

.modal-window {
    position: relative;
    z-index: 10000;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

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

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

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    touch-action: manipulation;
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

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

/* Institutional Admission Card (Light Theme Golden-Amber Gradient) */
.admission-card {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1.5px solid #f59e0b;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

.promo-kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #b45309;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.promo-lead {
    font-size: 0.92rem;
    color: #78350f;
}

.promo-headline {
    font-size: 1.2rem;
    font-weight: 700;
    color: #451a03;
    margin-bottom: 0.85rem;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    min-width: 0;
}

.program-card {
    background: #ffffff;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.08);
}

.program-card strong {
    color: #1e293b;
    font-size: 0.92rem;
}

.program-card span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

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

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

.promo-button {
    flex: 1;
    text-align: center;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.promo-button.main-cta {
    background: #d97706;
    color: #ffffff;
}

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

.promo-button.sub-cta {
    background: #ffffff;
    color: #92400e;
    border: 1px solid #d97706;
}

.promo-button.sub-cta:hover {
    background: #fef3c7;
}

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

.btn-modal-dismiss {
    background: #0284c7;
    color: #ffffff;
    border: none;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.2s;
}

.btn-modal-dismiss:hover {
    background: #0369a1;
}

/* ==========================================================================
   5. SIMULATION HEADER (STANDARD 22: CLEAN HEADER ARCHITECTURE)
   ========================================================================== */
.sim-header {
    margin-bottom: 1.5rem;
}

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

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

/* ==========================================================================
   6. MODE SELECTOR BAR (STANDARD 17)
   ========================================================================== */
.mode-tabs-wrapper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    background: var(--bg-panel);
    padding: 0.6rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-panel);
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    touch-action: manipulation;
}

.mode-tab:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.03);
}

.mode-tab.active {
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.35);
    color: var(--accent-sky);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.1);
}

.tab-index {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 4px;
    color: inherit;
}

.tab-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   7. MAIN SIMULATION DUAL COLUMN LAYOUT
   ========================================================================== */
.sim-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    align-items: start;
}

/* Left Column: Visualizer Panel */
.visualizer-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.viewport-wrapper {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 740 / 460;
    box-shadow: var(--shadow-panel);
}

#main-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: #ffffff;
}

/* Floating HUD Chips (Standard 21) */
.viewport-hud-overlay {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.hud-chip {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.hud-chip.mode-indicator {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(2, 132, 199, 0.35);
    color: var(--accent-sky);
}

.hud-chip.status-indicator {
    background: rgba(236, 253, 245, 0.95);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #047857;
}

/* Telemetry Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    background: var(--bg-panel);
    padding: 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-panel);
}

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

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    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);
}

/* Secondary Auxiliary Viewport */
.aux-viewport-wrapper {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem 0.6rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow-panel);
}

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

.aux-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.aux-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(2, 132, 199, 0.25);
    color: var(--accent-sky);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

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

/* Right Column: Controls Panel */
.controls-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
    box-shadow: var(--shadow-panel);
}

.controls-header {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.85rem;
}

.control-badge {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    color: var(--accent-sky);
    letter-spacing: 0.08em;
}

.controls-header h4 {
    font-size: 1.15rem;
    color: var(--text-primary);
}

/* Controls Rows, Sliders & Steppers */
.control-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.val-display {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-sky);
}

.stepper-container {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

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

.step-btn:hover {
    background: rgba(2, 132, 199, 0.1);
    border-color: var(--accent-sky);
    color: var(--accent-sky);
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    outline: none;
    border: 1px solid #cbd5e1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-sky);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
    border: 2px solid #ffffff;
    transition: transform 0.1s;
}

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

/* Preset Pills */
.preset-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.preset-pill {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.preset-pill:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.preset-pill.active {
    background: rgba(2, 132, 199, 0.08);
    border-color: var(--accent-sky);
    color: var(--accent-sky);
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.12);
}

/* Toggles Grid */
.toggles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.toggle-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-chip:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.toggle-chip input[type="checkbox"] {
    accent-color: var(--accent-sky);
}

/* Live Detector Hit Counters in Mode 3 */
.hit-counters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.hit-chip {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.45rem 0.6rem;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
}

.hit-chip.alpha { border-left: 3px solid #dc2626; color: #b91c1c; }
.hit-chip.beta { border-left: 3px solid #0284c7; color: #0369a1; }
.hit-chip.gamma { border-left: 3px solid #7c3aed; color: #6d28d9; }

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

/* Physics Cards */
.physics-card {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

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

.p-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    min-width: 0;
}

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

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

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

.p-val.highlight {
    color: var(--accent-sky);
}

.p-val.highlight-emerald {
    color: var(--accent-emerald);
}

.p-val.highlight-amber {
    color: var(--accent-amber);
}

.p-val.highlight-crimson {
    color: var(--accent-crimson);
}

.p-val.highlight-purple {
    color: var(--accent-purple);
}

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

.control-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Stepper Row in Mode 2 */
.half-life-steppers-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

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

.half-life-pills {
    margin-bottom: 0.5rem;
}

/* Global Runtime Controls */
.global-runtime-controls {
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.runtime-buttons-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    min-width: 0;
}

.btn-runtime {
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.btn-runtime.primary {
    background: #0284c7;
    border: none;
    color: #ffffff;
}

.btn-runtime.primary:hover {
    background: #0369a1;
}

.btn-runtime.primary.paused {
    background: #059669;
}

.btn-runtime.secondary {
    background: #f1f5f9;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.btn-runtime.secondary:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

/* POE Challenge Card (Standard 12) */
.poe-card {
    background: #ffffff;
    border: 1.5px solid #818cf8;
    border-radius: var(--radius-md);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.08);
}

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

.poe-badge {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    color: #4f46e5;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.poe-header h4 {
    font-size: 1.05rem;
    color: var(--text-primary);
}

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

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

.poe-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.poe-option:hover {
    background: #f1f5f9;
    border-color: #818cf8;
}

.poe-option input[type="radio"] {
    margin-top: 0.2rem;
    accent-color: #4f46e5;
}

.poe-option-text {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.poe-actions {
    display: flex;
    gap: 0.65rem;
}

.poe-check-btn {
    flex: 1;
    background: #4f46e5;
    color: #ffffff;
    border: none;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    touch-action: manipulation;
}

.poe-check-btn:hover {
    background: #4338ca;
}

.poe-reset-btn {
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    cursor: pointer;
    touch-action: manipulation;
}

.poe-feedback {
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.55;
    animation: fadeIn 0.3s ease;
}

.feedback-correct {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.feedback-incorrect {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.feedback-neutral {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
}

/* ==========================================================================
   8. DEEP PEDAGOGICAL THEORY SECTION
   ========================================================================== */
.theory-section {
    margin-top: 2rem;
    margin-bottom: 2.5rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 2.5rem;
}

.theory-header {
    text-align: center;
    max-width: 780px;
    margin: 0 auto 2rem auto;
}

.section-badge {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    color: var(--accent-sky);
    letter-spacing: 0.1em;
    font-weight: 700;
}

.theory-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin: 0.4rem 0 0.6rem 0;
}

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

.theory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    min-width: 0;
}

.theory-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow-panel);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

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

.theory-card h3 {
    font-size: 1.15rem;
    color: var(--text-primary);
    line-height: 1.35;
}

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

.theory-card ul, .theory-card ol {
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.theory-card strong {
    color: var(--text-primary);
}

/* ==========================================================================
   9. FEEDBACK CARD & FOOTER (STANDARD 4.4 & 4.5)
   ========================================================================== */
.feedback-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-panel);
}

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

.feedback-icon {
    color: var(--accent-sky);
    flex-shrink: 0;
}

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

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

.feedback-btn {
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(2, 132, 199, 0.25);
    color: var(--accent-sky);
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.feedback-btn:hover {
    background: rgba(2, 132, 199, 0.18);
    border-color: var(--accent-sky);
}

.series-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ==========================================================================
   10. RESPONSIVE BREAKPOINTS (OPTION A MOBILE ARCHITECTURE)
   ========================================================================== */
@media (max-width: 900px) {
    .sim-layout {
        grid-template-columns: 1fr;
    }

    .visualizer-panel {
        order: 1;
    }

    .controls-panel {
        order: 2;
    }

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

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

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

@media (max-width: 600px) {
    .container {
        padding: 0.85rem 0.85rem;
    }

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

    .sim-subtitle {
        font-size: 0.88rem;
    }

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

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

    /* Standard 21: Mode Chip Hidden on Mobile Screens <= 600px */
    #hud-mode-chip {
        display: none !important;
    }

    .stats-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

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

    /* Standard 19 Option A Mobile Modal Priority */
    .modal-admission {
        order: -1 !important;
        flex-shrink: 0 !important;
        min-height: fit-content !important;
        height: auto !important;
        margin-bottom: 0.75rem;
    }

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

    .promo-actions {
        flex-direction: column;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

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