/* One cockpit, one detail sheet. Loaded after legacy rules intentionally. */
:root{--rev-cockpit-bottom:132px;--rev-cockpit-top:112px;--rev-blue:#0866ff}
#revCockpitTools{display:none}#revEnergySheet[hidden]{display:none!important}
#revEnergySheet{position:fixed;inset:14px 10px calc(10px + env(safe-area-inset-bottom));z-index:9000;background:#fff;border:1px solid #dce7f4;border-radius:24px;box-shadow:0 16px 60px #10294b33;overflow:hidden;display:flex;flex-direction:column;direction:rtl}
.rev-sheet-heading{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #e5edf6;color:#142e4d;font:700 14px Tahoma,sans-serif;gap:10px}
.rev-sheet-heading button{border:0;border-radius:12px;background:#edf4ff;color:#0758ce;padding:10px 12px;font:700 12px Tahoma;min-height:44px;cursor:pointer}
#revEnergySheet iframe{width:100%;flex:1;min-height:0;border:0;background:#f6f9fd}
body.rev-navigating #map{transform:none!important}/* A popup remains upright and tappable. */
body.rev-navigating #navBanner{top:calc(8px + env(safe-area-inset-top))!important;left:10px!important;right:10px!important;width:auto!important;min-height:78px!important;max-height:100px!important;padding:10px 14px!important;border-radius:20px!important;z-index:3000!important;box-shadow:0 5px 24px #12365b18!important;overflow:hidden!important}
body.rev-navigating #navBanner .nav-maneuver-icon{width:48px!important;height:48px!important;flex-basis:48px!important;background:#0866ff!important;color:#fff!important;border-radius:15px!important}
body.rev-navigating #navInstr{font-size:clamp(15px,4vw,20px)!important;line-height:1.4!important}
body.rev-navigating #navNext{display:none!important}
body.rev-navigating #navDash{left:10px!important;right:10px!important;bottom:calc(8px + env(safe-area-inset-bottom))!important;width:auto!important;max-height:min(48dvh,280px)!important;min-height:0!important;transform:none!important;padding:10px 12px!important;border-radius:22px!important;overflow:auto!important;z-index:3000!important;box-shadow:0 6px 30px #12365b1f!important}
body.rev-navigating .rev-nav-live-pill,body.rev-navigating .rev-nav-progress,body.rev-navigating .rev-right-buttons,body.rev-navigating #routeSettingsToggle,body.rev-navigating .rev-weather,body.rev-navigating .map-top-widgets,body.rev-navigating #revAddStationBtn,body.rev-navigating .bottom-nav,body.rev-navigating #rev-app-bottom-nav{display:none!important}
body.rev-navigating .rev-nav-destination-row{margin-bottom:5px!important}
body.rev-navigating .rev-nav-destination-row>strong{max-width:100%!important;font-size:11px!important;color:#64748b!important}
body.rev-navigating .nav-stat{min-height:45px!important;background:transparent!important;border:0!important}
body.rev-navigating .nav-stat b{font-size:19px!important;color:#152e4c!important}
body.rev-navigating .nav-dash-btns button{width:40px!important;height:44px!important;min-width:40px!important;border-radius:13px!important}
body.rev-navigating #revCockpitTools{position:fixed;display:flex;flex-direction:column;gap:8px;right:10px;top:calc(var(--rev-cockpit-top) + 6px);z-index:3001}
#revCockpitTools button{border:1px solid #e1eaf5;border-radius:16px;background:#fff;color:#1556a4;width:48px;min-height:48px;box-shadow:0 3px 14px #15365915;display:grid;place-items:center;gap:0;padding:4px;cursor:pointer}#revCockpitTools button span{font-size:21px;line-height:1.1}#revCockpitTools small{font:9px Tahoma}
body.rev-navigating #rev-live-energy-advice,body.rev-navigating #revMusicPanel,body.rev-navigating #tripLivePanel,body.rev-navigating #groupTripPanel,body.rev-navigating #routeSettingsPanel,body.rev-navigating #details-panel,body.rev-navigating #routePanel{position:fixed!important;left:10px!important;right:10px!important;top:auto!important;bottom:calc(var(--rev-cockpit-bottom) + 80px)!important;width:auto!important;max-width:none!important;margin:0!important;max-height:min(42dvh,340px)!important;min-height:0!important;height:auto!important;overflow:auto!important;border-radius:20px!important;z-index:3200!important;background:#fff!important;box-shadow:0 8px 36px #102a3d24!important}
body.rev-navigating #revEnergySheet{top:var(--rev-cockpit-top)!important;bottom:calc(var(--rev-cockpit-bottom) + 8px)!important;max-height:none!important;z-index:4000}
body.rev-navigating[data-rev-sheet] #revCockpitTools{visibility:hidden}
#revJourneyStrip{display:none;direction:rtl;font-family:Vazirmatn,Tahoma,sans-serif}
body.rev-navigating #revJourneyStrip{position:fixed;left:10px;right:10px;bottom:var(--rev-cockpit-bottom);z-index:3000;display:block;background:#fff;border:1px solid #dce8f6;border-radius:18px;box-shadow:0 5px 20px #12365b18;padding:8px 10px}
.rev-journey-heading{display:flex;justify-content:space-between;gap:8px;font-size:10px;color:#64748b;margin-bottom:6px}.rev-journey-heading strong{color:#145ac3}.rev-journey-stops{display:flex;gap:7px;overflow-x:auto;overscroll-behavior:contain;scrollbar-width:none}.rev-journey-stops button{flex:0 0 auto;max-width:210px;border:1px solid #dce7f4;border-radius:11px;background:#f7faff;color:#254464;text-align:right;padding:7px 10px;font:11px Tahoma;min-height:44px}.rev-journey-stops button[data-next]{border-color:#0866ff;background:#edf4ff;color:#0758ce}.rev-journey-stops small{display:block;font-size:9px;margin-top:3px}.rev-journey-stops .rev-empty{font:11px Tahoma;color:#64748b;padding:5px}
body.rev-navigating .leaflet-popup{rotate:0deg!important;z-index:3500!important}body.rev-navigating .leaflet-popup-content-wrapper{border-radius:18px;box-shadow:0 6px 28px #10294b33}body.rev-navigating .leaflet-popup-content{max-height:28dvh;overflow:auto;font-size:12px;line-height:1.9}body.rev-navigating .leaflet-popup-close-button{width:36px!important;height:36px!important;font-size:26px!important}body.rev-navigating .leaflet-popup-pane{z-index:900!important}
body.rev-navigating .rev-energy-background-pin{opacity:.45!important;filter:grayscale(1)!important}body.rev-navigating .rev-chain-stop,body.rev-navigating .rev-plan-stop{opacity:1!important;filter:none!important}body.rev-navigating .rev-nav-arrow-wrap{opacity:1!important;filter:none!important}
@media(min-width:700px){body.rev-navigating #navBanner{right:16px!important;left:auto!important;width:380px!important}body.rev-navigating #navDash{left:16px!important;right:auto!important;width:390px!important}body.rev-navigating #revJourneyStrip{left:16px;right:auto;width:390px}body.rev-navigating #revCockpitTools{right:16px}body.rev-navigating #revEnergySheet{left:16px!important;right:auto!important;width:min(470px,calc(100vw - 32px))!important;top:16px!important}body.rev-navigating #rev-live-energy-advice,body.rev-navigating #revMusicPanel,body.rev-navigating #tripLivePanel,body.rev-navigating #routeSettingsPanel,body.rev-navigating #details-panel{width:390px!important;left:16px!important;right:auto!important}}
@media(max-height:500px) and (max-width:699px){body.rev-navigating #navBanner{right:70px!important;left:10px!important;max-width:45vw!important}body.rev-navigating #navDash{left:10px!important;right:auto!important;width:45vw!important}body.rev-navigating #revJourneyStrip{left:auto;right:10px;width:45vw;bottom:8px}body.rev-navigating #revEnergySheet{top:8px!important;bottom:8px!important;left:auto!important;right:8px!important;width:50vw!important}}
@media(prefers-reduced-motion:reduce){body.rev-navigating *{animation:none!important;transition:none!important}}
body.rev-navigating #navBanner{display:grid!important;grid-template-columns:48px 1fr!important;gap:6px 12px!important;max-height:132px!important;min-height:104px!important}
#revEnergyLine{grid-column:1/-1;display:block;width:100%;border:0;border-top:1px solid #e4edf8;border-radius:0;background:transparent;color:#0758ce;text-align:right;padding:8px 0 0;font:700 11px Tahoma;min-height:30px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer}#revEnergyLine[data-kind="bad"]{color:#b42318}#revEnergyLine[data-kind="warn"]{color:#946100}

#revCockpitTools svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}#revCockpitTools button:active{background:#edf4ff;transform:scale(.97)}button:focus-visible,a:focus-visible{outline:3px solid #8fbaff;outline-offset:3px}
body.rev-navigating .leaflet-marker-icon{rotate:0deg!important}
/* Approved direction: blue guidance, map-first white cockpit. */
body.rev-navigating #navBanner{background:linear-gradient(125deg,#0866ff,#0756db)!important;border:1px solid #3685ff!important;color:white!important;box-shadow:0 6px 24px #0854b52b!important;border-radius:22px!important}
body.rev-navigating #navDist,body.rev-navigating #navInstr{color:#fff!important}body.rev-navigating #navBanner .nav-maneuver-icon{background:#ffffff20!important;border:1px solid #ffffff24!important}body.rev-navigating #revEnergyLine{color:white!important;border-top-color:#ffffff30!important}body.rev-navigating #revEnergyLine[data-kind="bad"]{background:#fff2ee!important;color:#9b2919!important;border-radius:9px;padding:7px!important}body.rev-navigating #revEnergyLine[data-kind="warn"]{color:#fff2c2!important}
.rev-stop-accept,.rev-stop-reject{display:block;width:100%;min-height:44px;border-radius:12px;padding:10px 14px;font:700 12px Tahoma;cursor:pointer;margin-top:8px}.rev-stop-accept{border:1px solid #0866ff;background:#0866ff;color:#fff}.rev-stop-reject{border:1px solid #dbe5f1;background:#fff;color:#405572}
body.rev-navigating #revPinSheet{position:fixed;left:10px;right:10px;bottom:calc(var(--rev-cockpit-bottom) + 80px);max-height:36dvh;overflow:auto;z-index:3300;background:#fff;border:1px solid #dae6f5;border-radius:20px;box-shadow:0 8px 30px #15375725;padding:14px;direction:rtl;font:12px/1.8 Tahoma}
#revPinSheet[hidden]{display:none!important}#revPinSheet>button{float:left;border:0;background:#edf4ff;color:#0758ce;border-radius:10px;min-width:44px;min-height:44px;font-size:24px;margin-right:6px}
body.rev-navigating #revMusicToggle{display:none!important}
body.rev-navigating .rev-journey-stops button[data-unavailable]{border-color:#ce4632;background:#fff3ef;color:#9b2919}body.rev-navigating .rev-journey-stops button[data-passed]{opacity:.65}
@media(min-width:700px){body.rev-navigating #revPinSheet{left:16px;right:auto;width:390px;bottom:calc(var(--rev-cockpit-bottom) + 80px)}}
.rev-route-energy-summary{display:block;margin-top:5px;font:10px/1.7 Tahoma;color:#526b88}.route-choice.rev-energy-best{border-color:#0866ff!important}.route-choice.rev-energy-best:after{content:'پیشنهاد انرژی';font:700 9px Tahoma;color:#0866ff;display:block;margin-top:4px}
body.rev-navigating #navBanner,body.rev-navigating #navDash{position:fixed!important}
body.rev-navigating #navDash{background:rgba(255,255,255,.98)!important;border:1px solid #dce7f5!important;color:#183451!important;box-shadow:0 6px 24px #12365b22!important}
.nav-stat b{direction:ltr;unicode-bidi:isolate}.rev-journey-stops button{font-size:12px!important}.rev-journey-stops small{font-size:10px!important}#revEnergyLine{font-size:12px!important}
#revToolsSheet[hidden]{display:none!important}#revToolsSheet{position:fixed;z-index:3400;left:10px;right:10px;bottom:calc(var(--rev-cockpit-bottom) + 80px);padding:12px;background:#fff;border:1px solid #dae6f5;border-radius:20px;box-shadow:0 6px 30px #15375725;display:grid;grid-template-columns:repeat(2,1fr);gap:8px;direction:rtl}#revToolsSheet>button{display:flex;align-items:center;justify-content:center;gap:10px;min-height:48px;border:1px solid #e0e9f5;border-radius:13px;background:#f5f9ff;color:#1556a4;font:700 13px Tahoma;cursor:pointer}#revToolsSheet>button:first-child{grid-column:1/-1;min-height:38px;background:#fff}#revToolsSheet svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}#revToolsSheet small{font:700 12px Tahoma}#revCockpitTools button{font-size:24px;min-height:48px}
body.rev-navigating #navCenterBtn{display:none!important}
@media(min-width:700px){#revToolsSheet{left:16px;right:auto;width:390px}}
body.rev-navigating .leaflet-control-container{rotate:0deg!important}
body.rev-navigating #navBanner,body.rev-navigating #navDash,body.rev-navigating #revJourneyStrip,body.rev-navigating #revEnergySheet,body.rev-navigating #revPinSheet,#revToolsSheet{box-sizing:border-box!important}
body.rev-navigating .leaflet-marker-icon:not(.rev-chain-stop):not(.rev-plan-stop):not(.rev-nav-arrow-wrap):not(.rev-live-car-marker){filter:grayscale(1)!important;opacity:.35!important}
@media(min-width:700px){body.rev-navigating #navBanner{width:min(380px,calc(50vw - 24px))!important}body.rev-navigating #navDash,body.rev-navigating #revJourneyStrip,body.rev-navigating #revPinSheet,#revToolsSheet{width:min(390px,calc(50vw - 24px))!important}body.rev-navigating #revEnergySheet{width:min(470px,calc(50vw - 24px))!important}}
