/* Atlas 22.0: focused VI phone usability and genuine map-first layout.
   Source maps, map controls, category filters and original Elario design remain. */
body[data-start-world="6"] #selectedCard{
 max-height:calc(100% - 180px);
 overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
 scrollbar-color:#af74ac #24142f;
 background:linear-gradient(145deg,#331b47fa,#151526fc);
 border:2px solid #f2b969;
}
body[data-start-world="6"] #selectedCard .close{
 position:sticky;top:0;float:right;z-index:2;
 display:inline-flex;justify-content:center;align-items:center;
 min-width:44px;min-height:44px;padding:8px 12px;margin:-3px -3px 5px 8px;
 border-radius:10px;border:1px solid #ffe2a1;
 color:#2b1636;background:linear-gradient(115deg,#ffe7b2,#f7ae62);
 font:850 12px/1.15 system-ui,sans-serif;
 box-shadow:0 3px 11px #05020ba8;cursor:pointer;
}
body[data-start-world="6"] #selectedCard .close:focus-visible{
 outline:3px solid #fff;outline-offset:2px;
}
body[data-start-world="6"] #selectedCard #selectedName{
 display:block;overflow-wrap:anywhere;line-height:1.35;
}
body[data-start-world="6"] #selectedCard .selected-actions{
 clear:both;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;
}
body[data-start-world="6"] #selectedCard .selected-actions :is(button,a){
 display:flex;min-height:40px;align-items:center;justify-content:center;
 white-space:normal;overflow-wrap:anywhere;text-align:center;
 padding:8px;border:1px solid #aa79ad;border-radius:8px;
 color:#ffe8bd;background:#3a234d;text-decoration:none;font:750 11px/1.25 system-ui;
}
@media(max-width:700px){
 body[data-start-world="6"] .topbar .brand b{
  font-size:clamp(12px,3.3vw,15px);letter-spacing:.07em;
 }
 body[data-start-world="6"] .topbar .brand small{
  font-size:9px;letter-spacing:.04em;line-height:1.35;
  white-space:normal;overflow-wrap:anywhere;
 }
 body[data-start-world="6"] .topbar>nav{
  gap:5px 12px;scrollbar-width:thin;
 }
 body[data-start-world="6"] .topbar>nav>a{
  min-height:36px;white-space:nowrap;font-size:11px;
 }
 /* One accessible universal menu replaces overlapping legacy phone docks.
    The source map/All Maps remain reachable through the universal menu. */
 body[data-start-world="6"]:has(#j132-nav-toggle) #j89-shell,
 body[data-start-world="6"]:has(#j132-nav-toggle) > a[data-j87-maps-link]{
  display:none!important;
 }
 /* The route bar owns Directions / 2D / 3D; sidebar owns source photos.
    Avoid another four-button row across the tiny map workspace. */
 body[data-start-world="6"] .jura-quick-nav{display:none!important}
 body[data-start-world="6"] .jura-3d-tools{display:none!important}
 body[data-start-world="6"].jura-in-3d .jura-3d-tools{
  display:flex!important;top:182px;right:8px;
 }
 body[data-start-world="6"] .maptop{
  left:8px;right:8px;gap:7px;
 }
 body[data-start-world="6"] .maptitle{
  max-width:58%;min-width:0;padding:8px;
 }
 body[data-start-world="6"] .maptitle small{
  font-size:10px;line-height:1.3;overflow-wrap:anywhere;
 }
 body[data-start-world="6"] .mapcontrols{
  min-width:0;max-width:40%;padding:6px;
 }
 body[data-start-world="6"] .mapcontrols button{
  white-space:normal;min-height:40px;
 }
 body[data-start-world="6"] .jura-nav-bar{
  top:86px;right:8px;max-width:calc(100% - 16px);
 }
 body[data-start-world="6"] .j217-vi-hub{
  top:134px;left:8px;
 }
 body[data-start-world="6"] .j217-vi-hub>summary{
  min-height:44px;max-width:calc(100vw - 20px);
 }
 body[data-start-world="6"] .j217-vi-panel{
  max-height:min(50dvh,360px);
 }
 body[data-start-world="6"] .zoom{
  top:192px;right:8px;
 }
 body[data-start-world="6"] .map-actions{
  bottom:29px;max-width:calc(100% - 16px);
  justify-content:center;flex-wrap:wrap;
 }
 body[data-start-world="6"] .map-actions button{
  min-height:42px;white-space:normal;
 }
 body[data-start-world="6"] #selectedCard{
  z-index:28;left:8px;right:8px;bottom:88px;
  width:auto;max-width:none;max-height:min(43dvh,calc(100% - 194px));
  padding:9px 11px 12px;touch-action:pan-y;
 }
 body[data-start-world="6"] #selectedCard #selectedInfo{
  line-height:1.45;overflow-wrap:anywhere;
 }
 body[data-start-world="6"] #selectedCard .selected-photo img{max-height:110px}
 body[data-start-world="6"] .map-status{
  top:auto;bottom:118px;max-width:54%;font-size:10px;
  pointer-events:none;
 }
 body[data-start-world="6"].jura-nav-open #selectedCard{
  pointer-events:none;visibility:hidden;
 }
}
@media(max-width:390px){
 body[data-start-world="6"] .jura-nav-bar button{font-size:10px;padding:6px}
 body[data-start-world="6"] #selectedCard .selected-actions{gap:5px}
}
@media(prefers-reduced-motion:reduce){
 body[data-start-world="6"] #selectedCard{scroll-behavior:auto}
}

