:root {
    --nm-bg-900: #040712;
    --nm-bg-800: #0b1021;
    --nm-surface: rgba(12, 17, 33, 0.86);
    --nm-surface-strong: rgba(14, 20, 36, 0.92);
    --nm-border: rgba(255, 255, 255, 0.08);
    --nm-border-strong: rgba(126, 241, 255, 0.25);
    --nm-text: #e6eeff;
    --nm-muted: #9eb0d3;
    --nm-accent: #7ef1ff;
    --nm-accent-2: #ffad66;
    --nm-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
    --nm-blur: blur(16px);
    --nm-font: "SF Pro Text", "SF Pro Display", "SF Pro", "San Francisco", "SF UI Text", "SF UI Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui;
}

* {
    box-sizing: border-box;
}

html, body, #map {
    height: 100%;
    width: 100%;
}

body {
    margin: 0;
    background: radial-gradient(circle at 18% 20%, rgba(70, 107, 255, 0.05), transparent 24%), radial-gradient(circle at 80% 0%, rgba(255, 173, 102, 0.06), transparent 22%), var(--nm-bg-900);
    color: var(--nm-text);
    font-family: var(--nm-font);
    letter-spacing: 0.01em;
    line-height: 1.6;
}

#map {
    position: fixed;
    inset: 0;
    z-index: 1;
}

sup {
    vertical-align: baseline;
    position: relative;
    top: -0.4em;
}

a {
    color: var(--nm-accent);
}

/* Contributor editing */
.nm-contrib-row { margin-top: 6px; }
.nm-loc-contrib {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(126, 241, 255, 0.6);
}

p {
    margin: 0 0 8px;
}

ul, ol {
    display: inline-block;
    text-align: left;
    padding-left: 16px;
}

/* --- New overlay shell --- */
.nm-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px;
    padding-top: calc(48px + env(safe-area-inset-top, 0px));
    pointer-events: none;
    z-index: 500;
    overflow-y: auto;
    touch-action: manipulation;
}

.nm-overlay--hidden {
    display: none;
}

.nm-overlay:not(.nm-overlay--hidden) {
    pointer-events: auto;
}

.nm-panel {
    pointer-events: auto;
    width: min(92vw, 640px);
    max-width: 640px;
    max-height: 88vh;
    background: linear-gradient(135deg, rgba(12, 18, 35, 0.92), rgba(9, 14, 27, 0.9));
    border: 1px solid var(--nm-border);
    border-radius: 18px;
    box-shadow: var(--nm-shadow);
    backdrop-filter: var(--nm-blur);
    padding: 18px 20px 16px;
    position: relative;
    overflow: hidden;
}

.nm-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 12% 16%, rgba(126, 241, 255, 0.16), transparent 30%), radial-gradient(circle at 82% 8%, rgba(255, 173, 102, 0.12), transparent 30%);
}

/* Location popup tweaks */
.nm-loc-title {
    font-weight: 700;
}
.leaflet-popup-close-button {
    width: 32px;
    height: 32px;
    padding: 0;
    color: transparent;
    font-size: 0;
    line-height: 0;
    text-indent: -9999px;
    overflow: hidden;
    background: url("/images/xmark.circle.svg") center/24px 24px no-repeat !important;
    background-color: transparent !important;
    top: 6px !important;
    right: 6px !important;
}
.leaflet-popup-close-button:hover {
    background-color: rgba(255,255,255,0.06);
    border-radius: 999px;
}

.nm-panel__header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.nm-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: transparent;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    box-shadow: none;
    transition: all 0.2s ease;
}

.nm-close:hover {
    opacity: 0.85;
}

.nm-badge {
    padding: 6px 10px;
    background: rgba(126, 241, 255, 0.14);
    color: var(--nm-accent);
    border: 1px solid var(--nm-border-strong);
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nm-title {
    margin: 6px 0;
    font-size: clamp(24px, 3vw, 32px);
    letter-spacing: -0.02em;
}

.nm-subtitle {
    color: var(--nm-muted);
    font-size: 15px;
    margin: 0 0 12px;
    max-width: 720px;
}

.nm-welcome {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--nm-border);
    border-radius: 14px;
    padding: 12px 14px;
    margin: 0 0 12px;
    color: var(--nm-muted);
}

