html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
}

#map {
    width: 100%;
    height: 100%;
}

.info-box {
    position: absolute;
    top: 10px;
    left: 50px;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    color: #222;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.25);
    font-size: 13px;
    line-height: 1.5;
    min-width: 220px;
}

.coords {
    margin-top: 5px;
    font-family: monospace;
    color: #222;
}

.map-switcher {
    position: absolute;
    top: 22px;
    right: 24px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 35;
    width: min(690px, 64vw) !important;
    padding: 10px;
    display: grid;
    grid-template-columns: 180px 1fr 92px 148px;
    gap: 8px;
    background: rgba(9,18,31,0.84);
    border: 1px solid var(--ua-border);
    box-shadow: 0 18px 45px rgba(0,0,0,0.38);
    backdrop-filter: blur(18px);
}

.map-switcher select,
.map-switcher input,
.map-switcher button {
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
}

.popup-content {
    width: 420px;
}

.popup-content h2 {
    margin-top: 0;
}

.video-preview {
    position: relative;
    margin-top: 10px;
    cursor: pointer;
    display: block;
}

.video-preview img {
    width: 100%;
    border-radius: 6px;
    display: block;
}

.photo360-viewer {
    width: 100%;
    height: 300px;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
}

.photo360-viewer .ua-rotate-btn {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 20;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 999px;
    background: rgba(0,0,0,0.58);
    color: white;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: auto;
}

.photo360-viewer .ua-rotate-btn:hover {
    background: rgba(0,0,0,0.76);
}
.photo360-viewer .ua-rotate-btn{
 font-size:0;
}
.photo360-viewer .ua-rotate-btn::before{font-size:18px;}
.photo360-viewer .ua-rotate-btn.play::before{content:"▶";}
.photo360-viewer .ua-rotate-btn.pause::before{content:"❚❚";}

.splat-button {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border: 0;
    border-radius: 8px;
    background: #0a8f31;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.splat-button:hover {
    background: #0fc447;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255,0,0,0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: white;
    pointer-events: none;
}

.marker-pin {
    width: 42px;
    height: 42px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg) scale(var(--ua-map-marker-scale, 1));
    transform-origin: center bottom;
    position: relative;

    cursor: pointer;

    transition:
        transform 0.12s ease,
        filter 0.15s ease,
        box-shadow 0.15s ease;

    box-shadow:
        0 3px 8px rgba(0,0,0,0.45),
        inset 0 0 0 2px rgba(255,255,255,0.85);
}

.marker-pin:hover {

    filter: brightness(1.22);

    box-shadow:
        0 0 0 4px rgba(255,255,255,0.45),
        0 0 14px rgba(0,0,0,0.65),
        inset 0 0 0 2px rgba(255,255,255,0.95);
}

