/* Solar System Orrery Styles */

.orrery-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* iOS viewport fix — supported browsers use dvh, others keep vh */
    background: #000;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.orrery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: rgba(17, 24, 39, 0.9);
    border-bottom: 1px solid rgba(75, 85, 99, 0.5);
    z-index: 110;
    flex-shrink: 0;
    height: 48px;
}

.orrery-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.orrery-title {
    color: #e5e7eb;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.orrery-header-center {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.orrery-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.orrery-btn {
    background: rgba(55, 65, 81, 0.7);
    border: 1px solid rgba(75, 85, 99, 0.6);
    color: #d1d5db;
    padding: 0.3rem 0.6rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.orrery-btn:hover {
    background: rgba(75, 85, 99, 0.8);
    color: #f3f4f6;
}

.orrery-btn.active {
    background: rgba(59, 130, 246, 0.5);
    border-color: rgba(59, 130, 246, 0.7);
    color: #93c5fd;
}

/* Floating action buttons (bottom-left Demo, bottom-right Run) */
.orrery-fab {
    position: absolute;
    bottom: 40px;
    z-index: 115;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    padding: 0.4rem 0.85rem;
    border: 1px solid;
}

.orrery-fab-left {
    left: 16px;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.7), rgba(34, 197, 94, 0.7));
    border-color: rgba(34, 197, 94, 0.8);
    color: #fff;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.3);
}

.orrery-fab-left:hover {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.95), rgba(34, 197, 94, 0.95));
    transform: scale(1.04);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.orrery-fab-left.active {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.6), rgba(239, 68, 68, 0.6));
    border-color: rgba(239, 68, 68, 0.7);
    color: #fecaca;
}

.orrery-fab-left.active:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.85), rgba(239, 68, 68, 0.85));
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.orrery-fab-right {
    right: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.7), rgba(59, 130, 246, 0.7));
    border-color: rgba(59, 130, 246, 0.8);
    color: #fff;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.orrery-fab-right:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(59, 130, 246, 0.95));
    transform: scale(1.04);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

.orrery-fab-right.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.7), rgba(22, 163, 74, 0.7));
    border-color: rgba(34, 197, 94, 0.8);
    color: #fff;
}

.orrery-fab-right.active:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.95));
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.orrery-date-display {
    color: #9ca3af;
    font-size: 0.85rem;
    font-family: monospace;
    min-width: 180px;
    text-align: center;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.orrery-date-display:hover {
    background: rgba(55, 65, 81, 0.5);
    border-color: rgba(75, 85, 99, 0.5);
    color: #e5e7eb;
}

.orrery-date-input {
    background: rgba(55, 65, 81, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.6);
    border-radius: 0.25rem;
    color: #e5e7eb;
    font-size: 0.85rem;
    font-family: monospace;
    padding: 0.15rem 0.4rem;
    min-width: 180px;
    text-align: center;
    outline: none;
    color-scheme: dark;
}

.orrery-date-input:focus {
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.orrery-speed-label {
    color: #6b7280;
    font-size: 0.75rem;
    white-space: nowrap;
    width: 70px;
    text-align: left;
    flex-shrink: 0;
}

.orrery-speed-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.orrery-speed-presets {
    display: flex;
    gap: 2px;
    margin-left: 0.25rem;
}

.orrery-speed-preset {
    background: rgba(55, 65, 81, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.4);
    color: #9ca3af;
    padding: 1px 5px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.6rem;
    font-family: monospace;
    transition: background 0.15s, color 0.15s;
    line-height: 1.3;
}

.orrery-speed-preset:hover {
    background: rgba(75, 85, 99, 0.7);
    color: #e5e7eb;
}

.orrery-speed-preset.active {
    background: rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.6);
    color: #93c5fd;
}

.orrery-speed-slider {
    width: 140px;
    min-width: 140px;
    flex-shrink: 0;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #374151 49.5%, #6b7280 49.5%, #6b7280 50.5%, #374151 50.5%);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.orrery-speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #60a5fa;
    cursor: pointer;
}

.orrery-speed-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #60a5fa;
    cursor: pointer;
    border: none;
}

.orrery-canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.orrery-canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Info Panel */
.orrery-info-panel {
    position: absolute;
    top: 60px;
    right: 12px;
    width: 280px;
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.5rem;
    padding: 1rem;
    z-index: 120;
    display: none;
    color: #d1d5db;
    font-size: 0.85rem;
    backdrop-filter: blur(8px);
}

.orrery-info-panel.visible {
    display: block;
}

.orrery-info-panel h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    color: #f3f4f6;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.orrery-info-panel .info-close {
    margin-left: auto;
    cursor: pointer;
    color: #6b7280;
    font-size: 1rem;
    padding: 0.2rem;
}

