/* V7.7 — distinct interaction zones over the unmodified illustrations.
 * Top: story lenses → named scale → precision zoom.
 * Middle: readable narrative and selected project panels.
 * Bottom: mode buttons and visual options.
 * Avoid placing useful text beneath the decorative masonry/foliage surround.
 */
.jw-micro-desktop[hidden],
.jw-micro-mobile[hidden],
.jw-env-toggle[hidden]{display:none!important;}
/* A mode change can occur before its event listeners finish. The actual active
   view decides whether precision zoom is allowed to cover the canvas. */
body:has(#modeCinematic:not([aria-pressed="true"])) .jw-micro-desktop,
body:has(#modeCinematic:not([aria-pressed="true"])) .jw-micro-mobile,
body:has(#modeCinematic:not([aria-pressed="true"])) #jwAtmosphereDesktop,
body:has(#modeCinematic:not([aria-pressed="true"])) #jwAtmosphereMobile{
  display:none!important;
}
/* The level bar replaces the small unlabeled vertical +/- controls;
   the 3D camera toolbar is only meaningful in actual terrain mode. */
#cinematicWorld .lw-zoom-guide,
#terrainWorld.cinematic-active .terrain-controls{display:none!important;}
/* Historical decorative overlay remains intact; merely supply safe panel
   coordinates so its pillars and botanical props do not cover information. */
@media (min-width:901px) and (min-height:541px) {
  #v46Stage #v54LensDock{
    position:absolute;top:12px!important;left:50%!important;right:auto!important;
    transform:translateX(-50%)!important;
    width:min(470px,calc(100% - 410px))!important;
    min-width:0!important;max-width:470px!important;
    z-index:80!important;
  }
  #cinematicWorld .lw-scale-bar{
    top:81px!important;left:50%!important;right:auto!important;
    transform:translateX(-50%)!important;
    width:min(570px,calc(100% - 410px))!important;
    min-width:0!important;max-width:570px!important;
    z-index:54!important;
  }
  #v46Stage #jwMicroDesktop:not([hidden]){
    position:absolute;top:145px!important;left:50%!important;right:auto!important;
    transform:translateX(-50%)!important;
    width:min(344px,calc(100% - 450px))!important;
    z-index:65!important;
  }
  /* Deliberately opened story lenses form a scrollable popover below all
     three control bars rather than covering the level or zoom buttons. */
  #v46Stage #v54LensDock #v54LensBody:not([hidden]){
    position:absolute!important;top:calc(100% + 150px)!important;
    left:50%!important;transform:translateX(-50%)!important;
    width:min(470px,calc(100vw - 40px))!important;
    max-height:min(48dvh,410px)!important;overflow-y:auto!important;
    box-shadow:0 20px 46px #031007df;
  }
  /* The same lower command dock is used in Estate / Valley / Region / Realm.
     Four modes occupy row one; the three display options occupy row two. */
  #v46Stage .map-view-switch{
    position:absolute!important;left:50%!important;right:auto!important;
    bottom:14px!important;transform:translateX(-50%)!important;
    width:min(820px,calc(100% - 420px))!important;
    max-width:820px!important;padding:7px!important;
    display:grid!important;grid-template-columns:repeat(12,minmax(0,1fr))!important;
    gap:6px!important;align-items:stretch!important;z-index:74!important;
    background:#0a2117ed!important;
  }
  #v46Stage .map-view-switch > .view-switch{
    grid-column:span 3!important;min-width:0!important;min-height:39px!important;
    padding:8px 5px!important;white-space:normal!important;
    font-size:9px!important;line-height:1.25!important;letter-spacing:.02em!important;
  }
  #v46Stage .map-view-switch > #frameToggle,
  #v46Stage .map-view-switch > #immersiveToggle,
  #v46Stage .map-view-switch > #jwAtmosphereDesktop:not([hidden]){
    grid-column:span 4!important;min-width:0!important;min-height:39px!important;
    padding:8px 5px!important;white-space:normal!important;
    font-size:9px!important;line-height:1.25!important;letter-spacing:.02em!important;
  }
  #v46Stage .map-view-switch:has(#jwAtmosphereDesktop[hidden]) > #frameToggle,
  #v46Stage .map-view-switch:has(#jwAtmosphereDesktop[hidden]) > #immersiveToggle{
    grid-column:span 6!important;
  }
  #v46Stage .map-view-switch > .view-hint{display:none!important;}
  /* Keep named-world descriptive copy in front of scenery, outside the
     substantial left pillar and both collapsed wing handles. */
  #cinematicWorld.lw-scale--valley .lw-valley-scale{
    left:clamp(220px,23%,420px)!important;top:25%!important;
    width:min(335px,calc(100% - 480px))!important;
    max-width:335px!important;z-index:6!important;
    text-align:left!important;
    padding:9px 11px!important;
    background:linear-gradient(90deg,#0b251cc9,#0b251c65 80%,transparent)!important;
    text-shadow:0 2px 12px #06130af0;
  }
  #cinematicWorld.lw-scale--valley .lw-valley-scale strong{
    font-size:clamp(24px,2.4vw,37px)!important;line-height:1.14!important;
    overflow-wrap:break-word;
  }
  #cinematicWorld.lw-scale--valley .lw-valley-scale small{
    font-size:11px!important;line-height:1.45!important;
    white-space:normal!important;
  }
  /* The two floating information cards were previously underneath side
     decorations. Shift them into the unobstructed interior and make long
     descriptions scroll instead of slipping behind the scene frame. */
  #v46Stage:has(#cinematicWorld.lw-scale--valley) #terrainWorld.cinematic-active .network-compass{
    left:clamp(210px,19%,335px)!important;right:auto!important;
    bottom:220px!important;width:clamp(165px,19vw,220px)!important;
    max-height:190px!important;overflow-y:auto!important;
    background:#0b241aec!important;
    box-shadow:0 9px 24px #02100ac9!important;
  }
  #v46Stage:has(#cinematicWorld.lw-scale--valley) #terrainWorld.cinematic-active .world-facts{
    right:clamp(200px,18%,335px)!important;left:auto!important;
    bottom:218px!important;width:clamp(200px,21vw,265px)!important;
    max-height:260px!important;overflow-y:auto!important;
    padding:14px 15px!important;background:#0b241af2!important;
    box-shadow:0 9px 24px #02100ac9!important;
  }
  #v46Stage:has(#cinematicWorld.lw-scale--valley) .world-facts strong{
    font-size:clamp(17px,1.7vw,25px)!important;line-height:1.16!important;
    overflow-wrap:anywhere!important;
  }
  #v46Stage:has(#cinematicWorld.lw-scale--valley) .world-facts p{
    font-size:11px!important;line-height:1.55!important;overflow-wrap:anywhere!important;
  }
  #v46Stage:has(#cinematicWorld.lw-scale--valley) .world-fact-actions button{
    min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important;
  }
  /* Region/Realm headings need the same architectural safe area. */
  #cinematicWorld.lw-scale--region .lw-region-title,
  #cinematicWorld.lw-scale--realm .lw-realm-title{
    left:clamp(220px,23%,420px)!important;
    top:26%!important;width:min(310px,calc(100% - 490px))!important;
    max-width:310px!important;transform:none!important;text-align:left!important;
  }
  #cinematicWorld.lw-scale--region .lw-region-title strong,
  #cinematicWorld.lw-scale--realm .lw-realm-title strong{
    font-size:clamp(24px,2.1vw,34px)!important;line-height:1.15!important;
  }
  /* One active drawer at a time gets the visual priority. */
  #v46Stage:has(#wingLeft[data-open="true"]) #terrainWorld.cinematic-active .network-compass,
  #v46Stage:has(#wingRight[data-open="true"]) #terrainWorld.cinematic-active .world-facts{
    display:none!important;
  }
}
@media (min-width:901px) and (max-width:1199px) and (min-height:541px) {
  #v46Stage #jwMicroDesktop:not([hidden]){width:300px!important;}
  #cinematicWorld.lw-scale--valley .lw-valley-scale{width:260px!important;}
  #cinematicWorld.lw-scale--valley .lw-valley-scale strong{font-size:25px!important;}
  #v46Stage:has(#cinematicWorld.lw-scale--valley) #terrainWorld.cinematic-active .world-facts{
    width:205px!important;max-height:215px!important;
  }
  #v46Stage:has(#cinematicWorld.lw-scale--valley) #terrainWorld.cinematic-active .network-compass{
    width:175px!important;max-height:160px!important;
  }
  #cinematicWorld.lw-scale--region .lw-region-title,
  #cinematicWorld.lw-scale--realm .lw-realm-title{width:250px!important;}
}
@media (min-width:651px) and (max-width:900px) and (min-height:541px) {
  /* Tablet portrait uses the same three top zones; the phone-specific
     bottom Zoom drawer remains untouched below 651px. */
  #v46Stage #v54LensDock{
    top:10px!important;left:50%!important;transform:translateX(-50%)!important;
    width:min(455px,calc(100% - 90px))!important;min-width:0!important;
  }
  #cinematicWorld .lw-scale-bar{
    top:78px!important;left:50%!important;transform:translateX(-50%)!important;
    width:calc(100% - 115px)!important;
  }
  #v46Stage #jwMicroDesktop:not([hidden]){
    top:140px!important;left:50%!important;right:auto!important;
    transform:translateX(-50%)!important;width:300px!important;
  }
  #v46Stage .map-view-switch{
    left:50%!important;right:auto!important;bottom:10px!important;
    transform:translateX(-50%)!important;width:calc(100% - 50px)!important;
    display:grid!important;grid-template-columns:repeat(12,minmax(0,1fr))!important;
    gap:5px!important;z-index:75!important;
  }
  #v46Stage .map-view-switch > .view-switch{
    grid-column:span 3!important;white-space:normal!important;min-width:0!important;
    font-size:9px!important;min-height:38px!important;padding:6px!important;
  }
  #v46Stage .map-view-switch > #frameToggle,
  #v46Stage .map-view-switch > #immersiveToggle,
  #v46Stage .map-view-switch > #jwAtmosphereDesktop:not([hidden]){
    grid-column:span 4!important;min-width:0!important;min-height:38px!important;
    font-size:9px!important;white-space:normal!important;
  }
  #cinematicWorld.lw-scale--valley .lw-valley-scale{
    left:clamp(155px,21%,220px)!important;top:34%!important;
    width:230px!important;max-width:230px!important;
    background:#0a241bce!important;padding:8px!important;
  }
  #cinematicWorld.lw-scale--valley .lw-valley-scale strong{font-size:24px!important;}
  #v46Stage:has(#cinematicWorld.lw-scale--valley) #terrainWorld.cinematic-active .network-compass{
    left:90px!important;bottom:195px!important;width:165px!important;max-height:160px!important;
  }
  #v46Stage:has(#cinematicWorld.lw-scale--valley) #terrainWorld.cinematic-active .world-facts{
    right:90px!important;bottom:195px!important;width:200px!important;max-height:210px!important;
    overflow-y:auto!important;
  }
}
@media (prefers-reduced-motion:reduce) {
  #v46Stage .map-view-switch,#v46Stage #v54LensDock{transition:none!important;}
}

