/* A compact route first; details open explicitly. Desktop retains its side panel. */
.sheet-header,.mobile-booking-summary{display:none}
@media(max-width:760px){
  body{--map-height:60dvh}
  #map{height:var(--map-height);bottom:auto}
  .picking #map{height:100dvh}
  .ride-panel,[data-theme=dark] .ride-panel{max-height:50dvh;border-radius:22px 22px 0 0;transition:none;box-shadow:0 -4px 24px #0000000e}
  .ride-panel.expanded,[data-theme=dark] .ride-panel.expanded{height:68dvh;max-height:calc(100dvh - 112px)}
  .sheet-header{display:flex;align-items:center;flex-shrink:0;padding:0 12px;border-bottom:1px solid var(--edge);min-height:46px}
  .sheet-header .panel-handle{position:relative;display:flex;align-items:center;gap:8px;flex:1;min-height:46px;width:auto;padding:12px 4px 5px;border-radius:0;background:transparent;color:var(--ink);touch-action:none}
  .panel-handle .sheet-grip{position:absolute;width:30px;height:3px;top:5px;left:calc(50% - 15px);background:var(--edge);border-radius:3px}
  .panel-handle .sheet-label{height:auto;width:auto;background:none;font-size:12px;font-weight:600;line-height:1.3;text-align:left}
  .panel-handle .sheet-chevron{height:auto;width:auto;background:none;margin-left:auto;font-size:20px;font-weight:400;color:var(--subtle)}
  #minimize-sheet{display:flex;align-items:center;justify-content:center;gap:5px;min-height:44px;min-width:72px;margin-left:14px;font-size:12px;color:var(--accent-text)}
  #minimize-sheet svg{width:17px;height:17px}
  .ride-panel[data-sheet=peek] #minimize-sheet,.ride-panel[data-sheet=peek] .panel-content,.ride-panel[data-sheet=peek] #booking-footer,.ride-panel[data-sheet=peek] .panel-nav{display:none}
  .ride-panel[data-sheet=peek]{padding-bottom:env(safe-area-inset-bottom)}
  .panel-content{padding:10px 16px 12px;overscroll-behavior:contain;scroll-padding:12px;min-height:0}
  .panel-content h1{font-size:24px;line-height:1.15;margin:8px 0 12px;letter-spacing:-.7px}
  .panel-content>.subtitle,.panel-content>.eyebrow{display:none}
  .booking-heading{margin:0 0 6px}
  .city-button{min-height:32px;max-width:100%;font-size:12px}
  .booking-step{display:none}
  .ride-panel[data-content=booking] .panel-content>h1{display:none}
  .route-fields,[data-theme=dark] .route-fields{padding:0 10px;border-radius:14px}
  .field-row{height:54px;gap:8px}
  .field-button small{font-size:9px;margin-bottom:2px;letter-spacing:.5px}
  .field-button b{font-size:13px;line-height:1.3}
  .field-dot{flex-shrink:0;width:8px;height:8px}
  .field-dot:after{top:12px;height:27px;left:1px}
  .route-fields .field-action{margin-left:0;flex-basis:44px;border-radius:10px}
  .route-fields #field-locate{display:none}
  .ride-panel[data-content=booking][data-sheet=compact] .stops-editor,
  .ride-panel[data-content=booking][data-sheet=compact] .quick-places,
  .ride-panel[data-content=booking][data-sheet=compact] .section-head,
  .ride-panel[data-content=booking][data-sheet=compact] .tariffs,
  .ride-panel[data-content=booking][data-sheet=compact] .ride-options{display:none}
  .ride-panel[data-content=booking][data-sheet=compact]:not(.route-ready) #booking-footer{display:none}
  #booking-footer,[data-theme=dark] #booking-footer{flex-shrink:0;padding:9px 16px}
  #booking-footer .primary{min-height:48px;padding:12px 16px}
  .under-button{display:none}
  .panel-nav,[data-theme=dark] .panel-nav{flex-shrink:0;min-height:54px;padding:4px 10px max(4px,env(safe-area-inset-bottom))}
  .panel-nav button{min-height:44px;min-width:60px;font-size:10px;gap:3px}
  .panel-nav svg{width:17px;height:17px}
  .quick-places{margin:8px 0 14px;flex-wrap:wrap}
  .chip,[data-theme=dark] .chip{min-height:40px}
  .add-stop{min-height:44px}
  .section-head{margin:10px 0 8px}
  .tariffs{display:flex;gap:7px}
  .tariff,[data-theme=dark] .tariff{flex:1;min-width:0;min-height:112px;padding:8px;border-radius:12px}
  .tariff .car-art{height:34px;margin:0 0 6px;width:100%}
  .car-art .vehicle-image{width:100%;max-width:100%;height:45px;margin:-4px 0 0}
  .tariff b{font-size:12px}.tariff strong{font-size:19px;margin:5px 0 0}.tariff small{display:none}
  .ride-options{margin-top:12px}.ride-options summary{padding:12px 0;min-height:48px;align-items:center}
  .ride-options summary span{font-size:11px}
  .map-top-info,[data-theme=dark] .map-top-info{top:76px;max-width:calc(100vw - 24px);padding:8px 10px;font-size:10px;pointer-events:none}
  .map-tools{top:auto;bottom:calc(100dvh - var(--map-height) + 38px);right:12px;gap:7px}
  .map-tool,[data-theme=dark] .map-tool{width:44px;height:44px;border-radius:14px}
  .map-tools>span{display:none}
  #geo-status{top:auto;bottom:calc(100dvh - var(--map-height) + 38px);left:12px;max-width:calc(100vw - 82px);min-height:36px;font-size:10px;padding:8px 10px}
  .picking #geo-status{display:none}
  .leaflet-control-attribution,body:has(.ride-panel.expanded) .leaflet-control-attribution{position:fixed;top:auto;bottom:calc(100dvh - var(--map-height) + 18px);font-size:8px!important;max-width:100vw}
  .picking .leaflet-control-attribution{bottom:0}
  .picking .map-tools{top:120px;bottom:auto}
  .picking .map-tools #zoom-in,.picking .map-tools #zoom-out{display:flex}
  .map-pick,[data-theme=dark] .map-pick{padding:14px;bottom:max(12px,env(safe-area-inset-bottom));border-radius:18px}
  .map-pick p{font-size:12px;min-height:0;margin:6px 0 12px}
  .pick-heading{font-size:16px}.pick-heading button{min-height:44px}
  .map-pick .pick-search{min-height:44px}
  #toast{top:116px;bottom:auto;max-width:calc(100vw - 24px);font-size:12px}
  .picking #toast{bottom:auto;top:76px}
  .connection{top:76px;max-width:calc(100vw - 24px)}
  dialog,[data-theme=dark] dialog{max-height:calc(100dvh - 24px);padding:20px;width:calc(100vw - 20px);overscroll-behavior:contain}
  dialog h2{font-size:25px}.modal-header .round{width:44px;height:44px}
  .search-form{gap:6px}.search-form button{width:44px;min-height:48px;padding:10px}.search-input{padding:12px 10px}
  .form input,.form textarea,.search-input{font-size:16px}
  .assigned-car{margin:10px 0;border-radius:14px}
  .assigned-car-top{padding:10px 12px 0}
  .assigned-car-art{height:78px}.assigned-car-art .vehicle-image{height:105px;width:100%}
  .assigned-car-details{padding:4px 12px 12px;gap:8px;flex-wrap:wrap}
  .assigned-car-details b{font-size:14px}
  .trip-summary{padding:10px 0;margin:8px 0}.trip-summary strong{font-size:23px}
  .stepper{margin:8px 0}.radar{width:54px;height:54px;margin:12px auto}
  .metric-row{gap:8px;margin:12px 0}.metric{padding:12px}.metric strong{font-size:22px}
  .driver-panel .status-badge{margin-bottom:12px}
  .driver-panel .metric-row{display:none}
  .ride-panel.expanded .driver-panel .metric-row{display:flex}
  .job{padding:14px;margin:12px 0}.job header strong{font-size:23px}.job .primary{min-height:48px}
  .filter-numbers{gap:8px}.filter-numbers input{min-width:0;width:100%}
}
@media(max-width:760px) and (max-height:600px){
  .ride-panel,[data-theme=dark] .ride-panel{max-height:56dvh}.ride-panel.expanded,[data-theme=dark] .ride-panel.expanded{height:calc(100dvh - 100px);max-height:calc(100dvh - 100px)}
  .topbar,[data-theme=dark] .topbar{height:50px;top:6px}.map-top-info,[data-theme=dark] .map-top-info{top:64px}
  #geo-status{display:none}.booking-heading{display:none}.map-tools #fit-route{display:none}
}
@media(max-width:760px) and (orientation:landscape){
  .ride-panel,[data-theme=dark] .ride-panel{left:0;right:auto;top:70px;bottom:0;width:46%;max-height:calc(100dvh - 70px)}
  .ride-panel.expanded{height:calc(100dvh - 70px)}
  #map{height:100dvh;left:46%;width:54%}.picking #map{left:0;width:100%}
  .map-top-info,[data-theme=dark] .map-top-info{left:calc(46% + 12px);max-width:calc(54vw - 24px)}
  .map-tools{bottom:28px}.leaflet-control-attribution{bottom:0}
  .ride-panel[data-sheet=peek]{top:auto;max-height:60px}
}

@media(max-width:760px){.mobile-booking-summary{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:44px;font-size:11px;text-align:left;color:var(--subtle)}.mobile-booking-summary>span:last-child{white-space:nowrap;color:var(--accent-text)}.ride-panel.expanded .mobile-booking-summary{display:none}}

@media(max-width:760px){
 .ride-panel[data-content=booking][data-sheet=compact].route-ready .booking-heading{display:none}
 .ride-panel[data-content=booking][data-sheet=compact].route-ready .panel-content{padding-top:8px;padding-bottom:8px}
 .ride-panel[data-content=booking][data-sheet=compact].route-ready .field-row{height:44px}
 .ride-panel[data-content=booking][data-sheet=compact].route-ready .field-button small{font-size:8px;margin-bottom:1px}
 .ride-panel[data-content=booking][data-sheet=compact].route-ready #booking-footer{padding-top:0;padding-bottom:8px}
 .ride-panel[data-content=booking][data-sheet=compact].route-ready .route-fields .map-shortcut{border:0;background:transparent}
 .ride-panel[data-content=booking][data-sheet=compact].route-ready .field-dot:after{height:20px}
 #geo-status{transform:none}
}

@media(max-width:760px) and (orientation:landscape){
 body:has(.ride-panel[data-sheet=peek]) #map{left:0;width:100%}
 body:has(.ride-panel[data-sheet=peek]) .map-top-info{left:12px;max-width:calc(100vw - 24px)}
}

@media(max-width:760px){
 .topbar,[data-theme=dark] .topbar{height:60px;padding-top:6px;padding-bottom:6px}
 .theme-toggle,.account-btn{width:44px;height:44px;flex-shrink:0}
 .role-switch button{min-height:44px}
 .map-top-info,[data-theme=dark] .map-top-info{top:80px}
 .ride-panel[data-content=trip][data-sheet=compact] .driver-panel .dispatch-control{display:none}
 .ride-panel[data-content=trip][data-sheet=compact] .driver-panel .stepper{display:none}
 .ride-panel[data-content=trip][data-sheet=compact] .driver-panel .driver-card{padding:10px;margin:8px 0}
 .ride-panel[data-content=trip][data-sheet=compact] .driver-panel .avatar{width:32px;height:32px}
 .ride-panel[data-content=trip] .trip-line{padding:8px 0}
 [data-theme=dark] .leaflet-tile-pane{filter:invert(1) hue-rotate(180deg) saturate(.22) brightness(1)}
}
@media(max-width:760px) and (max-height:600px){
 .topbar,[data-theme=dark] .topbar{height:56px;top:4px}
 .map-top-info,[data-theme=dark] .map-top-info{top:66px}
}