.orrery-info-panel .info-close:hover {
    color: #d1d5db;
}

.orrery-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.orrery-info-row .info-label {
    color: #9ca3af;
}

.orrery-info-row .info-value {
    color: #e5e7eb;
    font-family: monospace;
}

.orrery-info-notes {
    margin-top: 0.5rem;
    color: #9ca3af;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Demo Info Overlay */
.orrery-demo-info {
    position: absolute;
    bottom: 40px;
    left: 16px;
    width: 300px;
    max-width: calc(100vw - 32px);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    z-index: 120;
    color: #d1d5db;
    font-size: 0.85rem;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.orrery-demo-info.visible {
    opacity: 1;
    transform: translateY(0);
}

.orrery-demo-info.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.orrery-demo-info-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f3f4f6;
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.orrery-demo-info-type {
    font-size: 0.7rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.orrery-demo-info-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 1rem;
    margin-bottom: 0.3rem;
}

.orrery-demo-info-stat {
    display: flex;
    gap: 0.3rem;
    font-size: 0.78rem;
}

.orrery-demo-info-stat .stat-label {
    color: #6b7280;
}

.orrery-demo-info-stat .stat-value {
    color: #e5e7eb;
    font-family: monospace;
    font-size: 0.75rem;
}

.orrery-demo-info-notes {
    font-size: 0.73rem;
    color: #9ca3af;
    line-height: 1.4;
    margin-top: 0.3rem;
}

@media (max-width: 768px) {
    .orrery-demo-info {
        width: 250px;
        left: 8px;
        bottom: 36px;
        padding: 0.7rem 0.85rem;
    }

    .orrery-demo-info-name {
        font-size: 1rem;
    }
}

/* Settings Panel */
.orrery-settings-panel {
    position: absolute;
    top: 52px;
    right: 12px;
    width: 220px;
    background: rgba(17, 24, 39, 0.94);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.5rem;
    z-index: 125;
    display: none;
    color: #d1d5db;
    font-size: 0.85rem;
    backdrop-filter: blur(8px);
    max-height: calc(100vh - 100px);
    overflow: hidden;
    flex-direction: column;
}

.orrery-settings-panel.visible {
    display: flex;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.4);
    font-weight: 600;
    color: #f3f4f6;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.settings-close {
    cursor: pointer;
    color: #6b7280;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.2rem;
}

.settings-close:hover {
    color: #d1d5db;
}

.settings-tabs {
    display: flex;
    border-bottom: 1px solid rgba(75, 85, 99, 0.4);
    flex-shrink: 0;
}

.settings-tab {
    flex: 1;
    padding: 0.4rem 0;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    user-select: none;
}

.settings-tab:hover {
    color: #9ca3af;
}

.settings-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.settings-tab-content {
    display: none;
    padding: 0.4rem 0 0.5rem;
    overflow-y: auto;
    flex: 1;
}

.settings-tab-content.active {
    display: block;
}

.settings-section-label {
    padding: 0.5rem 0.75rem 0.2rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: background 0.1s;
}

.settings-row:hover {
    background: rgba(55, 65, 81, 0.4);
}

.settings-row input[type="checkbox"] {
    accent-color: #3b82f6;
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.settings-row span {
    font-size: 0.8rem;
    color: #d1d5db;
    user-select: none;
}

/* Tooltip (mouseover, paused only) */
.orrery-tooltip {
    position: fixed;
    pointer-events: none;
    display: none;
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.375rem;
    padding: 0.35rem 0.6rem;
    z-index: 130;
    color: #d1d5db;
    font-size: 0.8rem;
    white-space: nowrap;
    max-width: 260px;
    line-height: 1.4;
}

.orrery-tooltip.visible {
    display: block;
}

.orrery-tooltip-name {
    font-weight: 600;
    color: #f3f4f6;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.orrery-tooltip-detail {
    color: #9ca3af;
    font-size: 0.72rem;
}

/* Status bar */
.orrery-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 1rem;
    background: rgba(17, 24, 39, 0.9);
    border-top: 1px solid rgba(75, 85, 99, 0.3);
    color: #6b7280;
    font-size: 0.75rem;
    flex-shrink: 0;
    height: 28px;
}

/* ── Immersive Mode ──────────────────────────────────────── */
.orrery-container.orrery-immersive .orrery-header {
    transform: translateY(-100%);
    transition: transform 0.4s ease;
    pointer-events: none;
}

.orrery-container.orrery-immersive .orrery-status {
    transform: translateY(100%);
    transition: transform 0.4s ease;
    pointer-events: none;
}

/* Smooth transition back when exiting immersive */
.orrery-header {
    transition: transform 0.4s ease;
}

.orrery-status {
    transition: transform 0.4s ease;
}

/* Briefly peek header when tapping canvas in immersive */
.orrery-container.orrery-immersive.orrery-peek .orrery-header {
    transform: translateY(0);
    pointer-events: auto;
}

/* Immersive exit button */
.orrery-immersive-exit {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 125;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.orrery-immersive-exit:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
}

.orrery-container.orrery-immersive .orrery-immersive-exit {
    display: flex;
}

.orrery-container.orrery-immersive .orrery-fab {
    display: none;
}

/* Night Sky shortcut button — hidden on desktop, shown on mobile */
.orrery-nightsky-btn {
    display: none;
}

/* Gyro toast hint */
.orrery-gyro-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8);
    color: #e5e7eb;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 0.85rem;
    z-index: 130;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    white-space: nowrap;
}