.marker-pin::after {
    content: "360";
    position: absolute;
    width: 29px;
    height: 17px;
    top: -8px;
    left: 7px;
    border-radius: 9px;
    background: #000;
    color: white;
    font-size: 10px;
    font-weight: bold;
    line-height: 17px;
    text-align: center;
    transform: rotate(45deg);
    z-index: 3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

.marker-pin.video {
    background: linear-gradient(135deg, #ff2b2b, #9b0000);
}

.marker-pin.photo {
    background: linear-gradient(135deg, #21a8ff, #004f99);
}

.marker-pin.monet {
    background: linear-gradient(135deg, #d9a441, #744313);
}

.marker-pin.monet::after {
    content: "ART";
}

.marker-pin.splat {
    background: linear-gradient(135deg, #35d95b, #087c26);
}

.marker-pin.splat::after {
    content: "3D";
}

.marker-pin span {
    position: absolute;
    width: 42px;
    height: 42px;
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.splat-modal {
    display: none;
    position: fixed;
    z-index: 5000;
    inset: 0;
    background: rgba(0,0,0,0.82);
}

.splat-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.splat-modal-box {
    width: 92vw;
    height: 82vh;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 35px rgba(0,0,0,0.75);
    display: flex;
    flex-direction: column;
}

.splat-modal-header {
    height: 44px;
    background: #151515;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-size: 14px;
}

.splat-modal-actions {
    display: flex;
    gap: 8px;
}

.splat-modal-actions button,
.splat-modal-actions a {
    background: #333;
    color: white;
    border: 0;
    border-radius: 6px;
    padding: 6px 9px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.splat-modal-actions button:hover,
.splat-modal-actions a:hover {
    background: #555;
}

#splatFrame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

.maplibregl-ctrl-attrib {
    font-size: 10px !important;
    opacity: 0.55;
    background: rgba(255,255,255,0.35) !important;
    border-radius: 6px;
    padding: 2px 6px !important;
    margin: 4px !important;
    color: #333 !important;
    backdrop-filter: blur(2px);
}

.maplibregl-ctrl-attrib a {
    color: #333 !important;
    text-decoration: none;
}

.pnlm-about-msg {
    display: none !important;
}


/* ==============================
   UpAbove.Me premium UI layer
   ============================== */
:root { --ua-blue: #1187ff; --ua-panel: rgba(6,15,28,0.72); --ua-border: rgba(255,255,255,0.16); --ua-text: #f7fbff; --ua-muted: rgba(247,251,255,0.72); }
body { background: #02070d; overflow: hidden; }
#map::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 72% 42%, rgba(0,130,255,0.06), transparent 32%), linear-gradient(90deg, rgba(1,7,16,0.40) 0%, rgba(1,7,16,0.26) 27%, rgba(1,7,16,0.05) 58%, rgba(1,7,16,0.015) 100%), linear-gradient(180deg, rgba(1,7,16,0.28) 0%, transparent 26%, rgba(1,7,16,0.20) 100%); z-index: 1; }
.ua-shell { position: fixed; inset: 0; z-index: 20; pointer-events: none; color: var(--ua-text); }
.ua-topbar { position: absolute; top: 0; left: 0; right: 0; height: 124px; display: flex; align-items: center; justify-content: space-between; padding: 12px 32px; box-sizing: border-box; background: linear-gradient(180deg, rgba(2,9,18,0.96), rgba(2,9,18,0.72), transparent); pointer-events: none; }
.ua-brand { display: flex; align-items: center; height: 108px; }
.ua-brand img { height: 106px; width: auto; object-fit: contain; filter: drop-shadow(0 10px 26px rgba(0,0,0,0.75)); }
.ua-nav { display: flex; gap: 28px; align-items: center; font-size: 15px; }
.ua-nav a { color: rgba(255,255,255,0.82); text-decoration: none; }
.ua-nav a:hover { color: white; }
.ua-hero { position: absolute; left: 42px; top: 172px; width: min(460px, calc(100vw - 84px)); pointer-events: none; text-shadow: 0 3px 20px rgba(0,0,0,0.55); }
.ua-kicker { color: #75bdff; font-size: 12px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 16px; }
.ua-hero h1 { margin: 0; font-size: clamp(44px, 5.4vw, 76px); line-height: 0.96; letter-spacing: -0.055em; }
.ua-hero h1 span { color: var(--ua-blue); }
.ua-hero p { max-width: 380px; margin: 22px 0 26px; font-size: 18px; line-height: 1.5; color: var(--ua-muted); }
.ua-hero-actions { display: flex; gap: 12px; pointer-events: auto; }
.ua-hero-actions button { border: 1px solid var(--ua-border); border-radius: 12px; color: white; padding: 13px 18px; font-weight: 700; cursor: pointer; background: rgba(255,255,255,0.1); backdrop-filter: blur(14px); box-shadow: 0 10px 25px rgba(0,0,0,0.25); }
.ua-hero-actions button:first-child { border: 0; background: linear-gradient(135deg, rgba(7,24,48,0.94), rgba(15,46,84,0.84));
    border: 1px solid rgba(140,180,255,0.22);
    box-shadow:
        0 16px 40px rgba(0,0,0,0.5),
        0 0 22px rgba(17,135,255,0.22),
        inset 0 1px 0 rgba(255,255,255,0.08); }
.ua-stats { position: absolute; left: 42px; bottom: 28px; display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); width: min(760px, calc(100vw - 84px)); background: rgba(8,17,29,0.68); border: 1px solid var(--ua-border); border-radius: 18px; backdrop-filter: blur(18px); box-shadow: 0 18px 45px rgba(0,0,0,0.38); overflow: hidden; pointer-events: none; }
.ua-stats div { padding: 18px 20px; border-right: 1px solid rgba(255,255,255,0.1); }
.ua-stats div:last-child { border-right: 0; }
.ua-stats strong, .ua-stats span { display: block; }
.ua-stats strong { font-size: 17px; margin-bottom: 5px; }
.ua-stats span { color: var(--ua-muted); font-size: 13px; }
.info-box { top: 660px; left: 42px; z-index: 30; min-width: 0; width: 230px; color: white; background: var(--ua-panel); border: 1px solid var(--ua-border); box-shadow: 0 18px 45px rgba(0,0,0,0.35); backdrop-filter: blur(18px); pointer-events: none; }
.info-box strong { color: #75bdff; }
.coords { color: rgba(255,255,255,0.82); }
.map-switcher { bottom: 22px; right: 22px; z-index: 35; width: min(420px, 38vw); padding: 10px; display: grid; grid-template-columns: 120px 1fr 92px; gap: 8px; background: rgba(9,18,31,0.84); border: 1px solid var(--ua-border); box-shadow: 0 18px 45px rgba(0,0,0,0.38); backdrop-filter: blur(18px); }
.map-switcher select, .map-switcher input, .map-switcher button { height: 38px; margin-top: 0; border-radius: 10px; border: 1px solid rgba(255,255,255,0.14); background: rgba(9,18,31,0.72);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 0 0 1px rgba(255,255,255,0.02); color: white; padding: 0 10px; outline: none; }
.map-switcher select option { color: #111; }
.map-switcher input::placeholder { color: rgba(255,255,255,0.55); }
.map-switcher button { border: 0; background: linear-gradient(135deg, rgba(7,24,48,0.94), rgba(15,46,84,0.84));
    border: 1px solid rgba(140,180,255,0.22);
    box-shadow:
        0 16px 40px rgba(0,0,0,0.5),
        0 0 22px rgba(17,135,255,0.22),
        inset 0 1px 0 rgba(255,255,255,0.08); font-weight: 700; cursor: pointer; }
.maplibregl-ctrl-top-right { top: 124px; right: 18px; }
.maplibregl-ctrl-top-left { top: 112px; left: auto; right: 18px; }
.maplibregl-ctrl-group { background: rgba(6,15,28,0.78) !important; border: 1px solid rgba(255,255,255,0.14) !important; backdrop-filter: blur(12px); border-radius: 12px !important; overflow: hidden; }
.maplibregl-ctrl button { filter: invert(1); }
.maplibregl-popup-content { background: rgba(8,17,29,0.94) !important; color: white !important; border: 1px solid rgba(255,255,255,0.14); border-radius: 16px !important; box-shadow: 0 22px 60px rgba(0,0,0,0.55) !important; backdrop-filter: blur(18px); }
.maplibregl-popup-tip { border-top-color: rgba(8,17,29,0.94) !important; border-bottom-color: rgba(8,17,29,0.94) !important; }
.popup-content { width: min(420px, 82vw); }
.popup-content h2 { color: #75bdff; }
.splat-modal-box { border: 1px solid rgba(255,255,255,0.16); }
@media (max-width: 900px) { .ua-topbar { height: 94px; padding: 8px 14px; } .ua-brand img { height: 76px; } .ua-nav { display: none; } .map-switcher { top: auto; right: 12px; left: 12px; bottom: 14px; width: auto; grid-template-columns: 1fr; } .info-box { display: none; } .ua-hero { top: 104px; left: 18px; width: calc(100vw - 36px); } .ua-kicker { font-size: 10px; margin-bottom: 8px; } .ua-hero h1 { font-size: 38px; } .ua-hero p { max-width: 290px; font-size: 14px; margin: 12px 0 14px; } .ua-hero-actions button { padding: 10px 12px; font-size: 13px; } .ua-stats { display: none; } .maplibregl-ctrl-top-left, .maplibregl-ctrl-top-right { top: 92px; } .photo360-viewer { height: 230px; } }
@media (max-width: 520px) { .ua-hero { pointer-events: none; } .ua-hero-actions { display: none; } .ua-hero p { display: none; } .ua-hero h1 { font-size: 30px; } .map-switcher { pointer-events: auto; } }

/* ==============================
   Final requested cleanup overrides
   ============================== */
.ua-brand {
    transform: translateY(18px);
}

.maplibregl-popup {
    z-index: 80 !important;
}

.maplibregl-marker {
    z-index: 40 !important;
}

.splat-modal {
    z-index: 5000 !important;
}

@media (max-width: 900px) {
    .ua-brand {
        transform: translateY(12px);
    }
}


/* ==============================
   Lat/Lng moved into top controls
   ============================== */
.info-box {
    display: none !important;
}

.map-switcher {
    grid-template-columns: 180px 1fr 92px 148px !important;
    width: min(640px, 60vw) !important;
    right: 24px !important;
}

.coords-top {
    min-height: 38px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.075);
    color: rgba(255,255,255,0.84);
    font-family: monospace;
    font-size: 11px;
    line-height: 1.35;
    padding: 5px 9px;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 900px) {
    .map-switcher {
        grid-template-columns: 1fr !important;
        width: auto !important;
        right: 12px !important;
    }

    .coords-top {
        display: none;
    }
}


/* Improved popup close buttons */
.maplibregl-popup-close-button {
    color: white !important;
    font-size: 30px !important;
    font-weight: bold;
    width: 42px !important;
    height: 42px !important;
    line-height: 42px !important;
    background: transparent !important;
    border: 0 !important;
    opacity: 0.95;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.maplibregl-popup-close-button:hover {
    opacity: 1;
    transform: scale(1.08);
}






/* ==============================
   Simple bottom-left info panel
   ============================== */
#uaInfoBox {
    position: fixed;
    
    bottom: 134px;
    width: min(380px, calc(100vw - 44px));
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(117,189,255,0.44);
    background: rgba(6,15,28,0.96);
    color: rgba(255,255,255,0.92);
    box-shadow: 0 22px 58px rgba(0,0,0,0.58);
    backdrop-filter: blur(18px);
    font-size: 14px;
    line-height: 1.5;
    z-index: 10000;
    display: none;
    pointer-events: auto;
}

#uaInfoBox.ua-info-open {
    display: block;
}

#uaInfoBox strong {
    display: block;
    color: #75bdff;
    font-size: 16px;
    margin-bottom: 8px;
}

#uaInfoButton {
    position: fixed;
    
    bottom: 78px;
    z-index: 10001;
    min-width: 96px;
    height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(140,180,255,0.22);
    background: linear-gradient(135deg, rgba(7,24,48,0.94), rgba(15,46,84,0.84));
    color: white;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 22px rgba(17,135,255,0.42);
    pointer-events: auto;
}

#uaInfoButton::before {
    content: "i";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.24);
    font-family: Georgia, serif;
    font-size: 18px;
    font-style: italic;
    font-weight: bold;
    text-transform: none;
}

#uaInfoButton:hover {
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    #uaInfoButton {
        left: 12px;
        bottom: 264px;
        min-width: 86px;
        height: 42px;
        font-size: 12px;
    }

    #uaInfoBox {
        left: 12px;
        bottom: 316px;
        width: calc(100vw - 24px);
        max-height: 34vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }
}

@media (max-width: 520px) and (orientation: portrait) {
    #uaInfoButton {
        bottom: 278px;
    }

    #uaInfoBox {
        bottom: 330px;
        max-height: 32vh;
    }
}


/* ==============================
   Instruction marker legend panel
   ============================== */
#uaInstructionBox {
    position: fixed;
    
    bottom: 134px;
    width: min(380px, calc(100vw - 44px));
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(117,189,255,0.44);
    background: rgba(6,15,28,0.96);
    color: rgba(255,255,255,0.92);
    box-shadow: 0 22px 58px rgba(0,0,0,0.58);
    backdrop-filter: blur(18px);
    font-size: 14px;
    line-height: 1.5;
    z-index: 10000;
    display: none;
    pointer-events: auto;
}

