/* Mappa fullscreen, bottom sheet e localizzazione live. */
.booking-screen{position:relative!important}
.booking-screen .control-panel{transition:transform .34s cubic-bezier(.22,.8,.24,1),border-radius .25s ease!important;will-change:transform}
.booking-screen .control-panel>div#bookingPanelContent{display:contents}
.sheet-toggle{position:relative;width:100%;height:40px;margin:0 0 2px;padding:10px 13px 5px;display:flex;align-items:center;justify-content:flex-end;gap:6px;border:0;background:transparent;color:#667169;font:850 9px/1 -apple-system,BlinkMacSystemFont,"SF Pro Text",Inter,sans-serif;letter-spacing:.15px}
.sheet-grabber{position:absolute;top:7px;left:50%;width:42px;height:5px;transform:translateX(-50%);border-radius:8px;background:#c8d0cb;box-shadow:inset 0 1px #fff}
.sheet-toggle svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;transition:transform .28s ease}
html[data-theme="dark"] .sheet-toggle{color:#a4b0a8}html[data-theme="dark"] .sheet-grabber{background:#526059;box-shadow:none}
.locate-btn svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round}
.location-open{flex:0 0 auto;width:36px;height:36px;display:grid;place-items:center;border:1px solid #d7e2d9;border-radius:50%;background:rgba(255,255,255,.78);color:#4cae12;box-shadow:0 5px 16px rgba(38,73,44,.1)}
.location-open svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
html[data-theme="dark"] .location-open{border-color:#334038;background:#121a14;color:#a1f450}
.map-route-actions{display:none;position:absolute;z-index:610;top:max(112px,calc(env(safe-area-inset-top) + 84px));left:12px;right:12px;gap:7px}
.map-route-actions button{min-width:0;height:58px;padding:8px 11px;display:flex;align-items:center;gap:10px;border:1px solid rgba(255,255,255,.72);border-radius:18px;background:rgba(250,253,250,.9);color:#162019;text-align:left;box-shadow:0 12px 32px rgba(22,42,28,.2),inset 0 1px #fff;backdrop-filter:blur(20px) saturate(1.4);-webkit-backdrop-filter:blur(20px) saturate(1.4)}
.map-route-actions button>i{width:12px;height:12px;flex:0 0 12px;border:3px solid #253129;border-radius:50%;background:#fff}.map-route-actions button>i.destination{border:0;background:#8bea24;box-shadow:0 0 0 3px #fff,0 0 12px #77dd1e}
.map-route-actions button>span{min-width:0;flex:1}.map-route-actions small,.map-route-actions b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.map-route-actions small{color:#768079;font-size:8px}.map-route-actions b{margin-top:3px;font-size:12px}.map-route-actions svg{width:16px;height:16px;fill:none;stroke:#6c766f;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
html[data-theme="dark"] .map-route-actions button{border-color:rgba(157,244,79,.25);background:rgba(9,15,11,.9);color:#f6faf7;box-shadow:0 14px 34px rgba(0,0,0,.45),inset 0 1px rgba(255,255,255,.08)}
.driver-live-chip{position:absolute;z-index:680;left:12px;bottom:72px;max-width:calc(100% - 82px);height:53px;padding:6px 10px 6px 7px;align-items:center;gap:8px;border:1px solid rgba(180,255,88,.76);border-radius:18px;background:rgba(8,17,10,.9);color:#fff;text-align:left;box-shadow:0 10px 28px rgba(0,0,0,.4),0 0 20px rgba(117,226,27,.2);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.driver-live-chip:not([hidden]){display:flex}.driver-live-chip>i{width:36px;height:36px;flex:0 0 36px;border-radius:13px;background:radial-gradient(circle at 50% 34%,#c7ff59,#68cf00 55%,#173306);box-shadow:0 0 14px rgba(139,240,42,.45)}.driver-live-chip>i:after{content:"";display:block;width:24px;height:12px;margin:12px auto 0;border-radius:7px 8px 4px 4px;background:#102007;box-shadow:inset 0 2px #aaff50}
.driver-live-chip span{min-width:0;flex:1}.driver-live-chip b,.driver-live-chip small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.driver-live-chip b{font-size:11px}.driver-live-chip small{margin-top:2px;color:#c4d1c7;font-size:8px}.driver-live-chip strong{color:#a7f64b;font-size:8px;letter-spacing:.8px}.driver-live-chip.stale{border-color:#766c46}.driver-live-chip.stale strong{color:#e4b95e}
.booking-screen.sheet-collapsed{height:var(--app-height,100dvh)!important;min-height:var(--app-height,100dvh)!important;overflow:hidden!important;scroll-snap-align:start!important}
.booking-screen.sheet-collapsed>.map-stage{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:100%!important;max-height:none!important;flex:none!important}
.booking-screen.sheet-collapsed>.control-panel{position:absolute!important;z-index:900!important;left:0!important;right:0!important;bottom:0!important;height:auto!important;max-height:calc(100% - 66px)!important;margin:0!important;padding-top:0!important;overflow:hidden!important;transform:translate3d(0,calc(100% - 56px),0)!important;border-radius:26px 26px 0 0!important;box-shadow:0 -12px 34px rgba(0,0,0,.18)!important}
.booking-screen.sheet-collapsed>.control-panel #bookingPanelContent{pointer-events:none!important}
.booking-screen.sheet-collapsed .sheet-toggle{height:56px!important;margin:0!important;padding:14px 15px 8px!important;pointer-events:auto!important}.booking-screen.sheet-collapsed .sheet-toggle svg{transform:rotate(180deg)}
.booking-screen.sheet-collapsed .map-route-actions{display:grid;animation:mapActionsIn .3s .12s both}.booking-screen.sheet-collapsed .map-status{bottom:76px!important}.booking-screen.sheet-collapsed .locate-btn{bottom:76px!important}.booking-screen.sheet-collapsed .driver-live-chip{bottom:76px}
body.map-picking #map{cursor:crosshair}body.map-picking .map-route-actions{opacity:.45;pointer-events:none}
@keyframes mapActionsIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}
.location-dialog{width:min(94%,430px)!important;max-height:min(82dvh,680px);padding:0!important;overflow:hidden;border:1px solid rgba(255,255,255,.82)!important;border-radius:28px!important;background:linear-gradient(180deg,#fbfdfb,#eef4ef)!important;color:#142019!important;box-shadow:0 32px 90px rgba(0,0,0,.36)!important}
.location-dialog::backdrop{background:rgba(3,8,5,.56);backdrop-filter:blur(9px);-webkit-backdrop-filter:blur(9px)}
.location-dialog form{padding:23px 16px 15px!important;overflow:auto;max-height:min(82dvh,680px)}.location-close{position:absolute;right:14px;top:13px;width:35px;height:35px;border:1px solid #d3ded5;border-radius:50%;background:#fff;color:#3d4b41;font-size:22px;line-height:1}.location-kicker{display:block;color:#52b712;font-size:8px;font-weight:950;letter-spacing:1.1px}.location-dialog h2{margin:7px 43px 14px 0!important;color:#142019!important;font-size:25px!important;letter-spacing:-.8px}
.location-search-wrap{height:52px;margin:0!important;padding:0 13px;display:flex!important;align-items:center;gap:10px;border:1px solid #cddacf;border-radius:17px;background:#fff;box-shadow:0 8px 24px rgba(35,65,40,.08)}.location-search-wrap svg{width:20px;height:20px;fill:none;stroke:#68756c;stroke-width:1.8;stroke-linecap:round}.location-search-wrap input{height:48px!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;color:#142019!important;font-size:14px!important;box-shadow:none!important}
.location-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:9px}.location-actions button{min-width:0;height:63px;padding:8px;display:flex;align-items:center;gap:8px;border:1px solid #d2dfd4;border-radius:17px;background:rgba(255,255,255,.8);color:#17221a;text-align:left}.location-actions svg{width:23px;height:23px;flex:0 0 23px;fill:none;stroke:#5bbf18;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.location-actions span{min-width:0}.location-actions b,.location-actions small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-actions b{font-size:11px}.location-actions small{margin-top:3px;color:#7a877e;font-size:8px}
.location-results{display:grid;gap:5px;margin-top:10px}.location-results>button{width:100%;min-height:52px;padding:7px 6px;display:flex;align-items:center;gap:9px;border:0;border-bottom:1px solid #dbe4dc;background:transparent;color:#17221a;text-align:left}.location-results>button>i{width:35px;height:35px;flex:0 0 35px;display:grid;place-items:center;border-radius:12px;background:#e5f8d8;color:#58b614}.location-results>button>i svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.location-results>button>span{min-width:0;flex:1}.location-results b,.location-results small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-results b{font-size:12px}.location-results small{margin-top:3px;color:#7a867e;font-size:9px}.location-results strong{color:#7a867e;font-size:23px;font-weight:400}.location-status{min-height:14px;margin:7px 0 0!important;color:#718078!important;text-align:center;font-size:9px!important}
html[data-theme="dark"] .location-dialog{border-color:#33443a!important;background:linear-gradient(180deg,#101712,#070b08)!important;color:#f4f8f5!important}html[data-theme="dark"] .location-dialog h2{color:#f4f8f5!important}html[data-theme="dark"] .location-close,html[data-theme="dark"] .location-search-wrap,html[data-theme="dark"] .location-actions button{border-color:#2c3a31;background:#141c16;color:#f4f8f5}html[data-theme="dark"] .location-search-wrap input{color:#fff!important}html[data-theme="dark"] .location-results>button{border-color:#26322a;color:#f4f8f5}html[data-theme="dark"] .location-results>button>i{background:#19300f;color:#94ef43}
.driver-live-marker-host{background:none!important;border:0!important}.driver-live-marker{position:relative;width:66px;height:52px;filter:drop-shadow(0 7px 10px rgba(0,0,0,.45))}.driver-live-marker:before{content:"";position:absolute;left:18px;bottom:3px;width:30px;height:12px;border-radius:50%;background:rgba(120,239,28,.48);filter:blur(8px);animation:driverPulse 1.4s ease-in-out infinite}.driver-live-marker>i{position:absolute;z-index:-1;left:13px;top:1px;width:40px;height:40px;border:2px solid rgba(143,244,52,.7);border-radius:50%;animation:driverRing 1.8s ease-out infinite}.driver-live-marker svg{position:absolute;z-index:2;left:1px;top:4px;width:64px;height:38px;overflow:visible}.driver-live-marker svg .body{fill:#a8f53f;stroke:#edffd1;stroke-width:1.5}.driver-live-marker svg .glass{fill:#153321}.driver-live-marker svg circle{fill:#071009;stroke:#baff5d;stroke-width:2}.driver-live-marker>b{position:absolute;z-index:3;left:50%;bottom:0;transform:translateX(-50%);padding:3px 6px;border-radius:7px;background:#101b0d;color:#b9ff61;font:950 7px/1 system-ui;letter-spacing:.7px}.driver-live-marker.stale{filter:grayscale(.45) drop-shadow(0 7px 10px rgba(0,0,0,.45))}.driver-live-marker.stale:before,.driver-live-marker.stale>i{animation:none;opacity:.3}
@keyframes driverRing{0%{transform:scale(.55);opacity:.9}100%{transform:scale(1.5);opacity:0}}@keyframes driverPulse{50%{opacity:.35;transform:scale(1.25)}}
@media(max-width:360px){.map-route-actions{top:100px}.map-route-actions button{height:54px}.location-actions{grid-template-columns:1fr}.location-dialog h2{font-size:22px!important}}
@media(prefers-reduced-motion:reduce){.booking-screen .control-panel,.sheet-toggle svg,.driver-live-marker:before,.driver-live-marker>i{transition:none!important;animation:none!important}}

/* Partenza e destinazione sono un solo blocco funzionale: entrambe restano visibili. */
.booking-screen .route-card{overflow:visible!important;border:1px solid #d2ded4!important;background:#fff!important;box-shadow:0 12px 34px rgba(24,51,31,.13),inset 0 1px #fff!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
.booking-screen .route-row{display:flex!important;min-height:64px;background:#fff!important}
.booking-screen .route-line{display:block!important;background:#8bea24!important;opacity:.8}
html[data-theme="dark"] .booking-screen .route-card{border-color:#344139!important;background:#101612!important;box-shadow:0 14px 38px rgba(0,0,0,.42)!important}
html[data-theme="dark"] .booking-screen .route-row{background:#101612!important}

.location-dialog form{display:flex;min-height:0;flex-direction:column;overflow:hidden!important}
.location-route-pair{position:relative;flex:0 0 auto;margin:0 0 11px;padding:5px;border:1px solid #cedbd0;border-radius:20px;background:#fff;box-shadow:0 10px 28px rgba(28,59,36,.1)}
.location-route-pair button{position:relative;z-index:2;width:100%;min-height:60px;padding:8px 10px;display:flex;align-items:center;gap:10px;border:1px solid transparent;border-radius:15px;background:#fff;color:#17221a;text-align:left;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}
.location-route-pair button.active{border-color:#82df29;background:#f4ffe9;box-shadow:0 0 0 2px rgba(126,222,34,.13)}
.location-route-pair button>i{width:14px;height:14px;flex:0 0 14px;border:3px solid #27332b;border-radius:50%;background:#fff}
.location-route-pair button>i.destination{border:0;background:#86e826;box-shadow:0 0 0 3px #fff,0 0 0 4px #86e826}
.location-route-pair button>span{min-width:0;flex:1}.location-route-pair small,.location-route-pair b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-route-pair small{color:#758178;font-size:8px;font-weight:750}.location-route-pair b{margin-top:4px;color:inherit;font-size:12px}.location-route-pair button>strong{color:#7a867e;font-size:20px;font-weight:500}
.location-route-connector{position:absolute;z-index:3;left:16px;top:61px;width:3px;height:14px;border-radius:4px;background:#80e422;pointer-events:none}
.location-dialog .location-search-wrap,.location-dialog .location-actions,.location-dialog .location-status{flex:0 0 auto}.location-dialog .location-results{min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
html[data-theme="dark"] .location-route-pair{border-color:#35443a;background:#101612;box-shadow:0 12px 30px rgba(0,0,0,.3)}
html[data-theme="dark"] .location-route-pair button{background:#101612;color:#f4f8f5}html[data-theme="dark"] .location-route-pair button.active{border-color:#82df29;background:#182513}html[data-theme="dark"] .location-route-pair button>i.destination{box-shadow:0 0 0 3px #101612,0 0 0 4px #86e826}

@media(max-width:599px){
  .location-dialog{width:calc(100% - 16px)!important;max-height:min(92dvh,700px)!important}
  .location-dialog form{max-height:min(92dvh,700px)!important;padding:17px 12px 10px!important}
  .location-dialog h2{margin-bottom:9px!important;font-size:22px!important}
  .location-route-pair{margin-bottom:8px}.location-route-pair button{min-height:57px}.location-route-connector{top:58px;height:13px}
  .location-dialog .location-results{max-height:30dvh}
}


/* Freccia animata: indica di tirare su lo sheet */
.sheet-pull-hint{
  position:absolute;left:50%;top:18px;z-index:2;
  width:28px;height:28px;margin-left:-14px;
  display:none;pointer-events:none;
}
.booking-screen.sheet-collapsed .sheet-pull-hint{display:block}
.sheet-pull-hint i{
  position:absolute;left:50%;top:50%;
  width:14px;height:14px;margin:-7px 0 0 -7px;
  border:solid #8cf000;border-width:0 3px 3px 0;
  border-radius:2px;
  transform:rotate(-135deg);
  opacity:0;
  box-shadow:0 0 12px rgba(140,240,0,.45);
  animation:sheetPullArrow 1.6s cubic-bezier(.22,.8,.24,1) infinite;
}
.sheet-pull-hint i:nth-child(2){animation-delay:.28s;opacity:0}
html:not([data-theme="dark"]) .sheet-pull-hint i{
  border-color:#4cae12;
  box-shadow:0 0 10px rgba(76,174,18,.35);
}
@keyframes sheetPullArrow{
  0%{transform:translateY(10px) rotate(-135deg);opacity:0}
  28%{opacity:1}
  55%{transform:translateY(-6px) rotate(-135deg);opacity:.95}
  100%{transform:translateY(-14px) rotate(-135deg);opacity:0}
}
/* Glow leggero sul grabber quando collassato */
.booking-screen.sheet-collapsed .sheet-grabber{
  background:#8cf000!important;
  box-shadow:0 0 0 4px rgba(140,240,0,.18),0 0 16px rgba(140,240,0,.45)!important;
  animation:sheetGrabberPulse 1.6s ease-in-out infinite;
}
html:not([data-theme="dark"]) .booking-screen.sheet-collapsed .sheet-grabber{
  background:#4cae12!important;
  box-shadow:0 0 0 4px rgba(76,174,18,.16),0 0 14px rgba(76,174,18,.35)!important;
}
@keyframes sheetGrabberPulse{
  0%,100%{transform:translateX(-50%) scaleX(1);opacity:1}
  50%{transform:translateX(-50%) scaleX(1.18);opacity:.85}
}
@media(prefers-reduced-motion:reduce){
  .sheet-pull-hint i,.booking-screen.sheet-collapsed .sheet-grabber{animation:none!important;opacity:.9!important}
}


/* ===== Route ready minibar (vehicles + book) ===== */
.route-minibar{
  position:absolute;z-index:950;left:0;right:0;bottom:0;
  padding:12px 14px max(16px,env(safe-area-inset-bottom));
  border-radius:26px 26px 0 0;
  background:linear-gradient(180deg,rgba(12,16,13,.98),#050806 40%);
  border-top:1px solid rgba(140,240,0,.18);
  box-shadow:0 -18px 48px rgba(0,0,0,.45);
  transform:translate3d(0,110%,0);
  opacity:0;pointer-events:none;
  transition:transform .38s cubic-bezier(.22,.8,.24,1),opacity .28s ease;
  backdrop-filter:blur(18px) saturate(1.2);
  -webkit-backdrop-filter:blur(18px) saturate(1.2);
}
.route-minibar.show{
  transform:translate3d(0,0,0);opacity:1;pointer-events:auto;
}
html:not([data-theme="dark"]) .route-minibar{
  background:linear-gradient(180deg,rgba(248,251,248,.98),#f3f7f2 45%);
  border-top-color:rgba(76,174,18,.2);
  box-shadow:0 -14px 40px rgba(20,40,24,.18);
}
.route-minibar-fare{
  display:grid;grid-template-columns:1fr 1fr 1.2fr;gap:8px;
  margin-bottom:10px;padding:10px 12px;border-radius:16px;
  background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);
}
html:not([data-theme="dark"]) .route-minibar-fare{background:rgba(0,0,0,.04);border-color:rgba(0,0,0,.06)}
.route-minibar-fare span{display:flex;flex-direction:column;gap:2px;min-width:0}
.route-minibar-fare small{color:#8f9b93;font:750 9px/1 system-ui;letter-spacing:.3px;text-transform:uppercase}
.route-minibar-fare b,.route-minibar-fare strong{color:#f2f7f2;font:900 15px/1.1 system-ui}
.route-minibar-price{text-align:right}
.route-minibar-price strong{color:#8cf000;font-size:18px}
html:not([data-theme="dark"]) .route-minibar-fare b,
html:not([data-theme="dark"]) .route-minibar-fare strong{color:#122018}
html:not([data-theme="dark"]) .route-minibar-price strong{color:#3ca800}

.route-minibar-head{
  display:flex;align-items:center;justify-content:space-between;
  margin:2px 2px 8px;color:#e8efe9;font:900 13px/1 system-ui;
}
.route-minibar-head small{color:#8f9b93;font:750 11px system-ui}
html:not([data-theme="dark"]) .route-minibar-head{color:#122018}

.route-minibar-vehicles{
  display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px;
}
.mini-vehicle{
  position:relative;display:flex;flex-direction:column;align-items:center;
  gap:2px;padding:10px 6px 8px;border-radius:16px;cursor:pointer;
  border:1.5px solid rgba(255,255,255,.1);background:rgba(255,255,255,.04);
  color:#e8efe9;text-align:center;transition:.2s;
}
.mini-vehicle img{width:100%;max-width:88px;height:42px;object-fit:contain;margin:2px 0 4px}
.mini-vehicle b{font:900 10px/1.15 system-ui;letter-spacing:-.2px}
.mini-vehicle small{color:#8f9b93;font:650 9px/1.2 system-ui}
.mini-vehicle .vehicle-badge{
  position:absolute;top:6px;left:6px;padding:2px 6px;border-radius:6px;
  background:#1a2e12;color:#8cf000;font:950 7px/1 system-ui;letter-spacing:.4px;text-transform:uppercase;
}
.mini-vehicle .vehicle-badge.economy{background:#2a2114;color:#e2bd63}
.mini-vehicle.active{
  border-color:#8cf000;background:rgba(140,240,0,.1);
  box-shadow:0 0 0 1px rgba(140,240,0,.35),0 8px 22px rgba(100,200,20,.15);
}
html:not([data-theme="dark"]) .mini-vehicle{background:#fff;border-color:#d7e2d9;color:#122018}
html:not([data-theme="dark"]) .mini-vehicle small{color:#667169}
html:not([data-theme="dark"]) .mini-vehicle.active{border-color:#4cae12;background:#f0fbe6;box-shadow:0 0 0 1px rgba(76,174,18,.25)}

.route-minibar-book{
  width:100%;height:54px;display:flex;align-items:center;justify-content:center;gap:10px;
  border:0;border-radius:16px;cursor:pointer;
  background:linear-gradient(180deg,#b4fc31,#79df00);color:#102000;
  font:950 16px/1 system-ui;box-shadow:0 10px 28px rgba(120,220,20,.35);
}
.route-minibar-book:disabled{opacity:.55;cursor:not-allowed}
.route-minibar-book .book-car{display:grid;place-items:center}
.route-minibar-book .book-car svg{width:22px;height:22px;fill:currentColor}
.route-minibar-book b{margin-left:auto;padding-right:4px;opacity:.85}

/* Quando minibar aperta: alza status/locate e nascondi pull-hint del sheet collassato */
.booking-screen.route-ready.sheet-collapsed .map-status,
.booking-screen.route-ready.sheet-collapsed .locate-btn,
.booking-screen.route-ready.sheet-collapsed .driver-live-chip{bottom:auto!important;top:auto}
.booking-screen.route-ready.sheet-collapsed .control-panel{opacity:0;pointer-events:none;transform:translate3d(0,120%,0)!important}
.booking-screen.route-ready .sheet-pull-hint{display:none!important}

@media(prefers-reduced-motion:reduce){
  .route-minibar{transition:none!important}
}


/* ===== Book launch + pickup radar (visible to drivers) ===== */
.route-minibar-book.launching{
  pointer-events:none;
  background:linear-gradient(90deg,#79df00,#b4fc31,#79df00);
  background-size:200% 100%;
  animation:bookLaunchBg .9s linear infinite, bookLaunchPulse .55s ease-in-out infinite;
  transform:scale(1.02);
}
.route-minibar-book.launching #miniBookLabel::after{
  content:"…";
  animation:bookDots 1s steps(3,end) infinite;
}
@keyframes bookLaunchBg{0%{background-position:0% 50%}100%{background-position:200% 50%}}
@keyframes bookLaunchPulse{0%,100%{box-shadow:0 10px 28px rgba(120,220,20,.35)}50%{box-shadow:0 12px 36px rgba(120,220,20,.7),0 0 0 6px rgba(140,240,0,.2)}}
@keyframes bookDots{0%{content:""}33%{content:"."}66%{content:".."}100%{content:"..."}}

.booking-search-chip{
  position:absolute;z-index:920;left:50%;bottom:auto;
  transform:translateX(-50%);
  top:max(72px, calc(env(safe-area-inset-top) + 58px));
  display:none;align-items:center;gap:10px;
  padding:10px 14px;border-radius:999px;
  background:rgba(8,12,9,.92);border:1px solid rgba(140,240,0,.35);
  color:#e8ffe0;font:850 12px/1.2 system-ui;
  box-shadow:0 12px 32px rgba(0,0,0,.4);
  backdrop-filter:blur(14px);
}
.booking-search-chip.show{display:flex;animation:chipIn .35s cubic-bezier(.22,.8,.24,1)}
.booking-search-chip .spin{
  width:16px;height:16px;border:2px solid rgba(140,240,0,.25);
  border-top-color:#8cf000;border-radius:50%;
  animation:spin .7s linear infinite;flex:0 0 auto;
}
.booking-search-chip b{color:#8cf000}
@keyframes chipIn{from{opacity:0;transform:translateX(-50%) translateY(-8px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}
@keyframes spin{to{transform:rotate(360deg)}}
html:not([data-theme="dark"]) .booking-search-chip{
  background:rgba(255,255,255,.95);color:#122018;border-color:rgba(76,174,18,.35)
}
html:not([data-theme="dark"]) .booking-search-chip b{color:#3ca800}

.pickup-radar-host{background:none!important;border:0!important}
.pickup-radar{
  position:relative;width:120px;height:120px;
  margin-left:-60px;margin-top:-60px;
  pointer-events:none;
}
.pickup-radar .core{
  position:absolute;left:50%;top:50%;width:18px;height:18px;
  margin:-9px 0 0 -9px;border-radius:50%;
  background:#8cf000;border:3px solid #fff;
  box-shadow:0 0 0 4px rgba(140,240,0,.35),0 4px 14px rgba(0,0,0,.4);
  z-index:3;
}
.pickup-radar .ring{
  position:absolute;left:50%;top:50%;
  width:24px;height:24px;margin:-12px 0 0 -12px;
  border-radius:50%;border:2px solid rgba(140,240,0,.85);
  animation:radarRing 2s cubic-bezier(.15,.7,.25,1) infinite;
  z-index:1;
}
.pickup-radar .ring:nth-child(2){animation-delay:.55s}
.pickup-radar .ring:nth-child(3){animation-delay:1.1s}
.pickup-radar .beam{
  position:absolute;left:50%;top:50%;
  width:60px;height:60px;margin:-60px 0 0 -60px;
  border-radius:60px 0 0 0;
  background:conic-gradient(from 0deg, rgba(140,240,0,.0) 0deg, rgba(140,240,0,.35) 50deg, rgba(140,240,0,0) 90deg);
  transform-origin:100% 100%;
  animation:radarBeam 2.4s linear infinite;
  z-index:2;
}
@keyframes radarRing{
  0%{transform:scale(.4);opacity:.95}
  100%{transform:scale(4.2);opacity:0}
}
@keyframes radarBeam{
  to{transform:rotate(360deg)}
}
@media(prefers-reduced-motion:reduce){
  .route-minibar-book.launching,.pickup-radar .ring,.pickup-radar .beam,.booking-search-chip .spin{animation:none!important}
}


/* ===== Autista in arrivo (cliente) ===== */
.driver-arriving-overlay{
  position:absolute;z-index:980;inset:0;display:none;
  align-items:flex-end;justify-content:center;
  padding:0 14px calc(108px + env(safe-area-inset-bottom, 0px));
  background:linear-gradient(180deg,transparent 20%,rgba(3,5,4,.55) 55%,rgba(3,5,4,.88));
  pointer-events:none;
}
.driver-arriving-overlay.show{display:flex;animation:arrivingFade .4s ease}
.driver-arriving-card{
  width:min(100%,420px);pointer-events:auto;
  margin-bottom:12px;
  padding:16px 16px 14px;border-radius:22px;
  background:linear-gradient(160deg,#121a12,#0a100c);
  border:1px solid rgba(140,240,0,.35);
  box-shadow:0 20px 50px rgba(0,0,0,.5),0 0 0 1px rgba(140,240,0,.12);
  color:#eef6ea;
}
.driver-arriving-card .pulse-row{
  display:flex;align-items:center;gap:12px;margin-bottom:10px;
}
.driver-arriving-card .car-pulse{
  position:relative;width:48px;height:48px;flex:0 0 48px;
  border-radius:14px;background:#1a2a14;
  display:grid;place-items:center;font-size:22px;
}
.driver-arriving-card .car-pulse:before,
.driver-arriving-card .car-pulse:after{
  content:"";position:absolute;inset:-4px;border-radius:16px;
  border:2px solid rgba(140,240,0,.55);animation:arrivingRing 1.6s ease-out infinite;
}
.driver-arriving-card .car-pulse:after{animation-delay:.55s}
.driver-arriving-card h3{margin:0;font:950 16px/1.2 system-ui;color:#b8ff4a}
.driver-arriving-card p{margin:4px 0 0;color:#a8b5ad;font:650 12px/1.35 system-ui}
.driver-arriving-card .eta{
  margin-top:12px;padding:10px 12px;border-radius:14px;
  background:rgba(140,240,0,.1);border:1px solid rgba(140,240,0,.25);
  display:flex;justify-content:space-between;align-items:center;
  font:900 13px system-ui;color:#d8ff9a;
}
.driver-arriving-card .eta b{font-size:20px;color:#8cf000}
@keyframes arrivingRing{
  0%{transform:scale(.85);opacity:.9}
  100%{transform:scale(1.55);opacity:0}
}
@keyframes arrivingFade{from{opacity:0}to{opacity:1}}
html:not([data-theme="dark"]) .driver-arriving-card{
  background:linear-gradient(160deg,#f7fbf5,#eef6ea);color:#122018;border-color:rgba(76,174,18,.3)
}
html:not([data-theme="dark"]) .driver-arriving-card h3{color:#2f8a00}
html:not([data-theme="dark"]) .driver-arriving-card p{color:#5a6a60}
html:not([data-theme="dark"]) .driver-arriving-card .eta{background:#eef9e4;color:#2a5a10}
html:not([data-theme="dark"]) .driver-arriving-card .eta b{color:#3ca800}


/* ===== Cliente / Autista perspective toggle ===== */
.brand-stack{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0}
.role-btn{
  display:inline-flex;align-items:center;gap:8px;padding:3px 8px 3px 3px;
  border:1px solid rgba(255,255,255,.14);border-radius:999px;
  background:rgba(8,13,9,.84);color:#e8efe9;cursor:pointer;
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  box-shadow:0 6px 18px rgba(0,0,0,.28);
}
.role-track{
  position:relative;width:46px;height:24px;border-radius:999px;
  background:#1a221c;display:block;flex:0 0 46px;
}
.role-track i{position:absolute;top:3px;font-style:normal;font-size:12px;line-height:18px;width:18px;text-align:center;opacity:.45;transition:.25s}
.role-track .role-client{left:3px}.role-track .role-driver{right:3px}
.role-track b{
  position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;
  background:linear-gradient(180deg,#b4fc31,#79df00);
  box-shadow:0 2px 8px rgba(120,220,20,.4);
  transition:transform .28s cubic-bezier(.22,.8,.24,1);
}
.role-btn[aria-pressed="true"] .role-track b{transform:translateX(22px)}
.role-btn[aria-pressed="true"] .role-driver{opacity:1}
.role-btn:not([aria-pressed="true"]) .role-client{opacity:1}
.role-btn small{font:850 10px/1 system-ui;letter-spacing:.2px;color:#c5d0c8;min-width:52px;text-align:left}
html:not([data-theme="dark"]) .role-btn{
  background:rgba(255,255,255,.9);border-color:rgba(16,40,22,.12);color:#122018;
  box-shadow:0 6px 18px rgba(32,61,38,.12)
}
html:not([data-theme="dark"]) .role-track{background:#e6eee6}
html:not([data-theme="dark"]) .role-btn small{color:#3a4a40}

.live-fleet-marker-host,.live-client-marker-host,
.leaflet-marker-icon.live-fleet-marker-host,
.leaflet-marker-icon.live-client-marker-host{
  background:transparent!important;border:0!important;box-shadow:none!important;
}
.live-fleet-marker,.live-client-marker{
  position:relative;width:32px;height:32px;margin:0;
  background:none!important;border:0!important;box-shadow:none!important;
  filter:drop-shadow(0 2px 6px rgba(0,0,0,.55));
}
.live-fleet-marker:before,.live-client-marker:before,
.live-fleet-marker.live:before{content:none!important;display:none!important;animation:none!important}
.live-fleet-marker span,.live-client-marker span{
  position:absolute;inset:0;border:0!important;background:none!important;
  border-radius:0!important;display:grid;place-items:center;
  font-size:22px;line-height:1;color:inherit;
}

.role-hint-chip{
  position:absolute;z-index:500;left:12px;right:12px;transform:none;
  top:max(96px, calc(env(safe-area-inset-top) + 86px));
  display:none;padding:7px 12px;border-radius:999px;
  background:rgba(8,12,9,.9);border:1px solid rgba(140,240,0,.28);
  color:#d8e6d8;font:750 11px/1.2 system-ui;white-space:normal;text-align:center;
  box-shadow:0 8px 22px rgba(0,0,0,.35);
}
.role-hint-chip.show{display:block}
body[data-perspective="driver"] .role-hint-chip{display:none!important}


.cancel-order-btn{
  position:absolute;z-index:930;right:12px;
  top:max(72px, calc(env(safe-area-inset-top) + 58px));
  height:36px;padding:0 12px;border-radius:999px;cursor:pointer;
  border:1px solid rgba(255,100,100,.45);background:rgba(40,12,12,.92);
  color:#ffb4b4;font:850 12px/1 system-ui;
  box-shadow:0 8px 22px rgba(0,0,0,.35);
  display:none;align-items:center;gap:4px;
}
.cancel-order-btn.show{display:inline-flex}
.cancel-order-btn:active{transform:scale(.96)}


/* ===== Driver mode: compact requests strip (non-invasivo) ===== */
.driver-requests-panel{
  position:absolute;z-index:920;left:0;right:0;bottom:0;
  max-height:42%;
  padding:10px 12px max(12px, env(safe-area-inset-bottom));
  border-radius:22px 22px 0 0;
  background:linear-gradient(180deg,rgba(10,14,11,.94),rgba(5,8,6,.98));
  border-top:1px solid rgba(140,240,0,.22);
  box-shadow:0 -10px 28px rgba(0,0,0,.35);
  transform:translate3d(0,110%,0);opacity:0;pointer-events:none;
  transition:transform .32s cubic-bezier(.22,.8,.24,1),opacity .22s ease;
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  display:flex;flex-direction:column;gap:8px;
}
.driver-requests-panel.show{
  transform:translate3d(0,0,0);opacity:1;pointer-events:auto;
}
html:not([data-theme="dark"]) .driver-requests-panel{
  background:linear-gradient(180deg,rgba(248,251,248,.96),#eef4ee);
  border-top-color:rgba(76,174,18,.25);
}
.drp-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 2px}
.drp-title{font:850 12px/1 system-ui;color:#c5d0c8}
.drp-title b{color:#8cf000;font-size:14px;margin-right:4px}
.drp-open{
  font:850 11px system-ui;color:#8cf000;text-decoration:none;
  padding:6px 10px;border-radius:999px;border:1px solid rgba(140,240,0,.3);background:rgba(140,240,0,.08);
}
.drp-list{
  display:flex;flex-direction:column;gap:6px;
  overflow:auto;max-height:min(28vh,220px);
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}
.drp-item{
  display:grid;grid-template-columns:1fr auto;gap:6px 10px;
  padding:10px 12px;border-radius:14px;
  border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.04);
  color:#e8efe9;cursor:pointer;text-align:left;
  transition:border-color .2s,background .2s,transform .15s;
}
.drp-item:active{transform:scale(.98)}
.drp-item.is-new{border-color:rgba(140,240,0,.45);background:rgba(140,240,0,.08)}
.drp-item .who{font:900 13px/1.2 system-ui;color:#f2f7f0;grid-column:1}
.drp-item .price{font:950 14px/1 system-ui;color:#8cf000;grid-column:2;grid-row:1/3;align-self:center}
.drp-item .route{font:650 11px/1.3 system-ui;color:#8f9b93;grid-column:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.drp-item .age{font:750 10px system-ui;color:#aefa61}
.drp-item .meta{grid-column:1/-1;display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:2px}
.drp-item .meta span{font:750 10px system-ui;color:#9aa69e;padding:3px 7px;border-radius:8px;background:rgba(255,255,255,.05)}
.drp-item .meta span.km{color:#c8ff9a}
.drp-item .meta span.pr{color:#8cf000;font-weight:900}
.drp-item .drp-gps{
  grid-column:2;grid-row:2;justify-self:end;align-self:end;
  width:34px;height:34px;border-radius:11px;border:1px solid rgba(140,240,0,.35);
  background:rgba(140,240,0,.12);color:#8cf000;font-size:15px;cursor:pointer;
  display:grid;place-items:center;padding:0;
}
.drp-item .drp-gps:active{transform:scale(.94);background:rgba(140,240,0,.25)}
.drp-accept{
  grid-column:1/-1;
  height:40px;margin-top:4px;border:0;border-radius:12px;
  background:linear-gradient(#b4fc31,#79df00);color:#102000;
  font:950 13px/1 system-ui;cursor:pointer;letter-spacing:.2px;
}
.drp-accept:disabled{opacity:.55;cursor:wait}
.drp-accept:active{transform:scale(.98)}
.drp-busy{
  grid-column:1/-1;margin-top:4px;padding:8px 10px;border-radius:10px;
  background:rgba(125,211,252,.1);color:#7dd3fc;font:800 11px system-ui;text-align:center;
}
.drp-item{grid-template-columns:1fr auto}
.drp-empty{padding:16px;text-align:center;color:#7a887f;font:650 12px system-ui}
/* In driver mode nascondi pull-hint del sheet cliente e alza un filo lo sheet */
body[data-perspective="driver"] .sheet-pull-hint{display:none!important}
body[data-perspective="driver"].booking-screen .control-panel,
body[data-perspective="driver"] .booking-screen.sheet-collapsed > .control-panel{
  /* panel richieste prende il posto visuale in basso */
}
body[data-perspective="driver"] .booking-screen.sheet-collapsed > .control-panel{
  opacity:.35;pointer-events:none;
}
body[data-perspective="driver"] .route-minibar{display:none!important}
body[data-perspective="driver"] .map-route-actions,
body[data-perspective="driver"] .booking-screen .map-route-actions,
body[data-perspective="driver"] .booking-screen.sheet-collapsed .map-route-actions,
body[data-perspective="driver"] .map-status,
body[data-perspective="driver"] .booking-search-chip,
body[data-perspective="driver"] .cancel-order-btn,
body[data-perspective="driver"] .driver-arriving-overlay,
body[data-perspective="driver"] .driver-live-chip{
  display:none!important;visibility:hidden!important;pointer-events:none!important;
}
body[data-perspective="driver"] .locate-btn,
.topbar .locate-btn,
body[data-perspective="driver"] .topbar .locate-btn{
  position:static!important;right:auto!important;bottom:auto!important;left:auto!important;
  width:36px!important;height:36px!important;min-width:36px!important;
  border-radius:14px!important;background:rgba(10,14,11,.88)!important;
  color:#8cf000!important;border:1px solid rgba(140,240,0,.3)!important;
  box-shadow:none!important;
}
body[data-perspective="driver"] .locate-btn::after{
  content:none!important;display:none!important;
}
body[data-perspective="driver"] .live-client-marker:before,
body[data-perspective="driver"] .live-fleet-marker:before{
  animation:none!important;
}

.drp-item .st-badge{
  font:950 9px/1 system-ui;letter-spacing:.3px;padding:5px 8px;border-radius:8px;
  justify-self:end;align-self:start;white-space:nowrap;
}
.drp-item .st-badge.open{background:rgba(140,240,0,.15);color:#8cf000}
.drp-item .st-badge.accepted{background:rgba(56,180,255,.18);color:#7dd3fc}
.drp-item .st-badge.cancelled{background:rgba(255,80,80,.15);color:#ff8f8f}
.drp-item .st-badge.done{background:rgba(180,180,180,.15);color:#aab5ad}
.drp-item.status-accepted{border-color:rgba(56,180,255,.35)}
.drp-item.status-cancelled{opacity:.72;border-color:rgba(255,80,80,.25)}
.drp-item.status-done{opacity:.65;border-color:rgba(160,160,160,.2)}
.drp-item .price{display:none} /* prezzo già in meta */