.orrery-gyro-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Gyro active indicator */
.orrery-gyro-indicator {
    display: none;
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 125;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: rgba(59, 130, 246, 0.8);
    font-size: 0.8rem;
    align-items: center;
    justify-content: center;
}

.orrery-gyro-indicator.active {
    display: flex;
}

/* Views Panel */
.orrery-views-panel {
    position: absolute;
    top: 52px;
    right: 12px;
    width: 220px;
    background: rgba(17, 24, 39, 0.94);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.5rem;
    z-index: 125;
    display: none;
    color: #d1d5db;
    font-size: 0.85rem;
    backdrop-filter: blur(8px);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-bottom: 0.5rem;
}

.orrery-views-panel.visible {
    display: block;
}

.views-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.4);
    font-weight: 600;
    color: #f3f4f6;
    font-size: 0.9rem;
}

.views-close {
    cursor: pointer;
    color: #6b7280;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.2rem;
}

.views-close:hover {
    color: #d1d5db;
}

.views-section-label {
    padding: 0.5rem 0.75rem 0.2rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.views-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
}

.views-row:hover {
    background: rgba(55, 65, 81, 0.4);
}

.views-row .views-icon {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.views-row .views-label {
    font-size: 0.8rem;
    color: #d1d5db;
}

.views-row.tour-row .views-icon {
    color: #60a5fa;
}

.views-row.tour-row .views-label {
    color: #93c5fd;
}

.views-row.tour-row.demo-row {
    margin-top: 0.25rem;
}

/* Search */
.orrery-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.orrery-search-icon {
    position: absolute;
    left: 7px;
    color: #6b7280;
    font-size: 0.7rem;
    pointer-events: none;
}

.orrery-search-input {
    width: 110px;
    padding: 0.25rem 0.4rem 0.25rem 1.4rem;
    background: rgba(55, 65, 81, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.375rem;
    color: #e5e7eb;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.15s, width 0.2s;
}

.orrery-search-input::placeholder {
    color: #6b7280;
}

.orrery-search-input:focus {
    border-color: rgba(59, 130, 246, 0.6);
    width: 140px;
}

.orrery-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    background: rgba(17, 24, 39, 0.96);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.375rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 130;
    backdrop-filter: blur(8px);
}

.orrery-search-dropdown.visible {
    display: block;
}

.orrery-search-item {
    padding: 0.35rem 0.6rem;
    color: #d1d5db;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.1s;
}

.orrery-search-item:hover,
.orrery-search-item.selected {
    background: rgba(59, 130, 246, 0.3);
    color: #f3f4f6;
}

.orrery-search-item .search-type {
    color: #6b7280;
    font-size: 0.65rem;
    margin-left: 0.4rem;
}

/* Record Panel */
.orrery-record-panel {
    position: absolute;
    top: 52px;
    right: 12px;
    width: 240px;
    background: rgba(17, 24, 39, 0.94);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.5rem;
    z-index: 125;
    display: none;
    color: #d1d5db;
    font-size: 0.85rem;
    backdrop-filter: blur(8px);
    padding-bottom: 0.5rem;
}

.orrery-record-panel.visible {
    display: block;
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.4);
    font-weight: 600;
    color: #f3f4f6;
    font-size: 0.9rem;
}

.record-close {
    cursor: pointer;
    color: #6b7280;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.2rem;
}

.record-close:hover {
    color: #d1d5db;
}

.record-section-label {
    padding: 0.5rem 0.75rem 0.2rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.record-format-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
}

.record-format-row:hover {
    background: rgba(55, 65, 81, 0.4);
}

.record-format-row.selected {
    background: rgba(59, 130, 246, 0.25);
    border-left: 2px solid #3b82f6;
}

.record-format-icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.record-format-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.record-format-label {
    font-size: 0.82rem;
    color: #e5e7eb;
    font-weight: 500;
}

