/* Short, wide phone viewport. Keep the existing palette and all three nav actions. */
@media (orientation:landscape) and (max-height:500px) and (max-width:1024px) {
  :root {
    --pt-header-height:calc(40px + var(--pt-safe-top));
    --pt-nav-space:calc(18px + var(--pt-safe-bottom));
    --pt-rail-space:calc(72px + var(--pt-safe-right));
    --pt-sheet-height:calc(var(--pt-viewport-height) - var(--pt-header-height) - var(--pt-safe-bottom) - 26px);
  }
  body .header {padding-left:max(10px,var(--pt-safe-left))!important;padding-right:max(10px,var(--pt-safe-right))!important;}
  body .header-left,body .header-right {height:40px!important;gap:8px!important;}
  body .header .logo {width:26px!important;height:26px!important;min-width:26px!important;}
  body .header .title {font-size:16px!important;line-height:1.2!important;}
  body .header .userbox {display:none!important;}
  body .header .weather-section {height:34px!important;min-height:0!important;padding:2px 10px!important;border-radius:16px!important;}
  body .header .weather-content {gap:5px!important;}
  body .header .weather-content > div {display:flex!important;align-items:center!important;gap:6px!important;}
  body .header .weather-icon {width:24px!important;height:24px!important;}
  body .header .weather-temp {font-size:13px!important;}
  body .header .weather-location {font-size:11px!important;max-width:170px!important;}
  body .main-container {position:fixed!important;left:0!important;right:0!important;}

  body .mobile-nav {
    top:calc(var(--pt-header-height) + 8px)!important;bottom:auto!important;
    left:auto!important;right:max(8px,var(--pt-safe-right))!important;
    width:56px!important;height:164px!important;min-height:164px!important;max-height:164px!important;
    flex-direction:column!important;gap:2px!important;padding:6px 4px!important;border-radius:20px!important;
  }
  body .mobile-nav .nav-btn {width:48px!important;height:48px!important;min-height:48px!important;flex:0 0 48px!important;transform:none!important;padding:2px!important;}
  body .mobile-nav .nav-btn.primary div {width:38px!important;height:38px!important;border-radius:12px!important;}
  body .mobile-nav .nav-btn svg {width:22px!important;height:22px!important;}
  body .mobile-nav .nav-profile-visual {width:26px!important;height:26px!important;}
  body .mobile-nav #navProfileText {max-width:44px!important;font-size:9px!important;}

  body .sidebar {
    top:calc(var(--pt-header-height) + 6px)!important;right:var(--pt-rail-space)!important;
    bottom:calc(var(--pt-safe-bottom) + 8px)!important;width:min(360px,calc(100vw - var(--pt-rail-space) - var(--pt-safe-left) - 12px))!important;
    padding:10px!important;transform:translateX(calc(100% + var(--pt-rail-space)))!important;
  }
  body .sidebar.show {transform:translateX(0)!important;}
  body .sidebar .filter-btn,body .sidebar .btn-primary,body .sidebar .btn-secondary {min-height:44px!important;padding:8px 10px!important;font-size:12px!important;}
  body .sidebar .section-title {font-size:12px!important;margin:8px 0!important;}
  body .sidebar .sidebar-section,body .sidebar .search-section {padding:0!important;margin:0 0 8px!important;}
  body .sidebar #action-buttons,body .sidebar .filter-buttons {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;}
  body .sidebar #action-buttons button {min-height:44px!important;height:auto!important;margin:0!important;padding:6px!important;font-size:12px!important;white-space:normal!important;}
  body .sidebar .filter-btn {white-space:normal!important;gap:4px!important;}
  body .sidebar .filter-btn > span {gap:4px!important;}
  body .sidebar .filter-btn svg {width:14px!important;min-width:14px!important;height:14px!important;}
  body .sidebar .btn-count {font-size:10px!important;padding:1px 5px!important;}
  body .sidebar .leaflet-control-geocoder {margin:0!important;}
  body .sidebar .leaflet-control-geocoder-form input {height:44px!important;}
  body .sidebar .info-cards {margin:0!important;}
  body .sidebar .info-card-mini {padding:6px!important;font-size:12px!important;}
  body .sidebar > div:last-child {margin-top:8px!important;padding-top:8px!important;}

  #mobilePlaceSurface .custom-modern-saved-popup {top:6px!important;left:max(8px,var(--pt-safe-left))!important;right:var(--pt-rail-space)!important;}
  #mobilePlaceSurface .saved-popup-card,#mobilePlaceSurface .saved-popup-card.no-gpx {padding:8px!important;}
  #mobilePlaceSurface .saved-popup-top-bar {padding:0 0 6px!important;margin:0 0 8px!important;gap:8px!important;}
  #mobilePlaceSurface .saved-popup-header-left {flex-direction:row!important;align-items:center!important;flex-wrap:wrap!important;gap:4px 8px!important;}
  #mobilePlaceSurface .saved-popup-header-right {align-items:center!important;flex-wrap:nowrap!important;gap:6px!important;}
  #mobilePlaceSurface .saved-popup-title {font-size:16px!important;line-height:1.25!important;}
  #mobilePlaceSurface .saved-popup-type-pill {font-size:10px!important;min-height:22px!important;height:auto!important;padding:3px 6px!important;}
  #mobilePlaceSurface .saved-popup-type-pill-icon {width:14px!important;height:14px!important;}
  #mobilePlaceSurface .saved-popup-weather-pill {font-size:11px!important;}
  #mobilePlaceSurface .saved-popup-grid {gap:8px!important;}
  #mobilePlaceSurface .saved-popup-grid.has-gpx {grid-template-columns:minmax(120px,30%) minmax(0,1fr)!important;grid-template-areas:"media info" "minimap info"!important;}
  #mobilePlaceSurface .saved-popup-grid.no-gpx {grid-template-columns:minmax(120px,34%) minmax(0,1fr)!important;grid-template-areas:"media info"!important;}
  #mobilePlaceSurface .saved-popup-media-col {grid-area:media!important;width:100%!important;max-width:100%!important;}
  #mobilePlaceSurface .saved-popup-minimap-col {grid-area:minimap!important;width:100%!important;max-width:100%!important;}
  #mobilePlaceSurface .saved-popup-info-col {grid-area:info!important;gap:6px!important;}
  #mobilePlaceSurface .saved-popup-media-col,#mobilePlaceSurface .saved-popup-minimap-col,
  #mobilePlaceSurface .saved-popup-media-col > div,#mobilePlaceSurface .carousel,#mobilePlaceSurface .carousel-main,#mobilePlaceSurface .saved-popup-minimap-canvas {height:100px!important;min-height:0!important;max-height:100px!important;}
  #mobilePlaceSurface .saved-popup-grid.no-gpx .saved-popup-media-col,
  #mobilePlaceSurface .saved-popup-grid.no-gpx .saved-popup-media-col > div,
  #mobilePlaceSurface .saved-popup-grid.no-gpx .carousel,
  #mobilePlaceSurface .saved-popup-grid.no-gpx .carousel-main {height:144px!important;max-height:144px!important;}
  #mobilePlaceSurface .carousel-thumbs {display:none!important;}
  #mobilePlaceSurface .saved-popup-stats-grid {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px!important;padding:5px 6px!important;margin:0!important;}
  #mobilePlaceSurface .saved-popup-stat-item {min-width:0!important;padding:0!important;}
  #mobilePlaceSurface .saved-popup-stat-label {font-size:9px!important;}
  #mobilePlaceSurface .saved-popup-stat-val {font-size:14px!important;overflow-wrap:anywhere;}
  #mobilePlaceSurface .saved-popup-mini-elevation-wrap {padding:3px 6px!important;margin:0!important;}
  #mobilePlaceSurface .saved-popup-mini-elevation-canvas {height:28px!important;}
  #mobilePlaceSurface .saved-popup-mini-elevation-footer {font-size:10px!important;}
  #mobilePlaceSurface .saved-popup-desc-wrap {padding:5px 7px!important;margin:0!important;max-height:52px!important;}
  #mobilePlaceSurface .saved-popup-desc {font-size:12px!important;line-height:1.4!important;max-height:42px!important;}
  #mobilePlaceSurface .saved-popup-actions-wrap {padding-top:0!important;}
  #mobilePlaceSurface .saved-popup-actions-wrap:has(.saved-popup-memory-btn) {display:grid!important;grid-template-columns:minmax(80px,1fr) minmax(0,3fr)!important;gap:6px!important;align-items:stretch!important;}
  #mobilePlaceSurface .saved-popup-memory-btn {margin:0!important;}
  #mobilePlaceSurface .saved-popup-actions a,#mobilePlaceSurface .saved-popup-actions button,#mobilePlaceSurface .saved-popup-memory-btn {font-size:12px!important;min-height:44px!important;padding:6px 4px!important;}
  body .leaflet-control-container > .leaflet-right {right:var(--pt-rail-space)!important;}
  #mobilePlaceSurface .leaflet-control-container > .leaflet-right {right:0!important;}
  #mobilePlaceSurface .leaflet-control-container .leaflet-bottom {bottom:0!important;}
  body dialog[open] {max-width:calc(100vw - var(--pt-safe-left) - var(--pt-safe-right) - 16px)!important;}
  body dialog .card,body dialog .login-card {max-height:calc(var(--pt-viewport-height) - var(--pt-safe-top) - var(--pt-safe-bottom) - 20px)!important;overflow-y:auto!important;}
  body #shareModalOverlay {position:fixed!important;inset:var(--pt-safe-top) var(--pt-safe-right) var(--pt-safe-bottom) var(--pt-safe-left)!important;width:auto!important;height:auto!important;max-height:none!important;padding:6px!important;box-sizing:border-box!important;}
  body #shareModalOverlay .share-modal-card {width:min(600px,100%)!important;max-height:calc(var(--pt-viewport-height) - var(--pt-safe-top) - var(--pt-safe-bottom) - 16px)!important;overflow-y:auto!important;margin:auto!important;}
  body input,body textarea,body select {font-size:16px!important;}
}
