/*
 * Nuclear Size, Composition & Density Bench
 * PlusPhysics — Interactive Nuclear Physics Laboratory (Academic Light Theme)
 *
 * Department of Physics, D B Pampa College, Parumala
 * Dr. Ajith S Kumar (ajithsalimkumar@gmail.com)
 *
 * Standards Compliant: Standards 1 to 24 (Option A Responsive & Academic Light Theme)
 */

/* ==========================================================================
   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-medium: #cbd5e1;
    --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;     /* Stability emerald green */
    --accent-sky: #0284c7;         /* High-contrast royal sky / Cobalt blue */
    --accent-crimson: #ef4444;     /* Proton crimson red */
    --accent-amber: #d97706;       /* Amber warning / decay */
    --accent-purple: #7c3aed;      /* Heavy alpha emitter purple */

    --proton-color: #ef4444;       /* Crimson Red */
    --neutron-color: #0284c7;      /* Cobalt Blue (User & Sim 4 Standard) */

    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --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);
    --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   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 {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* MathJax Dual-Rule Architecture (Standard 11) */
.math-display,
.formula-block {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-width: 100% !important;
    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);
    box-sizing: border-box;
}

.math-display mjx-container,
.formula-block mjx-container,
mjx-container[display="true"] {
    display: block !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    margin: 0.4rem auto !important;
    text-align: center;
}

mjx-container:not([display="true"]) {
    display: inline-block !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    vertical-align: middle !important;
}

/* ==========================================================================
   3. APP CONTAINER & MASTER LAYOUT
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 3.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

/* ==========================================================================
   4. TOP NAVIGATION (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);
    gap: 1rem;
    box-shadow: var(--shadow-panel);
}

.nav-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.nav-home-btn:hover {
    color: var(--accent-sky);
}

.brand-physics {
    color: var(--accent-sky);
    font-weight: 700;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-pill-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.nav-dept-tag {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================================================
   5. SERIES MODAL DIALOG (STANDARD 4.1 & 19: OUTSIDE CONTAINER)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.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 45px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.modal-header {
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem 1.4rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
}

.modal-footer {
    padding: 0.85rem 1.4rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    background: #f8fafc;
}

.btn-modal-dismiss {
    padding: 0.5rem 1.25rem;
    background: var(--accent-sky);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-modal-dismiss:hover {
    background: #0369a1;
}

/* ==========================================================================
   6. SIMULATION HEADER (STANDARD 22: ZERO HEADER BADGE ROWS)
   ========================================================================== */
.sim-header {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
}

.sim-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.sim-subtitle {
    font-size: 0.98rem;
    color: var(--text-secondary);
    max-width: 860px;
    margin: 0 auto;
    line-height: 1.55;
}

/* ==========================================================================
   7. MODE SELECTOR BAR (STANDARD 17)
   ========================================================================== */
.mode-tabs-wrapper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    background: var(--bg-panel);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
}

.mode-tab:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
    color: var(--text-primary);
}

.mode-tab.active {
    background: #ffffff;
    border-color: var(--accent-sky);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
    color: var(--text-primary);
}

.tab-index {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-sky);
    background: #e0f2fe;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.tab-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
}

/* ==========================================================================
   8. DUAL-COLUMN LAYOUT (OPTION A RESPONSIVE)
   ========================================================================== */
.sim-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 1.25rem;
    align-items: start;
}

/* Left Column: Visualizer & Graphs */
.visualizer-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-panel);
    overflow: hidden;
}

/* Primary 3D Viewport Wrapper */
.viewport-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 380px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

#main-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    cursor: grab;
}

#main-canvas:active {
    cursor: grabbing;
}

/* HUD Overlay Chips (Standard 21) */
.viewport-hud-overlay {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
    gap: 0.5rem;
}

.hud-chip {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.hud-chip.status-indicator {
    color: var(--accent-sky);
    font-family: var(--font-mono);
}

/* Invariant Telemetry Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f1f5f9;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: #ffffff;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    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-crimson {
    color: var(--accent-crimson);
}

/* Auxiliary 2D Viewport Wrapper */
.aux-viewport-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.aux-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aux-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.aux-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-sky);
    background: #e0f2fe;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
}