.record-format-desc {
    font-size: 0.65rem;
    color: #6b7280;
}

.record-actions {
    padding: 0.5rem 0.75rem;
}

.record-start-btn {
    width: 100%;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.375rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    background: rgba(55, 65, 81, 0.5);
    color: #9ca3af;
}

.record-start-btn:disabled {
    cursor: default;
    opacity: 0.6;
}

.record-start-btn.ready {
    background: rgba(220, 38, 38, 0.3);
    border-color: rgba(220, 38, 38, 0.5);
    color: #fca5a5;
}

.record-start-btn.ready:hover {
    background: rgba(220, 38, 38, 0.5);
    color: #fecaca;
}

.record-start-btn.recording {
    background: rgba(75, 85, 99, 0.5);
    border-color: rgba(75, 85, 99, 0.6);
    color: #d1d5db;
}

.record-start-btn.recording:hover {
    background: rgba(75, 85, 99, 0.7);
}

.record-timer {
    text-align: center;
    font-family: monospace;
    font-size: 0.85rem;
    color: #f87171;
    padding: 0.25rem 0.75rem;
}

/* Record button toolbar states */
.orrery-btn.recording {
    background: rgba(220, 38, 38, 0.5);
    border-color: rgba(220, 38, 38, 0.7);
    color: #fca5a5;
    animation: pulse-record 1.5s ease-in-out infinite;
}

/* Crop Overlay */
.video-crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 105;
}

.crop-bar {
    position: absolute;
    background: rgba(0, 0, 0, 0.6);
}

.crop-border {
    position: absolute;
    border: 2px solid rgba(239, 68, 68, 0.7);
    border-radius: 2px;
    box-sizing: border-box;
}

/* Recording Indicator */
.record-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    z-index: 115;
    pointer-events: none;
}

.record-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulse-record 1.5s ease-in-out infinite;
}

.record-indicator-time {
    font-family: monospace;
    font-size: 0.8rem;
    color: #fca5a5;
}