/* V7.8 — Move the two story lenses into the former horizontal Fine Zoom row.
 * The zoom stays fully functional but becomes a compact, right-gutter vertical
 * camera control on desktop only. Do not change artwork or camera state. */
#v46Stage .jw-scene-eyebrow{display:none;}
@media (min-width:901px) and (min-height:541px) {
  /* Keep just a quiet scene identity where the lens buttons used to be. */
  #v46Stage .jw-scene-eyebrow{
    position:absolute;top:18px;left:50%;transform:translateX(-50%);
    display:block;z-index:78;pointer-events:none;text-align:center;
    width:min(350px,calc(100% - 570px));max-width:350px;
    padding:4px 8px 9px;white-space:nowrap;
    border-bottom:1px solid #d8c58d7a;
    font:700 10px/1.3 system-ui,sans-serif;letter-spacing:.17em;
    text-transform:uppercase;color:#f2e5b9;
    text-shadow:0 2px 11px #071a11,0 1px 2px #071a11;
  }
  #v46Stage #v54LensDock{
    top:145px!important;width:min(420px,calc(100% - 610px))!important;
    min-width:0!important;max-width:420px!important;
    left:50%!important;right:auto!important;transform:translateX(-50%)!important;
    z-index:80!important;
  }
  /* Its expanded story stays attached to the newly relocated buttons. */
  #v46Stage #v54LensDock #v54LensBody:not([hidden]){
    top:calc(100% + 8px)!important;
    max-height:min(49dvh,400px)!important;overflow-y:auto!important;
  }
  #v46Stage #jwMicroDesktop:not([hidden]){
    top:146px!important;left:auto!important;right:clamp(235px,16vw,345px)!important;
    transform:none!important;box-sizing:border-box!important;
    width:62px!important;min-width:62px!important;max-width:62px!important;
    min-height:0!important;padding:7px 6px!important;
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto 25px 78px auto 25px 29px!important;
    justify-items:stretch!important;align-items:center!important;
    gap:4px!important;z-index:81!important;
  }
  #v46Stage #jwMicroDesktop label{
    grid-column:1!important;grid-row:1!important;
    padding:0!important;margin:0!important;white-space:normal!important;
    font-size:8px!important;line-height:1.2!important;letter-spacing:.04em!important;
  }
  #v46Stage #jwMicroDesktop [data-micro-action="in"]{
    grid-column:1!important;grid-row:2!important;min-height:25px!important;
  }
  #v46Stage #jwMicroDesktop input[type="range"]{
    grid-column:1!important;grid-row:3!important;
    writing-mode:vertical-lr!important;direction:rtl!important;
    width:22px!important;height:77px!important;min-height:0!important;
    margin:0 auto!important;justify-self:center!important;
    touch-action:none;
  }
  #v46Stage #jwMicroDesktop output{
    grid-column:1!important;grid-row:4!important;
    font-size:10px!important;line-height:1.2!important;
  }
  #v46Stage #jwMicroDesktop [data-micro-action="out"]{
    grid-column:1!important;grid-row:5!important;min-height:25px!important;
  }
  #v46Stage #jwMicroDesktop [data-micro-action="fit"]{
    grid-column:1!important;grid-row:6!important;min-height:28px!important;
  }
  #v46Stage #jwMicroDesktop button{
    padding:2px!important;font-size:12px!important;
  }
  /* Enlarged/full-screen atlas has no right wing, so keep zoom near the edge. */
  #mapFrame.is-immersive #v46Stage #jwMicroDesktop:not([hidden]){
    right:clamp(16px,3.3vw,52px)!important;
  }
}
@media (min-width:901px) and (max-width:1099px) and (max-height:800px) and (min-height:541px){
  /* Leave vertical zoom above the project fact panel on shorter desktops. */
  #v46Stage:has(#cinematicWorld.lw-scale--valley) #terrainWorld.cinematic-active .world-facts{
    bottom:165px!important;max-height:min(190px,21dvh)!important;
  }
}
