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

/* Keep search-engine and screen-reader copy available without displaying it
   above the full-screen map. */
.ua-seo-content {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

#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;
}
/* SVG shapes avoid font and character-encoding differences. */
.photo360-viewer .ua-rotate-btn::before {
    content:"";
    position:absolute;
    left:50%; top:50%;
    width:18px; height:18px;
    transform:translate(-50%,-50%);
    background-position:center;
    background-repeat:no-repeat;
    background-size:contain;
    pointer-events:none;
}
.photo360-viewer .ua-rotate-btn.play::before {
    background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22white%22%3E%3Cpath%20d%3D%22M7%203L21%2012L7%2021Z%22%2F%3E%3C%2Fsvg%3E");
}
.photo360-viewer .ua-rotate-btn.pause::before {
    background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22white%22%3E%3Cpath%20d%3D%22M5%203H10V21H5ZM14%203H19V21H14Z%22%2F%3E%3C%2Fsvg%3E");
}

.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.video {
    background:linear-gradient(135deg, #ff9294, #ff353c 48%, #bb0920);
}

.marker-pin.photo {
    background:linear-gradient(135deg, #52d7ff, #079cff 48%, #0062b9);
}

.marker-pin.monet {
    background:linear-gradient(135deg, #ffe885, #f7bd22 48%, #c78608);
}

.marker-pin.splat {
    background:linear-gradient(135deg, #78ed8c, #22ca48 48%, #087c26);
}

/* Soft dimensional icons; preserve original pin rotation and map sizing. */
.marker-pin span {
    position:absolute; width:42px; height:42px;
    transform:rotate(45deg); display:block;
    font-size:0; color:transparent; text-shadow:none;
    background-position:center; background-size:28px 30px;
    background-repeat:no-repeat; pointer-events:none; z-index:2;
}
.marker-pin.photo span { background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2034%2036%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22white%22%20x2%3D%22.3%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22white%22%2F%3E%3Cstop%20offset%3D%22.6%22%20stop-color%3D%22%23f7fafc%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23b8cbd7%22%2F%3E%3C%2FlinearGradient%3E%3Cfilter%20id%3D%22shadow%22%20x%3D%22-30%25%22%20y%3D%22-30%25%22%20width%3D%22170%25%22%20height%3D%22180%25%22%3E%3CfeDropShadow%20dx%3D%220%22%20dy%3D%221.3%22%20stdDeviation%3D%221%22%20flood-opacity%3D%22.4%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Cg%20filter%3D%22url%28%23shadow%29%22%3E%3Cpath%20fill%3D%22url%28%23white%29%22%20d%3D%22M7%2010h5l2-3h6l2%203h3a3%203%200%200%201%203%203v12a3%203%200%200%201-3%203H7a3%203%200%200%201-3-3V13a3%203%200%200%201%203-3Z%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2219%22%20r%3D%226%22%20fill%3D%22%23176ca2%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2219%22%20r%3D%224.2%22%20fill%3D%22url%28%23white%29%22%2F%3E%3Crect%20x%3D%2223%22%20y%3D%2213%22%20width%3D%223%22%20height%3D%222%22%20rx%3D%22.6%22%20fill%3D%22%23268ac8%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
.marker-pin.video span { background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2034%2036%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22white%22%20x2%3D%22.3%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22white%22%2F%3E%3Cstop%20offset%3D%22.6%22%20stop-color%3D%22%23f7fafc%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23b8cbd7%22%2F%3E%3C%2FlinearGradient%3E%3Cfilter%20id%3D%22shadow%22%20x%3D%22-30%25%22%20y%3D%22-30%25%22%20width%3D%22170%25%22%20height%3D%22180%25%22%3E%3CfeDropShadow%20dx%3D%220%22%20dy%3D%221.3%22%20stdDeviation%3D%221%22%20flood-opacity%3D%22.4%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Cg%20filter%3D%22url%28%23shadow%29%22%3E%3Cpath%20d%3D%22M10%207Q8%206%208%209v17q0%203%203%201l17-9q2-1%200-3Z%22%20fill%3D%22url%28%23white%29%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
.marker-pin.splat span { background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2034%2036%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22white%22%20x2%3D%22.3%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22white%22%2F%3E%3Cstop%20offset%3D%22.6%22%20stop-color%3D%22%23f7fafc%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23b8cbd7%22%2F%3E%3C%2FlinearGradient%3E%3Cfilter%20id%3D%22shadow%22%20x%3D%22-30%25%22%20y%3D%22-30%25%22%20width%3D%22170%25%22%20height%3D%22180%25%22%3E%3CfeDropShadow%20dx%3D%220%22%20dy%3D%221.3%22%20stdDeviation%3D%221%22%20flood-opacity%3D%22.4%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Cg%20filter%3D%22url%28%23shadow%29%22%3E%3Cpath%20d%3D%22m16%204%2012%207-12%207-12-7Z%22%20fill%3D%22%23fff%22%2F%3E%3Cpath%20d%3D%22m4%2012%2011%207v13L4%2025Z%22%20fill%3D%22url%28%23white%29%22%2F%3E%3Cpath%20d%3D%22m17%2019%2011-7v13l-11%207Z%22%20fill%3D%22%23b9e6c8%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
.marker-pin.monet span { background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2034%2036%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22white%22%20x2%3D%22.3%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22white%22%2F%3E%3Cstop%20offset%3D%22.6%22%20stop-color%3D%22%23f7fafc%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23b8cbd7%22%2F%3E%3C%2FlinearGradient%3E%3Cfilter%20id%3D%22shadow%22%20x%3D%22-30%25%22%20y%3D%22-30%25%22%20width%3D%22170%25%22%20height%3D%22180%25%22%3E%3CfeDropShadow%20dx%3D%220%22%20dy%3D%221.3%22%20stdDeviation%3D%221%22%20flood-opacity%3D%22.4%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Cg%20filter%3D%22url%28%23shadow%29%22%3E%3Cpath%20d%3D%22M24%204c3-2%206%201%204%204L17%2023l-6-5Z%22%20fill%3D%22url%28%23white%29%22%2F%3E%3Cpath%20d%3D%22M10%2020c-7%200-2%208-7%2010%208%203%2014-1%2012-6Z%22%20fill%3D%22url%28%23white%29%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }


.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;
}


/* ==============================
   Refined non-intrusive UpAbove.me logo
   ============================== */
.ua-logo-mark {
    position: fixed;
    left: 22px;
    top: 22px;
    z-index: 130 !important;
    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;
}

/* Keep the top UI above map markers. */
.ua-shell {
    z-index: 100 !important;
}

.map-switcher {
    z-index: 120 !important;
}

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

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

/* Phones: keep the logo clear of the 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));
        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;
    }
}

@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;
    }
}


#uaPopularButton {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    bottom: calc(134px + env(safe-area-inset-bottom));
    z-index: 10001;
    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: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    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;
}

#uaPopularBox {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    width: min(245px, 64vw);
    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;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

/* Keep every open panel above all three buttons. */
#uaInfoBox,
#uaInstructionBox,
#uaPopularBox {
    bottom: calc(190px + env(safe-area-inset-bottom)) !important;
    max-height: min(52vh, calc(100vh - 244px - env(safe-area-inset-bottom))) !important;
    max-height: min(52dvh, calc(100dvh - 244px - env(safe-area-inset-bottom))) !important;
}

#uaPopularHeading {
    display: block;
    color: #75bdff;
    font-size: 16px;
    margin-bottom: 10px;
}

#uaPopularBox nav { display: grid; gap: 6px; }

#uaPopularBox a {
    display: block;
    padding: 10px 12px;
    border-radius: 9px;
    border: 1px solid rgba(117,189,255,0.20);
    background: rgba(117,189,255,0.08);
    color: #f7fbff;
    text-decoration: none;
    font-weight: 700;
}
.location-flag { width: 16px; height: 11px; object-fit: cover; vertical-align: 0; margin-right: 6px; border-radius: 1px; box-shadow: 0 0 0 1px rgba(255,255,255,.24); }

#uaPopularBox a:hover { background: rgba(117,189,255,0.20); }

#uaPopularBox a:focus-visible,
#uaPopularButton:focus-visible {
    outline: 2px solid #75bdff;
    outline-offset: 3px;
}

/* Popular areas and share controls share one row. */
#uaAreaTools {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    bottom: calc(134px + env(safe-area-inset-bottom));
    display: flex;
    gap: 8px;
    align-items: center;
    max-width: calc(100vw - 24px);
    z-index: 10001;
}
#uaAreaTools #uaPopularButton { position: static; min-width: 0; }
#uaPopularButton::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);
    color: #ffffff;
    font-size: 16px;
    line-height: 1;
}
#uaShareButton {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    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: 22px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0,0,0,0.4);
}
#uaShareBox {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    bottom: calc(190px + env(safe-area-inset-bottom));
    width: min(380px, calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    max-height: min(52vh, calc(100vh - 244px - env(safe-area-inset-bottom)));
    max-height: min(52dvh, calc(100dvh - 244px - env(safe-area-inset-bottom)));
    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;
    box-sizing: border-box;
    overflow-y: auto;
    pointer-events: auto;
}
#uaShareBox.ua-info-open { display: block; }
#uaShareHeading { display: block; color: #75bdff; font-size: 16px; }
#uaCopyLocationButton {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(117,189,255,0.4);
    border-radius: 10px;
    background: #1565c0;
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    white-space: normal;
}
#uaCopyLocationButton:disabled { opacity: 0.7; cursor: wait; }
#uaShareStatus { color: #a7d4ff; margin: 10px 0 0; }
#uaShareLink { box-sizing: border-box; width: 100%; padding: 10px; font-size: 16px; }
#uaManualShare { margin-top: 10px; }
#uaShareButton:focus-visible, #uaCopyLocationButton:focus-visible {
    outline: 2px solid #75bdff;
    outline-offset: 3px;
}
.popup-share-actions { display:flex; gap:9px; flex-wrap:wrap; margin:12px 0 14px; }
.popup-share-actions button {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    min-height:36px;
    padding:8px 13px;
    border:1px solid rgba(142,205,255,.48);
    border-radius:999px;
    background:linear-gradient(135deg, #1768bd, #0c4387);
    color:#fff;
    cursor:pointer;
    font:inherit;
    font-size:12px;
    font-weight:700;
    letter-spacing:.01em;
    box-shadow:0 5px 14px rgba(0,33,82,.32), inset 0 1px 0 rgba(255,255,255,.18);
    transition:transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.popup-share-actions button:hover {
    transform:translateY(-1px);
    background:linear-gradient(135deg, #2583df, #1257a0);
    box-shadow:0 7px 18px rgba(0,33,82,.42), inset 0 1px 0 rgba(255,255,255,.22);
}
.popup-share-actions button:active { transform:translateY(0); }
.popup-share-actions button:focus-visible { outline:2px solid #75bdff; outline-offset:2px; }
.splat-modal-actions #splatShare3d,
.splat-modal-actions #splatShareArea {
    border: 1px solid rgba(142,205,255,.48);
    border-radius: 999px;
    padding: 7px 11px;
    background: linear-gradient(135deg, #1768bd, #0c4387);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}
.splat-modal-actions #splatShare3d:hover,
.splat-modal-actions #splatShareArea:hover { background: linear-gradient(135deg, #2583df, #1257a0); }
.ua-share-legend { font-size: 26px; }

/* Compact marker previews with measured viewport limits. */
.ua-marker-popup {
    max-width: min(380px, var(--ua-popup-width, calc(100vw - 24px))) !important;
}
.ua-marker-popup .maplibregl-popup-content {
    max-width: 100%;
    max-height: var(--ua-popup-height, calc(100vh - 120px)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}
.ua-marker-popup .popup-content {
    width: min(336px, calc(var(--ua-popup-width, 100vw) - 24px)) !important;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.ua-marker-popup .popup-content h2 { padding-right: 28px; }
.ua-marker-popup .photo360-viewer { height: 240px; }
.ua-marker-popup .ios-photo-preview img { width: 100%; height: auto; display: block; }
@media (max-width: 900px) {
    .ua-marker-popup .popup-content {
        width: min(272px, calc(80vw - 57.6px), calc(var(--ua-popup-width, 100vw) - 24px)) !important;
    }
    .ua-marker-popup .photo360-viewer { height: min(184px, 28.8vh) !important; }
}
.ua-marker-popup .photo360-viewer:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
}
.ua-marker-popup .photo360-viewer:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
}