#uaInstructionBox.ua-info-open {
    display: block;
}

#uaInstructionBox strong {
    display: block;
    color: #75bdff;
    font-size: 16px;
    margin-bottom: 8px;
}

#uaInstructionButton {
    position: fixed;
    
    bottom: 22px;
    z-index: 10001;
    min-width: 146px;
    height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(140,180,255,0.22);
    background: linear-gradient(135deg, rgba(7,24,48,0.94), rgba(15,46,84,0.84));
    color: white;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 22px rgba(17,135,255,0.42);
    pointer-events: auto;
}

#uaInstructionButton::before {
    content: "?";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.24);
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    text-transform: none;
}

#uaInstructionButton:hover {
    transform: translateY(-1px);
}

.ua-marker-legend {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.ua-marker-legend-row {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 10px;
    align-items: center;
}

.ua-marker-sample {
    width: 46px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ua-marker-sample .marker-pin {
    transform: rotate(-45deg) scale(0.62);
    transform-origin: center;
    cursor: default;
    pointer-events: none;
}

.ua-marker-legend-row b {
    color: white;
}

.ua-marker-legend-row span {
    display: block;
    color: rgba(255,255,255,0.75);
    font-size: 13px;
}

#uaInstructionBox p {
    margin: 0 0 12px 0;
}

#uaInstructionBox p:last-child {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    #uaInstructionButton {
        left: 12px;
        bottom: 218px;
        min-width: 126px;
        height: 42px;
        font-size: 12px;
    }

    #uaInstructionBox {
        left: 12px;
        bottom: 316px;
        width: calc(100vw - 24px);
        max-height: 30vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }
}