@keyframes pulse-record {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Responsive — tablet */
@media (max-width: 768px) {
    .orrery-header {
        padding: 0.4rem 0.5rem;
        gap: 0.5rem;
    }

    .orrery-date-display {
        font-size: 0.75rem;
        min-width: 140px;
    }

    .orrery-date-input {
        font-size: 0.75rem;
        min-width: 140px;
    }

    .orrery-speed-slider {
        width: 80px;
        min-width: 80px;
    }

    .orrery-info-panel {
        width: 240px;
        right: 8px;
    }

    /* Search: collapsed to icon-only, expands on tap */
    .orrery-search-container {
        display: flex;
        width: 32px;
        overflow: hidden;
        transition: width 0.25s ease;
    }

    .orrery-search-container .orrery-search-icon {
        pointer-events: auto;
        cursor: pointer;
        position: relative;
        left: 0;
        width: 32px;
        min-width: 32px;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem;
    }

    .orrery-search-container .orrery-search-input {
        width: 0;
        padding: 0;
        border: none;
        opacity: 0;
        transition: width 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
    }

    .orrery-search-container.expanded {
        width: 170px;
    }

    .orrery-search-container.expanded .orrery-search-input {
        width: 130px;
        padding: 0.25rem 0.4rem 0.25rem 0.3rem;
        border: 1px solid rgba(75, 85, 99, 0.5);
        opacity: 1;
    }

    .orrery-search-container.expanded .orrery-search-input:focus {
        width: 130px;
    }

    .orrery-search-dropdown {
        min-width: 160px;
    }
}

/* ── Welcome help overlay ─────────────────────────────────── */

.orrery-help-overlay {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    pointer-events: none;
}

.orrery-help-overlay.hidden {
    display: none !important;
}

.orrery-help-content {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(100, 140, 200, 0.25);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    text-align: center;
    max-width: 520px;
}

.orrery-help-title {
    color: rgba(180, 210, 240, 0.9);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    letter-spacing: 0.03em;
}

.orrery-help-hints {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.2rem;
}

.orrery-help-hints span {
    color: rgba(160, 185, 220, 0.85);
    font-size: 0.8rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.orrery-help-hints span i {
    color: rgba(130, 170, 220, 0.7);
    font-size: 0.7rem;
    width: 1rem;
    text-align: center;
}

.orrery-help-hints kbd {
    background: rgba(60, 80, 110, 0.5);
    border: 1px solid rgba(100, 130, 170, 0.4);
    border-radius: 3px;
    padding: 0 0.3rem;
    font-size: 0.75rem;
    font-family: inherit;
    color: rgba(180, 210, 240, 0.9);
}

.orrery-help-note {
    width: 100%;
    justify-content: center;
    margin-top: 0.3rem;
    font-size: 0.7rem;
    color: rgba(140, 160, 190, 0.65) !important;
    font-style: italic;
}

/* Touch help hints — hidden by default, shown on mobile */
.orrery-help-touch {
    display: none;
}

/* Default: hide touch status, show desktop status */
.orrery-status-touch {
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   PHONE — 480px breakpoint
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

    /* ── Header: multi-row layout ────────────────────────── */
    .orrery-header {
        flex-wrap: wrap;
        height: auto;
        padding: 4px 6px;
        gap: 2px;
    }

    .orrery-header-left {
        gap: 4px;
        flex: 0 0 auto;
    }

    .orrery-header-center {
        order: 3;
        width: 100%;
        justify-content: space-between;
        gap: 2px;
        padding: 0;
        flex-wrap: wrap;
    }

    .orrery-speed-row {
        gap: 3px;
    }

    .orrery-header-right {
        gap: 3px;
        flex: 1 1 auto;
        justify-content: flex-end;
    }

    /* First-row buttons: stretch wider for easier touch targets */
    .orrery-header-left > .orrery-btn,
    .orrery-header-right > .orrery-btn {
        flex: 1 1 0;
        min-width: 44px;
        max-width: 60px;
    }

    /* Hide elements that don't fit on phones */
    .orrery-title {
        display: none;
    }

    .orrery-fab {
        position: fixed;
        bottom: 70px;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
        font-size: 1.1rem;
    }

    .orrery-fab .fab-label {
        display: none;
    }

    .orrery-fab-left {
        left: 16px;
    }

    .orrery-fab-right {
        right: 16px;
    }

    .orrery-fab-left.active {
        box-shadow: 0 2px 12px rgba(239, 68, 68, 0.4);
    }

    /* Hide FABs during immersive mode */
    .orrery-immersive .orrery-fab {
        display: none;
    }

    /* Search: narrower on phone */
    .orrery-search-container {
        width: 32px;
    }

    .orrery-search-container.expanded {
        width: 150px;
    }

    .orrery-search-container.expanded .orrery-search-input {
        width: 110px;
    }

    .orrery-search-container.expanded .orrery-search-input:focus {
        width: 110px;
    }

    #orreryRecordBtn {
        display: none;
    }

    #orreryFullscreen {
        display: none;
    }

    /* Hide "Now" label, keep icon */
    .orrery-btn-label {
        display: none;
    }

    /* ── Touch targets: 44px minimum ────────────────────── */
    .orrery-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 0.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
    }

    /* Speed presets stay visible (more useful than slider on touch) */
    .orrery-speed-presets {
        display: flex;
        gap: 2px;
        margin-left: 0;
    }

    .orrery-speed-preset {
        min-height: 26px;
        padding: 2px 5px;
        font-size: 0.65rem;
        display: flex;
        align-items: center;
    }

    .orrery-speed-desktop {
        display: none;
    }

    /* Hide slider and label on phones — presets are better for touch */
    .orrery-speed-slider {
        display: none;
    }

    .orrery-speed-label {
        display: none;
    }

    /* Date display: compact */
    .orrery-date-display {
        font-size: 0.72rem;
        min-width: auto;
        padding: 0 0.3rem;
    }

    .orrery-date-input {
        font-size: 0.72rem;
        min-width: auto;
    }

    /* ── Panels: bottom sheets ──────────────────────────── */
    .orrery-info-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 50vh;
        border-radius: 12px 12px 0 0;
        animation: slideUpPanel 0.25s ease-out;
        overflow-y: auto;
    }

    .orrery-settings-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 12px 12px 0 0;
        animation: slideUpPanel 0.25s ease-out;
    }

    .orrery-views-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 12px 12px 0 0;
        animation: slideUpPanel 0.25s ease-out;
    }

    .orrery-record-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 12px 12px 0 0;
        animation: slideUpPanel 0.25s ease-out;
    }

    /* Demo info overlay: slim single-line bottom bar on phone */
    .orrery-demo-info {
        left: 0;
        right: 0;
        bottom: 20px;
        width: auto;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        border: none;
        padding: 10px 16px;
        display: none;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .orrery-demo-info.visible {
        display: flex;
    }

    .orrery-demo-info-name {
        font-size: 0.9rem;
        margin-bottom: 0;
        white-space: nowrap;
    }

    .orrery-demo-info-type {
        display: none;
    }

    .orrery-demo-info-stats {
        flex-wrap: nowrap;
        gap: 0.5rem;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
    }

    .orrery-demo-info-stat {
        font-size: 0.7rem;
    }

    .orrery-demo-info-stat .stat-label {
        display: none;
    }

    .orrery-demo-info-notes {
        display: none;
    }

    /* In immersive mode, shift demo info to very bottom */
    .orrery-immersive .orrery-demo-info {
        bottom: 8px;
    }

    /* ── Status bar: compact ────────────────────────────── */
    .orrery-status {
        height: 20px;
        padding: 2px 8px;
        font-size: 0.7rem;
    }

    /* Show touch status text, hide desktop text */
    .orrery-status-desktop {
        display: none;
    }

    .orrery-status-touch {
        display: inline;
    }

    /* ── Help overlay: swap desktop/touch hints ─────────── */
    .orrery-help-desktop {
        display: none;
    }

    .orrery-help-touch {
        display: flex;
    }

    .orrery-help-content {
        padding: 0.75rem 1rem;
        max-width: 340px;
    }

    .orrery-help-title {
        font-size: 0.95rem;
    }

    .orrery-help-hints {
        gap: 0.3rem 0.8rem;
    }

    .orrery-help-hints span {
        font-size: 0.75rem;
    }

    /* Help overlay repositioned for phone — above the WebXR "Enter VR" button */
    .orrery-help-overlay {
        top: auto;
        bottom: 80px;
    }

    /* ── Night Sky shortcut button (mobile only) ─────────── */
    .orrery-nightsky-btn {
        display: flex;
    }
}

