/* Main styles for Weather Mini App */

:root {
    --primary-color: #4834d4;
    --text-color: #ffffff;
    --secondary-text: rgba(255, 255, 255, 0.8);
    --card-bg: rgba(255, 255, 255, 0.1);
    --app-max-width: 428px;
    --app-max-height: 926px;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    height: 100vh;
    height: calc(var(--tg-viewport-height, 100vh));
    overflow: hidden;
    color: #333;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

/* ── Desktop: constrain to mobile viewport ──────────────────────────── */
html.is-desktop body {
    width: var(--app-max-width);
    max-height: var(--app-max-height);
    height: 100vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 20px;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

html.is-desktop #bg-layer,
html.is-desktop #bg-layer-color {
    width: var(--app-max-width);
    max-height: var(--app-max-height);
    height: 100vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 20px;
}

html.is-desktop {
    background: #1a1a2e;
}

/* Constrain all fixed overlays to the mobile frame on desktop */
html.is-desktop .user-menu,
html.is-desktop .cloud-map-overlay,
html.is-desktop .aurora-globe-overlay,
html.is-desktop .aurora-dash-overlay,
html.is-desktop .light-map-overlay,
html.is-desktop .moon-calendar-overlay,
html.is-desktop .moon-day-modal-overlay,
html.is-desktop .error-toast {
    inset: auto;
    width: var(--app-max-width);
    max-height: var(--app-max-height);
    height: 100vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

html.is-desktop .aurora-globe-overlay,
html.is-desktop .aurora-dash-overlay {
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}

html.is-desktop .cloud-map-overlay {
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}

/* Clip-path overlays need border-radius inside the frame */
html.is-desktop .user-menu.open,
html.is-desktop .light-map-overlay.open,
html.is-desktop .moon-calendar-overlay.open {
    border-radius: 20px;
}

html.is-desktop .user-menu.open,
html.is-desktop .user-menu.opening,
html.is-desktop .user-menu.closing {
    border-radius: 20px 20px 0 0;
}

html.is-desktop .cloud-map-overlay.open,
html.is-desktop .cloud-map-overlay.opening,
html.is-desktop .cloud-map-overlay.closing {
    border-radius: 20px 20px 0 0;
}

html.is-desktop .aurora-globe-overlay.open,
html.is-desktop .aurora-globe-overlay.opening,
html.is-desktop .aurora-globe-overlay.closing,
html.is-desktop .aurora-dash-overlay.open,
html.is-desktop .aurora-dash-overlay.opening,
html.is-desktop .aurora-dash-overlay.closing {
    border-radius: 20px 20px 0 0;
}

html.is-desktop .aurora-dash-enlil-modal {
    inset: auto;
    width: var(--app-max-width);
    max-height: var(--app-max-height);
    height: 100vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
html.is-desktop .aurora-dash-alerts-modal {
    inset: auto;
    width: var(--app-max-width);
    max-height: var(--app-max-height);
    height: 100vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Bootstrap modal — constrain to frame */
html.is-desktop .modal {
    inset: auto;
    width: var(--app-max-width);
    max-height: var(--app-max-height);
    height: 100vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

html.is-desktop .modal-backdrop {
    inset: auto;
    width: var(--app-max-width);
    max-height: var(--app-max-height);
    height: 100vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Отдельная анимация для page-indicators: сохраняет translateX(-50%) */
@keyframes fadeInDots {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.weather-app {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Top Section */
.top-section {
    padding: 1rem 2rem;
    color: white;
    text-align: center;
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    max-height: 430px;
    animation: fadeIn 0.6s ease-out;
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease-out;
}

.location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.location span {
    font-size: 0.85rem;
}

.location i {
    transition: transform 0.3s ease;
}

.location:hover i {
    transform: scale(1.2);
}

.menu-icon {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.menu-icon:hover {
    transform: rotate(90deg);
}

/* Current Weather */
.current-weather {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
    max-height: 120px;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.date {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.temperature {
    font-size: 5rem;
    line-height: 1;
    margin: 0.5rem 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.5s ease;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.temp-value {
    margin-left: 0.3em;
    font-weight: 300;
    animation: slideUp 0.6s ease-out 0.4s both;
}

.temp-unit {
    font-size: 2.5rem;
    opacity: 0.9;
    margin-right: 0.4em;
}

/* Sun progress indicators */
.cloud-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 1.5rem;
    opacity: 0.85;
    animation: fadeIn 0.6s ease-out 0.5s both;
    transition: all 0.3s ease;
}

.cloud-progress:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.cloud-progress:hover i {
    transform: scale(1.15) rotate(5deg);
}

.cloud-progress i {
    font-size: 1.5rem;
    margin-bottom: 0.15rem;
    transition: all 0.5s ease;
}

.cloud-progress span {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}
.cloud-progress small {
    font-size: 0.35em;
    white-space: nowrap;
}

.cloud-progress .precipitation-text {
    font-size: 0.35em;
    display: block;
    margin-top: 0.1rem;
    opacity: 0.9;
    font-weight: 500;
}

.sunrise-progress {
    animation-delay: 0.45s;
    cursor: pointer;
    transition: opacity 0.15s;
}

.sunset-progress {
    animation-delay: 0.55s;
    cursor: pointer;
    transition: opacity 0.15s;
}

.sunrise-progress:active,
.sunset-progress:active {
    opacity: 0.65;
}

.temp-range {
    display: flex;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease-out 0.5s both;
}

.temp-range span {
    transition: transform 0.3s ease;
}

.temp-range span:hover {
    transform: translateY(-2px);
}

/* Swipeable Conditions Container */
.conditions-container {
    position: relative;
    overflow: hidden;
    margin: 1rem 0 2rem 0;
    animation: fadeIn 0.8s ease-out 0.6s both;
    border-radius: 1.25rem;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.conditions-wrapper {
    display: flex;
    transition: transform 0.3s ease-out;
    will-change: transform;
    height: 155px;
    padding-bottom: 10px;
}

.conditions-wrapper.swiping {
    transition: none;
}

/* Weather Conditions */
.day-sun-statistic {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 1.25rem;
    padding: 1.25rem 0.3rem 1.75rem 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    backdrop-filter: blur(20px);
    /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); */
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    flex-shrink: 0;
    width: calc(100% - 12px);
    min-width: calc(100% - 12px);
    box-sizing: border-box;
    margin: 0 6px;
}

.day-sun-statistic.active {
    padding: 0.22rem 0.4rem 1.32rem 0.4rem;
    gap: 0.04rem;
    justify-content: flex-start;
}

.day-sun-statistic:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.conditions-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.day-arc-wrap {
    width: 100%;
    margin-top: -8px;
    margin-bottom: -14px;
}

.day-arc-svg {
    display: block;
    width: 100%;
    height: 68px;
    overflow: visible;
}

.day-arc-track {
    fill: none;
    stroke: rgba(214, 223, 245, 0.56);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 7 7;
}

.day-arc-progress {
    fill: none;
    stroke: #FFC45C;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.day-arc-progress.is-night {
    stroke: #DDE7FF;
}

.day-arc-stats {
    margin-top: -4px;
}

.day-arc-stats .condition-item {
    gap: 0.14rem;
}

.day-arc-stats .condition-item .value {
    font-size: 1.25rem;
    line-height: 1.02;
    margin-bottom: 0;
}

.day-arc-stats .condition-item .description {
    font-size: 0.64rem;
    line-height: 1.05;
    min-height: 1.9em;
}

.day-arc-stats .condition-item-center .value {
    font-size: 1.2rem;
}

.day-arc-stats .condition-item-center .description {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.92);
}

.day-arc-stats .condition-item.is-dash .value {
    letter-spacing: 0.04em;
}

.day-arc-marker-day circle:first-child {
    filter: drop-shadow(0 0 8px rgba(255, 196, 92, 0.55));
}

.day-arc-marker-night circle:first-child {
    filter: drop-shadow(0 0 8px rgba(221, 231, 255, 0.42));
}

/* Page Indicators */
.page-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    animation: fadeInDots 0.6s ease-out 0.8s both;
    z-index: 10;
    pointer-events: all;
}

.page-indicators .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-indicators .dot.active {
    background: rgba(255, 255, 255, 0.9);
    width: 24px;
    border-radius: 4px;
}

/* Golden Hour Info */
.golden-hour-info {
    /* display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem; */
    padding: 0.5rem 0 0.25rem 0;
    /* border-top: 1px solid rgba(255, 255, 255, 0.2); */
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    animation: fadeIn 0.6s ease-out 0.9s both;
}

.day-sun-statistic.active .golden-hour-info {
    margin-top: 6px;
    padding: 0;
    font-size: 0.82rem;
    line-height: 1.1;
    text-align: center;
}

.golden-hour-info #goldenHourTime,
.golden-hour-info #astroNightTime,
.golden-hour-info #moonEventTime {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Moon Screen Styles */
.moon-screen .moon-display {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    /*gap: 1rem;
    padding: 0.5rem 1rem;*/
    margin-top: -5px;
}

.light-pollution-screen {
    padding: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.aurora-screen {
    padding: 7px 10px 8px;
    gap: 4px;
    justify-content: flex-start;
    background:
        radial-gradient(120% 170% at 0% 100%, rgba(34, 176, 136, 0.22) 0%, rgba(34, 176, 136, 0) 48%),
        radial-gradient(120% 170% at 100% 0%, rgba(126, 73, 211, 0.2) 0%, rgba(126, 73, 211, 0) 50%),
        rgba(255, 255, 255, 0.12);
}

.aurora-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.aurora-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #F1FBFF;
    line-height: 1.15;
}

.aurora-probability-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.aurora-globe-icon {
    font-size: 0.72rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.aurora-globe-icon:focus-visible {
    outline: 2px solid rgba(211, 236, 255, 0.9);
    outline-offset: 2px;
}

.aurora-probability-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: #f6ffcc;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 1px 8px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.aurora-kp-forecast {
    margin-top: 1px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    justify-content: stretch;
}

.aurora-kp-day {
    background: var(--kp-bg, rgba(255, 255, 255, 0.14));
    border: 1px solid var(--kp-border, rgba(255, 255, 255, 0.18));
    border-radius: 5px;
    padding: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    aspect-ratio: 1 / 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    max-width: 47px;
}

.aurora-kp-day-label {
    font-size: 0.45rem;
    color: var(--kp-label, rgba(234, 243, 255, 0.82));
    text-transform: lowercase;
    line-height: 1;
}

.aurora-kp-day-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--kp-value, #f6ffcc);
    line-height: 1;
}

.aurora-kp-day.placeholder {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.aurora-kp-day.placeholder .aurora-kp-day-label {
    color: rgba(228, 240, 252, 0.7);
}

.aurora-kp-day.placeholder .aurora-kp-day-value {
    color: rgba(233, 241, 251, 0.6);
}

.aurora-kp-empty {
    grid-column: 1 / -1;
    font-size: 0.72rem;
    color: rgba(228, 243, 255, 0.8);
    text-align: center;
    padding-top: 8px;
}

.aurora-kp-mini {
    min-height: 50px;
    padding: 1px 0 0;
}

.aurora-kp-mini-bars {
    height: 32px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: end;
    gap: 2px;
}

.aurora-kp-mini-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 0;
    cursor: pointer;
}

.aurora-kp-mini-bar {
    width: 100%;
    min-height: 2px;
    border-radius: 3px 3px 0 0;
    background: var(--kp-bg, #3ea63f);
    border: 1px solid var(--kp-border, rgba(255, 255, 255, 0.28));
}

.aurora-kp-mini-time {
    font-size: 0.44rem;
    line-height: 1;
    color: rgba(223, 236, 250, 0.82);
}

.aurora-kp-mini-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.66rem;
    color: rgba(228, 243, 255, 0.8);
    text-align: center;
}

.aurora-mini-tooltip {
    position: absolute;
    z-index: 12000;
    max-width: 240px;
    padding: 8px 9px;
    border-radius: 8px;
    font-size: 0.58rem;
    line-height: 1.25;
    color: #f4f7fb;
    background: rgba(10, 14, 22, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.36);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.aurora-mini-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.aurora-mini-tooltip-title {
    color: rgba(233, 240, 249, 0.92);
    font-size: 0.6rem;
    line-height: 1.2;
}

.aurora-mini-tooltip-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}

.aurora-mini-tooltip-kp {
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
}

.aurora-mini-tooltip-clouds {
    margin-top: 7px;
    display: grid;
    gap: 4px;
}

.aurora-mini-tooltip-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.aurora-mini-tooltip-time {
    color: rgba(183, 200, 220, 0.78);
    min-width: 32px;
    flex: 0 0 32px;
}

.aurora-mini-tooltip-text {
    color: rgba(244, 247, 251, 0.92);
    flex: 1 1 auto;
}

.aurora-probability-popup {
    position: absolute;
    inset: 0;
    z-index: 12010;
    pointer-events: none;
    opacity: 0;
    overflow: visible;
}

.aurora-probability-popup.open {
    opacity: 1;
}

.aurora-probability-popup-card {
    position: absolute;
    pointer-events: auto;
    left: var(--aurora-probability-popup-x, 50%);
    top: var(--aurora-probability-popup-y, 50%);
    width: 248px;
    max-width: calc(100vw - 34px);
    padding: 12px 12px 11px;
    border-radius: 14px;
    background: rgba(10, 14, 22, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
    transform: translate(-50%, 0) scale(0.86);
    transform-origin: center center;
    transition: transform 0.18s ease, opacity 0.18s ease;
    opacity: 0;
}

.aurora-probability-popup.open .aurora-probability-popup-card {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
}

.aurora-probability-popup-card::after {
    content: "";
    position: absolute;
    left: var(--aurora-probability-popup-arrow-x, 50%);
    bottom: -7px;
    width: 14px;
    height: 14px;
    background: rgba(10, 14, 22, 0.96);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    transform: translateX(-50%) rotate(45deg);
}

.aurora-probability-popup[data-arrow-dir="-1"] .aurora-probability-popup-card::after {
    top: -7px;
    bottom: auto;
    transform: translateX(-50%) rotate(225deg);
}

.aurora-probability-popup-title {
    color: #f4f7fb;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 8px;
}

.aurora-probability-popup-body {
    display: grid;
    gap: 10px;
}

.aurora-probability-popup-note {
    color: rgba(235, 242, 250, 0.9);
    font-size: 0.67rem;
    line-height: 1.3;
}

.aurora-probability-popup-rows {
    display: grid;
    gap: 10px;
}

.aurora-probability-popup-row {
    display: grid;
    gap: 3px;
}

.aurora-probability-popup-label {
    color: rgba(183, 200, 220, 0.78);
    font-size: 0.62rem;
    line-height: 1.2;
}

.aurora-probability-popup-value {
    color: #f4f7fb;
    font-size: 0.66rem;
    line-height: 1.2;
    font-weight: 600;
    text-align: left;
}

.light-pollution-preview {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
}

.light-pollution-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(6, 11, 20, 0.3) 0%, rgba(6, 11, 20, 0.2) 24%, rgba(6, 11, 20, 0.44) 100%),
        radial-gradient(circle at 50% 48%, rgba(7, 13, 22, 0.04) 0%, rgba(7, 13, 22, 0.2) 42%, rgba(7, 13, 22, 0.5) 100%);
}

.light-pollution-preview-map,
.light-map-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 42%, rgba(244, 166, 62, 0.18) 0%, rgba(244, 166, 62, 0.08) 18%, rgba(12, 24, 48, 0.12) 40%, rgba(9, 17, 31, 0.94) 100%),
        #0a1220;
}

.light-map-base-layer,
.light-map-overlay-layer,
.light-map-marker-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.light-map-base-layer img,
.light-map-overlay-layer img {
    position: absolute;
    width: 256px;
    height: 256px;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.light-map-base-layer {
    filter: invert(1) hue-rotate(180deg) saturate(0.72) brightness(1) contrast(1.08);
}

.light-map-overlay-layer {
    background:
        linear-gradient(180deg, rgba(7, 13, 22, 0.1) 0%, rgba(7, 13, 22, 0.18) 100%);
    mix-blend-mode: plus-lighter;
    opacity: 0.9;
}

#lightPollutionPreviewBase {
    filter: invert(1) hue-rotate(180deg) saturate(0.3) brightness(0.8) contrast(1.22);
}

#lightPollutionPreviewOverlay {
    opacity: 0.72 !important;
}

.light-map-marker-layer::before,
.light-map-marker-layer::after {
    content: "";
    position: absolute;
    left: var(--marker-x, 50%);
    top: var(--marker-y, 50%);
    transform: translate(-50%, -50%);
    border-radius: 999px;
}

.light-map-marker-layer::before {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle, rgba(255, 196, 94, 0.78) 0%, rgba(255, 196, 94, 0.08) 70%, rgba(255, 196, 94, 0) 100%);
}

.light-map-marker-layer::after {
    width: 10px;
    height: 10px;
    background: #FFC45C;
    border: 2px solid #FFF4DB;
    box-shadow: 0 0 12px rgba(255, 196, 94, 0.48);
}

.light-pollution-preview-topbar {
    position: absolute;
    inset: 10px 12px auto 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    z-index: 2;
    pointer-events: none;
}

.light-pollution-preview-chip,
.light-pollution-preview-hint {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.light-pollution-preview-chip {
    color: #F3F7FF;
    font-weight: 700;
    background: rgba(9, 20, 37, 0.78);
    border: 1px solid rgba(90, 118, 164, 0.34);
}

.light-pollution-preview-hint {
    color: rgba(219, 232, 255, 0.84);
    background: rgba(17, 30, 50, 0.1);
    /* border: 1px solid rgba(73, 92, 126, 0.28); */
}

.moon-phase-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    max-width: 100px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

/* Custom Moon Drawing */
.custom-moon {
    width: 55px;
    height: 55px;
    position: relative;
    flex-shrink: 0;
}

.custom-moon .moon-main-svg {
    display: block;
    width: 55px;
    height: 55px;
}

@keyframes moonFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

.moon-illumination {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.moon-phase-label {
    font-size: 0.72rem;
    line-height: 1.1;
    color: rgba(255, 255, 255, 0.82);
    text-align: center;
    text-transform: lowercase;
}

.moon-times-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 2;
    min-width: 0;
}

.moon-times {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.moon-time-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.moon-time-item i {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.moon-time-item span {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.moon-time-item small {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.moon-nearest-events {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 2px;
}

.moon-nearest-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.66rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.78);
}

.moon-nearest-label {
    white-space: nowrap;
}

.moon-nearest-value {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-align: right;
}

.moon-phase-container:active {
    transform: scale(0.98);
}

.condition-item {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeIn 0.5s ease-out both;
    transition: all 0.3s ease;
}

.condition-item:nth-child(1) {
    animation-delay: 0.7s;
}

.condition-item:nth-child(2) {
    animation-delay: 0.8s;
}

.condition-item:nth-child(3) {
    animation-delay: 0.9s;
}

.condition-item:hover {
    transform: scale(1.05);
}

.condition-item .value,
.condition-item .time {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.condition-item i {
    font-size: 1.5rem;
    margin: 0.25rem 0;
    transition: all 0.3s ease;
}

.condition-item:hover i {
    transform: scale(1.2);
}

.condition-item .description {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.2;
}

/* Bottom Sheet */
.bottom-sheet {
  position: fixed;
  background: #fff;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 15px 15px 20px 15px;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 16px);
  transition: height 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: height;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.bottom-sheet.dragging {
  transition: none;
}

/* ручка для перетаскивания */
.drag-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: #d0d0d0;
  border-radius: 2px;
  opacity: 0.6;
  transition: all 0.3s ease;
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle:hover {
  opacity: 1;
  width: 48px;
  background: #a0a0a0;
}

/* Hourly Forecast Table */
.hourly-forecast {
    margin-bottom: 1.2rem;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out 0.5s both;
}

.hourly-forecast h3 {
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Table container with horizontal scroll */
.table-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}


/* Custom scrollbar for table */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #6e8efb 0%, #a777e3 100%);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #5a7ae8 0%, #9665d4 100%);
}

/* Table structure */
.hourly-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    color: #333;
}

.hourly-table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s ease;
}

.hourly-table tbody tr:hover {
    background: rgba(110, 142, 251, 0.03);
}

.hourly-table tbody tr:last-child {
    border-bottom: none;
}

/* Sticky first column (fixed on scroll) */
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
    background: #fff;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-right: 2px solid rgba(110, 142, 251, 0.15);
    min-width: 140px;
    max-width: 140px;
    white-space: nowrap;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    font-size: 0.85rem;
    color: #444;
}

/* Keep sticky column background consistent on row hover */
.hourly-table tbody tr:hover .sticky-col {
    background: linear-gradient(90deg, #fff 0%, rgba(110, 142, 251, 0.03) 100%);
}

/* Date row styling */
.row-date {
    border: none !important;
    position: relative;
    z-index: 2;
}

.row-date .sticky-col {
    background: rgba(0, 0, 0, 0.3);
    border-right: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 13;
}

/* Строка с текстом дат */
.row-date-text {
    border: none !important;
}

.row-date-text .sticky-col {
    background: transparent;
    border-right: 2px solid rgba(0, 0, 0, 0.1) !important;
    border: none;
    z-index: 13;
}

.row-date-text .date-cell {
    position: sticky;
    left: 140px;
    z-index: 11;
    padding: 0.3rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: #000;
    white-space: nowrap;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    line-height: 1.2;
    min-width: 80px;
    background: transparent;
}

/* Строка с градиентом времени суток */
.row-daytime-gradient {
    height: 8px;
    max-height: 8px;
    border: none !important;
}

.row-daytime-gradient .sticky-col {
    padding: 0;
    border-right: 2px solid rgba(0, 0, 0, 0.1) !important;
}

.daytime-gradient-cell {
    padding: 0;
    height: 8px;
    max-height: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Красные вертикальные линии для рассвета и заката */
.sunrise-line,
.sunset-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(240, 112, 127, 0.8);
    pointer-events: none;
    z-index: 1;
}

/* Строка с градиентом луны */
.row-moon-gradient {
    height: 8px;
    border: none !important;
}

.row-moon-gradient td {
    padding: 0;
    border-bottom-width: 1px;
    border-bottom-color: #163159;
}

.row-moon-gradient .sticky-col {
    border-right: 2px solid rgba(0, 0, 0, 0.1) !important;
    border-bottom: none;
}

.moon-gradient-cell {
    padding: 0;
    height: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(16, 32, 58, 0.95);
}

/* Строка видимости Млечного Пути */
.row-milky-way-gradient {
    height: 10px;
    border: none !important;
}

.row-milky-way-gradient td {
    padding: 0;
    border-bottom-width: 1px;
    border-bottom-color: #0d1830;
}

.row-milky-way-gradient .sticky-col {
    border-right: 2px solid rgba(0, 0, 0, 0.1) !important;
    border-bottom: none;
}

.milky-way-gradient-cell {
    padding: 0;
    height: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(6, 10, 20, 0.98) 0%, rgba(10, 16, 30, 0.98) 100%);
}



.milky-way-hit-area {
    position: absolute;
    top: 0;
    bottom: 0;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    cursor: pointer;
    z-index: 2;
}

.astro-popover {
    position: fixed;
    inset: 0;
    z-index: 4500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.astro-popover.open {
    opacity: 1;
}

.astro-popover-card {
    position: fixed;
    left: var(--astro-popover-x, 50vw);
    top: var(--astro-popover-y, 50vh);
    transform: translate(-50%, -14px) scale(0.18, 0.08);
    transform-origin: bottom center;
    width: min(245px, calc(100vw - 24px));
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(11, 20, 36, 0.96);
    border: 1px solid rgba(172, 244, 255, 0.22);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    color: #eaf6ff;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
    will-change: transform, opacity;
}

.astro-popover.open .astro-popover-card {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 10px)) scale(1, 1);
}

.astro-popover-card::after {
    content: "";
    position: absolute;
    left: var(--astro-popover-arrow-x, 50%);
    bottom: -7px;
    width: 12px;
    height: 12px;
    background: rgba(11, 20, 36, 0.96);
    border-right: 1px solid rgba(172, 244, 255, 0.22);
    border-bottom: 1px solid rgba(172, 244, 255, 0.22);
    transform: translateX(-50%) rotate(45deg);
}

.astro-popover-title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    color: #acf4ff;
}

.astro-popover-body {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
    color: rgba(234, 246, 255, 0.86);
    white-space: pre-line;
}

/* Пустые ячейки дат (без текста) */
.row-date-text .date-cell:empty {
    padding: 0;
    min-width: 0;
    width: 0;
    border: none;
    pointer-events: none;
    
}

/* Data cells */
.hour-cell {
    padding: 0.75rem 1rem;
    text-align: center;
    min-width: 80px;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.hour-cell:last-child {
    border-right: none;
}

.hour-cell:hover {
    background: rgba(110, 142, 251, 0.08);
    transform: scale(1.02);
}

/* Icon cells */
.icon-cell i {
    font-size: 1.5rem;
    color: #6e8efb;
    transition: all 0.3s ease;
}

.icon-cell:hover i {
    transform: scale(1.2);
    color: #5a7ae8;
}

/* Temperature cells */
.temp-cell {
    font-weight: 600;
    color: #444;
    font-size: 1rem;
}

/* Wind cells - vertical stacking via inner div */
.wind-cell {
    padding: 0.5rem !important;
}

.wind-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.wind-arrow {
    font-size: 1.2rem;
    color: #6e8efb;
    transition: transform 0.3s ease;
    /* transform rotation is set inline via JS based on wind_deg */
}

.wind-content span {
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
}

/* Precipitation cells */
.precip-cell {
    color: #3498db;
    font-weight: 500;
}

.fog-cell {
    color: #8899aa;
}

.fog-cell.fog-active {
    color: #5577aa;
    font-weight: 600;
}

.cloud-layer-cell {
    color: #7a8fa6;
}

/* Row-specific styling */
.row-time .hour-cell {
    font-weight: 600;
    background: rgba(0, 0, 0, 0.02);
    color: #555;
}

.row-icon {
    background: rgba(110, 142, 251, 0.02);
}

/* Animation on data load */
@keyframes cellFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hour-cell {
    animation: cellFadeIn 0.4s ease-out both;
}

/* Staggered animation for first 5 cells only */
.hour-cell:nth-child(2) { animation-delay: 0.05s; }
.hour-cell:nth-child(3) { animation-delay: 0.1s; }
.hour-cell:nth-child(4) { animation-delay: 0.15s; }
.hour-cell:nth-child(5) { animation-delay: 0.2s; }
.hour-cell:nth-child(6) { animation-delay: 0.25s; }

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .sticky-col {
        min-width: 100px;
        max-width: 100px;
        font-size: 0.65rem;
        padding: 0.5rem 0.75rem;
        font-weight: 400;
        background-color: #f4f8fb !important;
        box-shadow: none;
    }

    .row-date-text .date-cell {
        left: 100px;
        font-size: 0.65rem;
        padding: 0.25rem 0.75rem;
        min-width: 60px;
    }

    .row-date-text .date-cell:empty {
        padding: 0;
        min-width: 0;
        width: 0;
        pointer-events: none;
    }

    .hour-cell {
        min-width: 60px;
        padding: 0.5rem 0.75rem;
        font-size: 0.6rem;
    }

    .hourly-forecast h3 {
        font-size: 1.1rem;
    }

    .icon-cell i {
        font-size: 1.3rem;
    }

    .wind-arrow {
        font-size: 1rem;
    }

    .wind-content span {
        font-size: 0.7rem;
    }
}

/* Tomorrow Forecast - Компактный дизайн */
.tomorrow-forecast {
    background: linear-gradient(135deg, #f5f5f5 0%, #ebeff2 100%);
    border-radius: 1.25rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease-out 0.7s both;
}

.tomorrow-forecast:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.tomorrow-forecast h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.forecast-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Верхняя строка: Иконка + Condition + Температура */
.forecast-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.forecast-icon {
    font-size: 1.8rem;
    color: #6e8efb;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.tomorrow-forecast:hover .forecast-icon {
    transform: scale(1.1);
}

.forecast-condition {
    flex: 1;
    font-size: 0.9rem;
    color: #444;
    font-weight: 500;
    text-transform: capitalize;
}

.forecast-temp {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

.forecast-temp .high {
    color: #e74c3c;
}

.forecast-temp .low {
    color: #3498db;
}

/* Дополнительные данные - Grid 2x2 */
.forecast-details {
    display: grid;
    grid-template-columns: 3fr 1fr;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0.5rem;
}

.detail-label {
    font-size: 0.7rem;
    color: #666;
    font-weight: 500;
}

.detail-value {
    font-size: 0.85rem;
    color: #333;
    font-weight: 600;
}

/* Responsive для мобильных */
@media (max-width: 768px) {
    .tomorrow-forecast {
        padding: 0.6rem;
    }

    .tomorrow-forecast h3 {
        font-size: 1rem;
        margin-bottom: 0;
    }

    .forecast-icon {
        font-size: 1.5rem;
    }

    .forecast-condition {
        font-size: 0.8rem;
    }

    .forecast-temp {
        font-size: 0.9rem;
    }

    .detail-label {
        font-size: 0.65rem;
    }

    .detail-value {
        font-size: 0.75rem;
    }
}

/* Background Layer */
#bg-layer, #bg-layer-color {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -2;
    transition: all 0.8s ease-in-out;
}

#bg-layer-color {
    z-index: -1;
    transition: background 1s ease-in-out;
}

/* поиск города */
.clickable {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: all 0.3s ease;
}

.clickable:hover {
    opacity: 0.85;
    transform: translateX(2px);
}

/* ========== LOCATION MODAL ========== */
.modal.fade .modal-dialog {
    transform: translateY(18px) scale(0.96);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

.modal-backdrop.show {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background-color: rgba(7, 15, 28, 0.58);
}

#cityModal .modal-dialog {
    max-width: 416px;
    padding: 0 14px;
}

#cityModal.show {
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    background: rgba(7, 15, 28, 0.14);
}

.location-modal {
    background: transparent;
    border: none;
    box-shadow: none;
}

.location-modal-card {
    border-radius: 20px;
    background: rgba(21, 30, 49, 0.95);
    border: 1px solid rgba(42, 59, 94, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.location-modal-top {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.location-modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.location-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #F2F6FF;
    letter-spacing: -0.02em;
}

.location-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 14px;
    background: #2A3B5F;
    color: #EAF1FF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.location-modal-close:hover {
    background: #324873;
    transform: scale(1.06);
}

.location-modal-close:active {
    transform: scale(0.96);
}

.location-modal-close i {
    font-size: 12px;
}

.location-search-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    background: #181F30;
    border: 1px solid rgba(42, 59, 94, 0.5);
}

.location-search-icon {
    font-size: 14px;
    color: #6B7A9E;
    flex: 0 0 auto;
}

.location-search-input {
    width: 100%;
    border: none;
    background: transparent;
    color: #EAF1FF;
    font-size: 14px;
    outline: none;
    padding: 0;
}

.location-search-input::placeholder {
    color: #6B7A9E;
}

.location-modal-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.location-current-btn {
    width: 100%;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(58, 80, 128, 0.63);
    background: linear-gradient(180deg, #243858 0%, #1A2C48 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    color: #E7EEFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.location-current-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.location-current-btn:active {
    transform: translateY(0) scale(0.985);
}

.location-current-btn:disabled {
    opacity: 0.7;
}

.location-current-btn-icon {
    font-size: 23px;
    color: #BFD2FF;
    text-shadow: 0 0 10px rgba(191, 210, 255, 0.25);
    margin-top: -5px;
}

.location-current-btn-text {
    color: #E7EEFF;
}

.location-results-panel {
    border-radius: 14px;
    background: #0D1522;
    border: 1px solid rgba(30, 46, 74, 0.44);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 84px;
}

.location-results-title {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #90A3D0;
}

.location-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 228px;
    overflow-y: auto;
}

.location-results-list::-webkit-scrollbar {
    width: 6px;
}

.location-results-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(74, 103, 158, 0.7);
}

