/* Short landscape screens use one row for tools and one for navigation/stats.
   The map camera can then fit the full world without a portrait-sized frame. */
@media (orientation: landscape) and (max-height: 500px) {
  body[data-page="map"] { padding: 0; overflow: hidden; }
  body[data-page="map"] .site-header { height: 44px; top: 0; z-index: 20; }
  body[data-page="map"] .brand-mark { width: 32px; height: 32px; }
  body[data-page="map"] .brand strong { font-size: 20px; }
  body[data-page="map"] .brand small { display: none; }
  body[data-page="map"] .header-actions .icon-btn { width: 32px; height: 32px; }
  body[data-page="map"] .header-actions .write-link { min-height: 32px; height: 32px; font-size: 11px; padding: 0 10px; }
  body[data-page="map"] .map-page { height: 100vh; height: 100dvh; min-height: 0; padding: 0; }
  body[data-page="map"] .world-svg { width: min(calc(100vw - 40px), calc((100dvh - 108px) * 1.9230769)); height: auto; left: 50%; top: 50%; transform: translate(-50%,-50%); }
  body[data-page="map"] .map-preference-row { position: fixed; top: 6px; left: 50%; transform: translateX(-50%); z-index: 21; }
  body[data-page="map"] .map-preference-row button { min-height: 32px; height: 32px; padding-block: 4px; font-size: 11px; }
  body[data-page="map"] .map-stats { left: max(16px,env(safe-area-inset-left)); bottom: max(8px,env(safe-area-inset-bottom)); width: min(43vw,370px)!important; }
  body[data-page="map"] .map-stats article { min-height: 36px; padding: 5px 8px; }
  body[data-page="map"] .map-stats .stat-icon { width: 24px!important; height: 24px!important; min-width: 24px!important; }
  body[data-page="map"] .map-stats article>div>span { font-size: 8px; white-space: normal; }
  body[data-page="map"] .map-stats strong { font-size: 13px; }
  body[data-page="map"] .site-nav { position: fixed; transform: none; margin: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; z-index: 24; inset: auto max(16px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) auto; width: min(43vw,370px); height: 36px; }
  body[data-page="map"] .site-nav a { display: grid; place-items: center; font-size: 11px; }
  body[data-page="map"] .site-nav a.active::after { bottom: 2px; }
  body[data-page="map"] .map-controls { display: flex; gap: 6px; }
  body[data-page="map"] .map-controls button { width: 34px; height: 34px; }
  body[data-page="map"] .map-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  body[data-page="map"] .map-controls { bottom: calc(max(8px,env(safe-area-inset-bottom)) + 46px)!important; right: max(16px,env(safe-area-inset-right))!important; }
  .map-pan-guide { top: 52px; width: min(360px,calc(100% - 32px)); padding: 7px; font-size: 11px; }
}

@media (orientation: landscape) and (max-height:500px) {
 body[data-page="map"] .site-header { display:flex; justify-content:space-between; }
 body[data-page="map"] .header-actions { margin-left:auto; flex:0 0 auto; }
 body[data-page="map"] .site-footer { display:none; }
}