/* Atlas 22.0 screenshot review: one purposeful world-navigation owner.
   Keep the collection progress live region accessible, not the duplicate links. */
@media(max-width:700px){
 body[data-start-world="6"] .atlas85-head{
  display:block!important;position:relative!important;height:0!important;
  min-height:0!important;max-height:0!important;
  margin:0!important;padding:0!important;border:0!important;
  background:none!important;
 }
 body[data-start-world="6"] .atlas85-head>a{display:none!important}
 body[data-start-world="6"] .atlas85-head .atlas85-live{
  position:absolute!important;display:block!important;
  width:1px!important;height:1px!important;
  clip-path:inset(50%)!important;overflow:hidden!important;
  white-space:nowrap!important;
 }
 /* Keep armory and motorpool destinations, but as one touch-scrollable row. */
 body[data-start-world="6"] #atlas90-catalog-shortcuts{
  display:flex!important;flex-wrap:nowrap!important;
  box-sizing:border-box!important;min-width:0!important;
  max-width:calc(100% - 16px)!important;
  margin:6px 8px!important;padding:5px 7px!important;
  gap:6px!important;white-space:nowrap!important;
  overflow-x:auto!important;overflow-y:hidden!important;
  overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
 }
 body[data-start-world="6"] #atlas90-catalog-shortcuts a{
  flex:0 0 auto!important;min-height:38px!important;
  display:inline-flex;align-items:center;
 }
 /* The right-edge Fit is already present in the accessible zoom column.
    Do not show the same action twice within the cramped title strip. */
 body[data-start-world="6"]:has(#j154ZoomFit) #resetView{display:none!important}
 body[data-start-world="6"] #j143-official-button{
  width:auto!important;max-width:130px!important;
  min-width:96px!important;min-height:42px!important;
  padding:5px 7px!important;font-size:10px!important;
  line-height:1.2!important;white-space:normal!important;
 }
 /* The details sheet, not background map toolbars, owns the foreground
    while a marker is selected. Map tools return immediately on Close. */
 body[data-start-world="6"]:has(#selectedCard:not(.hidden)) #j171-map-tools{
  display:none!important;
 }
 body[data-start-world="6"] #selectedCard{z-index:120!important}
}

/* Always-visible map escape on phones: canvas gestures must not trap visitors. */
body[data-start-world="6"] .j220-map-back{display:none}
@media(max-width:700px){
 body[data-start-world="6"] .j220-map-back{
  display:inline-flex;position:fixed;left:12px;
  bottom:max(14px,env(safe-area-inset-bottom));
  z-index:240;align-items:center;justify-content:center;
  min-width:88px;min-height:48px;padding:10px 15px;
  border:2px solid #f1c47a;border-radius:15px;
  background:#2c193e;color:#ffe1a5;
  font:800 14px/1.1 system-ui,sans-serif;
  box-shadow:0 5px 18px #10071dbb;cursor:pointer;
 }
 /* The back escape occupies the lower-left corner; give the map actions
    enough clearance so the last action remains tappable on small screens. */
 body[data-start-world="6"] .map-actions{
  padding-left:96px;box-sizing:border-box;
  max-width:calc(100% - 16px);
 }
 body[data-start-world="6"] .j220-map-back:focus-visible{
  outline:3px solid #fff;outline-offset:3px;
 }
}
