/* =========================================================
   Huygens' Principle & Wavefront Propagation — Stylesheet
   Department of Physics, D B Pampa College, Parumala
   Adheres to Antigravity Engineering Guidelines & AGENTS.md
   Mobile-First Option A Architecture (Zero Horizontal Overflow)
   ========================================================= */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-cyan: #38bdf8;
    --accent-purple: #c084fc;
    --bg-color: #f1f5f9;
    --panel-bg: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

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

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    padding: 1.25rem;
}

@media (max-width: 680px) {
    body {
        padding: 0.65rem 0.5rem;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    width: 100%;
    box-sizing: border-box;
}

/* =========================================================
   TOP NAVIGATION & HEADER
   ========================================================= */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 0.65rem 1.15rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    width: 100%;
    box-sizing: border-box;
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .top-nav {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    .nav-dept-tag {
        font-size: 0.75rem;
        text-align: right;
        line-height: 1.25;
    }
}

.nav-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    transition: all 0.2s ease;
    touch-action: manipulation;
    flex-shrink: 0;
}

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

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

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

@media (max-width: 680px) {
    header h1 {
        font-size: 1.35rem;
    }
}

header p {
    font-size: 0.95rem;
    color: #475569;
    max-width: 960px;
    line-height: 1.55;
    word-break: break-word;
}

/* =========================================================
   SERIES CARD & POE CARD
   ========================================================= */
.series-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 0.85rem 1.15rem;
    width: 100%;
    box-sizing: border-box;
}

.series-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.2rem;
}

.series-tagline {
    font-size: 0.82rem;
    font-style: italic;
    color: var(--primary-color);
    margin-bottom: 0.35rem;
}

.series-card p {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.45;
}

.poe-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 0.85rem 1.15rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

.poe-badge {
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.poe-text {
    font-size: 0.86rem;
    color: #1e3a8a;
    line-height: 1.45;
    word-break: break-word;
    min-width: 0;
}

/* =========================================================
   MAIN SIMULATION LAYOUT (Option A Responsive Standard)
   ========================================================= */
/* Mobile First: Visualizer is first, controls unrolled beneath */
.sim-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    box-sizing: border-box;
}

.visualizer-panel {
    order: 1;
    width: 100%;
    box-sizing: border-box;
}

.controls-panel {
    order: 2;
    width: 100%;
    max-height: none;
    overflow-y: visible;
    box-sizing: border-box;
}

/* Engage 2-column layout ONLY on desktop screens with ample width (>= 1100px) */
@media (min-width: 1100px) {
    .sim-layout {
        display: grid;
        grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
        gap: 1.25rem;
        align-items: start;
    }
    .visualizer-panel {
        order: 2;
    }
    .controls-panel {
        order: 1;
    }
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

@media (max-width: 680px) {
    .panel {
        padding: 0.85rem 0.75rem;
        border-radius: 10px;
    }
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.visualizer-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* =========================================================
   CONTROL GROUPS & MODE BUTTONS
   ========================================================= */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    width: 100%;
    box-sizing: border-box;
}

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

.group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mode-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

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

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

.mode-goal-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid var(--accent-emerald);
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
    font-size: 0.84rem;
    color: #166534;
    line-height: 1.45;
    width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

/* Button Grids */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.geom-btn-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.35rem;
}

.regime-btn-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.35rem;
}

@media (max-width: 540px) {
    .action-grid,
    .geom-btn-grid,
    .regime-btn-grid {
        grid-template-columns: 1fr;
    }
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.2s ease;
    min-height: 42px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    white-space: normal;
    word-break: break-word;
}

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

.action-btn.secondary {
    background: #f8fafc;
    color: #1e293b;
    border-color: var(--border-color);
}

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

.action-btn.playing {
    background: #dc2626;
    border-color: #b91c1c;
    color: #ffffff;
}

/* =========================================================
   COMPOSITE SLIDERS & STEPPERS (2-Line Flex-Wrap Standard)
   ========================================================= */
.slider-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    width: 100%;
    box-sizing: border-box;
}

.slider-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
}

.slider-header-row label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    min-width: 0;
    word-break: break-word;
}

