/* ==========================================================================
   NABLEIKR // 99942 APOPHIS OVERPASS COUNTDOWN & 3D ORBITAL SIMULATOR
   AICAP Astrodynamics Telemetry Bar, Top-Layer Modal Dialog, & Range Scrubber
   ========================================================================== */

/* 1. TOP APOPHIS TELEMETRY COUNTDOWN BANNER */
.apophis-countdown-banner {
    position: relative;
    z-index: 16;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 6px 20px;
    background: linear-gradient(
        90deg,
        rgba(14, 8, 12, 0.94) 0%,
        rgba(8, 13, 24, 0.92) 50%,
        rgba(14, 10, 18, 0.94) 100%
    );
    border-bottom: 1px solid color-mix(in srgb, var(--singularity-primary, #ff7a18) 45%, rgba(255, 255, 255, 0.12));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.65), inset 0 -1px 0 rgba(255, 122, 24, 0.18);
    backdrop-filter: blur(12px);
    pointer-events: auto;
    font-family: var(--font-mono, 'Fira Code', monospace);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.apophis-banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.apophis-hazard-beacon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff7a18;
    box-shadow: 0 0 10px #ff7a18, 0 0 20px rgba(255, 122, 24, 0.65);
    animation: apophis-beacon-pulse 1.6s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes apophis-beacon-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.75); }
}

.apophis-banner-tag {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #ffffff;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.apophis-banner-tag strong {
    color: var(--singularity-primary, #ff7a18);
}

.apophis-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399;
}

.apophis-banner-center {
    display: flex;
    align-items: center;
    gap: 12px 18px;
    flex-wrap: wrap;
}

.apophis-countdown-readout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(3, 6, 14, 0.78);
    border: 1px solid rgba(255, 122, 24, 0.36);
    padding: 3px 11px;
    border-radius: 6px;
    box-shadow: inset 0 0 12px rgba(255, 122, 24, 0.1);
}

.apophis-countdown-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #94a3b8;
    text-transform: uppercase;
}

.apophis-countdown-clock {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #fde047;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 10px rgba(253, 224, 71, 0.35);
}

.apophis-telemetry-strip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.66rem;
    color: #cbd5e1;
    font-variant-numeric: tabular-nums;
}

.apophis-telemetry-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.apophis-telemetry-item span {
    color: #64748b;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
}

.apophis-telemetry-item strong {
    color: #38bdf8;
    font-weight: 700;
}

.apophis-telemetry-item strong.orbit-class {
    color: var(--singularity-primary, #ff7a18);
}

.apophis-banner-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.apophis-card-trigger-btn {
    appearance: none;
    border: 1px solid rgba(56, 189, 248, 0.55);
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.28) 0%, rgba(15, 23, 42, 0.85) 100%);
    color: #7dd3fc;
    font-family: var(--font-mono, 'Fira Code', monospace);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.18);
    transition: transform 0.25s ease-out, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.apophis-card-trigger-btn:hover,
.apophis-card-trigger-btn:focus-visible {
    transform: translateY(-1px) scale(1.03);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.35) 0%, rgba(255, 122, 24, 0.28) 100%);
    border-color: #fde047;
    color: #ffffff;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
    outline: none;
}

