/* Scoped rules: existing iPhone fixes remain in index.html for fallback. */
#uaExploreLegacy[hidden],#uaExplorePanel[hidden]{display:none!important}
#uaExploreButton{position:fixed;left:max(12px,env(safe-area-inset-left));bottom:calc(22px + env(safe-area-inset-bottom));z-index:10021;display:flex;align-items:center;gap:9px;min-height:46px;padding:0 17px;border:1px solid #75bdff99;border-radius:999px;background:linear-gradient(135deg,#092744,#153e6d);color:#fff;font:800 14px/1.2 Arial,sans-serif;letter-spacing:.025em;cursor:pointer;box-shadow:0 5px 22px #0006,0 0 12px #1187ff44;touch-action:manipulation}
#uaExploreButton.ua-explore-invite{animation:uaExploreGlow 2.4s ease-in-out infinite}
@keyframes uaExploreGlow{0%,100%{box-shadow:0 5px 22px #0006,0 0 12px #1187ff44}50%{box-shadow:0 5px 22px #0006,0 0 24px 5px #299cffaa;border-color:#b5e3ff}}
#uaExplorePanel{position:fixed;left:max(12px,env(safe-area-inset-left));bottom:calc(80px + env(safe-area-inset-bottom));width:min(370px,calc(100vw - 24px));height:min(650px,calc(100vh - 170px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));height:min(650px,calc(100dvh - 170px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));z-index:10022;box-sizing:border-box;background:rgba(6,15,28,.98);color:#f7fbff;border:1px solid #75bdff70;border-radius:18px;box-shadow:0 16px 50px #0009;display:flex;flex-direction:column;overflow:hidden;font:14px/1.5 Arial,sans-serif;pointer-events:auto}
#uaExplorePanel .ua-explore-header{display:flex;align-items:center;justify-content:space-between;flex:none;gap:12px;padding:8px 12px 8px 18px;border-bottom:1px solid #75bdff33}
#uaExplorePanel .ua-explore-header strong{font-size:18px;color:#a2d3ff}
#uaExplorePanel button{touch-action:manipulation;cursor:pointer;color:#f7fbff;font:700 13px/1.2 Arial,sans-serif}
#uaExplorePanel .ua-explore-close{min-height:30px;height:30px;padding:0;border-radius:7px;border:1px solid #75bdff55;background:#14314f}
#uaExplorePanel .ua-explore-layout{display:flex;flex-direction:column;flex:1;min-height:0}
#uaExplorePanel .ua-explore-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:9px;flex:none;border-bottom:1px solid #75bdff33}
#uaExplorePanel .ua-explore-section{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:53px;padding:7px 3px;border-radius:9px;background:#10243b;border:1px solid transparent;font-size:12px}
#uaExplorePanel .ua-explore-section.is-active{background:#194975;border-color:#75bdff;color:white}
#uaExplorePanel .ua-explore-content{position:relative;display:flex;min-height:0;flex:1;overflow:hidden}
html body #uaExplorePanel #uaInfoBox,html body #uaExplorePanel #uaInstructionBox,html body #uaExplorePanel #uaPopularBox,html body #uaExplorePanel #uaPopularImagesBox,html body #uaExplorePanel #uaAutoTourPanel,html body #uaExplorePanel #uaNearbyPanel{
position:relative!important;inset:auto!important;top:auto!important;bottom:auto!important;left:auto!important;right:auto!important;width:100%!important;max-width:none!important;min-width:0!important;height:100%!important;max-height:100%!important;margin:0!important;padding:16px 18px 30px!important;transform:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;backdrop-filter:none!important;background:transparent!important;box-sizing:border-box!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;font-size:14px!important;line-height:1.55!important;z-index:auto!important;flex:1}
#uaExplorePanel a{overflow-wrap:anywhere}
#uaExplorePanel button:focus-visible,#uaExploreButton:focus-visible{outline:3px solid #91ceff;outline-offset:-3px}
@media(max-width:1100px) and (max-height:540px) and (orientation:landscape){
#uaExplorePanel{top:calc(52px + env(safe-area-inset-top));bottom:calc(10px + env(safe-area-inset-bottom));height:auto;width:min(620px,calc(100vw - 76px - env(safe-area-inset-left) - env(safe-area-inset-right)))}
#uaExplorePanel .ua-explore-header{padding:2px 10px 2px 16px}
#uaExplorePanel .ua-explore-layout{flex-direction:row}
#uaExplorePanel .ua-explore-nav{display:flex;flex-direction:column;width:128px;box-sizing:border-box;flex:0 0 128px;overflow-y:auto;-webkit-overflow-scrolling:touch;border-bottom:0;border-right:1px solid #75bdff33;padding:6px;gap:4px}
#uaExplorePanel .ua-explore-section{flex-direction:row;justify-content:flex-start;min-height:44px;flex-shrink:0;gap:7px;padding:6px;font-size:12px}
#uaExplorePanel .ua-explore-section svg{width:18px;height:18px;flex-shrink:0}
#uaExplorePanel .ua-explore-content{min-width:0}
#uaExploreButton[aria-expanded="true"]{visibility:hidden}
}
@media(prefers-reduced-motion:reduce){#uaExploreButton.ua-explore-invite{animation:none}}

/* Dashboard now lives in the shaded header. */
#uaExploreButton{top:calc(22px + env(safe-area-inset-top,0px));bottom:auto;pointer-events:auto}
#uaExplorePanel{top:calc(82px + env(safe-area-inset-top,0px));bottom:auto;height:min(650px,calc(100dvh - 106px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)))}
#uaExplorePanel .ua-explore-close{width:30px;padding:0;flex:none}
@media(max-width:1100px){
 #uaExploreButton{top:calc(8px + env(safe-area-inset-top,0px));width:auto;min-height:44px;padding:0 10px;gap:6px;justify-content:center;font-size:11px;letter-spacing:0;transform:none;white-space:nowrap}
 #uaExploreButton span{position:static;width:auto;height:auto;padding:0;overflow:visible;clip:auto;white-space:nowrap}
 #uaExploreButton svg{width:16px;height:16px;flex-shrink:0}
 #uaExplorePanel{top:calc(108px + env(safe-area-inset-top,0px));height:min(650px,calc(100dvh - 124px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)))}
}
@media(max-width:1100px) and (max-height:540px) and (orientation:landscape){
 #uaExplorePanel{top:calc(52px + env(safe-area-inset-top,0px));bottom:calc(10px + env(safe-area-inset-bottom,0px));height:auto}
}

/* Sound switch beside the Dashboard heading. */
#uaExplorePanel .ua-explore-header{gap:8px}
#uaExplorePanel .ua-dashboard-sound{display:flex;align-items:center;gap:6px;margin-left:auto;min-height:44px;font-size:12px;white-space:nowrap;cursor:pointer}
#uaExplorePanel .ua-dashboard-sound input{width:18px;height:18px;margin:0;accent-color:#75bdff;cursor:pointer}

/* Main Dashboard trigger: 7% smaller, retaining its header position. */
#uaExploreButton{transform:scale(.93);transform-origin:top left}

/* GPS Tour, User Guide and Auto Tour fit their content, capped to the available screen. */
#uaExplorePanel.ua-gps-panel-fit{height:auto;bottom:auto;max-height:calc(100vh - 106px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));max-height:calc(100dvh - 106px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))}
#uaExplorePanel.ua-gps-panel-fit .ua-explore-layout{flex:0 1 auto}
#uaExplorePanel.ua-gps-panel-fit .ua-explore-content{flex:1 1 auto}
html body #uaExplorePanel.ua-gps-panel-fit #uaNearbyPanel,
html body #uaExplorePanel.ua-gps-panel-fit #uaInstructionBox,
html body #uaExplorePanel.ua-gps-panel-fit #uaAutoTourPanel{height:auto!important;max-height:none!important;padding-bottom:16px!important;flex:1 1 auto}
#uaNearbyMessage:empty{display:none}
@media(max-width:1100px){
 #uaExplorePanel.ua-gps-panel-fit{max-height:calc(100vh - 124px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));max-height:calc(100dvh - 124px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))}
}
@media(max-width:1100px) and (max-height:540px) and (orientation:landscape){
 #uaExplorePanel.ua-gps-panel-fit{max-height:calc(100vh - 62px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));max-height:calc(100dvh - 62px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))}
}

/* Preserve the mobile touch target after the shared desktop scaling rule. */
@media(max-width:1100px){#uaExploreButton{transform:none}}

/* Persistent, labelled tour controls with room on small phones. */
#uaNearbyPause{display:inline-flex;align-items:center;gap:6px}
#uaNearbyPause svg{width:14px;height:14px;flex:none}
#uaNearbyBar button:disabled{opacity:.5;cursor:default}
#uaTourBar{flex-wrap:wrap}
#uaTourBar button,#uaNearbyBar button{min-height:44px}
@media(max-width:480px){#uaTourStatus{flex-basis:100%;box-sizing:border-box}#uaTourActions{margin-left:auto}}

/* GPS map controls sit near the bottom, clear of the device safe area. */
body.ua-nearby-active:not(.ua-near-photo-open) #uaNearbyBar{
    top:auto;
    bottom:12px;
    bottom:calc(12px + env(safe-area-inset-bottom,0px));
}

#uaExploreButton[aria-expanded="true"]{animation:none}

/* Compact menu trigger; preserve a 44px touch target. */
html body #uaExploreButton{width:44px;height:44px;min-height:44px;padding:0;gap:0;justify-content:center;transform:none;border-radius:14px;box-sizing:border-box}
html body #uaExploreButton svg{width:22px;height:22px;flex-shrink:0}
/* The existing map-style control now lives in the menu's fixed header area. */
html body #uaExplorePanel .ua-menu-map-style{
 position:static!important;inset:auto!important;top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;
 transform:none!important;width:100%!important;max-width:none!important;margin:0!important;
 display:grid;grid-template-columns:100px minmax(0,1fr)!important;align-items:center;
 padding:8px 12px!important;gap:8px!important;flex:none;box-sizing:border-box;
 background:transparent!important;border:0!important;border-bottom:1px solid #75bdff33!important;border-radius:0!important;
 box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
#uaExplorePanel .ua-menu-map-style label{font-size:12px;line-height:1.3;color:#f7fbff}
html body #uaExplorePanel #mapStyle{
 width:100%;min-width:0;max-width:100%;min-height:44px;box-sizing:border-box;
 padding:6px 8px;border:1px solid #75bdff88;border-radius:9px!important;
 background:#10243b;color:#fff;font:14px Arial,sans-serif;cursor:pointer;color-scheme:dark;
}
#uaExplorePanel #mapStyle:focus-visible{outline:3px solid #91ceff;outline-offset:2px}
/* Reclaim the space previously reserved for the floating mobile dropdown. */
@media(max-width:1100px) and (orientation:portrait){
 #uaExplorePanel{top:calc(62px + env(safe-area-inset-top,0px));height:min(650px,calc(100dvh - 78px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)))}
 #uaExplorePanel.ua-gps-panel-fit{height:auto;max-height:calc(100vh - 78px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));max-height:calc(100dvh - 78px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))}
}
@media(max-width:380px){
 html body #uaExplorePanel .ua-menu-map-style{grid-template-columns:minmax(0,1fr)!important;gap:4px!important}
}

/* Keep the expanded map-style options readable. */
html body #uaExplorePanel #mapStyle option {
    color: #fff !important;
    background-color: #10243b !important;
}

/* Faint static hex texture behind all menu sections. */
#uaExplorePanel { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22144%22%20height%3D%2283.14%22%20viewBox%3D%220%200%20144%2083.14%22%3E%3Cpath%20d%3D%22M0%2041.57%2024%200H72L96%2041.57%2072%2083.14H24L0%2041.57M96%2041.57H144L168%200M144%2041.57%20168%2083.14%22%20fill%3D%22none%22%20stroke%3D%22%2398ddff%22%20stroke-width%3D%221.25%22%20stroke-opacity%3D%22.065%22%2F%3E%3C%2Fsvg%3E"); background-size:72px 41.57px; background-repeat:repeat; }

/* Use the same bright blue thumb on every menu scroll surface. */
html body #uaExplorePanel, html body #uaExplorePanel * {
 scrollbar-width: thin;
 scrollbar-color: #75bdff rgba(117,189,255,.15);
}
html body #uaExplorePanel::-webkit-scrollbar,
html body #uaExplorePanel *::-webkit-scrollbar { width:6px; height:6px; }
html body #uaExplorePanel::-webkit-scrollbar-thumb,
html body #uaExplorePanel *::-webkit-scrollbar-thumb { background:#75bdff; border-radius:6px; }
html body #uaExplorePanel::-webkit-scrollbar-track,
html body #uaExplorePanel *::-webkit-scrollbar-track { background:rgba(117,189,255,.15); }