.stat-badge {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: #1d4ed8;
    background: #eff6ff;
    padding: 0.18rem 0.55rem;
    border-radius: 5px;
    border: 1px solid #bfdbfe;
    white-space: nowrap;
    flex-shrink: 0;
}

.stepper-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.stepper-container input[type="range"] {
    flex: 1;
    min-width: 0;
    width: 0;
    height: 7px;
    border-radius: 4px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.step-btn {
    width: 44px;
    height: 40px;
    min-width: 44px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #334155;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

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

@media (max-width: 680px) {
    .slider-row {
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        gap: 0.35rem 0.5rem;
        margin-bottom: 0.85rem;
        align-items: center;
    }
    .slider-header-row {
        flex: 0 0 100%;
    }
    .stepper-container {
        flex: 0 0 100%;
        width: 100%;
    }
}

/* =========================================================
   CHECKBOXES & TOGGLES
   ========================================================= */
.toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .toggle-grid {
        grid-template-columns: 1fr;
    }
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    min-width: 0;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-container span {
    min-width: 0;
    word-break: break-word;
}

/* =========================================================
   CURATED BENCHMARK PRESET PILLS
   ========================================================= */
.preset-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    width: 100%;
    box-sizing: border-box;
}

.preset-pill {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.2s ease;
    white-space: normal;
    text-align: left;
    max-width: 100%;
    word-break: break-word;
}

.preset-pill:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
}

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

/* =========================================================
   CALCULATIONS / TELEMETRY CARD
   ========================================================= */
.calc-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
    box-sizing: border-box;
}

.calc-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e2e8f0;
    gap: 0.35rem 0.5rem;
}

.calc-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.calc-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary-color);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    max-width: 100%;
    word-break: break-word;
}

.calc-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.82rem;
    gap: 0.2rem 0.5rem;
    width: 100%;
}

.calc-lbl {
    color: var(--text-muted);
    font-weight: 500;
    min-width: 0;
}

.calc-val {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-color);
    text-align: right;
    word-break: break-word;
}

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

.calc-val.danger {
    color: #dc2626;
}

/* Theory Insight Box */
.concept-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
    box-sizing: border-box;
}

.concept-card h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #166534;
}

.concept-card p {
    font-size: 0.82rem;
    color: #166534;
    line-height: 1.5;
    word-break: break-word;
}

/* =========================================================
   TOP STATS BAR (VISUALIZER PANEL)
   ========================================================= */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1099px) {
    .stats-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
    }
}

.stat-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.stat-value {
    font-size: 1rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.stat-value.highlight {
    color: var(--accent-emerald);
}

.stat-value.danger {
    color: #dc2626;
}

.stat-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* =========================================================
   OPTICAL BENCH CANVAS CONTAINER & IN-CANVAS HUD
   ========================================================= */
.canvas-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 380px;
    max-height: 520px;
    border-radius: 10px;
    overflow: hidden;
    background: #060911;
    border: 1px solid #1e293b;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .canvas-container {
        aspect-ratio: auto;
        height: 360px;
        min-height: 320px;
        max-height: 55vh;
    }
}

@media (max-width: 480px) {
    .canvas-container {
        height: 320px;
        min-height: 280px;
    }
}

#wavefront-canvas,
#sim-canvas,
.canvas-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* In-Canvas Telemetry HUD ($2x2 on Mobile per Standards Section 2.4) */
.voltmeter-hud {
    position: absolute;
    top: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    background: rgba(15, 23, 42, 0.90);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    pointer-events: none;
    z-index: 10;
    box-sizing: border-box;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    min-width: 0;
}

.hud-label {
    font-size: 0.62rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.1;
}

.hud-val {
    font-size: 0.80rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    line-height: 1.2;
}

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

.hud-val.danger {
    color: #f87171;
}

.hud-divider {
    display: none;
}