.nm-welcome p {
    margin: 0 0 8px;
}

.nm-welcome__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.nm-welcome__grid div {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--nm-border);
    border-radius: 10px;
    padding: 10px;
    color: var(--nm-text);
    font-size: 13px;
}

.nm-welcome__grid a {
    color: var(--nm-accent);
    font-weight: 600;
    text-decoration: none;
}

.nm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.nm-button {
    border: 1px solid var(--nm-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--nm-text);
    padding: 9px 14px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nm-button:hover {
    transform: translateY(-1px);
    border-color: var(--nm-border-strong);
    color: var(--nm-accent);
}

.nm-button--primary {
    background: linear-gradient(135deg, #7ef1ff, #6cc0ff);
    color: #041024;
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(126, 241, 255, 0.35);
}

.nm-button--primary:hover {
    box-shadow: 0 14px 32px rgba(126, 241, 255, 0.45);
}

.nm-button--ghost {
    background: rgba(255, 255, 255, 0.06);
}

.nm-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.nm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 12px;
    border: 1px solid var(--nm-border-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--nm-text);
    font-size: 13px;
}

.nm-chip--muted {
    border-color: var(--nm-border);
    color: var(--nm-muted);
}

.nm-inline-cards {
    pointer-events: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 980px;
}

.nm-card {
    pointer-events: auto;
    flex: 1 1 240px;
    max-width: 360px;
    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: var(--nm-shadow);
    backdrop-filter: var(--nm-blur);
}

.nm-card__label {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.01em;
    color: var(--nm-accent);
    margin: 0 0 6px;
}

.nm-card__body {
    margin: 0;
    color: var(--nm-muted);
    font-size: 14px;
    line-height: 1.5;
}

.nm-profile {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.nm-profile__trigger {
    width: 32px;
    height: 32px;
    border-radius: 0;
    border: none;
    background: transparent;
    color: var(--nm-text);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: none;
    padding: 0;
}

.nm-profile__initial img,
.nm-profile__initial svg {
    width: 32px;
    height: 32px;
    display: block;
}

.nm-profile__menu {
    margin-top: 8px;
    background: rgba(4, 7, 18, 0.9);
    border: 1px solid var(--nm-border);
    border-radius: 12px;
    padding: 12px;
    min-width: 220px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    display: none;
}

.nm-profile__menu.open {
    display: block;
}

.nm-profile__meta {
    margin-bottom: 10px;
}

.nm-profile__name {
    font-weight: 700;
}

.nm-profile__email {
    color: var(--nm-muted);
    font-size: 13px;
}

.nm-profile__action {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--nm-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--nm-text);
    cursor: pointer;
}

@media (max-width: 900px) {
    .nm-panel {
        width: clamp(260px, 92vw, 620px);
    }

    .nm-inline-cards {
        width: min(98vw, 980px);
    }
}

@media (max-width: 640px) {
    .nm-overlay {
        align-items: center;
        padding: 16px 10px;
        padding-top: calc(52px + env(safe-area-inset-top, 0px));
        overflow-y: auto;
    }

    .nm-panel {
        padding: 14px;
        width: min(96vw, 420px);
        max-width: 420px;
        max-height: 86vh;
        margin: 16px auto 10px;
        overflow-y: auto;
    }

    .nm-inline-cards {
        display: none;
    }
    .nm-actions {
        flex-direction: column;
        gap: 8px;
    }
    .nm-button {
        width: 100%;
        justify-content: center;
    }
    .nm-title {
        font-size: 20px;
        line-height: 1.3;
    }
    .nm-subtitle {
        font-size: 14px;
        line-height: 1.4;
    }
    /* Keep profile trigger visible on mobile without overlapping the search box */
    .nm-profile {
        top: 96px;
        bottom: auto;
        right: 14px;
    }
    .nm-panel__header {
        flex-direction: column;
        align-items: flex-start;
    }
    .leaflet-control-container .leaflet-top,
    .leaflet-control-container .leaflet-bottom {
        z-index: 1200 !important;
    }
.leaflet-control-search,
.leaflet-control-geocoder {
    z-index: 1300 !important;
    margin-top: 0;
}
    .nm-profile {
        z-index: 1400;
    }
    .leaflet-pane.leaflet-popup-pane,
    .leaflet-popup,
    .leaflet-popup-pane {
        z-index: 3000 !important;
    }

    body.nm-popup-open .leaflet-control-layers,
    body.nm-popup-open .leaflet-control-zoom,
    body.nm-popup-open .leaflet-control-search,
    body.nm-popup-open .leaflet-control-geocoder,
    body.nm-popup-open .leaflet-control-permalink,
    body.nm-popup-open .nm-search,
    body.nm-popup-open .nm-profile {
        opacity: 0;
        pointer-events: none;
    }

    .leaflet-bottom.leaflet-left .leaflet-control-zoom {
        margin-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    }

    .leaflet-top .leaflet-control-layers {
        margin-top: 38px;
    }
}

@media (max-width: 480px) {
    .nm-panel {
        border-radius: 12px;
        width: min(96vw, 380px);
    }
    .nm-title {
        font-size: 18px;
    }
    .nm-subtitle {
        font-size: 13px;
    }
    .nm-inline-cards {
        gap: 8px;
    }
    .nm-card {
        padding: 10px 12px;
        flex-basis: 260px;
    }
}

/* --- Leaflet UI polish --- */
.leaflet-container {
    font-family: var(--nm-font);
    color: var(--nm-text);
}

.leaflet-control {
    border: 1px solid var(--nm-border);
    border-radius: 12px;
    background: var(--nm-surface);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    backdrop-filter: var(--nm-blur);
    overflow: hidden;
}

.leaflet-control-permalink {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: none;
    backdrop-filter: none;
}

.leaflet-control-permalink a {
    color: #fff;
    text-decoration: underline;
}

.leaflet-control-permalink a:hover {
    color: var(--nm-accent);
    text-decoration: underline;
}

.leaflet-bar a, .leaflet-bar a:hover {
    background: transparent;
    color: var(--nm-text);
    border-bottom: 1px solid var(--nm-border);
}

.leaflet-bar a:last-child {
    border-bottom: none;
}

.leaflet-control-layers {
    padding: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.leaflet-control-layers.leaflet-control,
.leaflet-control-layers.leaflet-bar,
.leaflet-control-layers a,
.leaflet-control-layers a:link,
.leaflet-control-layers a:visited,
.leaflet-control-layers a:hover,
.leaflet-control-layers a:active {
    background: transparent;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.leaflet-control-layers .leaflet-control-layers-list {
    display: none;
}

.leaflet-control-layers.nm-click-expanded .leaflet-control-layers-list,
.leaflet-control-layers.leaflet-control-layers-expanded .leaflet-control-layers-list {
    display: block;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #20252d;
    opacity: 0.9;
}

.leaflet-control-layers.nm-click-expanded,
.leaflet-control-layers.leaflet-control-layers-expanded {
    background: #20252d;
    backdrop-filter: blur(14px);
}

.nm-layer-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    display: none;
    z-index: 420;
}

.nm-layer-backdrop.show {
    display: block;
}

.leaflet-top .leaflet-control-layers {
    margin-top: 38px;
}

html.nm-ua-mobile .leaflet-top .leaflet-control-layers {
    margin-top: calc(38px + env(safe-area-inset-top, 0px) + 10px);
}

html.nm-ua-mobile .leaflet-control-layers.nm-click-expanded .leaflet-control-layers-list,
html.nm-ua-mobile .leaflet-control-layers.leaflet-control-layers-expanded .leaflet-control-layers-list {
    max-height: calc(100vh - 180px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}

.leaflet-control-layers-toggle {
    width: 32px;
    height: 32px;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0;
    box-shadow: none;
    background-image: url("/images/square.2.layers.3d.fill.svg") !important;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 32px 32px;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
    -webkit-filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
}

.leaflet-control-layers-toggle:hover,
.leaflet-control-layers-toggle:active,
.leaflet-control-layers-toggle:focus,
.leaflet-control-layers-toggle:focus-visible {
    background-color: transparent !important;
    box-shadow: none;
    outline: none;
}

.date-control input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 0;
    background-color: transparent;
    background-image: url("/images/calendar.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
    -webkit-filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
    color: transparent;
    font-size: 0;
    cursor: pointer;
    box-shadow: none;
}

.date-control input[type="date"]:focus,
.date-control input[type="date"]:active,
.date-control input[type="date"]:focus-visible {
    outline: none;
    box-shadow: none;
    border: none;
}

.nm-home-control {
    background-color: transparent;
    border: 1px solid var(--nm-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.nm-home-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 0;
    background-color: transparent;
    background-image: url("/images/house.fill.svg");
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    box-shadow: none;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
    -webkit-filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
}

.nm-home-btn:focus,
.nm-home-btn:active,
.nm-home-btn:focus-visible {
    outline: none;
    box-shadow: none;
}

.nm-tools-control {
    background: transparent;
    border: 1px solid var(--nm-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.nm-tools-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 0;
    background-color: transparent;
    background-image: url("/images/wrench.and.screwdriver.fill.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    cursor: pointer;
    box-shadow: none;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
    -webkit-filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
}

.nm-tools-btn:focus,
.nm-tools-btn:active,
.nm-tools-btn:focus-visible {
    outline: none;
    box-shadow: none;
}

.date-control input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
    background: transparent;
}

.date-control input[type="date"]::-moz-focus-inner {
    border: 0;
}

.leaflet-control-layers-expanded {
    background: transparent;
    border: none;
    color: var(--nm-text);
}

/* Logo control: keep the background fully transparent */
.leaflet-bottom.leaflet-right .leaflet-control {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

/* Tighten spacing between attribution icon and logo */
.leaflet-bottom.leaflet-right .nm-attr-wrap {
    margin-bottom: 4px;
    margin-right: 10px;
}

html.nm-ua-mobile .leaflet-bottom.leaflet-right .leaflet-control {
    margin-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

html.nm-ua-mobile .leaflet-bottom.leaflet-right .nm-search-trigger {
    margin-bottom: 8px;
    margin-left: auto;
    margin-right: calc(10px + env(safe-area-inset-right, 0px));
}

html.nm-ua-mobile .leaflet-bottom.leaflet-right .nm-home-control {
    margin-bottom: 8px;
    margin-left: auto;
    margin-right: calc(10px + env(safe-area-inset-right, 0px));
}

html.nm-ua-mobile .leaflet-bottom.leaflet-right .nm-tools-control {
    margin-bottom: 8px;
    margin-left: auto;
    margin-right: calc(10px + env(safe-area-inset-right, 0px));
}

.leaflet-top .nm-home-control {
    margin-top: 10px;
}

.leaflet-top .nm-tools-control {
    margin-top: 10px;
}

html.nm-ua-mobile .leaflet-bottom.leaflet-right .nm-attr-wrap {
    margin-right: calc(10px + env(safe-area-inset-right, 0px));
}

.leaflet-control .logo {
    background: transparent;
    padding: 0;
    margin: 0;
    overflow: visible;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 4px;
}

.leaflet-control .logo img {
    display: block;
    background: transparent;
    max-width: none;
    height: auto;
}

.leaflet-control-layers-list label {
    color: #ffffff;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.leaflet-control-layers-selector {
    appearance: auto;
    -webkit-appearance: auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--nm-accent);
    display: inline-block;
    flex: 0 0 auto;
}

html.nm-ua-mobile .leaflet-control-layers-selector {
    width: 22px;
    height: 22px;
}

.leaflet-control-layers-selector[type="radio"] {
    accent-color: var(--nm-accent);
}

.nm-marker-camera {
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
    -webkit-filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
}

.nm-marker-telescope {
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
    -webkit-filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
}

.nm-marker-moon {
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
    -webkit-filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
}

.leaflet-marker-icon {
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
    -webkit-filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
}

.leaflet-control-layers-list a,
.leaflet-control-layers-list a:link,
.leaflet-control-layers-list a:visited,
.leaflet-control-layers-list a:hover,
.leaflet-control-layers-list a:active {
    color: #ffffff;
    font-weight: 700 !important;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.nm-attr-body a,
.nm-attr-body a:link,
.nm-attr-body a:visited,
.nm-attr-body a:hover,
.nm-attr-body a:active {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

.nm-layer-group-label {
    padding: 8px 12px 6px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--nm-muted);
    border-top: 1px solid rgba(255,255,255,0.06);
}

.leaflet-control-layers-list label.nm-layer-group--astro {
    display: none;
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background: var(--nm-surface-strong);
    color: var(--nm-text);
    border: 1px solid var(--nm-border);
    box-shadow: var(--nm-shadow);
    backdrop-filter: blur(14px);
}

.leaflet-popup-content {
    margin: 16px 18px 14px;
    line-height: 1.45;
    font-size: 14px;
    min-height: 1px;
    width: 100%;
    overflow-y: auto;
    max-height: 60vh;
}

.leaflet-popup-content-wrapper img {
    position: relative;
    margin: 6px auto 10px;
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--nm-border);
}

.leaflet-popup-content-wrapper .nm-fov-planner-icon {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    margin: 0 6px 0 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    object-fit: contain !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

.nm-fov-date-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 16, 0.55);
    z-index: 1200;
}

.nm-fov-date-panel {
    position: absolute;
    width: 280px;
    max-width: calc(100vw - 32px);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: #0b1220;
    color: #e6eeff;
    box-shadow: 0 18px 36px rgba(0,0,0,0.45);
}

.nm-fov-date-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.nm-fov-date-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.nm-fov-date-nav {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: #e6eeff;
    cursor: pointer;
}

.nm-fov-date-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 11px;
    color: #9eb0d3;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.nm-fov-date-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 6px;
}

.nm-fov-date-day {
    width: 100%;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(255,255,255,0.04);
    color: #e6eeff;
    cursor: pointer;
    font-size: 13px;
}

.nm-fov-date-day.is-other {
    color: #5c6b8a;
    background: rgba(255,255,255,0.02);
}

.nm-fov-date-day.is-selected {
    border-color: #7ef1ff;
    color: #7ef1ff;
    background: rgba(126,241,255,0.08);
}

.nm-fov-date-day.is-today {
    border-color: #fbbf24;
    color: #fbbf24;
}

.nm-fov-date-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.nm-fov-date-close {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: #e6eeff;
    cursor: pointer;
    font-size: 12px;
}

.leaflet-popup-content-wrapper a {
    color: var(--nm-accent);
    text-decoration: none;
    font-weight: 600;
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
    z-index: 450;
}

.leaflet-top.leaflet-left {
    top: 16px;
}

html.nm-ua-mobile .leaflet-top.leaflet-left {
    top: 38px;
}

.leaflet-bottom.leaflet-left .leaflet-control-layers {
    margin-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
}

.date-control-container {
    margin-bottom: 6px;
    background-color: transparent;
}

html:not(.nm-ua-mobile) .date-control-container input[type="date"] {
    pointer-events: none;
}

html.nm-ua-mobile .leaflet-bottom.leaflet-left .date-control-container {
    margin-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    background-color: transparent;
}

.leaflet-control-search,
.leaflet-control-geocoder {
    position: fixed !important;
    right: 70px !important;
    left: auto !important;
    top: calc(28px + env(safe-area-inset-top, 0px)) !important;
    z-index: 700;
    display: block !important;
}

/* --- Carousel inside popups --- */
.carousel {
    position: relative;
}

.carousel-slide {
    display: none;
}

.carousel-slide.active {
    display: block;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--nm-border);
    cursor: pointer;
}

.carousel-dot.active {
    background: var(--nm-accent);
}

.nm-list-actions {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.nm-list-actions button {
    border: 1px solid var(--nm-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--nm-text);
    border-radius: 10px;
    padding: 8px 12px;
    min-height: 36px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.nm-list-actions button:hover {
    border-color: var(--nm-border-strong);
    color: var(--nm-accent);
}

/* --- Lightboxes and full bleed overlays --- */
.lightbox,
[class^=lightbox_],
[class^=large_],
[class^=planner_],
.panobox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 18, 0.78);
    color: var(--nm-text);
    padding: clamp(12px, 5vw, 32px);
    box-sizing: border-box;
    z-index: 1000;
    backdrop-filter: blur(14px);
}

.lightbox-content,
.large-lightbox-content,
.panobox-content,
#planner-content {
    background: var(--nm-surface-strong);
    padding: clamp(16px, 4vw, 24px);
    border-radius: 16px;
    margin: auto;
    text-align: left;
    font-family: var(--nm-font);
    overflow-y: auto;
    max-height: calc(100% - 80px);
    max-width: 1100px;
    border: 1px solid var(--nm-border);
    box-shadow: var(--nm-shadow);
    position: relative;
}

.panobox-content,
#planner-content {
    text-align: center;
}

#panoLightbox {
    padding: 0;
    display: none;
    align-items: stretch;
    justify-content: stretch;
}