.location-result-item,
.location-results-empty,
.location-results-error {
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(42, 59, 94, 0.38);
    background: linear-gradient(180deg, #1C2D4A 0%, #182640 100%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    padding: 0 12px;
    display: flex;
    align-items: center;
}

.location-result-item {
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease, border-color 0.18s ease;
}

.location-result-item:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    border-color: rgba(83, 116, 179, 0.64);
}

.location-result-item:active,
.location-result-item.is-selected {
    transform: scale(0.985);
}

.location-result-item-label {
    color: #EAF1FF;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
}

.location-results-empty {
    color: #90A3D0;
    justify-content: center;
    text-align: center;
}

.location-results-error {
    color: #F4A8A8;
    justify-content: center;
    text-align: center;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading * {
    animation: pulse 2s ease-in-out infinite;
}

/* Loading Spinner Overlay */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
    animation: loadingSpinnerFadeIn 0.3s ease-out;
}

@keyframes loadingSpinnerFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.spinner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner-content p {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Toast */
.error-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4757;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(255, 71, 87, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    animation: slideDown 0.4s ease-out;
    max-width: 90%;
}

.error-toast i {
    font-size: 1.5rem;
}

.error-toast span {
    font-weight: 500;
    font-size: 0.95rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   USER MENU OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */

/* Keyframe for radial reveal */
@keyframes menuReveal {
    from { clip-path: circle(0% at calc(100% - 28px) 28px); }
    to   { clip-path: circle(150% at calc(100% - 28px) 28px); }
}
@keyframes menuHide {
    from { clip-path: circle(150% at calc(100% - 28px) 28px); }
    to   { clip-path: circle(0% at calc(100% - 28px) 28px); }
}
@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Base overlay — hidden by default */
.user-menu {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background:
        radial-gradient(circle at 50% 28%, rgba(18, 72, 128, 0.14) 0%, rgba(8, 18, 36, 0.8) 54%, rgba(5, 10, 20, 0.97) 100%),
        #050b14;
    clip-path: circle(0% at calc(100% - 28px) 28px);
    pointer-events: none;
    overflow: hidden;
}

.user-menu.opening {
    animation: menuReveal 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: all;
}

.user-menu.open {
    clip-path: circle(150% at calc(100% - 28px) 28px);
    pointer-events: all;
}

.user-menu.closing {
    animation: menuHide 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

/* Close button — same position as hamburger */
.user-menu-close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(11, 21, 38, 0.64);
    border: 1px solid rgba(120, 152, 196, 0.32);
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
}
.user-menu-close:hover {
    background: rgba(18, 33, 56, 0.9);
    transform: scale(1.1);
}

/* Scrollable inner content */
.user-menu-inner {
    height: 100%;
    overflow-y: auto;
    padding: 64px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: menuFadeIn 0.4s 0.1s ease-out both;
    /* custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.user-menu-inner::-webkit-scrollbar { width: 4px; }
.user-menu-inner::-webkit-scrollbar-track { background: transparent; }
.user-menu-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.user-menu-topline {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

/* ── User greeting ─────────────────────────────────────────────────────── */
.user-menu-greeting {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 14px 16px;
    background: rgba(10, 21, 37, 0.72);
    border-radius: 16px;
    border: 1px solid rgba(93, 123, 167, 0.24);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(64, 127, 212, 0.95), rgba(36, 86, 154, 0.95));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
    border: 1px solid rgba(166, 201, 243, 0.3);
    box-shadow: 0 10px 24px rgba(8, 18, 32, 0.28);
}

.user-greeting-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.user-greeting-text span {
    color: #f3f8ff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-greeting-text small {
    color: rgba(180, 205, 235, 0.62);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Action cards ──────────────────────────────────────────────────────── */
.user-menu-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex: 0 0 auto;
}

.menu-action-card {
    width: 112px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 12px 12px 10px;
    border: 1px solid rgba(93, 123, 167, 0.24);
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s, filter 0.18s;
    color: #f3f8ff;
    background: linear-gradient(180deg, rgba(15, 32, 56, 0.92) 0%, rgba(10, 21, 37, 0.82) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.menu-action-card:active {
    transform: scale(0.97);
}

.menu-action-settings {
    background: linear-gradient(180deg, rgba(15, 32, 56, 0.92) 0%, rgba(10, 21, 37, 0.82) 100%);
}
.menu-action-subscription {
    background: linear-gradient(180deg, rgba(15, 32, 56, 0.92) 0%, rgba(10, 21, 37, 0.82) 100%);
}

.menu-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.menu-action-settings .menu-action-icon {
    background: rgba(82, 138, 214, 0.18);
    color: #b9d8ff;
}
.menu-action-subscription .menu-action-icon {
    background: rgba(82, 138, 214, 0.18);
    color: #b9d8ff;
}

.menu-action-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.menu-action-label span {
    font-size: 13px;
    font-weight: 600;
    color: #f3f8ff;
}
.menu-action-label small {
    font-size: 10px;
    color: rgba(180, 205, 235, 0.6);
    line-height: 1.2;
}

.menu-action-arrow {
    display: none;
}

/* ── Location history ──────────────────────────────────────────────────── */
.user-menu-locations {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.locations-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 4px;
}

.locations-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.locations-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 0;
    color: rgba(255,255,255,0.25);
    font-size: 13px;
}
.locations-empty i {
    font-size: 24px;
    opacity: 0.4;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.07);
    cursor: pointer;
    transition: background 0.18s, transform 0.15s;
    animation: menuFadeIn 0.3s ease-out both;
}
.location-item:active {
    transform: scale(0.97);
    background: rgba(255,255,255,0.12);
}

.location-item-icon {
    color: rgba(255,255,255,0.4);
    font-size: 14px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.location-item-info {
    flex: 1;
    min-width: 0;
}
.location-item-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.location-item-coords {
    color: rgba(255,255,255,0.35);
    font-size: 11px;
    margin-top: 1px;
}

.location-item-delete {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255,80,80,0.0);
    border-radius: 8px;
    color: rgba(255,255,255,0.25);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s, color 0.18s;
}
.location-item-delete:active,
.location-item-delete:hover {
    background: rgba(255,80,80,0.25);
    color: #ff6060;
}

/* Sandbox badge (visible when DEBUG_MODE) */
.sandbox-badge {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,200,60,0.85);
    color: #2a1a00;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    z-index: 9999;
    pointer-events: none;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Active location in history */
.location-item--active {
    background: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.3);
}
.location-item--active .location-item-icon {
    color: #58a6ff;
}
.location-active-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #58a6ff;
    background: rgba(88, 166, 255, 0.15);
    border-radius: 6px;
    padding: 1px 6px;
    margin-left: 4px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* ═══════════════════════════════════════════════════════════════════════════
   CLOUD MAP OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes cloudMapReveal {
    from { clip-path: circle(0% at calc(100% - 40px) calc(100% - 40px)); }
    to   { clip-path: circle(150% at calc(100% - 40px) calc(100% - 40px)); }
}
@keyframes cloudMapHide {
    from { clip-path: circle(150% at calc(100% - 40px) calc(100% - 40px)); }
    to   { clip-path: circle(0% at calc(100% - 40px) calc(100% - 40px)); }
}

.cloud-map-overlay {
    position: fixed;
    inset: 0;
    z-index: 4400;
    background: #0d1b2e;
    clip-path: circle(0% at calc(100% - 40px) calc(100% - 40px));
    pointer-events: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.light-map-overlay {
    position: fixed;
    inset: 0;
    z-index: 4200;
    background: rgba(6, 12, 21, 0.94);
    clip-path: circle(0px at var(--light-map-overlay-origin-x, 50%) var(--light-map-overlay-origin-y, 50%));
    pointer-events: none;
    overflow: hidden;
}

.aurora-globe-overlay {
    position: fixed;
    inset: 0;
    z-index: 4300;
    background:
        radial-gradient(circle at 50% 42%, rgba(23, 96, 171, 0.14) 0%, rgba(11, 24, 46, 0.72) 52%, rgba(5, 11, 21, 0.96) 100%),
        #050b14;
    clip-path: circle(0px at var(--aurora-globe-overlay-origin-x, 50%) var(--aurora-globe-overlay-origin-y, 50%));
    pointer-events: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

@keyframes auroraGlobeReveal {
    from { clip-path: circle(0px at var(--aurora-globe-overlay-origin-x, 50%) var(--aurora-globe-overlay-origin-y, 50%)); }
    to   { clip-path: circle(150vmax at var(--aurora-globe-overlay-origin-x, 50%) var(--aurora-globe-overlay-origin-y, 50%)); }
}

@keyframes auroraGlobeHide {
    from { clip-path: circle(150vmax at var(--aurora-globe-overlay-origin-x, 50%) var(--aurora-globe-overlay-origin-y, 50%)); }
    to   { clip-path: circle(0px at var(--aurora-globe-overlay-origin-x, 50%) var(--aurora-globe-overlay-origin-y, 50%)); }
}

.aurora-globe-overlay.opening {
    animation: auroraGlobeReveal 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: auto;
}

.aurora-globe-overlay.open {
    clip-path: circle(150vmax at var(--aurora-globe-overlay-origin-x, 50%) var(--aurora-globe-overlay-origin-y, 50%));
    pointer-events: auto;
}

.aurora-globe-overlay.closing {
    animation: auroraGlobeHide 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

.aurora-globe-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    background: linear-gradient(180deg, rgba(5, 10, 18, 0.92) 0%, rgba(5, 10, 18, 0.44) 100%);
}

.aurora-globe-header-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.aurora-globe-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.aurora-globe-title {
    color: #f3f8ff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}

.aurora-globe-subtitle {
    color: rgba(195, 216, 242, 0.88);
    font-size: 12px;
    line-height: 1.2;
}

.aurora-globe-kp {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(19, 42, 76, 0.7);
    border: 1px solid rgba(110, 144, 192, 0.3);
    color: #eef6ff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.aurora-globe-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(120, 152, 196, 0.32);
    background: rgba(11, 21, 38, 0.64);
    color: #e6f0ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.aurora-globe-viewport {
    position: absolute;
    inset: 62px 10px 54px 10px;
    border-radius: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 45%, rgba(24, 65, 116, 0.18) 0%, rgba(7, 18, 34, 0.78) 62%, rgba(4, 9, 17, 0.98) 100%),
        #060d18;
    border: 1px solid rgba(101, 132, 178, 0.26);
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    overscroll-behavior: contain;
}

.aurora-globe-scene {
    position: absolute;
    inset: 0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.aurora-globe-scene canvas {
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.aurora-globe-user-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffd66e;
    border: 2px solid rgba(255, 247, 223, 0.94);
    box-shadow: 0 0 0 6px rgba(255, 214, 110, 0.18), 0 0 18px rgba(255, 214, 110, 0.66);
    pointer-events: auto;
}

.aurora-globe-status {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    font-size: 12px;
    color: rgba(204, 224, 247, 0.92);
    text-align: center;
    background: rgba(10, 21, 37, 0.66);
    border: 1px solid rgba(93, 123, 167, 0.28);
    border-radius: 999px;
    padding: 5px 8px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.aurora-globe-popup {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    opacity: 0;
    overflow: visible;
}

.aurora-globe-popup.open {
    opacity: 1;
}

.aurora-globe-popup-card {
    position: absolute;
    pointer-events: auto;
    left: var(--aurora-globe-popup-x, 50%);
    top: var(--aurora-globe-popup-y, 50%);
    width: 244px;
    max-width: calc(100vw - 32px);
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(9, 18, 34, 0.97);
    border: 1px solid rgba(92, 121, 166, 0.34);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transform: translate(-50%, 0) scale(0.82);
    transform-origin: center center;
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
    opacity: 0;
}

.aurora-globe-popup.open .aurora-globe-popup-card {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
}

.aurora-globe-popup-card::after {
    content: "";
    position: absolute;
    left: var(--aurora-globe-popup-arrow-x, 50%);
    bottom: -8px;
    width: 16px;
    height: 16px;
    background: rgba(9, 18, 34, 0.97);
    border-right: 1px solid rgba(92, 121, 166, 0.34);
    border-bottom: 1px solid rgba(92, 121, 166, 0.34);
    transform: translateX(-50%) rotate(45deg);
}

.aurora-globe-popup[data-arrow-dir="-1"] .aurora-globe-popup-card::after {
    top: -8px;
    bottom: auto;
    transform: translateX(-50%) rotate(225deg);
}

.aurora-globe-popup-title {
    color: #f4f8ff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 10px;
}

.aurora-globe-popup-body {
    display: grid;
    gap: 10px;
}

.aurora-globe-popup-coords {
    color: rgba(170, 191, 220, 0.76);
    font-size: 11px;
    line-height: 1.2;
    margin-top: -4px;
}

.aurora-globe-popup-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.aurora-globe-popup-stat {
    min-width: 0;
    padding: 10px 8px;
    border-radius: 12px;
    background: rgba(28, 43, 72, 0.72);
    border: 1px solid rgba(78, 96, 136, 0.24);
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.aurora-globe-popup-stat-label {
    color: rgba(174, 189, 216, 0.78);
    font-size: 10px;
    line-height: 1.15;
    margin-bottom: 6px;
}

.aurora-globe-popup-value {
    color: #f1f6ff;
    font-size: 15px;
    line-height: 1.15;
    font-weight: 600;
}

.aurora-globe-popup-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.aurora-globe-popup-label {
    color: rgba(174, 189, 216, 0.78);
    font-size: 11px;
    line-height: 1.2;
}

.aurora-globe-popup-note {
    color: #f1f6ff;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 400;
    text-align: left;
}

.aurora-globe-footer {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 8px;
    z-index: 3;
}

.aurora-globe-reach {
    font-size: 12px;
    line-height: 1.25;
    color: rgba(213, 230, 250, 0.92);
    text-align: center;
    background: rgba(9, 18, 34, 0.76);
    border: 1px solid rgba(85, 117, 162, 0.3);
    border-radius: 10px;
    padding: 8px 10px;
}

.aurora-globe-timeline {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(9, 18, 34, 0.76);
    border: 1px solid rgba(85, 117, 162, 0.3);
    border-radius: 10px;
    padding: 6px 8px;
}

.aurora-globe-play {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(111, 143, 187, 0.38);
    background: rgba(22, 36, 58, 0.88);
    color: #e8f1ff;
    cursor: pointer;
    flex: 0 0 auto;
    line-height: 1;
    font-size: 12px;
}

.aurora-globe-slider {
    flex: 1 1 auto;
    accent-color: #7fc8ff;
}

.aurora-globe-frame-meta {
    flex: 0 0 auto;
    min-width: 92px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.aurora-globe-frame-time {
    text-align: right;
    font-size: 11px;
    color: rgba(208, 226, 248, 0.92);
}

.aurora-globe-frame-cloud {
    padding: 0;
    border: none;
    background: transparent;
    font-size: 11px;
    line-height: 1.15;
    color: rgba(137, 193, 244, 0.96);
    text-align: right;
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.aurora-globe-frame-cloud:hover {
    color: #bde7ff;
    opacity: 1;
}

.aurora-globe-frame-cloud:active {
    transform: translateY(1px);
}

.aurora-globe-frame-cloud:disabled {
    cursor: default;
    opacity: 0.65;
}

@keyframes lightMapReveal {
    from { clip-path: circle(0px at var(--light-map-overlay-origin-x, 50%) var(--light-map-overlay-origin-y, 50%)); }
    to   { clip-path: circle(150vmax at var(--light-map-overlay-origin-x, 50%) var(--light-map-overlay-origin-y, 50%)); }
}

@keyframes lightMapHide {
    from { clip-path: circle(150vmax at var(--light-map-overlay-origin-x, 50%) var(--light-map-overlay-origin-y, 50%)); }
    to   { clip-path: circle(0px at var(--light-map-overlay-origin-x, 50%) var(--light-map-overlay-origin-y, 50%)); }
}

.light-map-overlay.opening {
    animation: lightMapReveal 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: auto;
}

.light-map-overlay.open {
    clip-path: circle(150vmax at var(--light-map-overlay-origin-x, 50%) var(--light-map-overlay-origin-y, 50%));
    pointer-events: auto;
}

.light-map-overlay.closing {
    animation: lightMapHide 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

.light-map-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    background: linear-gradient(180deg, rgba(6, 12, 21, 0.88) 0%, rgba(6, 12, 21, 0.42) 100%);
}

.light-map-header-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.light-map-title {
    color: #F2F6FF;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}

.light-map-title-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 5px 6px;
    border-radius: 999px;
    background: rgba(72, 95, 138, 0.42);
    color: rgba(223, 233, 250, 0.92);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    vertical-align: top;
    transform: translateY(-0.35em);
}

.light-map-subtitle {
    color: rgba(202, 216, 243, 0.88);
    font-size: 12px;
    line-height: 1.2;
}

.light-map-header-actions {
    display: flex;
    gap: 8px;
}

.light-map-action,
.light-map-close,
.light-map-zoom-btn {
    border: 1px solid rgba(78, 96, 136, 0.36);
    background: rgba(17, 28, 45, 0.78);
    color: #EFF5FF;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.light-map-action,
.light-map-close {
    width: 38px;
    height: 38px;
}

.light-map-action:active,
.light-map-close:active,
.light-map-zoom-btn:active {
    transform: scale(0.96);
}

.light-map-viewport {
    position: absolute;
    inset: 0;
    touch-action: none;
}

.light-map-controls {
    position: absolute;
    right: 14px;
    bottom: 164px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.light-map-zoom-btn {
    width: 42px;
    height: 42px;
    font-size: 28px;
    line-height: 1;
}

.light-map-zoom-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.light-map-legend {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 3;
    display: grid;
    gap: 6px;
    padding: 10px 12px 12px;
    border-radius: 16px;
    background: rgba(10, 18, 32, 0.82);
    border: 1px solid rgba(64, 82, 119, 0.32);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.light-map-scale-title {
    color: rgba(240, 245, 255, 0.96);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
}

.light-map-opacity-control {
    display: grid;
    gap: 7px;
}

.light-map-opacity-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.light-map-opacity-label {
    color: rgba(221, 229, 242, 0.9);
    font-size: 11px;
    line-height: 1.1;
}

.light-map-opacity-value {
    color: rgba(244, 247, 255, 0.94);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.light-map-opacity-slider {
    --light-map-slider-fill: 90%;
    width: 100%;
    height: 18px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
}

.light-map-opacity-slider:focus {
    outline: none;
}

.light-map-opacity-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        rgba(84, 123, 196, 0.98) 0%,
        rgba(84, 123, 196, 0.98) var(--light-map-slider-fill),
        rgba(255, 255, 255, 0.12) var(--light-map-slider-fill),
        rgba(255, 255, 255, 0.12) 100%
    );
}

.light-map-opacity-slider::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.light-map-opacity-slider::-moz-range-progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(84, 123, 196, 0.98);
}

.light-map-opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -5px;
    border-radius: 50%;
    border: 2px solid rgba(240, 245, 255, 0.92);
    background: #10203D;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
}

.light-map-opacity-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(240, 245, 255, 0.92);
    background: #10203D;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
}

.light-map-scale-bar,
.light-map-scale-zones {
    display: grid;
    grid-template-columns: repeat(15, minmax(0, 1fr));
    column-gap: 0;
}

.light-map-scale-bar {
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.light-map-scale-segment {
    display: block;
    height: 10px;
}

.light-map-scale-zones {
    margin-top: -1px;
}

.light-map-scale-zone {
    color: rgba(221, 229, 242, 0.82);
    font-size: 9px;
    line-height: 1;
    text-align: center;
}

.light-map-scale-note {
    color: rgba(168, 181, 204, 0.76);
    font-size: 10px;
    line-height: 1.1;
    text-align: left;
}

.light-map-popup {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
}

.light-map-popup.open {
    opacity: 1;
}

.light-map-popup-card {
    position: absolute;
    left: var(--light-map-popup-x, 50%);
    top: var(--light-map-popup-y, 50%);
    width: 250px;
    max-width: calc(100vw - 32px);
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(12, 19, 34, 0.96);
    border: 1px solid rgba(90, 111, 154, 0.34);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transform: translate(-50%, calc(-100% - 14px)) scale(0.82);
    transform-origin: bottom center;
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
    opacity: 0;
}

.light-map-popup.open .light-map-popup-card {
    transform: translate(-50%, calc(-100% - 14px)) scale(1);
    opacity: 1;
}

.light-map-popup-card::after {
    content: "";
    position: absolute;
    left: var(--light-map-popup-arrow-x, 50%);
    bottom: -8px;
    width: 16px;
    height: 16px;
    background: rgba(12, 19, 34, 0.96);
    border-right: 1px solid rgba(90, 111, 154, 0.34);
    border-bottom: 1px solid rgba(90, 111, 154, 0.34);
    transform: translateX(-50%) rotate(45deg);
}

.light-map-popup-title {
    color: #F4F7FF;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 10px;
}

.light-map-popup-body {
    display: grid;
    gap: 10px;
}

.light-map-popup-coords {
    color: rgba(168, 181, 204, 0.76);
    font-size: 11px;
    line-height: 1.2;
    margin-top: -4px;
}

.light-map-popup-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.light-map-popup-stat {
    min-width: 0;
    padding: 10px 8px;
    border-radius: 12px;
    background: rgba(28, 43, 72, 0.72);
    border: 1px solid rgba(78, 96, 136, 0.24);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 66px;
    text-align: center;
}

.light-map-popup-stat-label {
    color: rgba(174, 189, 216, 0.78);
    font-size: 10px;
    line-height: 1.15;
    margin-bottom: 6px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.light-map-popup-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.light-map-popup-label {
    color: rgba(174, 189, 216, 0.78);
    font-size: 11px;
    line-height: 1.2;
}

.light-map-popup-value {
    color: #F1F6FF;
    font-size: 14px;
    line-height: 1.2;
    text-align: right;
    font-weight: 600;
}

.light-map-popup-value.light {
  text-align: left;
  font-weight: 100;
}

.light-map-popup-stat .light-map-popup-value {
    font-size: 15px;
    line-height: 1;
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.light-map-popup-zone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.light-map-popup-zone-swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.light-map-popup-note {
    color: #F1F6FF;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 400;
    text-align: left;
}
.cloud-map-overlay.opening {
    animation: cloudMapReveal 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: all;
}
.cloud-map-overlay.open {
    clip-path: circle(150% at calc(100% - 40px) calc(100% - 40px));
    pointer-events: all;
}
.cloud-map-overlay.closing {
    animation: cloudMapHide 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

/* Header */
.cloud-map-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 18px 10px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cloud-map-header-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.cloud-map-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}
.cloud-map-title i { color: #58a6ff; }
.cloud-map-age {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: rgba(255,255,255,0.35);
    margin-top: 2px;
}
.cloud-map-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.cloud-notify-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,0.45);
    font-size: 12px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    transition: background .2s, color .2s;
    user-select: none;
    white-space: nowrap;
}
.cloud-notify-toggle input { display: none; }
.cloud-notify-toggle:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.7); }
.cloud-notify-toggle.active {
    background: rgba(88,166,255,0.2);
    color: #58a6ff;
}
.cloud-notify-toggle.active i { color: #58a6ff; }
.cloud-send-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(88,166,255,0.15);
    border: none;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.cloud-send-btn:hover { background: rgba(88,166,255,0.3); color: #fff; }
.cloud-send-btn:disabled { opacity: 0.4; cursor: default; }
.cloud-send-btn.sending { opacity: 0.6; cursor: default; }
.cloud-map-close {
    width: 34px; height: 34px;
    border: none;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
.cloud-map-close:hover { background: rgba(255,255,255,0.18); }

/* Loading */
.cloud-map-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(255,255,255,0.6);
}
.cloud-map-spinner {
    width: 44px; height: 44px;
    border: 3px solid rgba(88,166,255,0.2);
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: spinAnim 0.9s linear infinite;
}
@keyframes spinAnim { to { transform: rotate(360deg); } }
.cloud-map-loading p { font-size: 16px; font-weight: 600; color: #fff; margin: 0; }
.cloud-map-loading small { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: -4px; }
.cloud-map-tip {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-align: center;
    max-width: 300px;
    line-height: 1.5;
    margin-top: 4px;
    padding: 8px 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Error */
.cloud-map-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(255,255,255,0.5);
}
.cloud-map-error i { font-size: 32px; color: #e87d3e; }
.cloud-force-btn i { font-size: 12px; color: #e87d3e; }
.cloud-map-error p { font-size: 15px; color: #fff; margin: 0; }

/* Player */
.cloud-map-player {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Canvas wrap — zoomable/pannable */
.cloud-canvas-wrap {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    cursor: grab;
}
.cloud-canvas-wrap.panning { cursor: grabbing; }
#cloudCanvas {
    display: block;
    max-width: 100%;
    transform-origin: center center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Controls panel */
.cloud-controls {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    padding: 10px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.cloud-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.cloud-btn {
    width: 34px; height: 34px;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
}
.cloud-btn:active { transform: scale(0.92); }
.cloud-btn-play { background: rgba(88,166,255,0.25); color: #58a6ff; }
.cloud-btn-play.playing { background: rgba(255,150,60,0.25); color: #ff963c; }

/* Frame counter */
.cloud-frame-counter {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    min-width: 40px;
    text-align: center;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Speed */
.cloud-speed {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}
.cloud-speed input[type=range] {
    flex: 1;
    accent-color: #58a6ff;
    height: 3px;
}
#cloudSpeedVal {
    min-width: 22px;
    text-align: right;
    color: rgba(255,255,255,0.6);
}

/* Zoom buttons */
.cloud-zoom-btns { display: flex; gap: 4px; }

/* Cloud coverage legend */
.cloud-legend {
    padding: 8px 12px 4px;
    background: rgba(0,0,0,0.25);
}
.cloud-legend-title {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 5px;
    text-align: center;
    letter-spacing: 0.02em;
}
.cloud-legend-scale {
    display: flex;
    height: 12px;
    border-radius: 3px;
    overflow: hidden;
}
.cloud-legend-segment {
    flex: 1;
}
.cloud-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: rgba(255,255,255,0.4);
    margin-top: 3px;
    padding: 0 1px;
}

/* Timeline wrapper + floating scrubber label */
.cloud-timeline-wrapper {
    position: relative;
    width: 100%;
    padding-top: 36px; /* место для метки */
}
.cloud-scrubber-label {
    position: absolute;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    white-space: nowrap;
    transition: left 0.08s linear;
}
.cloud-scrubber-label[data-empty="true"] { display: none; }
.cloud-scrubber-date {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
}
.cloud-scrubber-time {
    font-size: 11px;
    color: rgba(255,255,255,0.65);
    line-height: 1.25;
}

/* Frame slider */
.cloud-slider {
    width: 100%;
    accent-color: #58a6ff;
    cursor: pointer;
    height: 4px;
}

/* Meta row */
.cloud-controls-meta { justify-content: space-between; }

/* Force refresh button */
.cloud-force-btn {
    border: none;
    background: rgba(88,166,255,0.15);
    color: #58a6ff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .2s;
}
.cloud-force-btn:hover { background: rgba(88,166,255,0.28); }
.cloud-force-btn:disabled { opacity: 0.4; cursor: default; }
.cloud-update-info {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    text-align: right;
    white-space: nowrap;
}

/* ── Twilight timeline (screen 2) ──────────────────────────── */
.twilight-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 16px 12px;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(159, 183, 219, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.twilight-timeline {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 2px;
    box-sizing: border-box;
    overflow: visible;
}

.twilight-timeline-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    color: #F2F6FF;
}

.twilight-track-wrap,
.twilight-timeline-times,
.twilight-intervals,
.twilight-edge-labels {
    position: relative;
    width: 100%;
}

.twilight-timeline-times {
    height: 24px;
}

.twilight-track-wrap {
    height: 14px;
}

.twilight-intervals {
    height: 11px;
}

.twilight-edge-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 12px;
    padding: 0 1px;
}

.twilight-bar {
    position: absolute;
    top: 6px;
    left: 0;
    width: 100%;
    height: 2px;
    overflow: visible;
}

.twilight-zone {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 999px;
}

.twilight-zone-civil {
    background: #8EC5FF;
}

.twilight-zone-nautical {
    background: #2E4F8A;
}

.twilight-zone-astro {
    background: #0E1118;
}

.twilight-zone-astro-night {
    background: #0A0D14;
}

.twilight-zone-soft-night {
    background: linear-gradient(90deg, #1A2742 0%, #22365E 100%);
}

.twilight-zone-light-night {
    background: linear-gradient(90deg, #44648D 0%, #5D82B1 100%);
}

.twilight-zone-polar-day {
    background: linear-gradient(90deg, #F1BE76 0%, #F9D98C 100%);
}

.twilight-zone-polar-night {
    background: linear-gradient(90deg, #070A12 0%, #111723 100%);
}

.twilight-points {
    position: absolute;
    inset: 0;
    overflow: visible;
}

.twilight-point {
    position: absolute;
    top: 2px;
    transform: translateX(-50%);
}

.twilight-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid #EEF5FF;
    background: #C3DAFF;
    box-sizing: border-box;
}

.twilight-point.is-edge .twilight-dot {
    background: #F7B84A;
    border-color: #FFF6E2;
}

.twilight-point.is-accent .twilight-dot {
    background: #A9C9FF;
    border-color: #DDEBFF;
}

.twilight-time {
    position: absolute;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 500;
    line-height: 1;
    color: #DDE6FA;
    white-space: nowrap;
}

.twilight-time.is-top-row {
    top: 0;
}

.twilight-time.is-bottom-row {
    top: 12px;
}

.twilight-time.is-edge-start {
    transform: translateX(-10px);
    text-align: left;
}

.twilight-time.is-edge-end {
    transform: translateX(calc(-100% + 12px));
    text-align: right;
}

.twilight-time.is-accent {
    color: #FFDFA0;
    font-weight: 600;
}

.twilight-interval {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 8px;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
}

.twilight-interval.is-civil {
    color: #8EC5FF;
    font-weight: 600;
}

.twilight-interval.is-nautical {
    color: #8FB0E6;
    font-weight: 500;
}

.twilight-interval.is-astro {
    color: #0E1118;
    font-weight: 600;
}

.twilight-interval.is-astro-night {
    color: #0E1118;
    font-weight: 600;
}

.twilight-interval.is-soft-night {
    color: #0E1118;
    font-weight: 600;
}

.twilight-interval.is-light-night {
    color: #D7E6FF;
    font-weight: 600;
}

.twilight-interval.is-polar-day {
    color: #5C3B00;
    font-weight: 700;
}

.twilight-interval.is-polar-night {
    color: #DFE9FF;
    font-weight: 700;
}

.twilight-interval.is-centered {
    transform: translateX(-50%);
    text-align: center;
}

.twilight-interval.is-interactive {
    cursor: pointer;
}

.twilight-edge-label {
    font-size: 8px;
    line-height: 1;
    color: #F3B24B;
    font-weight: 600;
    white-space: nowrap;
}

.astro-night-info {
    padding-top: 0;
    padding-bottom: 0;
    margin-top: -10px;
    text-align: center;
    font-size: 0.9rem;
    line-height: 2;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOON CALENDAR OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes moonCalendarReveal {
    from { clip-path: circle(0px at var(--moon-overlay-origin-x, 50%) var(--moon-overlay-origin-y, 50%)); }
    to   { clip-path: circle(150vmax at var(--moon-overlay-origin-x, 50%) var(--moon-overlay-origin-y, 50%)); }
}

@keyframes moonCalendarHide {
    from { clip-path: circle(150vmax at var(--moon-overlay-origin-x, 50%) var(--moon-overlay-origin-y, 50%)); }
    to   { clip-path: circle(0px at var(--moon-overlay-origin-x, 50%) var(--moon-overlay-origin-y, 50%)); }
}

.moon-calendar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1550;
    background: #0d1b2e;
    clip-path: circle(0px at var(--moon-overlay-origin-x, 50%) var(--moon-overlay-origin-y, 50%));
    pointer-events: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.moon-calendar-overlay.opening {
    animation: moonCalendarReveal 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: all;
}

.moon-calendar-overlay.open {
    clip-path: circle(150vmax at var(--moon-overlay-origin-x, 50%) var(--moon-overlay-origin-y, 50%));
    pointer-events: all;
}

.moon-calendar-overlay.closing {
    animation: moonCalendarHide 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

.moon-calendar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px 12px 14px;
    gap: 12px;
    background:
        radial-gradient(circle at top right, rgba(109, 141, 218, 0.16), transparent 34%),
        linear-gradient(180deg, #0d1b2e 0%, #08111f 100%);
}

.moon-calendar-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 4px 0;
    flex-shrink: 0;
}

.moon-calendar-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.moon-calendar-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: #F5F7FF;
}

.moon-calendar-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #E8ECFF;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.moon-calendar-controls {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.moon-calendar-picker {
    position: relative;
    flex: 1;
}

.moon-calendar-picker::after {
    content: "▾";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #AEB9D8;
    pointer-events: none;
}

.moon-calendar-picker select {
    width: 100%;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #1B2233;
    color: #F1F4FF;
    font-size: 14px;
    font-weight: 600;
    padding: 0 32px 0 12px;
    appearance: none;
    outline: none;
}

.moon-calendar-picker-year {
    flex: 0 0 104px;
}

.moon-calendar-today-btn {
    flex: 0 0 auto;
    min-width: 88px;
    padding: 0 14px;
    border: none;
    border-radius: 10px;
    background: #1D2538;
    color: #D8E0F8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.moon-calendar-scroll-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #131A2A;
    border-radius: 14px;
    padding: 10px;
    overflow: hidden;
}

.moon-calendar-quick-nav {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.moon-calendar-nav-btn {
    flex: 1;
    height: 34px;
    border: none;
    border-radius: 9px;
    background: #1D2538;
    color: #D8E0F8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.moon-calendar-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 2px 2px 0;
    scroll-padding-top: 8px;
}

.moon-calendar-scroll::-webkit-scrollbar {
    width: 6px;
}

.moon-calendar-scroll::-webkit-scrollbar-thumb {
    background: rgba(159, 176, 217, 0.24);
    border-radius: 999px;
}

.moon-calendar-month-card {
    background: #0E1422;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-margin-top: 8px;
}

.moon-calendar-month-title {
    font-size: 14px;
    font-weight: 700;
    color: #F3F6FF;
}

.moon-calendar-month-meta {
    font-size: 12px;
    color: #95A3C8;
}

.moon-calendar-weekdays,
.moon-calendar-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.moon-calendar-weekday {
    font-size: 10px;
    color: #7F8FB7;
    text-align: center;
}

.moon-calendar-day {
    position: relative;
    height: 56px;
    border-radius: 6px;
    background: #0B1223;
    overflow: hidden;
}

.moon-calendar-day.is-outside {
    background: #080D18;
}

.moon-calendar-day.is-today {
    box-shadow: inset 0 0 0 1px rgba(138, 173, 255, 0.45);
}

.moon-calendar-date {
    position: absolute;
    top: 4px;
    left: 5px;
    font-size: 9px;
    font-weight: 600;
    color: #EAF0FF;
}

.moon-calendar-astro-badges {
    position: static;
    z-index: 1;
}

.moon-calendar-astro-badge {
    position: absolute;
    width: 10px;
    height: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    background: transparent;
    color: rgba(234, 240, 255, 0.9);
    border: none;
    box-shadow: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.moon-calendar-astro-badge.meteor {
    top: 4px;
    right: 4px;
    color: #FFC45C;
    text-shadow: 0 0 8px rgba(255, 196, 92, 0.35);
}

.moon-calendar-astro-badge.meteor.is-peak {
    background: #ff000078;
    border-radius: 100%;
}

.moon-calendar-astro-badge.milky-way {
    top: 14px;
    left: 4px;
    width: 16px;
    height: 16px;
    background-image: url('../img/mp.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: drop-shadow(0 0 8px rgba(255, 196, 92, 0.35));
    z-index: 1;
}

.moon-calendar-astro-badge.is-strong {
    transform: scale(1.05);
}

.moon-calendar-pct {
    position: absolute;
    right: 4px;
    bottom: 4px;
    font-size: 8px;
    color: #9FB0D9;
}

.moon-calendar-marker {
    position: absolute;
    left: 4px;
    bottom: 4px;
    font-size: 8px;
    color: #EAF0FF;
}

.moon-calendar-disc {
    position: absolute;
    left: 50%;
    top: 13px;
    width: 24px;
    height: 24px;
    transform: translateX(-50%);
    transition: opacity 0.2s ease;
}

.moon-calendar-disc.is-hidden-from-horizon {
    opacity: 0.25;
}

.moon-calendar-svg {
    display: block;
    width: 24px;
    height: 24px;
}

.moon-calendar-legend {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 0 2px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.moon-calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #9BAAD2;
    font-size: 11px;
}

.moon-calendar-legend-icon {
    color: #F0F3FF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

.moon-calendar-loading,
.moon-calendar-empty {
    padding: 18px 12px;
    text-align: center;
    color: #95A3C8;
    font-size: 13px;
}

.moon-day-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3600;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 96px 12px 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.moon-day-modal-overlay.is-open,
.moon-day-modal-overlay.is-closing {
    visibility: visible;
    pointer-events: auto;
}

.moon-day-modal-overlay.is-open {
    opacity: 1;
}

.moon-day-modal-overlay.is-closing {
    opacity: 0;
}

.moon-day-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(7px);
}

.moon-day-modal {
    position: relative;
    width: min(392px, calc(100vw - 36px));
    border-radius: 20px;
    padding: 16px;
    background: rgba(21, 30, 49, 0.95);
    border: 1px solid rgba(42, 59, 94, 0.4);
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.36);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translateY(16px) scale(0.96);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.moon-day-modal-overlay.is-open .moon-day-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.moon-day-modal-overlay.is-closing .moon-day-modal {
    transform: translateY(8px) scale(0.98);
    opacity: 0;
}

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

.moon-day-modal-title {
    color: #F2F6FF;
    font-size: 18px;
    font-weight: 700;
}

.moon-day-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 14px;
    background: #2A3B5F;
    color: #EAF1FF;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.moon-day-modal-date-chip {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 14px;
    background: #233252;
    color: #DCE8FF;
    font-size: 12px;
    font-weight: 600;
}

.moon-day-card {
    border-radius: 14px;
    padding: 12px;
    background: #10192A;
    border: 1px solid rgba(30, 46, 74, 0.56);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.moon-day-card-stage {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    transition: opacity 0.2s ease-out, transform 0.36s cubic-bezier(0.16, 0.92, 0.24, 1);
}

.moon-day-card-stage.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.moon-day-moon-visual-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.moon-day-moon-visual {
    width: 84px;
    height: 84px;
    border-radius: 42px;
    background: #0D1424;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.moon-day-modal-svg {
    width: 64px;
    height: 64px;
    display: block;
}

.moon-day-moon-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.moon-day-phase-name {
    color: #EAF1FF;
    font-size: 14px;
    font-weight: 600;
}

.moon-day-phase-meta {
    color: #AFC1E8;
    font-size: 13px;
    line-height: 1.25;
}

.moon-day-moon-times {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.moon-day-mini-stat,
.moon-day-stat,
.moon-day-wide-stat {
    border-radius: 10px;
    background: #1A2740;
    padding: 8px 10px;
    min-width: 0;
}

.moon-day-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.moon-day-stat-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.moon-day-card-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #EAF1FF;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.moon-day-card-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.moon-day-card-icon-milky {
    filter: drop-shadow(0 0 8px rgba(255, 196, 92, 0.35));
}

.moon-day-card-icon-meteor {
    color: #FFC45C;
    text-shadow: 0 0 8px rgba(255, 196, 92, 0.35);
}

.moon-day-stat-label {
    color: #8FA3CE;
    font-size: 11px;
    line-height: 1.2;
}

.moon-day-stat-value {
    color: #EAF1FF;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 4px;
    word-break: break-word;
}

.moon-day-stat-value-accent {
    color: #A8E6CF;
}

.moon-day-note {
    color: #AFC1E8;
    font-size: 12px;
    line-height: 1.35;
    word-break: break-word;
}

.moon-day-chip {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 8px;
    border-radius: 8px;
    background: #233252;
    color: #DCE8FF;
    font-size: 11px;
    font-weight: 600;
}

.moon-day-peak-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 16px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 85, 85, 0.22);
    color: #FFD9D9;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

#moonDayMeteorCard .moon-day-stat-value {
    font-size: 14px;
}

#moonDayMeteorCard .moon-day-note {
    margin-top: 2px;
}

/* ============================================================
   Aurora Dashboard Overlay
   ============================================================ */
.aurora-dash-overlay {
    position: fixed;
    inset: 0;
    z-index: 4350;
    background:
        radial-gradient(circle at 50% 38%, rgba(18, 72, 128, 0.12) 0%, rgba(8, 18, 36, 0.78) 54%, rgba(5, 10, 20, 0.97) 100%),
        #050b14;
    clip-path: circle(0px at var(--aurora-dash-origin-x, 50%) var(--aurora-dash-origin-y, 50%));
    pointer-events: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes auroraDashReveal {
    from { clip-path: circle(0px at var(--aurora-dash-origin-x, 50%) var(--aurora-dash-origin-y, 50%)); }
    to   { clip-path: circle(150vmax at var(--aurora-dash-origin-x, 50%) var(--aurora-dash-origin-y, 50%)); }
}
@keyframes auroraDashHide {
    from { clip-path: circle(150vmax at var(--aurora-dash-origin-x, 50%) var(--aurora-dash-origin-y, 50%)); }
    to   { clip-path: circle(0px at var(--aurora-dash-origin-x, 50%) var(--aurora-dash-origin-y, 50%)); }
}

.aurora-dash-overlay.opening {
    animation: auroraDashReveal 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: auto;
}
.aurora-dash-overlay.open {
    clip-path: circle(150vmax at var(--aurora-dash-origin-x, 50%) var(--aurora-dash-origin-y, 50%));
    pointer-events: auto;
}
.aurora-dash-overlay.closing {
    animation: auroraDashHide 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

/* Header */
.aurora-dash-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    background: linear-gradient(180deg, rgba(5, 10, 18, 0.94) 0%, rgba(5, 10, 18, 0.5) 100%);
    z-index: 3;
}
.aurora-dash-header-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.aurora-dash-title {
    color: #f3f8ff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}
.aurora-dash-subtitle {
    color: rgba(180, 205, 235, 0.72);
    font-size: 12px;
    line-height: 1.2;
}
.aurora-dash-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(110, 144, 192, 0.28);
    background: rgba(11, 21, 38, 0.64);
    color: #e6f0ff;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Scrollable body */
.aurora-dash-body {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 12px 24px;
}

/* Sections */
.aurora-dash-section {
    margin-top: 16px;
}
.aurora-dash-section-title {
    color: rgba(200, 220, 245, 0.82);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Solar Wind KPI cards */
.aurora-dash-sw-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.aurora-dash-sw-card {
    background: rgba(14, 28, 52, 0.72);
    border: 1px solid rgba(80, 120, 170, 0.22);
    border-radius: 12px;
    padding: 10px 8px 8px;
    text-align: center;
    position: relative;
    transition: border-color 0.3s;
}
.aurora-dash-sw-card.highlight-south {
    border-color: rgba(255, 90, 90, 0.55);
    background: rgba(40, 14, 18, 0.62);
}
.aurora-dash-sw-card.highlight-fast {
    border-color: rgba(255, 180, 50, 0.45);
}
.aurora-dash-sw-card.highlight-dense {
    border-color: rgba(100, 200, 255, 0.45);
}
.aurora-dash-sw-label {
    color: rgba(180, 205, 235, 0.7);
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 4px;
}
.aurora-dash-sw-unit {
    font-weight: 400;
    opacity: 0.6;
}
.aurora-dash-sw-value {
    color: #f0f6ff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.aurora-dash-sw-delta {
    color: rgba(180, 205, 235, 0.55);
    font-size: 10px;
    margin-top: 3px;
    min-height: 14px;
    font-variant-numeric: tabular-nums;
}
.aurora-dash-sw-delta.rising { color: #ff9b7a; }
.aurora-dash-sw-delta.falling { color: #7acfff; }

/* Transit time */
.aurora-dash-transit {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    background: rgba(14, 28, 52, 0.52);
    border: 1px solid rgba(80, 120, 170, 0.18);
    border-radius: 10px;
    color: rgba(200, 220, 245, 0.82);
    font-size: 12px;
}
.aurora-dash-transit i {
    color: rgba(130, 180, 240, 0.7);
    font-size: 13px;
}

/* Chart tabs */
.aurora-dash-chart-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}
.aurora-dash-chart-tab {
    flex: 1;
    padding: 5px 0;
    border: 1px solid rgba(80, 120, 170, 0.24);
    border-radius: 8px;
    background: rgba(14, 28, 52, 0.42);
    color: rgba(180, 205, 235, 0.72);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.aurora-dash-chart-tab.active {
    background: rgba(30, 70, 120, 0.52);
    color: #e0f0ff;
    border-color: rgba(100, 160, 230, 0.44);
}

/* Chart wrapper */
.aurora-dash-chart-wrap {
    margin-bottom: 10px;
    position: relative;
}
.aurora-dash-chart-label {
    color: rgba(180, 205, 235, 0.55);
    font-size: 10px;
    font-weight: 500;
    margin-bottom: 3px;
    padding-left: 2px;
}
.aurora-dash-chart-wrap canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    background: rgba(8, 18, 34, 0.6);
}

/* Alert card */
.aurora-dash-alert-card {
    background: rgba(14, 28, 52, 0.62);
    border: 1px solid rgba(80, 120, 170, 0.22);
    border-radius: 12px;
    padding: 10px 12px;
    min-height: 40px;
}
.aurora-dash-alert-card.is-clickable {
    cursor: pointer;
}
.aurora-dash-alert-card.severity-1 {
    border-color: rgba(112, 181, 99, 0.36);
    background: rgba(24, 52, 26, 0.5);
}
.aurora-dash-alert-card.severity-2 {
    border-color: rgba(214, 188, 86, 0.42);
    background: rgba(64, 58, 24, 0.5);
}
.aurora-dash-alert-card.severity-3 {
    border-color: rgba(226, 139, 58, 0.46);
    background: rgba(72, 42, 18, 0.52);
}
.aurora-dash-alert-card.severity-4 {
    border-color: rgba(228, 92, 73, 0.46);
    background: rgba(76, 28, 23, 0.54);
}
.aurora-dash-alert-card.severity-5 {
    border-color: rgba(196, 61, 92, 0.5);
    background: rgba(76, 18, 34, 0.58);
}
.aurora-dash-alert-empty {
    color: rgba(180, 205, 235, 0.45);
    font-size: 12px;
    text-align: center;
    padding: 6px 0;
}
.aurora-dash-alert-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    margin-right: 6px;
    text-transform: uppercase;
    vertical-align: middle;
}
.aurora-dash-alert-badge.severity-info { background: rgba(80,140,200,0.28); color: #a0ccf0; }
.aurora-dash-alert-badge.severity-1 { background: rgba(70,160,70,0.3); color: #b0e8b0; }
.aurora-dash-alert-badge.severity-2 { background: rgba(200,180,50,0.3); color: #f0e8a0; }
.aurora-dash-alert-badge.severity-3 { background: rgba(220,140,40,0.32); color: #ffe0a0; }
.aurora-dash-alert-badge.severity-4 { background: rgba(220,70,50,0.32); color: #ffc0b0; }
.aurora-dash-alert-badge.severity-5 { background: rgba(180,30,60,0.38); color: #ffa0b0; }
.aurora-dash-alert-title {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}
.aurora-dash-alert-time {
    color: rgba(180, 205, 235, 0.48);
    font-size: 10px;
    margin-top: 4px;
}
.aurora-dash-alert-text {
    color: rgba(255, 255, 255, 0.92);
    font-size: 11px;
    line-height: 1.42;
    margin-top: 6px;
    white-space: pre-wrap;
    word-break: break-word;
}
.aurora-dash-alert-more {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(80, 120, 170, 0.24);
    border-radius: 10px;
    background: rgba(14, 28, 52, 0.42);
    color: rgba(140, 185, 240, 0.82);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.aurora-dash-alert-more i { font-size: 10px; }

/* Event cards grid (flares, CME, storm) */
.aurora-dash-events-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.aurora-dash-events-grid .aurora-dash-event-card:last-child {
    grid-column: 1 / -1;
}
.aurora-dash-event-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    background: rgba(14, 28, 52, 0.62);
    border: 1px solid rgba(80, 120, 170, 0.2);
    border-radius: 12px;
}
.aurora-dash-event-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
#auroraDashFlareCard .aurora-dash-event-icon {
    background: rgba(255, 180, 50, 0.18);
    color: #ffcc66;
}
#auroraDashCmeCard .aurora-dash-event-icon {
    background: rgba(100, 200, 255, 0.16);
    color: #7ad4ff;
}
#auroraDashStormCard .aurora-dash-event-icon {
    background: rgba(255, 100, 100, 0.16);
    color: #ff9999;
}
.aurora-dash-event-label {
    color: rgba(180, 205, 235, 0.62);
    font-size: 10px;
    font-weight: 500;
    margin-bottom: 1px;
}
.aurora-dash-event-value {
    color: #e0ecff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}
.aurora-dash-event-value.active-event {
    color: #ffcc66;
}
.aurora-dash-event-meta {
    margin-top: 3px;
    color: rgba(198, 216, 239, 0.7);
    font-size: 10px;
    line-height: 1.35;
}

/* ENLIL section */
.aurora-dash-enlil-wrap {
    position: relative;
}
.aurora-dash-enlil-wrap canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    background: rgba(8, 18, 34, 0.6);
}
/* ENLIL cards row */
.aurora-dash-enlil-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}
.aurora-dash-enlil-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(14, 28, 52, 0.62);
    border: 1px solid rgba(80, 120, 170, 0.2);
    border-radius: 12px;
    cursor: default;
}
.aurora-dash-enlil-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    background: rgba(255, 180, 50, 0.16);
    color: #ffcc66;
}
.aurora-dash-enlil-card-status.cme-approaching .aurora-dash-enlil-card-icon {
    background: rgba(255, 200, 80, 0.22);
    color: #ffd966;
}
.aurora-dash-enlil-card-status.cme-at-earth .aurora-dash-enlil-card-icon {
    background: rgba(255, 100, 80, 0.22);
    color: #ff9977;
}
.aurora-dash-enlil-card-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.aurora-dash-enlil-card-body {
    min-width: 0;
    flex: 1;
}
.aurora-dash-enlil-card-label {
    color: rgba(180, 205, 235, 0.62);
    font-size: 10px;
    font-weight: 500;
    margin-bottom: 1px;
}
.aurora-dash-enlil-card-value {
    color: #e0ecff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}
.aurora-dash-enlil-card-meta {
    margin-top: 2px;
    color: rgba(198, 216, 239, 0.7);
    font-size: 10px;
    line-height: 1.35;
}
.aurora-dash-enlil-card-player {
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.aurora-dash-enlil-card-play {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(80, 160, 255, 0.2);
    color: #7ad4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
}

/* ENLIL player modal */
.aurora-dash-enlil-modal {
    position: fixed;
    inset: 0;
    z-index: 4500;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
}
.aurora-dash-enlil-modal[aria-hidden="false"] {
    pointer-events: auto;
    opacity: 1;
}
.aurora-dash-enlil-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 5, 10, 0.82);
}
.aurora-dash-enlil-modal-content {
    position: relative;
    width: min(428px, calc(100vw - 16px));
    max-height: min(88vh, 720px);
    background: #0a1526;
    border-radius: 18px;
    border: 1px solid rgba(80, 120, 170, 0.22);
    display: flex;
    flex-direction: column;
    transform: translateY(10px) scale(0.985);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.aurora-dash-enlil-modal[aria-hidden="false"] .aurora-dash-enlil-modal-content {
    transform: translateY(0) scale(1);
}
.aurora-dash-enlil-modal-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
    border-bottom: 1px solid rgba(80, 120, 170, 0.18);
}
.aurora-dash-enlil-modal-header > span {
    color: #e8f0ff;
    font-size: 14px;
    font-weight: 600;
}
.aurora-dash-enlil-modal-close {
    background: none;
    border: none;
    color: rgba(200, 220, 255, 0.6);
    font-size: 16px;
    padding: 4px 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.aurora-dash-enlil-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 12px 14px;
    gap: 8px;
}
.aurora-dash-enlil-modal-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 960 / 720;
    background: #050d18;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.aurora-dash-enlil-modal-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.aurora-dash-enlil-modal-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(180, 205, 235, 0.5);
    font-size: 12px;
}
.aurora-dash-enlil-modal-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.aurora-dash-enlil-ctrl-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(80, 160, 255, 0.16);
    color: #7ad4ff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.aurora-dash-enlil-ctrl-btn:active {
    background: rgba(80, 160, 255, 0.3);
}
.aurora-dash-enlil-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(80, 140, 220, 0.25);
    border-radius: 2px;
    outline: none;
}
.aurora-dash-enlil-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #7ad4ff;
    cursor: pointer;
}
.aurora-dash-enlil-frame-counter {
    color: rgba(180, 205, 235, 0.5);
    font-size: 10px;
    min-width: 38px;
    text-align: right;
    flex-shrink: 0;
}
.aurora-dash-enlil-modal-ts {
    text-align: center;
    color: rgba(188, 210, 240, 0.72);
    font-size: 11px;
    font-weight: 500;
}
.aurora-dash-enlil-legend {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    justify-content: center;
}
.aurora-dash-enlil-leg-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(180, 205, 235, 0.6);
    font-size: 10px;
}
.aurora-dash-enlil-leg-item i {
    display: inline-block;
    width: 10px;
    height: 3px;
    border-radius: 2px;
}
.aurora-dash-enlil-empty {
    color: rgba(180, 205, 235, 0.4);
    font-size: 12px;
    text-align: center;
    padding: 24px 0;
}

/* 27-day Kp calendar */
.aurora-dash-kp-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}
.aurora-dash-kp-cal-weekday {
    color: rgba(180, 205, 235, 0.52);
    font-size: 10px;
    font-weight: 600;
    text-transform: lowercase;
    text-align: center;
    padding-bottom: 3px;
}
.aurora-dash-kp-cal-pad {
    min-height: 0;
}
.aurora-dash-kp-cal-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(180, 205, 235, 0.4);
    font-size: 12px;
    padding: 16px 0;
}
.aurora-dash-kp-cal-day {
    aspect-ratio: 1 / 1;
    background: var(--kc-bg, rgba(134,134,134,0.25));
    border: 1px solid var(--kc-border, rgba(100,100,100,0.25));
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 2px;
}
.aurora-dash-kp-cal-date {
    color: rgba(200, 220, 245, 0.62);
    font-size: 9px;
    font-weight: 500;
    line-height: 1.1;
}
.aurora-dash-kp-cal-kp {
    color: #f0f6ff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}
.aurora-dash-kp-cal-legend {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: center;
}
.aurora-dash-kp-cal-leg {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(180, 205, 235, 0.55);
    font-size: 10px;
}
.aurora-dash-kp-cal-leg::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--kc);
    opacity: 0.65;
}

/* Alerts modal */
.aurora-dash-alerts-modal {
    position: fixed;
    inset: 0;
    z-index: 4500;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
}
.aurora-dash-alerts-modal[aria-hidden="false"] {
    pointer-events: auto;
    opacity: 1;
}
.aurora-dash-alerts-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 5, 10, 0.7);
}
.aurora-dash-alerts-modal-content {
    position: relative;
    width: min(428px, calc(100vw - 20px));
    height: min(78vh, 680px);
    max-height: min(78vh, 680px);
    background: #0c1a2e;
    border-radius: 18px;
    border: 1px solid rgba(80, 120, 170, 0.22);
    display: flex;
    flex-direction: column;
    transform: translateY(10px) scale(0.985);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.aurora-dash-alerts-modal[aria-hidden="false"] .aurora-dash-alerts-modal-content {
    transform: translateY(0) scale(1);
}
.aurora-dash-alerts-modal-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(80, 120, 170, 0.18);
}
.aurora-dash-alerts-modal-headcopy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.aurora-dash-alerts-modal-headcopy > span:first-child {
    color: #e8f0ff;
    font-size: 15px;
    font-weight: 600;
}
.aurora-dash-alerts-modal-meta {
    color: rgba(188, 205, 228, 0.72);
    font-size: 10px;
    line-height: 1.35;
}
.aurora-dash-alerts-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.aurora-dash-alerts-mode-switch {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(80, 120, 170, 0.18);
    border-radius: 999px;
}
.aurora-dash-alerts-mode {
    border: none;
    background: transparent;
    color: rgba(188, 205, 228, 0.72);
    font-size: 10px;
    font-weight: 600;
    padding: 5px 8px;
    border-radius: 999px;
    cursor: pointer;
}
.aurora-dash-alerts-mode.active {
    background: rgba(98, 160, 235, 0.18);
    color: #f0f6ff;
}
.aurora-dash-alerts-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #c0d0e8;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.aurora-dash-alerts-modal-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 14px 20px;
}
.aurora-dash-alerts-modal-body .aurora-dash-alert-card {
    margin-bottom: 8px;
}
.aurora-dash-alerts-modal-body .aurora-dash-alert-text {
    color: rgba(255, 255, 255, 0.92);
    font-size: 10.5px;
    line-height: 1.45;
    margin-top: 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Subscription Overlay & Upgrade Modal
   ═══════════════════════════════════════════════════════════════════════════ */

.subscription-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 30, 0.97);
    z-index: 10000;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.subscription-overlay.opening,
.subscription-overlay.open {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.subscription-overlay.opening {
    animation: overlaySlideIn 0.3s ease-out forwards;
}
.subscription-overlay.closing {
    display: flex;
    animation: overlaySlideOut 0.25s ease-in forwards;
}
.subscription-overlay-inner {
    width: 100%;
    max-width: 420px;
    padding: 20px 16px 40px;
}
.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.subscription-header h2 {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}
.subscription-plans {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.plan-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 18px 16px;
    position: relative;
    transition: border-color 0.2s;
}
.plan-card.plan-current {
    border-color: rgba(100, 180, 255, 0.5);
    background: rgba(100, 180, 255, 0.08);
}
.plan-card-highlight {
    border-color: rgba(160, 120, 255, 0.4);
    background: rgba(160, 120, 255, 0.06);
}
.plan-badge {
    position: absolute;
    top: -9px;
    right: 16px;
    background: linear-gradient(135deg, #7c5cfc, #a078ff);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.plan-name {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}
.plan-price {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 12px;
}
.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}
.plan-features li {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    padding: 3px 0 3px 18px;
    position: relative;
}
.plan-features li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    position: absolute;
    left: 0;
    top: 5px;
    color: rgba(100, 200, 150, 0.8);
}
.plan-action-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(100, 180, 255, 0.2);
    color: #8cc4ff;
    transition: background 0.2s;
}
.plan-action-btn:hover:not([disabled]) {
    background: rgba(100, 180, 255, 0.3);
}
.plan-action-btn:disabled {
    opacity: 0.5;
    cursor: default;
}
.trial-btn {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #7c5cfc, #a078ff);
    color: #fff;
    transition: opacity 0.2s;
}
.trial-btn:hover {
    opacity: 0.9;
}
.upgrade-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}
.upgrade-modal-inner {
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    position: relative;
}
.upgrade-modal-icon {
    font-size: 32px;
    color: rgba(160, 120, 255, 0.7);
    margin-bottom: 12px;
}
.upgrade-modal-inner h3 {
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 8px;
}
.upgrade-modal-inner p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin: 0 0 20px;
}
.upgrade-action-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #7c5cfc, #a078ff);
    color: #fff;
    margin-bottom: 8px;
}
.upgrade-close-btn {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
}
.page-indicators .dot.dot-locked::after {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 6px;
    position: absolute;
    top: -2px;
    right: -4px;
    color: rgba(255, 255, 255, 0.5);
}
.page-indicators .dot.dot-locked {
    position: relative;
    opacity: 0.5;
}
html.is-desktop .subscription-overlay {
    position: fixed;
    width: var(--app-max-width);
    max-height: var(--app-max-height);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 20px;
}
html.is-desktop .upgrade-modal {
    width: var(--app-max-width);
    max-height: var(--app-max-height);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 20px;
}
.error-toast.success {
    background: rgba(46, 161, 83, 0.92);
}
.referral-panel {
    margin-top: 18px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.referral-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.referral-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}
.referral-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.45;
    max-width: 420px;
}
.referral-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.referral-stat-chip {
    min-width: 74px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}
.referral-stat-chip span {
    display: block;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}
.referral-stat-chip small {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
}
.referral-label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 600;
}
.referral-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.referral-input {
    flex: 1 1 220px;
    min-width: 0;
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(12, 12, 18, 0.46);
    color: #fff;
    padding: 0 14px;
    outline: none;
}
.referral-input::placeholder {
    color: rgba(255, 255, 255, 0.36);
}
.referral-btn {
    height: 46px;
    padding: 0 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #a96fff 0%, #ff9b5e 100%);
    color: #fff;
    font-weight: 700;
}
.referral-btn:disabled {
    opacity: 0.5;
}
.referral-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
}
.referral-status-text {
    margin-top: 9px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
    line-height: 1.45;
}
