/* Adventsroute V1.0.1 — mobile map-first usability patch.
   Keep full map usable on iPhone/iPad portrait; details in toggled panels. */
.mobile-map-tools-toggle,.mobile-map-info-toggle{display:none}
.mobile-map-details{display:contents}
/* The visit-day summary belongs in the itinerary, not beneath the full-screen map. */
body[data-view="route"] #balance-summary{display:none!important}
@media(max-width:760px), (min-width:761px) and (max-width:1100px) and (orientation:portrait){
 :root{--cockpit-top:56px;--mobile-nav:65px}
 html,body{max-width:100%;overflow-x:hidden}
 body[data-view="route"] .app-main{width:100%;margin-left:0}
 body[data-view="route"] .app-top-inner{height:56px!important;min-height:56px!important;padding:0 15px!important;gap:8px}
 body[data-view="route"] .app-breadcrumb small{font-size:8px!important;letter-spacing:1.15px}
 body[data-view="route"] .app-breadcrumb strong{font-size:16px!important;line-height:1.1}
 body[data-view="route"] .app-top-actions{gap:7px;max-width:52%}
 body[data-view="route"] .top-source{font-size:10px;gap:3px;white-space:nowrap}
 body[data-view="route"] .top-source svg{display:none}
 body[data-view="route"] .top-source-link{display:none}
 body[data-view="route"] .app-main main{height:calc(100dvh - 56px - 65px - env(safe-area-inset-bottom,0px))!important;overflow:hidden}
 body[data-view="route"] #route>.planner{height:100%!important;min-height:0!important}
 body[data-view="route"] #route .planner>.map-panel{position:relative;display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;overflow:hidden!important;background:#e7ede8}
 body[data-view="route"] .map-panel>.map-header{height:55px!important;min-height:55px!important;max-height:55px!important;flex:0 0 55px!important;gap:6px!important;padding:6px 10px!important}
 body[data-view="route"] .map-header-left{min-width:0;flex:1 1 auto}
 body[data-view="route"] .map-header-left strong{font-size:13px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
 body[data-view="route"] .map-header-left span{font-size:10px!important;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
 body[data-view="route"] .map-provider-chip{display:none!important}
 body[data-view="route"] .map-header>.manual-editor-toggle{height:36px!important;min-height:36px!important;padding:0 10px!important;gap:4px;flex-shrink:0}
 body[data-view="route"] .map-header>.manual-editor-toggle #manual-badge{font-size:11px!important;max-width:none!important;display:inline-block}
 body[data-view="route"] .map-header>.planner-toggle{height:36px!important;min-height:36px!important;width:36px!important;flex:0 0 36px!important;padding:0!important;display:grid!important;place-items:center!important}
 body[data-view="route"] .map-header>.planner-toggle span{display:none!important}
 /* Keep map large and functional. Previous toolbar + audit crowded it out. */
 body[data-view="route"] #route-map{flex:1 1 0!important;min-height:0!important;height:0!important;max-height:none!important;position:relative}
 body[data-view="route"] .mobile-map-tools-toggle{position:absolute;top:65px;left:11px;z-index:945;display:flex;align-items:center;gap:7px;min-height:39px;padding:8px 12px;border:1px solid #d3ded6;border-radius:11px;background:#ffffffed;color:#284c3f;font-family:inherit;font-size:12px;font-weight:700;line-height:1.1;box-shadow:0 3px 15px #152a242e;cursor:pointer;backdrop-filter:blur(7px)}
 body[data-view="route"] .mobile-map-tools-toggle svg{width:16px!important;height:16px!important;min-width:16px!important;min-height:0!important;flex:0 0 16px!important;stroke:currentColor!important;background:none!important}
 body[data-view="route"] .mobile-map-tools-toggle[aria-expanded="true"]{background:#1c5746;color:white}
 body[data-view="route"] .map-panel>.map-toolbar{display:none!important;position:absolute!important;top:111px!important;left:10px!important;right:10px!important;bottom:auto!important;z-index:948!important;max-height:min(58dvh,470px);overflow:auto;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;padding:12px!important;gap:10px!important;border:1px solid #dbe6df!important;border-radius:13px!important;background:#fff!important;box-shadow:0 12px 34px #192a264f!important;align-items:end}
 body[data-view="route"] .map-panel.mobile-tools-open>.map-toolbar{display:grid!important}
 body[data-view="route"] .map-toolbar label:not(.map-lines-switch){display:grid!important;gap:5px!important;font-size:11px!important;min-width:0!important;line-height:1.2}
 body[data-view="route"] .map-toolbar select{height:42px!important;min-width:0!important;max-width:none!important;width:100%!important;font-size:13px!important;padding:5px 24px 5px 9px!important;box-sizing:border-box}
 body[data-view="route"] .map-toolbar button{height:42px!important;font-size:12px!important;padding:6px 10px!important;min-width:0!important}
 body[data-view="route"] .map-toolbar .map-lines-switch{grid-column:1 / -1!important;min-height:36px!important;font-size:12px!important;display:flex!important;align-items:center!important;gap:8px!important}
 body[data-view="route"] .map-toolbar .map-lines-switch input{width:18px;height:18px}
 body[data-view="route"] .map-toolbar .map-road-type{grid-column:1 / -1!important}
 body[data-view="route"] .map-toolbar #map-road-load{grid-column:1/-1;white-space:normal;height:auto!important;min-height:42px!important}
 body[data-view="route"] .map-toolbar a.map-open-osm{grid-column:2!important;justify-self:stretch!important;min-height:42px;display:grid;place-items:center;padding:8px!important;text-align:center;font-size:12px!important}
 body[data-view="route"] .map-toolbar #map-reset{grid-column:1;justify-self:stretch!important;height:42px!important;align-self:end!important}
 /* Road report, clustering details and legend are available, but no longer occupy the map's height. */
 body[data-view="route"] .mobile-map-info-toggle{flex:0 0 42px;min-height:42px;max-height:42px;display:flex;align-items:center;justify-content:space-between;gap:9px;width:100%;padding:7px 15px;border:0;border-top:1px solid #dbe6e1;background:#fff;color:#315a4c;font-family:inherit;font-size:12px;font-weight:650;line-height:1.25;text-align:left;cursor:pointer}
 body[data-view="route"] .mobile-map-info-toggle>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}
 body[data-view="route"] .mobile-map-info-toggle svg{width:16px;height:16px;flex:0 0 16px;transition:transform .18s}
 body[data-view="route"] .mobile-map-info-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}
 body[data-view="route"] .mobile-map-details{display:none!important;position:absolute;left:10px;right:10px;bottom:47px;z-index:949;max-height:min(60dvh,520px);overflow-y:auto;overscroll-behavior:contain;background:#fff;border:1px solid #dce7e0;border-radius:13px;box-shadow:0 12px 30px #102b2455}
 body[data-view="route"] .map-panel.mobile-info-open>.mobile-map-details{display:block!important}
 body[data-view="route"] .mobile-map-details .road-feasibility{display:block!important;margin:0!important;padding:13px!important;font-size:12px!important;line-height:1.5!important}
 body[data-view="route"] .mobile-map-details .road-feasibility-heading{display:grid!important;gap:4px!important;align-items:initial!important}
 body[data-view="route"] .mobile-map-details .road-feasibility-heading strong{display:block!important;font-size:13px!important;line-height:1.35!important;letter-spacing:0!important;overflow-wrap:anywhere}
 body[data-view="route"] .mobile-map-details .road-feasibility-actions{display:grid!important;gap:9px!important;margin-top:10px!important}
 body[data-view="route"] .mobile-map-details .road-feasibility-actions button{font-size:12px!important;line-height:1.3!important;padding:10px!important;white-space:normal;max-width:100%}
 body[data-view="route"] .mobile-map-details #map-road-status{display:block!important;padding:9px 12px!important;white-space:normal;overflow-wrap:anywhere;font-size:11px!important;line-height:1.4!important}
 body[data-view="route"] .mobile-map-details .map-live-note{display:block!important;font-size:10px!important;line-height:1.35!important;padding:8px 12px!important}
 body[data-view="route"] .mobile-map-details .map-aggregation-note{display:block!important;padding:9px 12px!important;font-size:11px!important;line-height:1.4!important}
 body[data-view="route"] .mobile-map-details .map-footer.map-status-legend{display:flex!important;padding:11px!important;gap:8px 12px!important;flex-wrap:wrap}
 body[data-view="route"] .mobile-map-details .map-footer.map-status-legend .legend-item{display:flex!important;font-size:10px!important}
 body[data-view="route"] .mobile-map-details .map-footer.map-status-legend a{display:inline-block!important;white-space:normal!important}
 body[data-view="route"] .map-panel .leaflet-control-attribution{font-size:9px!important}
 body[data-view="route"] .map-panel .route-editor{z-index:1815}
 body[data-view="route"] .map-panel.mobile-info-open>.mobile-map-tools-toggle{opacity:.7}
}
@media(max-width:400px){
 body[data-view="route"] .map-header>.manual-editor-toggle #manual-badge{font-size:0!important;max-width:0!important;overflow:hidden!important}
 body[data-view="route"] .map-header>.manual-editor-toggle{width:37px;justify-content:center;padding:0!important}
 body[data-view="route"] .map-header-left strong{font-size:12px!important}
}

/* V1.0.2: keep native two-finger gestures in the map, not in Safari's viewport. */
#route-map, #route-map canvas, #route-map .advents-tiles { touch-action:none; -webkit-user-select:none; -webkit-touch-callout:none; }