/* ═══════════════════════════════════════════════════════════
   LANDSCAPE PHONE
   ═══════════════════════════════════════════════════════════ */
@media (max-height: 400px) {

    /* Single-row header (unwrap) */
    .orrery-header {
        flex-wrap: nowrap;
        height: auto;
        padding: 2px 6px;
        gap: 4px;
    }

    .orrery-header-center {
        order: 0;
        width: auto;
        padding: 0;
        gap: 4px;
    }

    /* Hide elements that waste space in landscape */
    .orrery-title {
        display: none;
    }

    .orrery-fab {
        display: none;
    }

    /* Search: collapsible in landscape too */
    .orrery-search-container {
        width: 32px;
    }

    .orrery-search-container.expanded {
        width: 150px;
    }

    .orrery-search-container.expanded .orrery-search-input {
        width: 110px;
    }

    .orrery-search-container.expanded .orrery-search-input:focus {
        width: 110px;
    }

    #orreryRecordBtn {
        display: none;
    }

    #orreryFullscreen {
        display: none;
    }

    .orrery-btn-label {
        display: none;
    }

    /* Hide status bar entirely */
    .orrery-status {
        display: none;
    }

    /* Hide speed presets in landscape (too tight) */
    .orrery-speed-presets {
        display: none;
    }

    /* Shorter slider */
    .orrery-speed-slider {
        width: 60px;
        min-width: 60px;
    }

    .orrery-speed-label {
        width: auto;
        font-size: 0.7rem;
    }

    .orrery-date-display {
        font-size: 0.72rem;
        min-width: 120px;
    }

    /* Smaller buttons */
    .orrery-btn {
        min-width: 32px;
        min-height: 32px;
        font-size: 0.8rem;
    }

    /* Help overlay at bottom — above the WebXR "Enter VR" button */
    .orrery-help-overlay {
        top: auto;
        bottom: 80px;
    }

    .orrery-help-content {
        padding: 0.5rem 0.8rem;
        max-width: 400px;
    }

    /* Touch help in landscape */
    .orrery-help-desktop {
        display: none;
    }

    .orrery-help-touch {
        display: flex;
    }

    /* Night Sky shortcut in landscape too */
    .orrery-nightsky-btn {
        display: flex;
    }
}

@keyframes slideUpPanel {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ============================================================
   NIGHT VISION MODE — Orrery
   ============================================================ */

/* Header */
body[data-theme="night"] .orrery-header {
    background: rgba(45, 10, 10, 0.9);
    border-bottom-color: rgba(127, 29, 29, 0.5);
}

body[data-theme="night"] .orrery-title {
    color: #fca5a5;
}

/* Buttons */
body[data-theme="night"] .orrery-btn {
    background: rgba(61, 16, 16, 0.7);
    border-color: rgba(127, 29, 29, 0.6);
    color: #d4a0a0;
}

body[data-theme="night"] .orrery-btn:hover {
    background: rgba(77, 21, 21, 0.8);
    color: #fca5a5;
}

body[data-theme="night"] .orrery-btn.active {
    background: rgba(239, 68, 68, 0.5);
    border-color: rgba(239, 68, 68, 0.7);
    color: #fca5a5;
}

/* FAB buttons */
body[data-theme="night"] .orrery-fab-left {
    background: linear-gradient(135deg, rgba(153, 27, 27, 0.7), rgba(239, 68, 68, 0.7));
    border-color: rgba(239, 68, 68, 0.8);
    color: #fca5a5;
}

body[data-theme="night"] .orrery-fab-left:hover {
    background: linear-gradient(135deg, rgba(153, 27, 27, 0.95), rgba(239, 68, 68, 0.95));
    color: #fca5a5;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

body[data-theme="night"] .orrery-fab-right {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.7), rgba(153, 27, 27, 0.7));
    border-color: rgba(127, 29, 29, 0.8);
    color: #fca5a5;
}

