/* One toolbar, one foreground panel. These rules do not change the desktop shell. */
.mobile-toolbar,.mobile-only,.mobile-menu,.pwa-status-edge,.pwa-bottom-edge{display:none}

@media(max-width:760px){
 /* Paint narrow opaque edges for WebKit to sample; soften the transition separately.
    The page background also fills any native gap outside the drawable viewport. */
 :root.ios-standalone{
  --pwa-status-inset:env(safe-area-inset-top,0px);
  --pwa-edge-depth:12px;
  --pwa-header-top:calc(max(var(--pwa-edge-depth),var(--pwa-status-inset)) + clamp(16px,3.2dvh,28px));
  --pwa-status-rgb:33 72 78;
  --pwa-sea:#a8d0d1;
 }
 :root.ios-standalone,:root.ios-standalone body{background-color:var(--pwa-sea)}
 .ios-standalone :is(.pwa-status-edge,.pwa-bottom-edge){
  display:block;position:fixed;height:var(--pwa-edge-depth);pointer-events:none;
 }
 .ios-standalone .pwa-status-edge{inset:0 0 auto;z-index:1;background-color:rgb(var(--pwa-status-rgb))}
 .pwa-status-edge::after{
  content:"";position:absolute;inset:100% 0 auto;height:calc(var(--pwa-header-top) - var(--pwa-edge-depth));
  background:linear-gradient(rgb(var(--pwa-status-rgb)),rgb(var(--pwa-status-rgb) / .82) 49%,rgb(var(--pwa-status-rgb) / 0));
 }
 .ios-standalone .pwa-bottom-edge{inset:auto 0 0;z-index:2;background-color:var(--pwa-sea)}
 .pwa-bottom-edge::before{
  content:"";position:absolute;inset:auto 0 100%;height:24px;background:linear-gradient(transparent,var(--pwa-sea));
 }
 .atlas{
  position:fixed;inset:0;width:auto;height:auto;
  --phone-top:calc(8px + env(safe-area-inset-top,0px));
  --phone-left:calc(8px + env(safe-area-inset-left,0px));
  --phone-right:calc(8px + env(safe-area-inset-right,0px));
  --phone-bottom:max(8px,env(safe-area-inset-bottom,0px));
  --phone-bar:50px;
  --sheet-start:calc(var(--phone-top) + var(--phone-bar) + 8px);
  --place-peek:158px;
  --route-peek:168px;
  --dock-size:55px;
  --dock-bottom:var(--phone-bottom);
  --map-cover:var(--dock-size);
  --map-overlay-offset:calc(var(--dock-bottom) + var(--map-cover));
 }
 .ios-standalone .atlas{--phone-top:var(--pwa-header-top);--dock-bottom:max(8px,calc(var(--phone-bottom) - 8px))}
 .atlas .masthead,.atlas .map-caption,.atlas .compass,.app-update{display:none}
 .mobile-toolbar{
  position:absolute;z-index:480;top:var(--phone-top);left:var(--phone-left);right:var(--phone-right);
  height:var(--phone-bar);display:flex;align-items:center;gap:2px;padding:2px 3px;
  background:#0f3037f5;border-color:#91bfb23f;border-radius:14px;box-shadow:0 5px 14px #0a2a3524;
 }
 .ios-standalone .mobile-toolbar{background:#0f3037;-webkit-backdrop-filter:none;backdrop-filter:none}
 .mobile-toolbar .mobile-search{
  position:static;flex:1;min-width:0;height:44px;gap:8px;padding:0 7px;
  color:#e1f3ed;line-height:1.2;text-align:left;
 }
 .mobile-search span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}
 .mobile-brand{width:26px;height:26px;flex:0 0 26px;fill:none;stroke:#9be8d4;stroke-width:1.6;stroke-linecap:round}
 .toolbar-icon{
  width:44px;height:44px;flex:0 0 44px;display:grid;place-items:center;position:relative;border-radius:9px;color:#d0e9e2;
 }
 .toolbar-icon svg,.mobile-dock svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
 .toolbar-icon svg circle{fill:#0f3037}
 #mobile-more svg circle{fill:currentColor;stroke:none;r:1.65}
 .toolbar-icon:active,.mobile-search:active{background:#94e2d513}
 .toolbar-icon:focus-visible,.mobile-search:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
 .filter-count{
  min-width:15px;height:15px;padding:1px 3px;display:inline-grid;place-items:center;
  border-radius:10px;background:var(--accent);color:#123c35;font-size:9px;line-height:1;font-weight:700;
 }
 .toolbar-icon .filter-count{position:absolute;top:3px;right:2px}
 .mobile-menu-dot{display:none;position:absolute;top:7px;right:6px;height:6px;width:6px;border-radius:50%;background:var(--gold)}
 .atlas.is-offline .mobile-menu-dot,body:has(.app-update:not([hidden])) .mobile-menu-dot{display:block}
 #mobile-apply-update{display:none}
 body:has(.app-update:not([hidden])) #mobile-apply-update{display:block;color:var(--accent)}
 .mobile-menu[open]{
  display:block;position:fixed;inset:calc(66px + env(safe-area-inset-top,0px)) calc(8px + env(safe-area-inset-right,0px)) auto auto;
  margin:0;width:min(295px,calc(100vw - 20px));max-height:calc(100dvh - 82px - env(safe-area-inset-bottom,0px));
  padding:5px 12px 8px;border-radius:16px;background:#102d33;color:var(--text);overflow-y:auto;
 }
 #mobile-legend-items{list-style:none;margin:8px 0 6px;padding:0 7px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;font-size:12px}
 #mobile-legend-items li{display:flex;align-items:center;gap:6px}
 #mobile-legend-items .legend-swatch{width:9px;height:9px;border:1px solid #f0fff5;margin:0}

 .mobile-dock{left:var(--phone-left);right:var(--phone-right);bottom:var(--dock-bottom);height:var(--dock-size);padding:4px}
 .ios-standalone .mobile-dock{box-shadow:0 4px 16px #0a2a3533}
 .mobile-dock button{width:auto;flex:1;gap:6px;margin:0 1px}
 .mobile-dock button span{font-size:12px}
 .atlas.detail-open,.atlas.itinerary-compact{--map-cover:var(--place-peek);--map-overlay-offset:calc(var(--phone-bottom) + var(--map-cover))}
 .atlas.itinerary-compact{--map-cover:var(--route-peek)}
 .atlas:is(.list-open,.detail-open,.itinerary-open) .mobile-dock,
 .atlas:has(.guide-panel:not([hidden])) .mobile-dock{display:none}
 .atlas.list-open .mobile-toolbar,.atlas.list-open .map-tools,.atlas:has(.guide-panel:not([hidden])) .map-tools{visibility:hidden}
 .atlas .map-tools,.atlas.detail-open:not(.detail-expanded) .map-tools{
  top:auto;bottom:calc(var(--map-overlay-offset) + 12px);right:var(--phone-right);
  width:44px;flex-direction:column;gap:0;padding:0;border:0;background:#153841ed;
  box-shadow:0 2px 10px #102b3454;border-radius:12px;overflow:hidden;
 }
 .map-tools>div{display:none}
 .map-tools button+button{border-top:1px solid #9bd3c12a}
 .atlas.detail-open:not(.detail-expanded) .map-tools,.atlas.itinerary-compact .map-tools{visibility:visible}
 .atlas:is(.detail-expanded,.itinerary-open:not(.itinerary-compact)) .map-tools{visibility:hidden}
 .atlas .leaflet-bottom.leaflet-left,.atlas .leaflet-bottom.leaflet-right{bottom:calc(var(--map-overlay-offset) + 3px)}
 .network-notice{top:calc(var(--sheet-start) + 2px);right:var(--phone-right);left:var(--phone-left);max-width:none}
 .atlas:is(.detail-expanded,.itinerary-open:not(.itinerary-compact)) .network-notice{visibility:hidden}
 .map-error{top:calc(var(--sheet-start) + 4px)}
 .atlas.is-offline .map-error{display:none}
 .notification{top:calc(var(--sheet-start) + 3px);bottom:auto}

 .detail,.itinerary,.guide-panel{
  left:var(--phone-left);right:var(--phone-right);bottom:var(--phone-bottom);
  height:calc(100dvh - var(--sheet-start) - var(--phone-bottom));max-height:calc(100dvh - var(--sheet-start) - var(--phone-bottom));
  border-radius:17px;background:#102d33;
 }
 .detail.collapsed{height:auto}
 .detail.collapsed h2{color:#f3fbf8}
 .detail.collapsed .detail-category{color:#b0cdc5}
 .detail.collapsed .detail-actions{background:transparent}
 .detail-more{border-color:#98bcaf38}
 .detail-nav>span{display:none}
 .detail-nav svg,.route-fold svg{display:inline-block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
 .guide-panel-head .round{width:44px;height:44px}

 .atlas.itinerary-compact .mobile-toolbar{visibility:visible}
 .atlas.itinerary-compact .itinerary{height:var(--route-peek)}
 .itinerary-title .eyebrow{color:#acd5ca;font-size:10px;letter-spacing:1px}
 .itinerary-title h2{font-size:19px}
 .itinerary-preview .itinerary-title h2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:18px}
 .itinerary-preview .itinerary-title{border-bottom:0;padding-bottom:3px}
 .itinerary-preview .itinerary-body{overflow:hidden}
 .itinerary-preview .route-overview{padding:5px 13px;border-bottom:0}
 .itinerary-preview .route-overview>:not(.route-summary):not(.route-message):not(.route-visit-condition),
 .itinerary-preview .stops,.itinerary-preview .route-footer,.itinerary.itinerary-preview .route-fold{display:none}
 .itinerary-preview .route-message{margin:3px 0 0;font-size:11px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .itinerary-preview .route-summary strong{font-size:17px}
 .itinerary-preview .route-summary{gap:2px 12px}
 .itinerary-preview .route-preview-footer{display:block;padding:4px 10px 9px}
 .route-preview-footer .primary{width:100%;min-height:44px}
 .itinerary:not(.itinerary-preview):has(.stop) .route-fold{display:grid;right:53px}
 .itinerary:not(.itinerary-preview):has(.stop) .itinerary-title h2{margin-right:92px}
 .itinerary:not(.itinerary-preview):has(.stop) .itinerary-title .eyebrow{display:block;margin-right:92px}
 .itinerary:not(:has(.stop)) .route-show-map{display:none}

 .atlas.list-open .explorer{
  top:var(--phone-top);bottom:var(--phone-bottom);left:var(--phone-left);right:var(--phone-right);
  padding:10px 14px 0;border-radius:17px;background:#102d33;
 }
 .explorer .explorer-top{display:flex;align-items:center;justify-content:space-between;margin:0 0 8px;min-height:44px}
 .explorer .explorer-top h1,.explorer .guide-tabs{display:none}
 .explorer #mobile-browse-title{display:block;margin:0;font:650 23px/1.15 Manrope,system-ui}
 .explorer #mobile-browse-title:focus{outline:none}
 .explorer .mobile-close{width:44px;height:44px;font-size:22px}
 .explorer .search-tools{display:flex;align-items:center;gap:7px}
 .explorer .search-wrap{flex:1;min-width:0}
 .explorer .inside-filters{display:inline-flex;align-items:center;gap:5px;min-height:44px;padding:6px 9px;white-space:nowrap}
 .atlas:not(.filters-open) .explorer[data-view="explore"] :is(.area-controls,#town-context,#active-filters,#categories,#topics,.browse-refiners,.browse-special){display:none}
 .atlas.filters-open .explorer :is(.search-tools,#search-scope,.results-heading,.results){display:none}
 .atlas.filters-open #categories{display:flex;flex-wrap:wrap}
 .atlas.filters-open #topics{display:flex;flex-wrap:wrap;overflow:visible;max-height:none}
 .atlas.filters-open #topics button,.atlas.filters-open #categories button{min-height:44px}
 .atlas.filters-open .explorer .mobile-filter-footer{display:block;padding:12px 0 max(12px,env(safe-area-inset-bottom,0px))}
 .mobile-filter-footer .primary{width:100%;min-height:44px}
 .atlas.filters-open .explorer.town-scope .browse-refiners:has(#beach-filters:not([hidden])){display:block}
}
@media(max-width:360px){
 .itinerary-preview .itinerary-title h2{font-size:16px}
 .itinerary-preview .route-summary small,.itinerary-preview .route-metrics{font-size:10px}
 .mobile-dock button{gap:3px}
}
@media(max-width:760px) and (max-height:450px){
 .atlas .map-tools,.atlas.detail-open:not(.detail-expanded) .map-tools{
  width:auto;flex-direction:row;bottom:min(calc(var(--map-overlay-offset) + 29px),calc(100dvh - var(--sheet-start) - 45px));
 }
 .map-tools button+button{border-top:0;border-left:1px solid #9bd3c12a}
}
