/* Hidden without JavaScript/mobile breakpoints. */
.jw-mobile-shell,.jw-mobile-extras,.jw-mobile-region-list{display:none;}
/* V6.5 — Mobile atlas clarity. The V6.0 scene, art, and project graph are intact.
 * Scoped to phone portrait and short-height phone landscape; no desktop redesign.
 */
@media (max-width:650px), (max-width:900px) and (max-height:540px) and (orientation:landscape) {
  body.jw-mobile-atlas-ready .v46-stage .map-view-switch {
    position:absolute;
    bottom:6px;
    left:6px;
    right:6px;
    width:auto;
    z-index:85;
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:5px;
    padding:6px;
    max-height:min(60dvh,350px);
    overflow-y:auto;
    overflow-x:hidden;
    background:#0a2219f5;
    border:1px solid #c8bb889e;
    box-shadow:0 10px 25px #04110dd9;
  }
  body.jw-mobile-atlas-ready .map-view-switch .view-hint {display:none!important;}
  /* Redundant scene zoom controls and the non-interactive beta label were
     covering buttons on phone-sized screens. The scale bar remains available. */
  body.jw-mobile-atlas-ready #terrainWorld.cinematic-active .terrain-controls,
  body.jw-mobile-atlas-ready .preview-label{display:none!important;}
  body.jw-mobile-atlas-ready .map-view-switch > .view-switch,
  body.jw-mobile-atlas-ready .map-view-switch > #frameToggle,
  body.jw-mobile-atlas-ready .map-view-switch > #immersiveToggle {display:none!important;}
  body.jw-mobile-atlas-ready .map-view-switch.jw-views-open > .view-switch {display:flex!important;align-items:center;justify-content:center;}
  body.jw-mobile-atlas-ready .map-view-switch.jw-tools-open > #frameToggle,
  body.jw-mobile-atlas-ready .map-view-switch.jw-tools-open > #immersiveToggle {display:block!important;}
  body.jw-mobile-atlas-ready .map-view-switch > .view-switch,
  body.jw-mobile-atlas-ready .map-view-switch > #frameToggle,
  body.jw-mobile-atlas-ready .map-view-switch > #immersiveToggle {
    grid-column:auto!important;
    min-height:42px!important;
    padding:9px 7px!important;
    font:700 10px/1.35 system-ui,sans-serif!important;
    white-space:normal;
    letter-spacing:.025em;
    min-width:0;
    text-align:center;
  }
  .jw-mobile-shell{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;width:100%;order:-2;}
  .jw-mobile-shell button,.jw-mobile-extras button {
    min-width:0;min-height:44px;white-space:normal;
    padding:10px 6px;
    color:#ece8cb;background:#1a392a;
    border:1px solid #b6b38c9c;
    font:700 11px/1.25 system-ui,sans-serif;
    letter-spacing:.03em;
    cursor:pointer;
    touch-action:manipulation;
  }
  .jw-mobile-shell button[aria-expanded="true"] {background:#e5e8b3;color:#16291d;}
  .jw-mobile-shell button:focus-visible,.jw-mobile-extras button:focus-visible{outline:2px solid #f7e9b1;outline-offset:-2px;}
  .jw-mobile-context {
    grid-column:1/-1;order:-1;margin:0 0 2px;
    padding:2px 4px;color:#e2ddba;
    font:11px/1.4 system-ui,sans-serif;text-align:center;letter-spacing:0;
  }
  .jw-mobile-context em{font-style:normal;color:#f2dfa5;}
  .jw-mobile-extras{grid-column:1/-1;display:none;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;order:1;}
  .map-view-switch.jw-tools-open .jw-mobile-extras{display:grid;}
  /* The original story-lens dock stays available via More, not permanently
     stacked on the four atlas scales. */
  body.jw-mobile-atlas-ready #v54LensDock{display:none!important;}
  body.jw-mobile-atlas-ready.jw-mobile-lenses-open #v54LensDock{
    display:block!important;top:66px!important;left:50%!important;
    width:calc(100% - 24px)!important;max-width:450px!important;
    z-index:100!important;
  }
  body.jw-mobile-atlas-ready #v54LensBody{max-height:45dvh;overflow-y:auto;}
  body.jw-mobile-atlas-ready .atlas-wing[data-open="false"]{display:none!important;}

  /* Leave one clear scale bar at the top, one compact toolbar at the bottom. */
  body.jw-mobile-atlas-ready #cinematicWorld .lw-scale-bar{
    top:9px!important;left:50%;width:calc(100% - 20px)!important;
    min-height:44px;max-width:none;padding:3px;gap:3px;
  }
  body.jw-mobile-atlas-ready #cinematicWorld .lw-scale-bar button{min-height:42px;font-size:10px;letter-spacing:.035em;padding:8px 2px;}
  body.jw-mobile-atlas-ready #cinematicWorld .lw-valley-scale{top:16%;left:7%;width:auto;max-width:86%;}
  body.jw-mobile-atlas-ready #cinematicWorld .lw-valley-scale strong{font-size:clamp(23px,6vw,30px);}
  body.jw-mobile-atlas-ready #cinematicWorld .lw-valley-scale small{display:block;font-size:10px;max-width:26ch;}
  body.jw-mobile-atlas-ready #cinematicWorld .lw-valley-stage{top:49%;}

  /* Re-enable genuine relationship paths. Render subdued selected edges,
     not a thicket of every connection. Original project focus still drives
     which SVG paths exist. */
  body.jw-mobile-atlas-ready #cinematicWorld.lw-scale--valley .lw-valley-links{display:block!important;opacity:.94;}
  body.jw-mobile-atlas-ready .lw-valley-links path{stroke-opacity:.73;stroke-width:1.9;filter:drop-shadow(0 0 2px #fae0aa9e);}
  body.jw-mobile-atlas-ready .lw-valley-links path.is-route{stroke-opacity:1;stroke-width:2.4;}

  /* Six editorial regions should not be 60px-wide vertical word stacks. */
  body.jw-mobile-atlas-ready .lw-region-layer > .lw-region-node{display:none!important;}
  body.jw-mobile-atlas-ready .lw-region-title{top:16%;max-width:90%;width:90%;}
  body.jw-mobile-atlas-ready .lw-region-title strong{font-size:clamp(21px,5.5vw,29px);}
  body.jw-mobile-atlas-ready .lw-region-core{top:40%;width:65%;max-width:335px;}
  body.jw-mobile-atlas-ready .jw-mobile-region-list {
    position:absolute;z-index:9;
    left:12px;right:12px;bottom:84px;
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px;max-height:185px;overflow-y:auto;
    padding:2px;scrollbar-width:thin;
  }
  body.jw-mobile-atlas-ready .jw-mobile-region-list .lw-region-node{
    position:static!important;left:auto!important;top:auto!important;
    display:flex!important;transform:none!important;
    width:100%!important;max-width:none!important;min-height:43px;
    padding:7px 9px;gap:7px;align-items:center;text-align:left;
    border-radius:2px;overflow:visible;
  }
  body.jw-mobile-atlas-ready .jw-mobile-region-list .lw-region-node strong{
    display:block;white-space:normal;overflow-wrap:normal;word-break:normal;
    font:700 10px/1.25 system-ui,sans-serif;letter-spacing:.01em;
  }
  body.jw-mobile-atlas-ready .jw-mobile-region-list .lw-region-node small{display:none;}
  body.jw-mobile-atlas-ready .jw-mobile-region-list .lw-region-node:before{flex:none;font-size:12px;}
  body.jw-mobile-atlas-ready .lw-region-annotation{display:none;}

  /* Seven symbolic choices become a swipeable strip, not a pile of micro-buttons. */
  body.jw-mobile-atlas-ready .lw-realm-title{top:16%;max-width:94%;width:90%;left:50%;transform:translateX(-50%);text-align:center;}
  body.jw-mobile-atlas-ready .lw-realm-title strong{font-size:clamp(21px,5.5vw,29px);}
  body.jw-mobile-atlas-ready .lw-realm-options{
    left:10px;right:10px;bottom:84px;width:auto;max-width:none;
    transform:none;display:flex;justify-content:flex-start;flex-wrap:nowrap;
    gap:6px;overflow-x:auto;overflow-y:hidden;
    padding:4px 2px 8px;scroll-snap-type:x proximity;
    -webkit-overflow-scrolling:touch;
  }
  body.jw-mobile-atlas-ready .lw-realm-options button{
    flex:0 0 auto;min-width:118px;max-width:150px;min-height:43px;
    padding:9px 8px;font:700 10px/1.3 system-ui,sans-serif;
    white-space:normal;scroll-snap-align:start;
  }
  body.jw-mobile-atlas-ready .lw-scale-caption{display:none;}
}
@media (max-width:900px) and (max-height:540px) and (orientation:landscape) {
  body.jw-mobile-atlas-ready #terrainWorld.cinematic-active .world-facts,
  body.jw-mobile-atlas-ready #terrainWorld.cinematic-active .network-compass{display:none!important;}
  body.jw-mobile-atlas-ready .jw-mobile-region-list{
    left:12%;right:12%;bottom:69px;max-height:102px;
    grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;
  }
  body.jw-mobile-atlas-ready .jw-mobile-region-list .lw-region-node{min-height:34px;padding:5px 7px;}
  body.jw-mobile-atlas-ready .lw-region-core{top:43%;width:33%;max-width:260px;}
  body.jw-mobile-atlas-ready #cinematicWorld .lw-valley-scale{top:18%;}
  body.jw-mobile-atlas-ready #cinematicWorld .lw-valley-scale small{display:none;}
  body.jw-mobile-atlas-ready .lw-realm-options{bottom:69px;}
  body.jw-mobile-atlas-ready .jw-mobile-context{display:none;}
  body.jw-mobile-atlas-ready .v46-stage .map-heading{display:none!important;}
  body.jw-mobile-atlas-ready #cinematicWorld .lw-scale-bar{top:72px!important;}
  body.jw-mobile-atlas-ready #cinematicWorld .lw-valley-scale{top:28%;}
  body.jw-mobile-atlas-ready .lw-region-title,
  body.jw-mobile-atlas-ready .lw-realm-title{top:29%;}
  body.jw-mobile-atlas-ready .v46-stage .map-view-switch{max-height:70dvh;}
}