.apophis-sim-trigger-btn {
    appearance: none;
    border: 1px solid var(--singularity-primary, #ff7a18);
    background: linear-gradient(135deg, rgba(255, 122, 24, 0.24) 0%, rgba(2, 132, 199, 0.24) 100%);
    color: #ffffff;
    font-family: var(--font-mono, 'Fira Code', monospace);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 14px rgba(255, 122, 24, 0.25);
    transition: transform 0.35s ease-out, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    transition-timing-function: var(--spring-easing, ease-out);
    white-space: nowrap;
}

.apophis-sim-trigger-btn:hover,
.apophis-sim-trigger-btn:focus-visible {
    transform: translateY(-1px) scale(1.03);
    background: linear-gradient(135deg, rgba(255, 122, 24, 0.42) 0%, rgba(2, 132, 199, 0.38) 100%);
    box-shadow: 0 0 20px rgba(255, 122, 24, 0.5);
    border-color: #fde047;
    outline: none;
}

/* ==========================================================================
   2. NATIVE <DIALOG> SOLAR SYSTEM & TRAJECTORY SIMULATOR (TOP LAYER)
   ========================================================================== */

.apophis-orrery-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(1140px, 95vw);
    height: min(820px, 92dvh);
    max-width: 95vw;
    max-height: 92dvh;
    padding: 0;
    border: 1px solid var(--singularity-primary, #ff7a18);
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(8, 12, 24, 0.98) 0%, rgba(4, 7, 15, 0.99) 100%);
    color: #f1f5f9;
    box-shadow:
        0 32px 90px rgba(0, 0, 0, 0.95),
        0 0 45px rgba(255, 122, 24, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    font-family: var(--font-mono, 'Fira Code', monospace);
    overflow: hidden;

    /* Base closed state for top-layer discrete transition (animate-to-from-top-layer) */
    opacity: 0;
    transform: scale(0.94) translateY(12px);
    transition-property: opacity, transform, display, overlay;
    transition-duration: 0.3s;
    transition-timing-function: ease-out;
    transition-behavior: allow-discrete;
}

.apophis-orrery-dialog:not([open]) {
    display: none;
}

.apophis-orrery-dialog[open] {
    display: flex;
    flex-direction: column;
}

.apophis-orrery-dialog::backdrop {
    background-color: rgba(2, 4, 10, 0);
    backdrop-filter: blur(0px);
    transition-property: background-color, backdrop-filter, display, overlay;
    transition-duration: 0.3s;
    transition-timing-function: ease-out;
    transition-behavior: allow-discrete;
}

:is(.apophis-orrery-dialog[open]):where(:not([data-closing])) {
    opacity: 1;
    transform: scale(1) translateY(0);

    @starting-style {
        opacity: 0;
        transform: scale(0.94) translateY(12px);
    }

    &::backdrop {
        background-color: rgba(2, 5, 14, 0.82);
        backdrop-filter: blur(8px);

        @starting-style {
            background-color: rgba(2, 4, 10, 0);
            backdrop-filter: blur(0px);
        }
    }
}

/* Dialog Inner Layout */
.apophis-dialog-shell {
    --scrollbar-thumb: color-mix(in srgb, var(--singularity-primary, #ff7a18) 68%, #1e293b);
    --scrollbar-track: #050914;

    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
    user-select: none;
    color-scheme: dark;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    scrollbar-gutter: stable;
}

@media (prefers-contrast: more) {
    .apophis-dialog-shell {
        --scrollbar-thumb: #fde047;
        --scrollbar-track: #000000;
    }
}

@supports not (scrollbar-color: auto) {
    .apophis-dialog-shell::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    .apophis-dialog-shell::-webkit-scrollbar-thumb {
        background: var(--scrollbar-thumb);
        border-radius: 999px;
    }

    .apophis-dialog-shell::-webkit-scrollbar-track {
        background: var(--scrollbar-track);
    }
}

/* Dialog Header */
.apophis-dialog-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(12, 18, 34, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.apophis-dialog-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.apophis-dialog-kicker {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--singularity-primary, #ff7a18);
    text-transform: uppercase;
}

.apophis-dialog-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(0.95rem, 1.6vw, 1.2rem);
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #ffffff;
    margin: 0;
}

.apophis-header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.apophis-view-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 9px;
    background: rgba(4, 7, 15, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.apophis-view-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-family: var(--font-mono, monospace);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.apophis-view-btn:hover {
    color: #ffffff;
}

.apophis-view-btn[aria-pressed="true"] {
    background: var(--singularity-primary, #ff7a18);
    color: #030712;
    box-shadow: 0 0 12px rgba(255, 122, 24, 0.45);
}

.apophis-close-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 34, 68, 0.14);
    color: #f8fafc;
    font-family: var(--font-mono, monospace);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 5px 11px;
    border-radius: 7px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.apophis-close-btn:hover,
.apophis-close-btn:focus-visible {
    background: rgba(255, 34, 68, 0.32);
    border-color: #fb7185;
    outline: none;
}

/* 3D Interactive Canvas Stage */
.apophis-viewport-wrapper {
    position: relative;
    flex: 1 0 clamp(290px, 46dvh, 430px);
    min-height: 290px;
    width: 100%;
    background: radial-gradient(circle at 50% 50%, #091024 0%, #040711 65%, #020307 100%);
    overflow: hidden;
}

#apophis-sim-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
}

#apophis-sim-canvas:active {
    cursor: grabbing;
}

/* Floating Canvas HUD Overlays */
.apophis-canvas-overlay-top {
    position: absolute;
    top: 12px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    pointer-events: none;
    flex-wrap: wrap;
}

.apophis-legend-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 6px 11px;
    border-radius: 8px;
    background: rgba(4, 8, 18, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    font-size: 0.62rem;
    color: #cbd5e1;
}

.apophis-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend-swatch {
    width: 10px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
}

.legend-swatch.aten {
    background: #ff7a18;
    box-shadow: 0 0 6px #ff7a18;
}

.legend-swatch.apollo {
    background: repeating-linear-gradient(90deg, #f43f5e 0 4px, transparent 4px 7px);
}

.legend-swatch.earth {
    background: #38bdf8;
    box-shadow: 0 0 6px #38bdf8;
}

.legend-swatch.geo {
    background: #34d399;
}

.apophis-cam-controls {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(4, 8, 18, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 4px;
    border-radius: 8px;
    pointer-events: auto;
    backdrop-filter: blur(8px);
}

.apophis-cam-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.8);
    color: #e2e8f0;
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.apophis-cam-btn:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    color: #ffffff;
}

.apophis-canvas-hint {
    position: absolute;
    bottom: 10px;
    left: 14px;
    padding: 4px 9px;
    border-radius: 6px;
    background: rgba(4, 8, 18, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.6rem;
    color: #94a3b8;
    pointer-events: none;
    letter-spacing: 0.05em;
}

/* Close-Approach Alert Banner inside Canvas */
.apophis-encounter-banner {
    position: absolute;
    bottom: 10px;
    right: 14px;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(56, 189, 248, 0.45);
    font-size: 0.64rem;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.06em;
    pointer-events: none;
    backdrop-filter: blur(6px);
}

.apophis-encounter-banner.perigee-active {
    background: rgba(255, 122, 24, 0.22);
    border-color: #fde047;
    color: #fde047;
    box-shadow: 0 0 18px rgba(255, 122, 24, 0.45);
}

/* ==========================================================================
   2B. SHAREABLE SOCIAL MEDIA TELEMETRY STATUS CARD OVERLAY
   ========================================================================== */

.apophis-view-btn.btn-status-card-tab {
    color: #7dd3fc;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    margin-left: 2px;
    padding-left: 11px;
}

.apophis-view-btn.btn-status-card-tab[aria-pressed="true"] {
    background: linear-gradient(135deg, #38bdf8 0%, #ff7a18 100%);
    color: #030712;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.55);
}

.apophis-status-card-panel {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 50% 45%, rgba(11, 19, 38, 0.98) 0%, rgba(3, 6, 14, 0.99) 100%);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.apophis-status-card-panel[hidden] {
    display: none !important;
}

.apophis-card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(7, 12, 24, 0.95);
    border-bottom: 1px solid rgba(56, 189, 248, 0.22);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.apophis-card-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.apophis-card-badge {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #fde047;
    text-transform: uppercase;
}

.apophis-card-aspect-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px;
    border-radius: 6px;
    background: rgba(3, 6, 14, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.apophis-aspect-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.apophis-aspect-btn:hover {
    color: #ffffff;
}

.apophis-aspect-btn[aria-pressed="true"] {
    background: #38bdf8;
    color: #030712;
}

.apophis-card-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.apophis-card-feedback {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #34d399;
    padding: 0 6px;
}

.apophis-card-action-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.9);
    color: #f1f5f9;
    font-family: var(--font-mono, monospace);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}

.apophis-card-action-btn:hover,
.apophis-card-action-btn:focus-visible {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-1px);
    outline: none;
}

.apophis-card-action-btn.btn-primary {
    border-color: #fde047;
    background: linear-gradient(135deg, rgba(255, 122, 24, 0.35) 0%, rgba(2, 132, 199, 0.35) 100%);
    color: #fde047;
    box-shadow: 0 0 14px rgba(255, 122, 24, 0.3);
}

.apophis-card-action-btn.btn-primary:hover,
.apophis-card-action-btn.btn-primary:focus-visible {
    background: linear-gradient(135deg, rgba(255, 122, 24, 0.55) 0%, rgba(2, 132, 199, 0.5) 100%);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(253, 224, 71, 0.5);
}

.apophis-card-action-btn.btn-back {
    border-color: rgba(255, 122, 24, 0.45);
    color: #cbd5e1;
}

.apophis-card-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    overflow: hidden;
}

#apophis-status-card-canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 122, 24, 0.45);
    box-shadow:
        0 18px 48px rgba(0, 0, 0, 0.85),
        0 0 28px rgba(56, 189, 248, 0.18);
    background: #040711;
}

/* Telemetry Readout Cards Row */
.apophis-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 18px;
    background: rgba(9, 14, 26, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    flex-shrink: 0;
}

.apophis-stat-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-variant-numeric: tabular-nums;
}