#panoLightbox .panobox-content {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    display: grid;
    grid-template-rows: auto 1fr;
    align-items: stretch;
    background: #0b1220;
}

#panoLightbox .panobox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--nm-border);
}

#panoLightbox .panobox-title {
    font-weight: 700;
    color: var(--nm-text);
}

#panoLightbox .panobox-close {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

#panoLightbox #panorama {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: block;
    position: relative;
    overflow: hidden;
}

#panoLightbox #panorama > *,
#panoLightbox #panorama canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

#panoLightbox #panorama > * {
    position: absolute;
    inset: 0;
}

.lightbox-content a {
    color: var(--nm-accent);
    text-decoration: none;
    font-weight: 600;
}

.nm-close-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}

.nm-close-icon__img {
    width: 32px;
    height: 32px;
    display: block;
    pointer-events: none;
}

.nm-close-icon:hover {
    opacity: 0.85;
}

.close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0;
    line-height: 0;
    color: transparent;
    background: transparent;
    border: none;
    padding: 0;
    background-image: url("/images/xmark.circle.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 32px 32px;
}

.close:hover {
    opacity: 0.85;
}

div.list-block-center {
    text-align: center;
}

/* Contributors lightbox */
.nm-contrib {
    max-width: 1080px;
}

.nm-contrib__header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
}