@media (max-width: 520px) and (orientation: portrait) {
    #uaInstructionButton {
        bottom: 232px;
    }

    #uaInstructionBox {
        bottom: 330px;
        max-height: 28vh;
    }
}


#uaInfoBox p {
    margin: 0 0 14px 0;
}

#uaInfoBox p:last-child {
    margin-bottom: 0;
}


/* ==============================
   Mobile-safe panel and popup fixes
   ============================== */
#uaInfoButton,
#uaInstructionButton,
#uaInfoBox,
#uaInstructionBox {
    left: max(12px, env(safe-area-inset-left)) !important;
}

#uaInstructionButton {
    bottom: calc(22px + env(safe-area-inset-bottom)) !important;
}

#uaInfoButton {
    bottom: calc(78px + env(safe-area-inset-bottom)) !important;
}

#uaInfoBox,
#uaInstructionBox {
    top: auto !important;
    right: auto !important;
    bottom: calc(134px + env(safe-area-inset-bottom)) !important;
    width: min(380px, calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right))) !important;
    max-height: min(52vh, calc(100vh - 190px - env(safe-area-inset-bottom))) !important;
    overflow-y: auto !important;
    box-sizing: border-box;
}

.maplibregl-popup {
    max-width: calc(100vw - 24px) !important;
}