.apophis-stat-label {
    font-size: 0.58rem;
    color: #94a3b8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.apophis-stat-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apophis-stat-value.accent-amber {
    color: #fde047;
}

.apophis-stat-value.accent-cyan {
    color: #38bdf8;
}

.apophis-stat-value.accent-orange {
    color: var(--singularity-primary, #ff7a18);
}

.apophis-stat-sub {
    font-size: 0.58rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   3. TIMELINE SCRUBBER & TRANSPORT BAR (modern-web-guidance: slider)
   ========================================================================== */

.apophis-timeline-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 18px 14px;
    background: rgba(6, 10, 20, 0.98);
    flex-shrink: 0;
}

.apophis-timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.apophis-slider-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #e2e8f0;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.apophis-slider-label strong {
    color: var(--singularity-primary, #ff7a18);
}

.apophis-transport-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.apophis-ctrl-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(15, 23, 42, 0.85);
    color: #e2e8f0;
    font-family: var(--font-mono, monospace);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.2s ease;
}

.apophis-ctrl-btn:hover,
.apophis-ctrl-btn:focus-visible {
    background: rgba(255, 122, 24, 0.22);
    border-color: var(--singularity-primary, #ff7a18);
    color: #ffffff;
    outline: none;
}

.apophis-ctrl-btn.btn-play {
    border-color: var(--singularity-primary, #ff7a18);
    background: rgba(255, 122, 24, 0.2);
    color: #fde047;
    min-width: 78px;
}

.apophis-ctrl-btn.btn-play[aria-pressed="true"] {
    background: var(--singularity-primary, #ff7a18);
    color: #030712;
}

.apophis-ctrl-btn.btn-perigee {
    border-color: rgba(253, 224, 71, 0.55);
    background: rgba(253, 224, 71, 0.12);
    color: #fde047;
}

.apophis-ctrl-btn.btn-perigee:hover {
    background: rgba(253, 224, 71, 0.28);
    border-color: #fde047;
}

.apophis-speed-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(3, 6, 14, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 2px;
    border-radius: 6px;
}

.apophis-speed-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    cursor: pointer;
}

.apophis-speed-btn:hover {
    color: #ffffff;
}

.apophis-speed-btn[aria-pressed="true"] {
    background: #38bdf8;
    color: #030712;
}

/* Native Range Input Styling (modern-web-guidance: slider) */
.apophis-slider-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.apophis-timeline-slider {
    --slider-track-size: 0.45rem;
    --slider-thumb-size: 1.15rem;
    --slider-track-radius: 999px;
    --slider-thumb-radius: 50%;
    --slider-track-color: #1e293b;
    --slider-fill-color: var(--singularity-primary, #ff7a18);
    --slider-thumb-color: #fde047;
    --slider-direction: to right;

    &:dir(rtl) {
        --slider-direction: to left;
    }

    --attr-min: attr(min type(<number>), 0);
    --attr-max: attr(max type(<number>), 100);
    --control-value: attr(value type(<number>), 50);
    --slider-progress: calc(
        progress(var(--control-value), var(--attr-min), var(--attr-max)) * 100%
    );

    appearance: none;
    inline-size: 100%;
    block-size: 1.85rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
}

@supports not (opacity: progress(1, 0, 100)) {
    .apophis-timeline-slider {
        --slider-progress: calc(
            (var(--control-value) - var(--attr-min)) /
            (var(--attr-max) - var(--attr-min)) * 100%
        );
    }
}

/* WebKit/Blink Slider Track & Thumb */
.apophis-timeline-slider::-webkit-slider-runnable-track {
    block-size: var(--slider-track-size);
    border: 0;
    border-radius: var(--slider-track-radius);
    background: linear-gradient(
        var(--slider-direction),
        var(--slider-fill-color) var(--slider-progress),
        var(--slider-track-color) var(--slider-progress)
    );
}

.apophis-timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    inline-size: var(--slider-thumb-size);
    block-size: var(--slider-thumb-size);
    margin-block-start: calc(
        (var(--slider-track-size) - var(--slider-thumb-size)) / 2
    );
    border: 2px solid #030712;
    border-radius: var(--slider-thumb-radius);
    background: var(--slider-thumb-color);
    box-shadow: 0 0 12px rgba(253, 224, 71, 0.8);
}

/* Firefox Slider Track, Progress & Thumb */
.apophis-timeline-slider::-moz-range-track {
    block-size: var(--slider-track-size);
    border: 0;
    border-radius: var(--slider-track-radius);
    background: var(--slider-track-color);
}

.apophis-timeline-slider::-moz-range-progress {
    block-size: var(--slider-track-size);
    border-radius: var(--slider-track-radius);
    background: var(--slider-fill-color);
}

.apophis-timeline-slider::-moz-range-thumb {
    inline-size: var(--slider-thumb-size);
    block-size: var(--slider-thumb-size);
    border: 2px solid #030712;
    border-radius: var(--slider-thumb-radius);
    background: var(--slider-thumb-color);
    box-shadow: 0 0 12px rgba(253, 224, 71, 0.8);
}

.apophis-timeline-slider:focus-visible {
    outline: 2px solid var(--slider-fill-color);
    outline-offset: 4px;
}

/* Timeline Landmark Ticks Row */
.apophis-timeline-ticks {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px;
    font-size: 0.58rem;
    color: #64748b;
}

.apophis-tick-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: #64748b;
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.apophis-tick-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
}

.apophis-tick-btn.tick-perigee {
    color: #fde047;
    font-weight: 700;
}

/* ==========================================================================
   4. AI'S RENDITION OF THE ASTEROID HURLING TOWARD EARTH
   ========================================================================== */

.apophis-rendition-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px 20px;
    background: linear-gradient(180deg, rgba(6, 10, 20, 0.98) 0%, rgba(3, 6, 14, 0.99) 100%);
    border-top: 1px solid rgba(255, 122, 24, 0.28);
    flex-shrink: 0;
}