.nm-contrib__header img {
    max-width: 200px;
}

.nm-contrib__eyebrow {
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--nm-accent);
    font-size: 12px;
}

.nm-contrib__lede {
    margin: 4px 0 0;
    color: var(--nm-muted);
}

.nm-contrib__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.nm-contrib__card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--nm-border);
    border-radius: 12px;
    padding: 12px 14px;
}

.nm-contrib__label {
    margin: 0 0 6px;
    font-weight: 700;
    color: var(--nm-accent);
}

.nm-contrib__card ul {
    margin: 0 0 10px;
    padding-left: 18px;
    color: var(--nm-text);
}

.nm-contrib__card li {
    margin-bottom: 4px;
}

.nm-contrib__card a {
    color: var(--nm-accent);
    font-weight: 600;
    text-decoration: none;
}

.nm-contrib__card a:hover {
    text-decoration: underline;
}

.nm-contrib__cta {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--nm-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.nm-contrib__cta p {
    margin: 0 0 8px;
    color: var(--nm-muted);
}

.nm-contrib__footer {
    text-align: center;
    color: var(--nm-muted);
    margin-top: 8px;
    font-weight: 600;
}

/* Lists modal */
.nm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 18, 0.78);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}
.nm-modal {
    background: var(--nm-surface-strong);
    border: 1px solid var(--nm-border);
    border-radius: 14px;
    padding: 16px 18px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 80px rgba(0,0,0,0.45);
    color: var(--nm-text);
}
.nm-modal h3 {
    margin: 0 0 10px;
}
.nm-modal label {
    display: block;
    margin: 8px 0 4px;
    font-weight: 600;
}
.nm-modal select, .nm-modal input {
    width: 100%;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid var(--nm-border);
    background: rgba(255,255,255,0.05);
    color: var(--nm-text);
    margin-bottom: 8px;
}
.nm-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
}
.nm-modal-actions button {
    border: 1px solid var(--nm-border);
    background: rgba(255,255,255,0.07);
    color: var(--nm-text);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
}
.nm-modal-actions .primary {
    background: linear-gradient(135deg, #7ef1ff, #6cc0ff);
    color: #041024;
    border: none;
    box-shadow: 0 10px 24px rgba(126,241,255,0.35);
}

.imageLightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    box-sizing: border-box;
    z-index: 1000;
    display: grid;
    place-items: center;
    animation: fadeToBlack 0.4s ease;
}