body[data-theme="night"] .orrery-fab-right:hover {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.95), rgba(153, 27, 27, 0.95));
    color: #fca5a5;
    box-shadow: 0 0 12px rgba(127, 29, 29, 0.5);
}

/* Date display */
body[data-theme="night"] .orrery-date-display {
    color: #993333;
}

body[data-theme="night"] .orrery-date-display:hover {
    background: rgba(61, 16, 16, 0.5);
    border-color: rgba(127, 29, 29, 0.5);
    color: #fca5a5;
}

body[data-theme="night"] .orrery-date-input {
    background: rgba(61, 16, 16, 0.8);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fca5a5;
}

body[data-theme="night"] .orrery-date-input:focus {
    border-color: rgba(239, 68, 68, 0.8);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Speed controls */
body[data-theme="night"] .orrery-speed-label {
    color: #7f3333;
}

body[data-theme="night"] .orrery-speed-preset {
    background: rgba(61, 16, 16, 0.5);
    border-color: rgba(127, 29, 29, 0.4);
    color: #993333;
}

body[data-theme="night"] .orrery-speed-preset:hover {
    background: rgba(77, 21, 21, 0.7);
    color: #fca5a5;
}

body[data-theme="night"] .orrery-speed-preset.active {
    background: rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fca5a5;
}

body[data-theme="night"] .orrery-speed-slider::-webkit-slider-thumb {
    background: #ef4444;
}

body[data-theme="night"] .orrery-speed-slider::-moz-range-thumb {
    background: #ef4444;
}

/* Info panel */
body[data-theme="night"] .orrery-info-panel {
    background: rgba(26, 5, 5, 0.92);
    border-color: rgba(127, 29, 29, 0.5);
    color: #d4a0a0;
}

body[data-theme="night"] .orrery-info-panel h3 {
    color: #fca5a5;
}

body[data-theme="night"] .orrery-info-panel .info-close {
    color: #7f3333;
}

body[data-theme="night"] .orrery-info-panel .info-close:hover {
    color: #d4a0a0;
}

body[data-theme="night"] .orrery-info-row {
    border-bottom-color: rgba(61, 16, 16, 0.5);
}

body[data-theme="night"] .orrery-info-row .info-label {
    color: #993333;
}

body[data-theme="night"] .orrery-info-row .info-value {
    color: #fca5a5;
}

body[data-theme="night"] .orrery-info-notes {
    color: #993333;
}

/* Settings panel */
body[data-theme="night"] .orrery-settings-panel {
    background: rgba(26, 5, 5, 0.94);
    border-color: rgba(127, 29, 29, 0.5);
    color: #d4a0a0;
}

body[data-theme="night"] .settings-header {
    border-bottom-color: rgba(127, 29, 29, 0.4);
    color: #fca5a5;
}

body[data-theme="night"] .settings-close {
    color: #7f3333;
}

body[data-theme="night"] .settings-close:hover {
    color: #d4a0a0;
}

body[data-theme="night"] .settings-tab {
    color: #7f3333;
}

body[data-theme="night"] .settings-tab:hover {
    color: #993333;
}

body[data-theme="night"] .settings-tab.active {
    color: #ef4444;
    border-bottom-color: #ef4444;
}

body[data-theme="night"] .settings-section-label {
    color: #7f3333;
}

body[data-theme="night"] .settings-row:hover {
    background: rgba(61, 16, 16, 0.4);
}

body[data-theme="night"] .settings-row input[type="checkbox"] {
    accent-color: #ef4444;
}

body[data-theme="night"] .settings-row span {
    color: #d4a0a0;
}

/* Status bar */
body[data-theme="night"] .orrery-status {
    background: rgba(26, 5, 5, 0.9);
    border-top-color: rgba(127, 29, 29, 0.3);
    color: #7f3333;
}

/* Search */
body[data-theme="night"] .orrery-search-input {
    background: rgba(61, 16, 16, 0.6);
    border-color: rgba(127, 29, 29, 0.5);
    color: #fca5a5;
}

body[data-theme="night"] .orrery-search-input::placeholder {
    color: #7f3333;
}

body[data-theme="night"] .orrery-search-input:focus {
    border-color: rgba(239, 68, 68, 0.6);
}

body[data-theme="night"] .orrery-search-icon {
    color: #7f3333;
}

body[data-theme="night"] .orrery-search-dropdown {
    background: rgba(26, 5, 5, 0.96);
    border-color: rgba(127, 29, 29, 0.5);
}

body[data-theme="night"] .orrery-search-item {
    color: #d4a0a0;
}

body[data-theme="night"] .orrery-search-item:hover,
body[data-theme="night"] .orrery-search-item.selected {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

body[data-theme="night"] .orrery-search-item .search-type {
    color: #7f3333;
}

/* Views panel */
body[data-theme="night"] .orrery-views-panel {
    background: rgba(26, 5, 5, 0.94);
    border-color: rgba(127, 29, 29, 0.5);
    color: #d4a0a0;
}

body[data-theme="night"] .views-header {
    border-bottom-color: rgba(127, 29, 29, 0.4);
    color: #fca5a5;
}

body[data-theme="night"] .views-close {
    color: #7f3333;
}

body[data-theme="night"] .views-close:hover {
    color: #d4a0a0;
}

body[data-theme="night"] .views-section-label {
    color: #7f3333;
}

body[data-theme="night"] .views-row:hover {
    background: rgba(61, 16, 16, 0.4);
}

body[data-theme="night"] .views-row .views-icon {
    color: #993333;
}

body[data-theme="night"] .views-row .views-label {
    color: #d4a0a0;
}

body[data-theme="night"] .views-row.tour-row .views-icon {
    color: #f87171;
}

body[data-theme="night"] .views-row.tour-row .views-label {
    color: #fca5a5;
}

/* Record panel */
body[data-theme="night"] .orrery-record-panel {
    background: rgba(26, 5, 5, 0.94);
    border-color: rgba(127, 29, 29, 0.5);
    color: #d4a0a0;
}

body[data-theme="night"] .record-header {
    border-bottom-color: rgba(127, 29, 29, 0.4);
    color: #fca5a5;
}

body[data-theme="night"] .record-close {
    color: #7f3333;
}

body[data-theme="night"] .record-close:hover {
    color: #d4a0a0;
}

body[data-theme="night"] .record-section-label {
    color: #7f3333;
}

body[data-theme="night"] .record-format-row:hover {
    background: rgba(61, 16, 16, 0.4);
}

body[data-theme="night"] .record-format-row.selected {
    background: rgba(239, 68, 68, 0.25);
    border-left-color: #ef4444;
}

body[data-theme="night"] .record-format-icon {
    color: #993333;
}

body[data-theme="night"] .record-format-label {
    color: #fca5a5;
}

body[data-theme="night"] .record-format-desc {
    color: #7f3333;
}

/* Tooltip */
body[data-theme="night"] .orrery-tooltip {
    background: rgba(26, 5, 5, 0.92);
    border-color: rgba(127, 29, 29, 0.5);
    color: #d4a0a0;
}

body[data-theme="night"] .orrery-tooltip-name {
    color: #fca5a5;
}

body[data-theme="night"] .orrery-tooltip-detail {
    color: #993333;
}

/* Demo info overlay */
body[data-theme="night"] .orrery-demo-info {
    background: rgba(13, 2, 2, 0.75);
    border-color: rgba(127, 29, 29, 0.4);
    color: #d4a0a0;
}

body[data-theme="night"] .orrery-demo-info-name {
    color: #fca5a5;
}

body[data-theme="night"] .orrery-demo-info-type {
    color: #993333;
}

body[data-theme="night"] .orrery-demo-info-stat .stat-label {
    color: #7f3333;
}

body[data-theme="night"] .orrery-demo-info-stat .stat-value {
    color: #fca5a5;
}

body[data-theme="night"] .orrery-demo-info-notes {
    color: #993333;
}

/* Help overlay */
body[data-theme="night"] .orrery-help-content {
    background: rgba(13, 2, 2, 0.65);
    border-color: rgba(239, 68, 68, 0.25);
}

body[data-theme="night"] .orrery-help-title {
    color: rgba(252, 165, 165, 0.9);
}

body[data-theme="night"] .orrery-help-hints span {
    color: rgba(212, 160, 160, 0.85);
}

body[data-theme="night"] .orrery-help-hints span i {
    color: rgba(248, 113, 113, 0.7);
}

body[data-theme="night"] .orrery-help-hints kbd {
    background: rgba(77, 21, 21, 0.5);
    border-color: rgba(127, 29, 29, 0.4);
    color: rgba(252, 165, 165, 0.9);
}