.maplibregl-popup-content {
    max-height: calc(100vh - 128px) !important;
    overflow-y: auto !important;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    #uaInstructionButton {
        bottom: calc(22px + env(safe-area-inset-bottom)) !important;
    }

    #uaInfoButton {
        bottom: calc(74px + env(safe-area-inset-bottom)) !important;
    }

    #uaInfoBox,
    #uaInstructionBox {
        bottom: calc(124px + env(safe-area-inset-bottom)) !important;
        max-height: min(46vh, calc(100vh - 160px - env(safe-area-inset-bottom))) !important;
    }

    .popup-content {
        width: min(340px, calc(100vw - 72px)) !important;
    }

    .photo360-viewer {
        height: min(230px, 36vh) !important;
    }
}

@media (max-width: 520px) and (orientation: portrait) {
    #uaInstructionButton {
        bottom: calc(22px + env(safe-area-inset-bottom)) !important;
    }

    #uaInfoButton {
        bottom: calc(74px + env(safe-area-inset-bottom)) !important;
    }

    #uaInfoBox,
    #uaInstructionBox {
        bottom: calc(124px + env(safe-area-inset-bottom)) !important;
        max-height: min(44vh, calc(100vh - 154px - env(safe-area-inset-bottom))) !important;
    }
}





/* ==============================
   Slim mobile top control bar
   Keeps map controls horizontal for longer
   ============================== */