@keyframes fadeToBlack {
    from { background-color: rgba(0, 0, 0, 0); }
    to { background-color: rgba(0, 0, 0, 0.9); }
}

.imagebox-content {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.imagebox-content img {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    animation: fadeIn 0.6s ease;
}

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

#panorama {
    width: 100%;
    min-height: 60vh;
    height: 70vh;
}

/* --- Legacy helpers kept for compatibility --- */
.two-column-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.two-column-list li {
    flex: 1 1 calc(50% - 20px);
    list-style-type: none;
}

legend {
    position: relative;
    top: 10px;
    width: 100%;
    text-align: center;
    color: var(--nm-muted);
}

legend > item {
    margin: 0 10px 10px 0;
    float: left;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: bold;
    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
}

.axis-grid line {
    stroke: #aaa;
    opacity: 0.25;
}

.attribution-control {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: var(--nm-surface);
    padding: 8px 10px;
    border: 1px solid var(--nm-border);
    border-radius: 10px;
    z-index: 1000;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    color: #fff;
}

.attribution-content {
    display: none;
}

.attribution-control.collapsed .attribution-content {
    display: block;
}

.leaflet-control-attribution a {
    color: #dbe8ff;
    font-weight: 600;
}

.leaflet-control-attribution {
    color: #dbe8ff;
}

