/* v39: final, narrowly scoped layout ownership for the mobile sheets. */
body.cc-app {--cc39-surface:var(--cc32-surface,#f8fbff);--cc39-ink:var(--cc32-ink,#183247);--cc39-line:var(--cc32-line,#cfdee8);}
.cc39-handle,.cc39-close {display:none;}
.cc39-scroll {display:contents;}
body.cc-app #sidePanel .cc39-scroll>.hidden,
body.cc-app #sidePanel .cc39-scroll>.panel-card-hidden {display:none!important;}
body.cc-app.cc39-q-open #sidePanel,.cc39-q-sheet.hidden {display:none!important;}
.cc39-q-sheet{display:none;}
@media(max-width:1000px){
 html:has(body.cc-app),body.cc-app{max-width:100%;overflow-x:clip!important;}
 body.cc-app .layout{max-width:100%;min-width:0;}
 body.cc-app.cc39-mobile :is(.left-panel,#sidePanel,#diarioFullscreen,#cc39QSheet).cc39-sheet{
   box-sizing:border-box!important;position:fixed!important;display:grid!important;
   grid-template-rows:44px minmax(0,1fr)!important;
   top:var(--cc39-top,38px)!important;bottom:auto!important;left:8px!important;right:8px!important;
   width:calc(100% - 16px)!important;max-width:calc(100% - 16px)!important;min-width:0!important;
   height:var(--cc39-size,calc(100dvh - 50px))!important;max-height:var(--cc39-size,calc(100dvh - 50px))!important;min-height:0!important;
   margin:0!important;padding:0!important;gap:0!important;align-content:start!important;
   border:1px solid var(--cc39-line)!important;border-radius:24px 24px 20px 20px!important;
   background:var(--cc39-surface)!important;color:var(--cc39-ink)!important;
   transform:translate3d(0,var(--cc39-y,110vh),0)!important;translate:none!important;scale:1!important;
   opacity:1!important;overflow:hidden!important;overscroll-behavior:none!important;
   box-shadow:0 8px 28px #0003!important;z-index:2300!important;
   visibility:hidden!important;pointer-events:none!important;transition:none!important;
 }
 body.cc-app.cc39-mobile :is(.left-panel,#sidePanel,#diarioFullscreen,#cc39QSheet).cc39-active{visibility:visible!important;pointer-events:auto!important;}
 body.cc-app.cc39-mobile .cc39-sheet.cc39-moving{transition:transform .30s cubic-bezier(.22,.8,.25,1)!important;}
 body.cc-app.cc39-mobile .cc39-sheet.cc39-dragging{will-change:transform;user-select:none;}
 body.cc-app.cc39-mobile .cc39-sheet::before{display:none!important;}
 body.cc-app.cc39-mobile .cc39-sheet>.cc39-scroll{
   display:block!important;box-sizing:border-box!important;min-width:0!important;width:100%!important;
   height:100%!important;max-height:var(--cc39-body-size,100%)!important;min-height:0!important;
   margin:0!important;padding:0 12px 16px!important;overflow-x:hidden!important;overflow-y:auto!important;
   overscroll-behavior:contain!important;touch-action:pan-y pinch-zoom;scrollbar-gutter:auto!important;
   -webkit-overflow-scrolling:touch;scroll-padding-block:12px 20px;
 }
 body.cc-app.cc39-mobile .cc39-scroll :is(.panel-section,.app-header,.toolbar,#selectedVehicleCard,.diario-fullscreen-inner){max-width:100%!important;min-width:0!important;box-sizing:border-box!important;margin-left:0!important;margin-right:0!important;}
 body.cc-app.cc39-mobile .cc39-scroll :is(.toolbar,.panel-section){width:100%!important;}
 body.cc-app.cc39-mobile .cc39-scroll :is(input,select,textarea){max-width:100%!important;min-width:0!important;box-sizing:border-box!important;}
 body.cc-app.cc39-mobile .cc39-scroll :is(.toolbar,.panel-section,#selectedVehicleCard){transform:none!important;translate:none!important;}
 body.cc-app.cc39-mobile :is(#closeLeftSheetBtn,#closeRightPanelBtn,#leftSheetHandle,.r38-grip,#diarioBackToMapBtn){display:none!important;}
 body.cc-app.cc39-mobile #ccRoutes38 .r38-header [data-action="close"]{visibility:hidden!important;pointer-events:none!important;}
 body.cc-app.cc39-mobile .cc39-handle{
   display:flex!important;align-items:center!important;justify-content:center!important;
   position:relative!important;box-sizing:border-box;width:100%!important;height:44px!important;min-height:44px!important;
   top:0!important;left:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:22px 22px 0 0!important;
   background:transparent!important;box-shadow:none!important;touch-action:none!important;cursor:ns-resize;z-index:10;
 }
 body.cc-app.cc39-mobile .cc39-handle>span{display:block;width:44px;height:5px;border-radius:8px;background:var(--cc39-ink);opacity:.45;}
 body.cc-app.cc39-mobile .cc39-handle:focus-visible{outline:2px solid #68cfc1;outline-offset:-5px;}
 body.cc-app.cc39-mobile #mobileDock.cc-navigation{transition:opacity .18s ease,translate .24s ease,visibility .24s!important;}
 body.cc-app.cc39-mobile.cc39-sheet-visible #mobileDock.cc-navigation,
 body.cc-app.cc39-mobile.cc38-map-pick #mobileDock.cc-navigation{
   visibility:hidden!important;pointer-events:none!important;opacity:0!important;translate:0 130%!important;
 }
 body.cc-app.cc39-sheet-visible :is(#tripActiveMini:not(.docked),#tripMiniRestoreBtn,#plannedRouteMini,.r38-mini-result){visibility:hidden!important;pointer-events:none!important;}
 body.cc-app.cc39-mobile.mode-diario .layout{display:grid!important;visibility:visible!important;}
 body.cc-app.cc39-mobile #diarioFullscreen .diario-fullscreen-inner{width:100%!important;padding:4px 0 16px!important;}
 body.cc-app.cc39-mobile #diarioFullscreen :is(.diario-fullscreen-header,.diario-summary){margin-top:0!important;}
 body.cc-app.cc39-mobile #diarioFullscreen{background:var(--cc39-surface)!important;}
 body.cc-app.cc39-mobile #diarioFullscreen h1{font-size:22px!important;line-height:1.25!important;margin:0 0 14px!important;}
 body.cc-app.cc39-mobile #sidePanel .cc39-scroll>.panel-card-reveal{animation:none!important;}
 body.cc-app.cc39-mobile #ccRoutes38 .r38-header{padding-top:0!important;}
 body.cc-app.cc39-mobile.cc-calc-editing #sidePanel.cc39-sheet{grid-template-rows:0 minmax(0,1fr)!important;}
 body.cc-app.cc39-mobile.cc-calc-editing #sidePanel>.cc39-handle{visibility:hidden!important;height:0!important;min-height:0!important;}
 body.cc-app.cc39-mobile.cc-calc-editing #sidePanel>.cc39-scroll{max-height:100%!important;padding-top:12px!important;}
}
/* Moving Q cards use a generous stage; clip only at the physical screen, not at card edges. */
body.cc-q-app{overflow-x:clip!important;}
body.cc-q-app .q-pages:is(.q-pager-dragging,.q-pager-animating),
body.cc-app #cc39QSheet .q-pages:is(.q-pager-dragging,.q-pager-animating){overflow:visible!important;perspective:none!important;isolation:isolate;}
body.cc-q-app .q-pages{padding-block:8px 18px!important;}
body.cc-q-app .q-pages>.q-panel{backface-visibility:hidden;}
body.cc-q-app .q-telegraph{overflow:visible!important;}
body.cc-q-app .q-telegraph .q-dial-label{max-width:126px;}
@media(prefers-reduced-motion:reduce){body.cc-app.cc39-mobile .cc39-sheet.cc39-moving,body.cc-app.cc39-mobile #mobileDock.cc-navigation{transition:none!important;}}
/* Q inside the mobile map uses the same controls, identifiers and calculation state. */
body.cc-app #cc39QSheet{--q-ink:var(--cc39-ink);--q-muted:var(--cc32-muted,#aac0d0);--q-good:#60d8be;--q-accent:#60d8be;}
body.cc-app #cc39QSheet .cc39-q-body{min-height:100%;font:14px/1.4 system-ui,sans-serif;color:var(--cc39-ink);}
body.cc-app #cc39QSheet .cc39-q-header h2{font:750 21px/1.3 system-ui,sans-serif;margin:2px 0 12px;}
body.cc-app #cc39QSheet .cc39-q-vehicle{display:flex;gap:10px;align-items:center;justify-content:space-between;border:1px solid var(--cc39-line);border-radius:16px;padding:12px;margin-bottom:8px;background:var(--cc32-soft,#173247);}
body.cc-app #cc39QSheet .cc39-q-vehicle>div{display:grid;gap:3px;min-width:0;}
body.cc-app #cc39QSheet .cc39-q-vehicle strong{font-size:16px;overflow-wrap:anywhere;}
body.cc-app #cc39QSheet .cc39-q-vehicle small{font-size:12px;color:var(--q-muted);}
body.cc-app #cc39QSheet .cc39-q-vehicle button,body.cc-app #cc39QSheet #cc39Locate{padding:8px;min-height:44px;min-width:44px;background:transparent;color:var(--cc39-ink);border:0;box-shadow:none;font:600 13px/1.3 system-ui;}
body.cc-app #cc39QSheet .q-telegraph{position:relative;display:block;width:100%;height:76px;margin:0 0 4px;overflow:visible;}
body.cc-app #cc39QSheet .q-pages{position:relative;min-width:0;padding:8px 0 20px;overflow:visible;}
body.cc-app #cc39QSheet .q-panel{margin:0!important;min-width:0;box-sizing:border-box;}
body.cc-app #cc39QSheet .q-panel:not(.active){display:none;}
body.cc-app #cc39QSheet .q-panel.active{display:block;}
body.cc-app #cc39QSheet .q-pages:is(.q-pager-dragging,.q-pager-animating)>.q-panel{pointer-events:none!important;will-change:transform;}
body.cc-app #cc39QSheet .q-page-dots{position:absolute;bottom:0;left:50%;transform:translateX(-50%);height:4px;display:flex;gap:5px;align-items:center;}
body.cc-app #cc39QSheet .q-page-dots i{height:3px;background:var(--q-good);border-radius:4px;}
body.cc-app #cc39QSheet :is(#tripModePanel,#calculatorCard){display:block!important;margin:0!important;width:100%!important;max-width:100%!important;min-width:0!important;padding:12px!important;background:var(--cc39-surface)!important;}
body.cc-app #cc39QSheet .cc39-price-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin-top:12px;}
body.cc-app #cc39QSheet .cc39-price-grid>div{display:grid;gap:5px;padding:12px;border-radius:12px;border:1px solid var(--cc39-line);}
body.cc-app #cc39QSheet .cc39-price-grid strong{font-size:23px;color:var(--q-good);}
body.cc-app #cc39QSheet #cc39NearPage{border:1px solid var(--cc39-line);padding:14px;border-radius:18px;background:var(--cc39-surface);}
body.cc-app #cc39QSheet #cc39NearResult h3{font-size:17px;line-height:1.4;margin:8px 0;}
body.cc-app #cc39QSheet .cc39-near-heading{display:flex;justify-content:space-between;align-items:center;}
body.cc-app #cc39QSheet .cc39-near-heading h3{margin:0;font-size:20px;}
body.cc-app #cc39QSheet .cc39-q-muted{font-size:13px;color:var(--q-muted);}
body.cc-app #cc39QSheet .trip-running-copy{display:none;}
body.cc-app.cc39-q-open.cc-calc-editing #cc39QSheet{grid-template-rows:0 minmax(0,1fr)!important;}
body.cc-app.cc39-q-open.cc-calc-editing #cc39QSheet>.cc39-handle{height:0!important;min-height:0!important;visibility:hidden!important;}
body.cc-app.cc39-q-open.cc-calc-editing #cc39QSheet>.cc39-scroll{max-height:100%!important;padding-top:12px!important;}
body.cc-app.cc39-q-open.cc-calc-editing #cc39QSheet :is(.cc39-q-header,.cc39-q-vehicle,.q-telegraph){display:none!important;}
body.cc-app.cc39-q-open.cc-calc-editing #cc39QSheet .cc-calc-heading{display:none!important;}
body.cc-app #cc39QSheet .cc39-q-vehicle{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;}
body.cc-app #cc39QSheet .cc39-q-vehicle>div{min-width:0!important;width:auto!important;display:grid!important;}
body.cc-app #cc39QSheet #cc39VehicleName,body.cc-app #cc39QSheet #cc39VehicleMeta{width:auto!important;white-space:normal!important;}
body.cc-app #cc39QSheet #calculatorCard :is(.cc-calc-heading,.cc-calc-vehicle){display:none!important;}
body.cc-app #cc39QSheet #cc39QPager{padding:8px 0 24px;}
body.cc-app #cc39QSheet .q-panel{touch-action:pan-y pinch-zoom;}
@media(max-width:920px){
 body.cc-app #cc39QSheet>.cc39-scroll{padding-left:0!important;padding-right:0!important;}
 body.cc-app #cc39QSheet .cc39-q-body{padding-left:12px;padding-right:12px;}
 body.cc-app #cc39QSheet .cc39-q-vehicle button{max-width:82px!important;}
}
/* A permanent desktop sidebar has nothing to dismiss. */
@media(min-width:921px){body.cc-app #closeLeftSheetBtn{display:none!important;}}
html[data-theme="light"] body.cc-app #cc39QSheet{--q-good:#08786a;--q-accent:#08786a;}