@media (max-width: 900px) {
    .map-switcher {
        top: env(safe-area-inset-top, 0px) !important;
        left: 10px !important;
        right: 10px !important;
        bottom: auto !important;
        width: auto !important;
        padding: 4px 5px !important;
        gap: 5px !important;
        grid-template-columns: minmax(92px, 0.85fr) minmax(120px, 1.4fr) minmax(72px, 0.65fr) !important;
        align-items: center;
    }

    .map-switcher select,
    .map-switcher input,
    .map-switcher button {
        height: 32px !important;
        min-width: 0 !important;
        padding: 0 7px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
    }

    .map-switcher button {
        font-size: 10px !important;
        letter-spacing: 0.02em;
    }

    .coords-top {
        display: none !important;
    }
}

@media (max-width: 420px) {
    .map-switcher {
        left: 6px !important;
        right: 6px !important;
        padding: 5px !important;
        gap: 4px !important;
        grid-template-columns: 86px minmax(96px, 1fr) 64px !important;
    }

    .map-switcher select,
    .map-switcher input,
    .map-switcher button {
        height: 30px !important;
        padding: 0 5px !important;
        font-size: 10px !important;
    }

    .map-switcher button {
        font-size: 9px !important;
    }
}

@media (max-width: 340px) {
    .map-switcher {
        grid-template-columns: 78px minmax(84px, 1fr) 58px !important;
    }

    .map-switcher select,
    .map-switcher input,
    .map-switcher button {
        font-size: 9px !important;
    }
}


/* Scroll hint ONLY for info/instruction panels */
#uaInfoBox.ua-info-open::after,
#uaInstructionBox.ua-info-open::after {
    content: "⌄ Scroll";
    position: sticky;
    bottom: -2px;
    display: block;
    width: 100%;
    padding: 10px 0 4px 0;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.72);
    background: linear-gradient(
        to bottom,
        rgba(6,15,28,0),
        rgba(6,15,28,0.96) 45%
    );
    pointer-events: none;
}


/* ==============================
   Latest cleanup stability fixes
   ============================== */

/* Explicit base left positions so panels/buttons do not depend on later mobile overrides */
#uaInfoBox,
#uaInstructionBox,
#uaInfoButton,
#uaInstructionButton {
    left: 22px;
}

