/* V6.6: local place zoom uses independent CSS scale / translate properties.
   Existing transform-based V6 art direction and camera state are untouched. */
#cinematicWorld.lw-scale--estate #cinematicScene,
#cinematicWorld.lw-scale--region .lw-region-core img,
#cinematicWorld.lw-scale--realm .lw-realm-disc {
  scale: var(--jw-place-scale, 1);
  translate: var(--jw-place-x, 0px) var(--jw-place-y, 0px);
  transform-origin: center center;
  transition: scale 180ms ease-out, translate 100ms ease-out;
}
/* The interactive phone Zoom tray is created by progressive enhancement.
   Hide it on desktop by default, even when mobile JS has already initialized. */
.jw-detail-tray {display:none;}
@media (prefers-reduced-motion: reduce) {
  #cinematicWorld.lw-scale--estate #cinematicScene,
  #cinematicWorld.lw-scale--region .lw-region-core img,
  #cinematicWorld.lw-scale--realm .lw-realm-disc { transition: none !important; }
}
@media (max-width:650px), (max-width:900px) and (max-height:540px) and (orientation:landscape) {
  /* The scale bar already serves as the mobile atlas heading. */
  body.jw-mobile-atlas-ready .v46-stage .map-heading { display:none!important; }
  /* When actively inspecting a place, keep old floating fact cards out of
     the image. Closing Zoom restores them without affecting project state. */
  body.jw-mobile-atlas-ready:has(.jw-detail-tray.is-open) #terrainWorld.cinematic-active .world-facts,
  body.jw-mobile-atlas-ready:has(.jw-detail-tray.is-open) #terrainWorld.cinematic-active .network-compass { display:none!important; }
  /* Phone browsers can still scroll the document vertically; two-finger
     pinch on the map is reserved for local zoom. */
  #cinematicWorld #cinematicScene,
  #cinematicWorld .lw-level-layer { touch-action: pan-y; }
  body.jw-mobile-atlas-ready .jw-mobile-shell { grid-template-columns: repeat(4,minmax(0,1fr)); }
  body.jw-mobile-atlas-ready .jw-mobile-shell button { padding: 10px 3px; font-size: 10px; }
  body.jw-mobile-atlas-ready .jw-mobile-shell button:disabled { opacity:.5; cursor:not-allowed; }
  body.jw-mobile-atlas-ready .jw-detail-tray {
    display:none; grid-column:1/-1; order:0;
    grid-template-columns: 44px minmax(72px,1fr) 44px 76px;
    gap:6px; align-items:center;
    background:#11291eff; border:1px solid #d2c68aa6;
    padding:5px; width:100%; color:#f0e6bf;
  }
  body.jw-mobile-atlas-ready .jw-detail-tray.is-open {display:grid;}
  body.jw-mobile-atlas-ready .jw-detail-tray button {
    min-height:44px;min-width:0;padding:7px 5px;
    border:1px solid #c7bd8a9c;background:#203e2b;
    color:#f0edda;font:700 13px/1.2 system-ui,sans-serif;
    touch-action:manipulation;
  }
  body.jw-mobile-atlas-ready .jw-detail-tray button:disabled {opacity:.48;}
  body.jw-mobile-atlas-ready .jw-detail-tray output {
    font:700 12px/1.2 system-ui,sans-serif;text-align:center;
    font-variant-numeric:tabular-nums;letter-spacing:.04em;
  }
  body.jw-mobile-atlas-ready .jw-detail-tray button:focus-visible {outline:2px solid #f1e0a9;}
}
