/* Phone tools live below the map, including short landscape viewports.
   Use dynamic viewport units so browser chrome and rotation keep the cap. */
.mobile-guide-shortcuts{display:none}
@media (max-width:720px), (max-width:960px) and (max-height:500px){
 :root{--header:62px;--phone-sheet-height:50dvh}
 .app{display:block}
 .map-area{height:100%;width:100%}
 .header-nav{display:none}
 .topbar{padding-inline:12px;gap:8px}
 .topbar .brand{width:182px;height:56px}
 .map-heading{display:none}
 .map-top-actions{top:16px;right:14px;gap:6px}
 .map-top-actions #orbitBtn{display:none}
 .map-toolbar{top:74px;right:14px;width:37px}
 .mobile-explore{display:flex;align-items:center;gap:7px;position:absolute;top:16px;left:14px;z-index:2;padding:10px 12px;min-height:44px;font-size:13px;background:var(--brand-gold);color:var(--brand-asphalt);border:1px solid var(--brand-gold);border-radius:var(--brand-radius-sm)}
 .sidebar,
 .detail-panel,
 .sun-panel,
 .profile-panel,
 .playback-bar,
 .layers-panel.expanded{
  position:fixed;inset:auto 0 0;width:100%;max-width:none;
  max-height:var(--phone-sheet-height);margin:0;box-sizing:border-box;
  border:1px solid #879b675c;border-bottom:0;border-radius:18px 18px 0 0;
  background:#17251ffb;box-shadow:0 -10px 35px #07100b55;
  overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;
  padding-bottom:max(16px,env(safe-area-inset-bottom));z-index:8;
 }
 .sidebar{height:var(--phone-sheet-height);display:block;transform:translateY(105%);visibility:hidden;transition:transform .2s,visibility .2s}
 .sidebar.mobile-open{transform:none;visibility:visible}
 .sidebar.mobile-open:after{display:none}
 .sidebar-heading{position:sticky;top:0;z-index:2;background:var(--brand-forest-panel);padding:14px 62px 12px 18px;border-bottom:1px solid #879b6733}
 .sidebar-heading h1{font-size:22px;line-height:1.3;margin:0}
 .sidebar-heading .eyebrow,.sidebar-heading .subtitle,.sidebar-heading .tiny-mountain,
 .sidebar-heading .area-badges,.sidebar-heading .visitor-entry,
 .sidebar-heading .map-safety-entry,.sidebar-heading .map-snow-entry{display:none}
 #mobileCloseSidebar{display:flex;align-items:center;justify-content:center;position:absolute;top:6px;right:12px;width:44px;height:44px;padding:10px}
 .sidebar-content{min-height:0;overflow:visible;padding:16px 18px}
 .sidebar .search-wrap{margin:12px 18px}
 .sidebar .tabs{position:static;min-height:40px}
 .sidebar-footer{min-height:40px;padding:8px 16px;flex-wrap:wrap}
 .mobile-guide-shortcuts{display:flex;gap:14px;flex-wrap:wrap;padding:12px 18px;font-size:11px}
 .mobile-guide-shortcuts a{color:#d3e6b6;min-height:32px;display:flex;align-items:center}
 .detail-panel{padding:0 0 max(16px,env(safe-area-inset-bottom))}
 .detail-head{position:sticky;top:0;z-index:2;background:#1b2b22;padding:14px 18px 10px}
 .detail-head h2{font-size:22px;padding-right:36px}
 .detail-body{padding:14px 18px 18px}
 #closeDetail{min-width:44px;min-height:44px}
 .profile-panel-open .detail-panel,.playback-active .detail-panel,
 .map-area:has(.layers-panel.expanded) .detail-panel,
 .app:has(.sidebar.mobile-open) .detail-panel{display:none}
 .profile-panel-open .profile-panel{inset:auto 0 0;width:100%;max-height:var(--phone-sheet-height);padding:12px 16px max(16px,env(safe-area-inset-bottom))}
 .profile-header{align-items:flex-start;gap:8px}
 .profile-header>div{min-width:0}
 .profile-header h3{font-size:13px;overflow-wrap:anywhere}
 .profile-hover{display:none}
 .profile-chart{height:90px;margin-top:10px}
 .profile-foot{flex-wrap:wrap;gap:5px}
 .sun-panel{padding:0 18px max(16px,env(safe-area-inset-bottom))}
 .sun-title{position:sticky;top:0;z-index:2;min-height:56px;background:#17251f;align-items:center;margin:0 -2px;padding:8px 0;border-bottom:1px solid #879b6733}
 .sun-title h3{margin:0;font-size:21px}
 #closeSun,#closeProfile{flex:none;min-width:44px;min-height:44px}
 .sun-panel>p{font-size:12px;line-height:1.5}
 .sun-inputs{gap:8px}
 .sun-inputs input{min-width:0;font-size:16px}
 .sun-panel input[type=range],.playback-bar input[type=range]{min-height:36px;touch-action:pan-y}
 .sun-panel label:has(#shadowToggle){display:flex;align-items:center;gap:10px;min-height:44px}
 #shadowToggle{width:20px;height:20px;flex:none}
 .layers-panel.expanded{display:flex;flex-direction:column;padding:0;max-height:var(--phone-sheet-height)}
 .layers-panel.expanded .layers-title{flex:none;min-height:52px;font-size:12px;padding:12px 18px}
 .layers-panel.expanded #layersBody{overflow:auto;min-height:0;padding-bottom:max(16px,env(safe-area-inset-bottom));overscroll-behavior:contain}
 .layers-panel:not(.expanded){position:absolute;top:74px;right:62px;width:165px;z-index:3}
 .layers-panel .layer-row{min-height:40px}
 .playback-bar{padding:12px 16px max(16px,env(safe-area-inset-bottom))}
 .playback-top{flex-wrap:wrap;gap:8px}
 .playback-top strong{min-width:0;overflow-wrap:anywhere}
 .map-area.sun-active .grade-legend,.map-area.sun-active .analytical-legend,
 .map-area.sun-active .slope-legend,.map-area.sun-active #snowMapLegend,
 .app:has(.sidebar.mobile-open) .scene-dock,.map-area:has(.detail-panel:not([hidden])) .scene-dock{display:none}
 body>dialog,.safety-dialog{
  position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:none;
  max-height:var(--phone-sheet-height);border-radius:18px 18px 0 0;
  padding:0 18px max(18px,env(safe-area-inset-bottom));overflow:auto;overscroll-behavior:contain;
 }
 body>dialog::backdrop,.safety-dialog::backdrop{background:#07100b40;backdrop-filter:none}
 #modal .modal-top,.safety-dialog-top{position:sticky;top:0;z-index:3;background:#17221e;padding:8px 0;min-height:56px}
 #modal .modal-logo-frame{height:42px}
 #modal #closeModal{min-width:44px;min-height:44px}
 .modal-source-list{max-height:none;overflow:visible}
 .safety-dialog h2{font-size:25px}
 .safety-dialog-actions{bottom:calc(-1 * max(18px,env(safe-area-inset-bottom)));z-index:2;flex-wrap:wrap;padding:12px 0 max(18px,env(safe-area-inset-bottom))}
 .safety-dialog-actions button{flex:1;min-width:110px}
 input,select,textarea{scroll-margin-block:60px 18px}
}