#aux-canvas {
    width: 100% !important;
    height: 135px !important;
    display: block;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    cursor: crosshair;
}

/* ==========================================================================
   9. CONTROLS PANEL & COMMON INPUTS
   ========================================================================== */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-panel);
}

.mode-control-group {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.controls-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.75rem;
}

.control-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-sky);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.controls-header h4 {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Control Rows & Range Sliders */
.control-row {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.val-display {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-sky);
    font-size: 0.88rem;
}

.stepper-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    flex-shrink: 0;
}

.step-btn:hover {
    background: #e2e8f0;
    border-color: var(--border-focus);
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-sky);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Preset Pill Grids */
.preset-pill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.45rem;
}

.preset-pill {
    padding: 0.45rem 0.65rem;
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.preset-pill:hover {
    background: #f1f5f9;
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.preset-pill.active {
    background: #e0f2fe;
    color: var(--accent-sky);
    border-color: var(--accent-sky);
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.12);
}

/* Category Filter Bar */
.category-filter-bar {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.category-pill {
    padding: 0.35rem 0.7rem;
    background: #f1f5f9;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.category-pill:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.category-pill.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

/* Visual Layer Toggles Grid */
.toggles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.toggle-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.toggle-chip:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.toggle-chip input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-sky);
    cursor: pointer;
}

/* Physics Cards */
.physics-card {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.p-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.p-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.p-item {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.p-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.p-val {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.p-val.highlight-emerald {
    color: var(--accent-emerald);
}

.p-val.highlight-amber {
    color: var(--accent-amber);
}

.p-verdict {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.density-badge-box {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-sm);
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.2rem;
}

.density-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #065f46;
    letter-spacing: 0.04em;
}

.density-stat {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 800;
    color: #059669;
}

.density-sub {
    font-size: 0.74rem;
    color: #047857;
    font-weight: 500;
}

/* Control Hint */
.control-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
    background: #f1f5f9;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-sky);
}

/* Action Button (e.g. Decay Trigger) */
.btn-action-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.btn-action-primary:hover {
    background: #0369a1;
    transform: translateY(-1px);
}

.btn-action-primary:active {
    transform: translateY(0);
}

.btn-action-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.85rem;
    background: #f1f5f9;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-action-secondary:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

/* Global Runtime Controls */
.global-runtime-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
}

.runtime-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.btn-runtime {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-runtime.primary {
    background: var(--accent-sky);
    color: #ffffff;
    border: none;
}

.btn-runtime.primary:hover {
    background: #0369a1;
}

.btn-runtime.secondary {
    background: #f1f5f9;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.btn-runtime.secondary:hover {
    background: #e2e8f0;
}

.speed-control-row {
    margin-top: 0.25rem;
}

/* ==========================================================================
   10. PREDICT-OBSERVE-EXPLAIN (POE) CHALLENGE CARD (STANDARD 12)
   ========================================================================== */
.poe-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow-panel);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.poe-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.poe-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-amber);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.poe-header h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.poe-question {
    font-size: 0.98rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.poe-options {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.poe-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.poe-option:hover {
    background: #f1f5f9;
    border-color: var(--border-focus);
}

.poe-option input[type="radio"] {
    accent-color: var(--accent-sky);
    width: 18px;
    height: 18px;
}

.poe-option-text {
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.poe-actions {
    display: flex;
    gap: 0.75rem;
}

.poe-check-btn {
    padding: 0.65rem 1.4rem;
    background: var(--accent-sky);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.poe-check-btn:hover {
    background: #0369a1;
}

.poe-reset-btn {
    padding: 0.65rem 1.2rem;
    background: #f1f5f9;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
}

.poe-reset-btn:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.poe-feedback {
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    line-height: 1.5;
}

.poe-feedback.feedback-correct {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.poe-feedback.feedback-incorrect {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.poe-feedback.feedback-neutral {
    background: #f1f5f9;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

/* ==========================================================================
   11. FOUNDATIONAL THEORY SECTION (STANDARD 13)
   ========================================================================== */
.theory-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.theory-header {
    text-align: center;
}

.section-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-sky);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.theory-header h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0.25rem 0 0.4rem;
}

.theory-header p {
    font-size: 0.96rem;
    color: var(--text-secondary);
}

.theory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.25rem;
}

.theory-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.theory-card h3 {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-primary);
}

.theory-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.theory-card ul {
    padding-left: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    line-height: 1.5;
}

/* Series Overview Card */
.series-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.series-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.series-tagline {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--accent-sky);
    font-weight: 500;
}

.series-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ==========================================================================
   12. INSTITUTIONAL ADMISSION CALLOUT (STANDARD 4.3)
   ========================================================================== */
.admission-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 2px solid #fbbf24;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

.attention-flash {
    animation: borderPulse 3s infinite ease-in-out;
}

@keyframes borderPulse {
    0%, 100% { border-color: #fbbf24; box-shadow: 0 0 15px rgba(251, 191, 36, 0.2); }
    50% { border-color: #f59e0b; box-shadow: 0 0 25px rgba(245, 158, 11, 0.45); }
}

.promo-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.promo-kicker {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.promo-lead {
    font-size: 0.95rem;
    color: #cbd5e1;
}

.promo-headline {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.program-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.program-card strong {
    font-size: 0.96rem;
    color: #ffffff;
}

.program-card span {
    font-size: 0.82rem;
    color: #94a3b8;
}

.program-card small {
    font-size: 0.74rem;
    color: #fbbf24;
    font-weight: 600;
}

.promo-actions {
    display: flex;
    gap: 0.75rem;
}

.promo-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
}

.promo-button.main-cta {
    background: #fbbf24;
    color: #0f172a;
}

.promo-button.main-cta:hover {
    background: #f59e0b;
}

.promo-button.sub-cta {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.promo-button.sub-cta:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Modal Admission Override */
.modal-admission {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border: 1px solid #fbbf24 !important;
    border-radius: var(--radius-md) !important;
    padding: 0.85rem 1.15rem !important;
    gap: 0.55rem !important;
}

/* ==========================================================================
   13. FEEDBACK CHANNEL & FOOTER (STANDARDS 4.4 & 4.5)
   ========================================================================= */
.feedback-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
}

.feedback-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.feedback-icon {
    color: var(--accent-sky);
    flex-shrink: 0;
}

.feedback-text h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.feedback-text p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.feedback-btn {
    padding: 0.55rem 1.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.feedback-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
    color: var(--accent-sky);
}

.series-footer {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    font-size: 0.84rem;
    color: var(--text-muted);
}

/* ==========================================================================
   14. RESPONSIVE DESIGN (STANDARDS 16, 21)
   ========================================================================== */
@media (max-width: 1080px) {
    .sim-layout {
        grid-template-columns: 1fr;
    }

    .mode-tabs-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem 0.75rem 2.5rem;
    }

    .sim-title {
        font-size: 1.45rem;
    }

    .mode-tabs-wrapper {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .theory-grid {
        grid-template-columns: 1fr;
    }

    .feedback-card {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Standard 21: Mode Chip Hidden on Mobile */
    .hud-chip.mode-indicator {
        display: none !important;
    }
}


/* ==================== 3-MINUTE INVESTIGATION CARD (Standard 26) ==================== */
.c-mission-card {
  background: #ffffff;
  border: 1.5px solid #0284c7;
  border-radius: 16px;
  padding: 1rem 1.15rem;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.c-mission-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 50%, #f59e0b 100%);
}
.c-mission-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.c-mission-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.c-mission-icon { font-size: 1.1rem; }
.c-mission-title-wrap h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0b1329;
  margin: 0;
}
.c-mission-step-counter {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0284c7;
  background: #e0f2fe;
  padding: 2px 7px;
  border-radius: 999px;
}
.c-mission-toggle-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.c-mission-toggle-btn:hover { background: #f1f5f9; color: #0b1329; }
.c-mission-card.is-collapsed .c-mission-chevron { transform: rotate(180deg); }
.c-mission-collapsed-summary {
  display: none;
  font-size: 0.82rem;
  color: #475569;
  cursor: pointer;
  padding: 0.2rem 0;
}
.c-mission-card.is-collapsed .c-mission-collapsed-summary { display: block; }
.c-mission-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.c-mission-card.is-collapsed .c-mission-body { display: none; }
.c-mission-steps-nav {
  display: flex;
  gap: 0.4rem;
  width: 100%;
}
.c-mission-step-btn {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 4px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.c-mission-step-btn.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0284c7;
}
.c-mission-step-btn.done {
  border-color: #10b981;
  color: #059669;
}
.c-step-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #fff;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.c-mission-step-btn.active .c-step-dot { background: #0284c7; }
.c-mission-step-btn.done .c-step-dot { background: #10b981; }
.c-mission-content-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem;
}
.c-mission-meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.c-mission-type-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #0284c7;
  text-transform: uppercase;
}
.c-mission-mode-indicator {
  font-size: 0.7rem;
  color: #64748b;
}
.c-mission-instruction {
  font-size: 0.84rem;
  line-height: 1.45;
  color: #1e293b;
  margin-bottom: 0.45rem;
}
.c-mission-observe {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #475569;
  background: #ffffff;
  border-left: 3px solid #0284c7;
  padding: 0.45rem 0.65rem;
  border-radius: 0 6px 6px 0;
}
.c-mission-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.65rem;
}
.c-btn-mission-done {
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.c-btn-mission-done:hover { background: #0369a1; }
.c-mission-time-tag {
  font-size: 0.72rem;
  color: #94a3b8;
}
.c-mission-congrats {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}
.c-mission-congrats h4 {
  margin: 0 0 0.3rem 0;
  color: #065f46;
  font-size: 0.95rem;
}
.c-mission-congrats p {
  margin: 0 0 0.75rem 0;
  color: #047857;
  font-size: 0.82rem;
}
.c-btn-mission-restart {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

/* ==================== PROGRESSIVE DISCLOSURE ACCORDIONS (Standard 27) ==================== */
.is-collapsible {
  background: #ffffff;
  border: 1px solid #E2E6EE;
  border-radius: 16px;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.is-collapsible:hover { border-color: #CBD5E1; }
.is-collapsible.is-open { box-shadow: 0 4px 14px rgba(11, 19, 41, 0.04); }
.accordion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
  cursor: pointer;
  user-select: none;
  background: #ffffff;
  transition: background 0.15s;
}
.accordion-head:hover { background: #F8FAFC; }
.accordion-head-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}
.accordion-icon { font-size: 1.5rem; line-height: 1; flex: none; }
.accordion-title-wrap { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.accordion-head h2, .accordion-head h3 {
  font-family: var(--font-display, inherit);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-color, #0B1329);
  margin: 0;
  line-height: 1.25;
}
.accordion-subtext { font-size: 0.82rem; color: #64748B; display: block; }
.accordion-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  flex: none;
  pointer-events: none;
}
.accordion-head:hover .accordion-toggle-btn { background: #0B1329; color: #FFFFFF; border-color: #0B1329; }
.accordion-chevron { width: 16px; height: 16px; transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.is-collapsible.is-open .accordion-chevron { transform: rotate(180deg); }
.accordion-content { padding: 1.25rem 1.4rem 1.4rem 1.4rem; border-top: 1px solid #F1F5F9; }
.accordion-content[hidden] { display: none !important; }
.poe-box { background: #F0F7FF; border-color: #BAE6FD; }
.poe-box .accordion-head { background: #F0F7FF; }
.poe-box .accordion-head:hover { background: #E0F2FE; }
.poe-box .accordion-head h3 { color: #0369A1; }
.poe-box .accordion-subtext { color: #0284C7; }
.poe-box .accordion-toggle-btn { background: #E0F2FE; color: #0369A1; border-color: #BAE6FD; }
.poe-box .accordion-head:hover .accordion-toggle-btn { background: #0284C7; color: #FFFFFF; border-color: #0284C7; }