/* On mobile, keep the controls as a thin top bar */
@media (max-width: 900px) {
    .map-switcher {
        position: absolute !important;
        top: env(safe-area-inset-top, 0px) !important;
        left: max(6px, env(safe-area-inset-left)) !important;
        right: max(6px, env(safe-area-inset-right)) !important;
        bottom: auto !important;
        width: auto !important;
        grid-template-columns: 86px minmax(96px, 1fr) 64px !important;
        padding: 5px !important;
        gap: 4px !important;
    }

    .map-switcher select,
    .map-switcher input,
    .map-switcher button {
        height: 30px !important;
        min-width: 0 !important;
        padding: 0 5px !important;
        font-size: 10px !important;
        margin-top: 0 !important;
    }

    .coords-top {
        display: none !important;
    }
}

/* Stop popup/modal 360 windows from showing unwanted scroll bars */
.maplibregl-popup-content {
    overflow: hidden !important;
}

.popup-content {
    overflow: hidden !important;
}

/* INFO and INSTRUCTIONS are the only panels that should scroll */
#uaInfoBox,
#uaInstructionBox {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Keep Pannellum native behaviour; do not force fullscreen/orientation controls */
.photo360-viewer {
    overflow: hidden !important;
}

.photo360-viewer:-webkit-full-screen,
.photo360-viewer:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background: #000 !important;
}


/* iOS dedicated 360 photo button */
.popup-content .splat-button {
    background: #1565c0;
}