.apophis-rendition-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(0.92rem, 1.4vw, 1.12rem);
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.apophis-rendition-title::before {
    content: "☄";
    color: var(--singularity-primary, #ff7a18);
    font-size: 1rem;
}

.apophis-rendition-figure {
    margin: 0;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 122, 24, 0.45);
    background: #03060e;
    box-shadow:
        0 16px 42px rgba(0, 0, 0, 0.85),
        0 0 26px rgba(56, 189, 248, 0.14);
}

.apophis-rendition-img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1376 / 768;
    object-fit: cover;
}

/* Responsive Adjustments */
@media (max-width: 960px) {
    .apophis-telemetry-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .apophis-telemetry-strip .hide-tablet {
        display: none;
    }
}

@media (max-width: 640px) {
    .apophis-countdown-banner {
        padding: 6px 12px;
        gap: 6px 10px;
    }
    .apophis-telemetry-strip {
        display: none;
    }
    .apophis-telemetry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .apophis-orrery-dialog {
        width: 98vw;
        height: 95dvh;
    }
}

/* MANDATORY Reduced Motion Compliance (animate-to-from-top-layer) */
@media (prefers-reduced-motion: reduce) {
    .apophis-orrery-dialog {
        transform: none;
        transition-duration: 0.1s;
    }

    @starting-style {
        .apophis-orrery-dialog[open] {
            transform: none;
        }
    }

    .apophis-hazard-beacon,
    .apophis-sim-trigger-btn {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}