.leaflet-tooltip.nm-tooltip {
    background: rgba(7, 10, 20, 0.92);
    color: var(--nm-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
}

/* Hide attribution footer on small screens to save space */
@media (max-width: 768px) {
    .leaflet-control-attribution {
        display: none;
    }
}

#details {
    background: var(--nm-surface);
    padding: 10px;
    color: var(--nm-text);
    display: flex;
    width: 800px;
    max-width: 800px;
    box-shadow: 7px -2px 8px -1px rgba(0, 0, 0, 0.7);
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
}

#details div {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

span {
    font-size: 0.9rem;
    margin-top: 10px;
}

.logo {
    pointer-events: auto;
}

.leaflet-center {
    left: 50%;
    transform: translate(-50%, 0%);
}

/* Image meta captions in carousel */
.nm-img-meta {
    color: var(--nm-muted);
    font-size: 12px;
    margin-top: 4px;
}

/* Add photo button in popups */
.nm-add-photo {
    background: linear-gradient(135deg, rgba(126,241,255,0.15), rgba(126,241,255,0.08));
    color: var(--nm-accent);
    border: 1px solid rgba(126,241,255,0.35);
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.nm-add-photo:hover {
    border-color: rgba(126,241,255,0.6);
    color: #0b1828;
    background: var(--nm-accent);
}

/* Add photo button match list style */
.nm-add-photo {
    border: 1px solid var(--nm-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--nm-text);
    border-radius: 10px;
    padding: 8px 12px;
    min-height: 36px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.2;
}
.nm-add-photo:hover {
    border-color: var(--nm-border-strong);
    color: var(--nm-accent);
}

/* Align list and photo buttons in popup */
.nm-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