/* Canvas Viewport Legend docked per Standards Section 2.3 */
.viewport-legend {
    position: absolute;
    top: 10px;
    right: 10px;
    max-width: calc(100% - 20px);
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    pointer-events: none;
    z-index: 10;
    box-sizing: border-box;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    color: #e2e8f0;
    font-weight: 500;
    white-space: nowrap;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .viewport-legend {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        padding: 5px 8px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px 10px;
        justify-content: center;
        background: rgba(8, 12, 20, 0.95);
    }
    .legend-item {
        font-size: 0.65rem;
        gap: 4px;
    }
    .voltmeter-hud {
        top: 6px;
        left: 6px;
        right: 6px;
        max-width: calc(100% - 12px);
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.3rem 0.5rem;
        padding: 0.35rem 0.55rem;
    }
    .voltmeter-hud .hud-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.1rem;
        min-width: 0;
    }
    .voltmeter-hud .hud-item:last-child {
        grid-column: 1 / -1;
    }
    .hud-label {
        font-size: 0.58rem;
    }
    .hud-val {
        font-size: 0.72rem;
    }
}

/* =========================================================
   AUXILIARY SUBPLOTS
   ========================================================= */
.graphs-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .graphs-row {
        grid-template-columns: 1fr;
    }
}

.graph-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

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

.graph-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    min-width: 0;
    word-break: break-word;
}

.graph-legend {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
}

.graph-canvas {
    width: 100%;
    height: 105px;
    background: #04060a;
    border-radius: 6px;
    display: block;
}

/* =========================================================
   INSTITUTIONAL ADMISSION CALLOUT & FEEDBACK
   ========================================================= */
.admission-card { 
    background: linear-gradient(135deg, #1e3a8a, #0f172a); 
    color: #ffffff; 
    border-radius: 12px; 
    padding: 1.25rem 1.5rem; 
    margin-top: 1.25rem; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); 
    display: flex; 
    flex-direction: column; 
    gap: 1.25rem; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    width: 100%;
    box-sizing: border-box;
} 

.promo-copy { display: flex; flex-direction: column; gap: 0.25rem; width: 100%; } 
.promo-kicker { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: #93c5fd; } 
.promo-lead { font-size: 1.25rem; font-weight: 700; color: #ffffff; line-height: 1.2; } 
.promo-headline { font-size: 1rem; color: #cbd5e1; font-weight: 500; } 

.program-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 0.85rem; 
    width: 100%;
    box-sizing: border-box;
} 

@media (max-width: 480px) {
    .program-grid {
        grid-template-columns: 1fr;
    }
}

.program-card { 
    background: rgba(255, 255, 255, 0.05); 
    padding: 0.75rem 1rem; 
    border-radius: 8px; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    font-size: 0.85rem; 
    display: flex; 
    flex-direction: column; 
    gap: 0.2rem; 
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
} 

.program-card strong { color: #fcd34d; font-size: 0.95rem; } 
.program-card span { color: #e2e8f0; } 
.program-card small { color: #94a3b8; font-style: italic; } 

.promo-actions { 
    display: flex; 
    flex-direction: column; 
    gap: 0.5rem; 
    width: 100%;
    box-sizing: border-box;
} 

@media (min-width: 681px) {
    .promo-actions {
        flex-direction: row;
        width: auto;
    }
} 

.promo-button { 
    padding: 0.65rem 1.2rem; 
    border-radius: 6px; 
    font-weight: 700; 
    text-decoration: none; 
    transition: all 0.2s ease; 
    text-align: center; 
    font-size: 0.9rem; 
    min-height: 44px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    touch-action: manipulation; 
    box-sizing: border-box;
} 

.main-cta { background-color: #fbbf24; color: #0f172a; } 
.main-cta:hover { background-color: #f59e0b; transform: translateY(-1px); } 

.sub-cta { background-color: transparent; color: #e2e8f0; border: 1px solid rgba(255, 255, 255, 0.3); } 
.sub-cta:hover { background-color: rgba(255, 255, 255, 0.1); color: #fff; border-color: #fff; } 

.feedback-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 800px) {
    .feedback-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.15rem;
    }
    .feedback-btn {
        width: 100%;
        text-align: center;
    }
}

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

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

.feedback-text h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.2rem;
}

.feedback-text p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.feedback-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.15rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--primary-color);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 44px;
    touch-action: manipulation;
    flex-shrink: 0;
}

.feedback-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: var(--primary-hover);
}

.series-footer { 
    text-align: center; 
    padding: 1.25rem 0 0.5rem; 
    border-top: 1px solid #e5e7eb; 
    margin-top: 1.25rem; 
    width: 100%;
} 

.series-footer p { 
    font-size: 0.82rem; 
    color: var(--text-muted); 
    font-weight: 500; 
}

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