/* iOS popup preview for 360 photos */
.ios-photo-preview {
    position: relative;
    width: 100%;
    height: 190px;
    margin-top: 10px;
    border-radius: 10px;
    overflow: hidden;
    background: #050b14;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.ios-photo-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.ios-photo-preview::after {
    content: "360° Preview";
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(0,0,0,0.58);
    color: white;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.ios-photo-note {
    margin: 8px 0 0 0;
    color: rgba(255,255,255,0.72);
    font-size: 12px;
    line-height: 1.35;
}


/* iPhone landscape popup fix */
@media (max-width: 900px) and (orientation: landscape) {
    .maplibregl-popup-content {
        max-height: calc(100dvh - 56px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .popup-content {
        width: min(360px, calc(100vw - 96px)) !important;
        overflow: visible !important;
    }

    .ios-photo-preview {
        height: min(150px, 34vh) !important;
    }

    .ios-photo-note {
        font-size: 11px !important;
        margin-top: 6px !important;
    }

    .popup-content .splat-button {
        margin-top: 8px !important;
        padding: 9px !important;
    }
}

@media (max-height: 430px) and (orientation: landscape) {
    .maplibregl-popup-content {
        max-height: calc(100dvh - 36px) !important;
    }

    .ios-photo-preview {
        height: min(118px, 30vh) !important;
    }

    .popup-content h2 {
        font-size: 16px !important;
        margin-bottom: 6px !important;
    }

    .popup-content p {
        margin-top: 6px !important;
        margin-bottom: 6px !important;
    }
}


/* Compact iPhone 360 popup sizing */
@media (max-width: 900px) {

    .popup-content {
        width: min(320px, calc(100vw - 88px)) !important;
    }

    .ios-photo-preview {
        height: 155px !important;
        margin-top: 8px !important;
        border-radius: 8px !important;
    }

    .popup-content p {
        margin-bottom: 8px !important;
    }

    .ios-photo-note {
        margin-top: 6px !important;
        margin-bottom: 8px !important;
        font-size: 11px !important;
        line-height: 1.3 !important;
    }

    .popup-content .splat-button {
        margin-top: 0 !important;
        padding: 9px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 900px) and (orientation: landscape) {

    .popup-content {
        width: min(300px, calc(100vw - 120px)) !important;
    }

    .ios-photo-preview {
        height: 120px !important;
    }

    .maplibregl-popup-content {
        padding: 12px !important;
    }
}


/* ==============================
   Refined non-intrusive UpAbove.me logo
   ============================== */
.ua-logo-mark {
    position: fixed;
    left: 22px;
    top: 22px;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px 8px 9px;
    border-radius: 999px;
    border: 1px solid rgba(130,185,255,0.22);
    background:
        linear-gradient(135deg, rgba(7,20,38,0.70), rgba(8,32,58,0.48));
    color: rgba(255,255,255,0.92);
    box-shadow:
        0 14px 34px rgba(0,0,0,0.36),
        0 0 20px rgba(17,135,255,0.10),
        inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    pointer-events: none;
    user-select: none;
}

.ua-logo-orb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 32% 28%, rgba(255,255,255,0.92), rgba(117,189,255,0.42) 24%, rgba(17,135,255,0.78) 48%, rgba(4,32,72,0.95) 100%);
    box-shadow:
        0 0 18px rgba(17,135,255,0.46),
        inset 0 1px 0 rgba(255,255,255,0.45);
    color: white;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
}

.ua-logo-text {
    display: flex;
    align-items: baseline;
    gap: 0;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.ua-logo-text .ua-up {
    color: white;
    font-size: 15px;
}

.ua-logo-text .ua-above {
    color: #75bdff;
    font-size: 15px;
}

.ua-logo-text .ua-dot {
    color: rgba(255,255,255,0.72);
    font-size: 12px;
    margin-left: 1px;
    letter-spacing: -0.02em;
}

/* Phones: keep clear of top search bar and bottom-left buttons */
@media (max-width: 900px) {
    .ua-logo-mark {
        top: auto;
        left: auto;
        right: 12px;
        bottom: calc(22px + env(safe-area-inset-bottom, 0px));
        z-index: 9998;
        padding: 7px 10px 7px 8px;
        gap: 7px;
        opacity: 0.88;
    }

    .ua-logo-orb {
        width: 23px;
        height: 23px;
        font-size: 7px;
    }

    .ua-logo-text .ua-up,
    .ua-logo-text .ua-above {
        font-size: 13px;
    }

    .ua-logo-text .ua-dot {
        font-size: 10px;
    }
}

/* Landscape: tuck it away in the upper-right, below the top controls */
@media (max-width: 900px) and (orientation: landscape) {
    .ua-logo-mark {
        top: calc(48px + env(safe-area-inset-top, 0px));
        right: 10px;
        bottom: auto;
        left: auto;
        padding: 6px 9px 6px 7px;
        opacity: 0.82;
    }

    .ua-logo-orb {
        width: 21px;
        height: 21px;
        font-size: 7px;
    }

    .ua-logo-text .ua-up,
    .ua-logo-text .ua-above {
        font-size: 12px;
    }
}

@media (max-width: 380px) and (orientation: portrait) {
    .ua-logo-mark {
        padding: 6px 8px 6px 7px;
        gap: 6px;
    }

    .ua-logo-text .ua-up,
    .ua-logo-text .ua-above {
        font-size: 12px;
    }
}


/* ==============================
   Keep map markers behind the top control bar
   ============================== */
.map-switcher {
    z-index: 120 !important;
}

.maplibregl-marker {
    z-index: 40 !important;
}

/* Keep popups above markers and controls when opened */
.maplibregl-popup {
    z-index: 300 !important;
}

/* Keep logo safely above markers too */
.ua-logo-mark {
    z-index: 130 !important;
}

/* Mobile/landscape: controls must stay above markers */
@media (max-width: 900px) {
    .map-switcher {
        z-index: 120 !important;
    }

    .ua-logo-mark {
        z-index: 130 !important;
    }

    .maplibregl-popup {
        z-index: 300 !important;
    }
}


/* SEO/accessibility content: visible to crawlers and screen readers, visually hidden from map UI */
.ua-seo-content {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.ua-seo-content:focus-within {
    position: fixed;
    left: 16px;
    top: 16px;
    width: min(720px, calc(100vw - 32px));
    height: auto;
    max-height: 70vh;
    overflow: auto;
    z-index: 20000;
    padding: 18px;
    border-radius: 14px;
    background: #06101d;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.55);
}
