/* ScanMAP UI V2 FIX refined */

#langBtn{
  min-width:76px!important;
  height:42px!important;
  gap:7px!important;
  flex-shrink:0!important;
}

.scanmap-lang-flag{font-size:20px!important}
.scanmap-lang-code{color:#fff!important;font-size:14px!important;font-weight:800!important}
.scanmap-lang-caret{color:rgba(255,255,255,.72)!important}

.scanmap-brand{max-width:220px!important}
.scanmap-topbar-left{min-width:0!important;flex:1 1 auto!important}
.scanmap-topbar-right{flex:0 0 auto!important}

#navbar{
  height:92px!important;
}

#navbar .icon-links{
  height:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-around!important;
  gap:0!important;
  padding:7px 10px 8px!important;
  box-sizing:border-box!important;
}

#navbar .icon-links a{
  flex:1 1 0!important;
  min-width:0!important;
  height:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-decoration:none!important;
  position:relative!important;
}

#navbar img.icon{
  display:none!important;
}

#navbar .icon-wrapper{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:5px!important;
  width:100%!important;
  height:100%!important;
}

#navbar .icon-wrapper::before{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:30px!important;
  height:30px!important;
  color:#fff!important;
  font-size:28px!important;
  line-height:1!important;
  font-weight:400!important;
  font-family:"Segoe UI Emoji","Apple Color Emoji",system-ui,sans-serif!important;
}

#icon-visit .icon-wrapper::before{content:"🏛️"}
#icon-lights .icon-wrapper::before{content:"🛎️"}
#icon-shopping .icon-wrapper::before{content:"🛍️"}
#icon-food .icon-wrapper::before{content:"🍴"}
#icon-hotel .icon-wrapper::before{content:"🛏️"}
#icon-events .icon-wrapper::before{content:"📣"}
#icon-transport .icon-wrapper::before,
#scanmap-ai-nav-btn .icon-wrapper::before{content:"🎙️"!important}

#navbar .icon-label{
  color:rgba(255,255,255,.95)!important;
  font-size:12px!important;
  line-height:1.05!important;
  text-align:center!important;
  font-weight:600!important;
  max-width:72px!important;
}

#icon-visit{order:1!important}
#icon-lights{order:2!important}
#icon-shopping{order:3!important}
#icon-transport,
#scanmap-ai-nav-btn{order:4!important}
#icon-food{order:5!important}
#icon-hotel{order:6!important}
#icon-events{order:7!important}

#icon-transport.scanmap-ai-nav,
#scanmap-ai-nav-btn{
  flex:0 0 78px!important;
  transform:translateY(-12px)!important;
  z-index:10!important;
}

#icon-transport.scanmap-ai-nav .icon-wrapper,
#scanmap-ai-nav-btn .icon-wrapper{
  width:66px!important;
  height:78px!important;
  border-radius:19px!important;
  background:linear-gradient(180deg,#ff3b2f 0%,#c91512 100%)!important;
  box-shadow:0 0 22px rgba(255,55,45,.52),0 12px 24px rgba(0,0,0,.36)!important;
}

#icon-transport.scanmap-ai-nav .icon-label,
#scanmap-ai-nav-btn .icon-label{
  color:#fff!important;
  font-size:12px!important;
  font-weight:800!important;
}

#scanmap-ai-nav-btn .scanmap-ai-icon{
  display:none!important;
}

#icon-transport.scanmap-ai-nav::after,
#scanmap-ai-nav-btn::after{
  content:""!important;
  position:absolute!important;
  left:25px!important;
  right:25px!important;
  bottom:-2px!important;
  height:4px!important;
  border-radius:999px!important;
  background:#ff3b2f!important;
}

/* Chat */
#chat-toggle{
  display:none!important;
}

#chat-box{
  background:rgba(3,16,29,.97)!important;
  color:#fff!important;
  border:1px solid rgba(90,180,255,.22)!important;
  border-radius:24px!important;
  box-shadow:0 24px 50px rgba(0,0,0,.46)!important;
  width:min(82vw,430px)!important;
  min-height:0!important;
  height:auto!important;
  max-height:calc(100dvh - var(--top-h,76px) - var(--bottom-h,92px) - 34px)!important;
}

#chat-box .chatbox-head{
  background:linear-gradient(135deg,#061727,#04111f)!important;
  border-bottom:1px solid rgba(255,255,255,.1)!important;
}

#chat-box #chat-scroll{
  background:transparent!important;
  max-height:calc(100dvh - var(--top-h,76px) - var(--bottom-h,92px) - 120px)!important;
  overflow-y:auto!important;
}

#chat-box .chatbox-input-row,
#chat-box #chat-quick-questions,
#chat-box #chat-dynamic-actions-wrap{
  background:rgba(255,255,255,.055)!important;
  border:1px solid rgba(90,180,255,.18)!important;
}

#chat-input{
  background:rgba(255,255,255,.08)!important;
  color:#fff!important;
}

#chat-input::placeholder{
  color:rgba(255,255,255,.58)!important;
}

@media(max-width:640px){
  #navbar .icon-label{
    font-size:10px!important;
  }

  #navbar .icon-wrapper::before{
    font-size:25px!important;
  }

  #icon-transport.scanmap-ai-nav,
  #scanmap-ai-nav-btn{
    flex:0 0 68px!important;
  }

  #icon-transport.scanmap-ai-nav .icon-wrapper,
  #scanmap-ai-nav-btn .icon-wrapper{
    width:60px!important;
    height:74px!important;
  }
}

/* Patch: nasconde la vecchia seconda serie di icone */
#navbar .scanmap-nav-symbol{
  display:none !important;
}

#navbar .icon-wrapper{
  gap:6px !important;
}

#navbar .icon-label{
  margin-top:0 !important;
}

/* ==========================================================
   Refinement navbar icons: usa le icone originali in bianco
   ========================================================== */

#navbar .scanmap-nav-symbol{
  display:none !important;
}

/* disattiva le icone pseudo-generate per le voci normali */
#icon-visit .icon-wrapper::before,
#icon-lights .icon-wrapper::before,
#icon-shopping .icon-wrapper::before,
#icon-food .icon-wrapper::before,
#icon-hotel .icon-wrapper::before,
#icon-events .icon-wrapper::before{
  content:none !important;
  display:none !important;
}

/* mostra le icone originali rendendole bianche */
#navbar img.icon{
  display:block !important;
  width:28px !important;
  height:28px !important;
  object-fit:contain !important;
  filter: brightness(0) invert(1) contrast(1.05) !important;
  opacity:.96 !important;
}

#icon-food img.icon{
  width:26px !important;
  height:26px !important;
}

#navbar .icon-wrapper{
  gap:6px !important;
}

#navbar .icon-label{
  margin-top:0 !important;
  font-size:12px !important;
  font-weight:600 !important;
  max-width:82px !important;
}

/* AI centrale: mantienila rossa e dedicata */
#scanmap-ai-nav-btn .icon-wrapper::before{
  content:none !important;
  display:none !important;
}

#scanmap-ai-nav-btn img.icon{
  display:none !important;
}

#scanmap-ai-nav-btn .scanmap-ai-icon{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:30px !important;
  height:30px !important;
  font-size:28px !important;
  line-height:1 !important;
  color:#fff !important;
}

#scanmap-ai-nav-btn .icon-label{
  font-size:12px !important;
  font-weight:800 !important;
  color:#fff !important;
}

/* fallback se AI usa ancora icon-transport */
#icon-transport.scanmap-ai-nav img.icon{
  display:none !important;
}

#icon-transport.scanmap-ai-nav .icon-wrapper::before{
  content:"🎙" !important;
  display:flex !important;
  font-size:28px !important;
  width:30px !important;
  height:30px !important;
  align-items:center !important;
  justify-content:center !important;
}

/* LIST un po' più compatto */
#floatingMarker{
  border-radius:18px 0 0 18px !important;
  padding:14px 8px !important;
  font-size:12px !important;
  letter-spacing:.03em !important;
}

/* ==========================================================
   PATCH V9 - icone navbar definitive, singole e bianche
   ========================================================== */

#navbar img.icon,
#navbar .scanmap-nav-symbol{
  display:none !important;
}

#navbar .icon-wrapper::before{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:32px !important;
  height:32px !important;
  color:#ffffff !important;
  font-size:26px !important;
  line-height:1 !important;
  font-weight:500 !important;
  margin-bottom:3px !important;
  text-shadow:0 0 10px rgba(255,255,255,.15) !important;
}

#icon-visit .icon-wrapper::before{
  content:"🏛" !important;
}

#icon-lights .icon-wrapper::before{
  content:"🛎" !important;
}

#icon-shopping .icon-wrapper::before{
  content:"🛍" !important;
}

#icon-food .icon-wrapper::before{
  content:"🍴" !important;
}

#icon-hotel .icon-wrapper::before{
  content:"🛏" !important;
}

#icon-events .icon-wrapper::before{
  content:"📣" !important;
}

#icon-transport .icon-wrapper::before,
#scanmap-ai-nav-btn .icon-wrapper::before{
  content:"🎙" !important;
}

/* Evita doppio microfono nel bottone AI */
#scanmap-ai-nav-btn .scanmap-ai-icon{
  display:none !important;
}

#navbar .icon-label{
  display:block !important;
  color:#ffffff !important;
  font-size:12px !important;
  line-height:1.05 !important;
  font-weight:600 !important;
  text-align:center !important;
  max-width:82px !important;
}

#scanmap-ai-nav-btn .icon-label,
#icon-transport.scanmap-ai-nav .icon-label{
  font-size:11px !important;
  font-weight:800 !important;
  color:#ffffff !important;
}

#navbar .icon-wrapper{
  gap:3px !important;
}

/* Migliora leggermente la navbar */
#navbar{
  border-top:1px solid rgba(255,255,255,.12) !important;
}

#navbar .icon-links a:not(.scanmap-ai-nav):hover,
#navbar .icon-links a.active:not(.scanmap-ai-nav){
  background:rgba(255,255,255,.045) !important;
}

/* ==========================================================
   PATCH V10 - sposta il pannello AI a sinistra
   lasciando libero il bottone LIST
   ========================================================== */

#chat-box{
  left:24px !important;
  right:auto !important;
  transform:none !important;
  width:min(420px, calc(100vw - 150px)) !important;
  max-width:calc(100vw - 150px) !important;
}

@media (max-width: 900px){
  #chat-box{
    left:16px !important;
    right:auto !important;
    transform:none !important;
    width:min(390px, calc(100vw - 120px)) !important;
    max-width:calc(100vw - 120px) !important;
  }
}

@media (max-width: 640px){
  #chat-box{
    left:12px !important;
    right:auto !important;
    transform:none !important;
    width:calc(100vw - 96px) !important;
    max-width:calc(100vw - 96px) !important;
  }

  #floatingMarker{
    right:0 !important;
  }
}

/* PATCH TOPBAR: nasconde solo la scritta "Accedi", mantiene il sottotitolo */
.scanmap-topbar-right .scanmap-user-chip{
  width:auto !important;
  max-width:210px !important;
  min-width:0 !important;
  height:46px !important;
  padding:6px 10px !important;
  border-radius:999px !important;
  justify-content:flex-start !important;
}

.scanmap-topbar-right .scanmap-user-chip-copy{
  display:flex !important;
}

.scanmap-topbar-right .scanmap-user-chip-copy strong{
  display:none !important;
}

.scanmap-topbar-right .scanmap-user-chip-copy span{
  display:block !important;
  font-size:11px !important;
  color:rgba(255,255,255,.72) !important;
  margin-top:0 !important;
}

.scanmap-topbar-right .scanmap-user-chip-media{
  width:34px !important;
  height:34px !important;
  margin:0 !important;
}

/* PATCH TOPBAR USER FINAL: solo icona utente, link invariato */
.scanmap-topbar-right .scanmap-user-chip{
  width:46px !important;
  height:46px !important;
  min-width:46px !important;
  max-width:46px !important;
  padding:0 !important;
  border-radius:50% !important;
  justify-content:center !important;
  gap:0 !important;
}

.scanmap-topbar-right .scanmap-user-chip-copy{
  display:none !important;
}

.scanmap-topbar-right .scanmap-user-chip-media{
  width:34px !important;
  height:34px !important;
  margin:0 !important;
}

/* ==========================================================
   PATCH MAP FLOATING CONTROLS
   layer + centra posizione sopra LIST
   ========================================================== */

.scanmap-map-controls-v2{
  position:fixed;
  right:10px;
  top:calc(50% - 118px);
  z-index:2450;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
}

.scanmap-map-control-btn{
  width:46px;
  height:46px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(5,22,38,.94);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(0,0,0,.34);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.scanmap-map-control-btn:active{
  transform:scale(.96);
}

.scanmap-layer-panel-v2{
  position:fixed;
  right:66px;
  top:calc(50% - 118px);
  z-index:2460;
  width:210px;
  background:rgba(5,22,38,.97);
  border:1px solid rgba(90,180,255,.22);
  border-radius:18px;
  box-shadow:0 18px 38px rgba(0,0,0,.38);
  color:#fff;
  padding:12px;
  display:none;
}

.scanmap-layer-panel-v2.is-open{
  display:block;
}

.scanmap-layer-panel-v2 strong{
  display:block;
  font-size:14px;
  margin-bottom:10px;
}

.scanmap-layer-panel-v2 button{
  width:100%;
  border:none;
  border-radius:12px;
  background:rgba(255,255,255,.08);
  color:#fff;
  padding:10px;
  margin-bottom:7px;
  text-align:left;
  cursor:pointer;
  font-size:13px;
}

.scanmap-layer-panel-v2 button:hover{
  background:rgba(255,255,255,.14);
}

@media(max-width:640px){
  .scanmap-map-controls-v2{
    right:10px;
    top:calc(50% - 122px);
  }

  .scanmap-map-control-btn{
    width:44px;
    height:44px;
    font-size:21px;
  }

  .scanmap-layer-panel-v2{
    right:62px;
    top:calc(50% - 122px);
    width:190px;
  }
}

/* PATCH FLOATING CONTROLS: alza i due bottoni sopra LIST */
.scanmap-map-controls-v2{
  top:calc(50% - 170px) !important;
}

@media(max-width:640px){
  .scanmap-map-controls-v2{
    top:calc(50% - 178px) !important;
  }
}

@media(max-width:420px){
  .scanmap-map-controls-v2{
    top:calc(50% - 186px) !important;
  }
}

/* ==========================================================
   PATCH UI V2 - AI panel, right controls, popup detail
   ========================================================== */

/* 1) PANNELLO AI: più stretto, a sinistra, non copre LIST */
#chat-box{
  left:14px !important;
  right:auto !important;
  transform:none !important;
  width:min(520px, calc(100vw - 112px)) !important;
  max-width:calc(100vw - 112px) !important;
  bottom:calc(var(--bottom-h, 92px) + 12px) !important;
  top:auto !important;
  height:auto !important;
  max-height:calc(100dvh - var(--top-h, 74px) - var(--bottom-h, 92px) - 26px) !important;
  overflow:hidden !important;
}

#chat-box #chat-scroll{
  max-height:calc(100dvh - var(--top-h, 74px) - var(--bottom-h, 92px) - 118px) !important;
  overflow-y:auto !important;
  padding-right:8px !important;
}

#chat-box .chatbox-head{
  padding:14px 16px !important;
}

#chat-box .chatbox-head-title{
  font-size:18px !important;
}

#chat-box .chatbox-head-subtitle{
  font-size:13px !important;
}

/* Input AI più compatto */
#chat-box .chatbox-input-row{
  margin:0 12px 12px !important;
  padding:10px !important;
  border-radius:16px !important;
}

#chat-box #chat-input{
  height:44px !important;
  font-size:14px !important;
  border-radius:13px !important;
}

#chat-box #chat-send,
#chat-box #chat-voice{
  height:44px !important;
  min-width:48px !important;
  border-radius:13px !important;
}

/* Domande rapide più compatte */
#chat-box #chat-quick-questions{
  margin:0 12px 12px !important;
  padding:12px !important;
  gap:8px !important;
  max-height:42vh !important;
  overflow-y:auto !important;
}

#chat-box #chat-quick-questions button,
#chat-box #chat-dynamic-actions button{
  font-size:14px !important;
  padding:9px 12px !important;
  line-height:1.18 !important;
  border-radius:11px !important;
}

/* 2) COLONNA DESTRA CONTROLLI: layer + posizione sopra LIST */
.scanmap-map-controls-v2{
  right:12px !important;
  top:calc(50% - 196px) !important;
  gap:10px !important;
  z-index:2470 !important;
}

.scanmap-map-control-btn{
  width:48px !important;
  height:48px !important;
  border-radius:50% !important;
  background:rgba(5,22,38,.96) !important;
  border:1px solid rgba(255,255,255,.18) !important;
  box-shadow:0 10px 24px rgba(0,0,0,.34) !important;
}

/* LIST stabile sotto i due bottoni */
#floatingMarker,
.floating-marker{
  right:0 !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  width:58px !important;
  height:86px !important;
  border-radius:20px 0 0 20px !important;
  z-index:2460 !important;
}

/* pannello layer non deve coprire il pannello AI */
.scanmap-layer-panel-v2{
  right:72px !important;
  top:calc(50% - 196px) !important;
  max-width:200px !important;
}

/* 3) POPUP MARKER / DETTAGLIO: più contenuto e scrollabile */
.mapboxgl-popup{
  z-index:2600 !important;
}

.mapboxgl-popup-content{
  background:rgba(4,17,30,.96) !important;
  color:#fff !important;
  border:1px solid rgba(90,180,255,.22) !important;
  border-radius:22px !important;
  box-shadow:0 24px 50px rgba(0,0,0,.42) !important;
  padding:0 !important;
  overflow:hidden !important;
  max-width:min(430px, calc(100vw - 104px)) !important;
  max-height:calc(100dvh - var(--top-h, 74px) - var(--bottom-h, 92px) - 24px) !important;
}

.mapboxgl-popup-content > div,
.mapboxgl-popup-content .popup-content,
.mapboxgl-popup-content .marker-popup,
.mapboxgl-popup-content .popup-inner{
  max-height:calc(100dvh - var(--top-h, 74px) - var(--bottom-h, 92px) - 34px) !important;
  overflow-y:auto !important;
  box-sizing:border-box !important;
}

/* immagini dentro popup: non devono dominare tutta la pagina */
.mapboxgl-popup-content img{
  max-width:100% !important;
  height:auto !important;
}

.mapboxgl-popup-content img:first-child,
.mapboxgl-popup-content .popup-image,
.mapboxgl-popup-content .marker-image{
  width:100% !important;
  max-height:155px !important;
  object-fit:cover !important;
  border-radius:16px !important;
}

/* testi popup più compatti */
.mapboxgl-popup-content h1,
.mapboxgl-popup-content h2,
.mapboxgl-popup-content h3,
.mapboxgl-popup-content .popup-title,
.mapboxgl-popup-content .marker-title{
  font-size:22px !important;
  line-height:1.15 !important;
  margin:12px 14px 8px !important;
  color:#fff !important;
}

.mapboxgl-popup-content p,
.mapboxgl-popup-content .popup-description,
.mapboxgl-popup-content .marker-description{
  font-size:15px !important;
  line-height:1.35 !important;
  margin:0 14px 12px !important;
  color:rgba(255,255,255,.88) !important;
}

/* bottoni popup più piccoli */
.mapboxgl-popup-content button,
.mapboxgl-popup-content a{
  max-width:100% !important;
}

/* evita che il popup finisca sotto la navbar */
.mapboxgl-popup-tip{
  display:none !important;
}

/* MOBILE */
@media(max-width:640px){

  #chat-box{
    left:10px !important;
    width:calc(100vw - 94px) !important;
    max-width:calc(100vw - 94px) !important;
    bottom:calc(var(--bottom-h, 88px) + 10px) !important;
  }

  #chat-box .chatbox-head{
    padding:13px 14px !important;
  }

  #chat-box .chatbox-head-title{
    font-size:18px !important;
  }

  #chat-box #chat-scroll{
    max-height:calc(100dvh - var(--top-h, 74px) - var(--bottom-h, 88px) - 112px) !important;
  }

  #chat-box #chat-quick-questions{
    max-height:40vh !important;
  }

  .scanmap-map-controls-v2{
    right:8px !important;
    top:calc(50% - 190px) !important;
  }

  .scanmap-map-control-btn{
    width:46px !important;
    height:46px !important;
  }

  #floatingMarker,
  .floating-marker{
    width:56px !important;
    height:84px !important;
  }

  .scanmap-layer-panel-v2{
    right:66px !important;
    width:185px !important;
  }

  .mapboxgl-popup{
    max-width:calc(100vw - 94px) !important;
  }

  .mapboxgl-popup-content{
    max-width:calc(100vw - 94px) !important;
    max-height:calc(100dvh - var(--top-h, 74px) - var(--bottom-h, 88px) - 20px) !important;
  }

  .mapboxgl-popup-content > div,
  .mapboxgl-popup-content .popup-content,
  .mapboxgl-popup-content .marker-popup,
  .mapboxgl-popup-content .popup-inner{
    max-height:calc(100dvh - var(--top-h, 74px) - var(--bottom-h, 88px) - 30px) !important;
  }

  .mapboxgl-popup-content img:first-child,
  .mapboxgl-popup-content .popup-image,
  .mapboxgl-popup-content .marker-image{
    max-height:135px !important;
  }

  .mapboxgl-popup-content h1,
  .mapboxgl-popup-content h2,
  .mapboxgl-popup-content h3,
  .mapboxgl-popup-content .popup-title,
  .mapboxgl-popup-content .marker-title{
    font-size:20px !important;
  }

  .mapboxgl-popup-content p,
  .mapboxgl-popup-content .popup-description,
  .mapboxgl-popup-content .marker-description{
    font-size:14px !important;
  }
}

@media(max-width:420px){

  #chat-box{
    left:8px !important;
    width:calc(100vw - 86px) !important;
    max-width:calc(100vw - 86px) !important;
  }

  .scanmap-map-controls-v2{
    top:calc(50% - 184px) !important;
  }

  .mapboxgl-popup,
  .mapboxgl-popup-content{
    max-width:calc(100vw - 86px) !important;
  }
}

/* ==========================================================
   PATCH LIST CONTENT PANEL
   il contenuto LIST non deve coprire il bottone LIST
   ========================================================== */

#floatingPopup.popup-scroll,
.popup-scroll#floatingPopup{
  left:10px !important;
  right:auto !important;
  transform:none !important;
  top:calc(var(--top-h, 74px) + 10px) !important;
  width:calc(100vw - 96px) !important;
  max-width:calc(100vw - 96px) !important;
  height:calc(100dvh - var(--top-h, 74px) - var(--bottom-h, 88px) - 22px) !important;
  max-height:calc(100dvh - var(--top-h, 74px) - var(--bottom-h, 88px) - 22px) !important;
  overflow:hidden !important;
  border-radius:22px !important;
  box-sizing:border-box !important;
  z-index:2455 !important;
}

/* lascia sempre sopra la colonna controlli */
#floatingMarker,
.floating-marker,
.scanmap-map-controls-v2{
  z-index:2470 !important;
}

/* se dentro la lista c'è un catalogo/turnjs, deve rispettare la larghezza */
#floatingPopup #catalog-wrapper,
#floatingPopup #catalogo,
#floatingPopup .turn-page-wrapper,
#floatingPopup .page,
#floatingPopup .page-inner{
  max-width:100% !important;
  box-sizing:border-box !important;
}

/* contenuto interno scrollabile */
#floatingPopup .page-body,
#floatingPopup .popup-content,
#floatingPopup .marker-popup,
#floatingPopup .popup-inner{
  max-width:100% !important;
  overflow-x:hidden !important;
  box-sizing:border-box !important;
}

@media(max-width:640px){
  #floatingPopup.popup-scroll,
  .popup-scroll#floatingPopup{
    left:8px !important;
    width:calc(100vw - 88px) !important;
    max-width:calc(100vw - 88px) !important;
    top:calc(var(--top-h, 74px) + 8px) !important;
    height:calc(100dvh - var(--top-h, 74px) - var(--bottom-h, 88px) - 18px) !important;
    max-height:calc(100dvh - var(--top-h, 74px) - var(--bottom-h, 88px) - 18px) !important;
  }
}

@media(max-width:420px){
  #floatingPopup.popup-scroll,
  .popup-scroll#floatingPopup{
    left:6px !important;
    width:calc(100vw - 82px) !important;
    max-width:calc(100vw - 82px) !important;
  }
}

/* ==========================================================
   PATCH LIST SCROLL
   mantiene la lista contenuta ma abilita lo scroll verticale
   ========================================================== */

#floatingPopup.popup-scroll,
.popup-scroll#floatingPopup{
  overflow-y:auto !important;
  overflow-x:hidden !important;
  -webkit-overflow-scrolling:touch !important;
  overscroll-behavior:contain !important;
}

/* Se usa catalog-wrapper / turn.js, anche i contenitori interni devono poter scorrere */
#floatingPopup #catalog-wrapper,
#floatingPopup #catalogo{
  height:100% !important;
  max-height:100% !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  -webkit-overflow-scrolling:touch !important;
}

#floatingPopup .page-body,
#floatingPopup .popup-content,
#floatingPopup .marker-popup,
#floatingPopup .popup-inner{
  overflow-y:auto !important;
  overflow-x:hidden !important;
  -webkit-overflow-scrolling:touch !important;
}

/* Evita che turn.js blocchi il touch scroll dentro la lista */
#floatingPopup,
#floatingPopup *{
  touch-action:pan-y !important;
}

/* ==========================================================
   PATCH LIST DETAIL REFINEMENT
   lista più elegante, schede più separate, meno ingombrante
   ========================================================== */

#floatingPopup.popup-scroll,
.popup-scroll#floatingPopup{
  width:calc(100vw - 118px) !important;
  max-width:440px !important;
  left:10px !important;
  padding:10px !important;
  background:rgba(4,17,30,.94) !important;
}

/* separazione visiva tra elementi lista */
#floatingPopup hr{
  border:none !important;
  border-top:1px solid rgba(255,255,255,.18) !important;
  margin:18px 0 !important;
}

#floatingPopup h1,
#floatingPopup h2,
#floatingPopup h3,
#floatingPopup .popup-title,
#floatingPopup .marker-title{
  font-size:24px !important;
  line-height:1.12 !important;
  margin:12px 0 8px !important;
  color:#fff !important;
}

#floatingPopup p,
#floatingPopup .popup-description,
#floatingPopup .marker-description{
  font-size:17px !important;
  line-height:1.32 !important;
  color:rgba(255,255,255,.9) !important;
  margin-bottom:14px !important;
}

/* immagini più controllate */
#floatingPopup img{
  max-width:100% !important;
  border-radius:16px !important;
}

#floatingPopup img:first-child,
#floatingPopup .popup-image,
#floatingPopup .marker-image{
  width:100% !important;
  max-height:130px !important;
  object-fit:contain !important;
  background:rgba(255,255,255,.04) !important;
}

/* pulsanti azione meno invadenti */
#floatingPopup button,
#floatingPopup a{
  font-size:13px !important;
}

#floatingPopup .action-button,
#floatingPopup .popup-action,
#floatingPopup .marker-action{
  width:54px !important;
  height:54px !important;
}

/* su smartphone molto stretto */
@media(max-width:420px){
  #floatingPopup.popup-scroll,
  .popup-scroll#floatingPopup{
    width:calc(100vw - 96px) !important;
    max-width:calc(100vw - 96px) !important;
    left:8px !important;
  }

  #floatingPopup h1,
  #floatingPopup h2,
  #floatingPopup h3,
  #floatingPopup .popup-title,
  #floatingPopup .marker-title{
    font-size:22px !important;
  }

  #floatingPopup p,
  #floatingPopup .popup-description,
  #floatingPopup .marker-description{
    font-size:16px !important;
  }
}

/* ==========================================================
   PATCH LIST CARDS V3 - markup reale .popup-item
   logo a sinistra, testo a destra, Leggi tutto
   ========================================================== */

#floatingPopup.popup-scroll,
.popup-scroll#floatingPopup{
  padding:10px !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  -webkit-overflow-scrolling:touch !important;
}

/* Card */
#floatingPopup .popup-item.scanmap-list-item-v3{
  display:block !important;
  margin:0 0 12px 0 !important;
  padding:0 !important;
  border:none !important;
  background:transparent !important;
}

/* Contenuto card */
#floatingPopup .scanmap-list-content-v3{
  display:grid !important;
  grid-template-columns:82px minmax(0,1fr) !important;
  gap:10px 12px !important;
  align-items:start !important;
  width:100% !important;
  box-sizing:border-box !important;
  padding:10px !important;
  border-radius:18px !important;
  background:rgba(255,255,255,.055) !important;
  border:1px solid rgba(90,180,255,.16) !important;
  box-shadow:0 10px 24px rgba(0,0,0,.18) !important;
  color:#fff !important;
  overflow:visible !important;
  max-height:none !important;
}

/* Logo/immagine */
#floatingPopup .scanmap-list-img-v3{
  grid-column:1 !important;
  grid-row:1 / span 3 !important;
  width:82px !important;
  height:82px !important;
  max-width:82px !important;
  max-height:82px !important;
  object-fit:contain !important;
  background:rgba(255,255,255,.06) !important;
  border-radius:14px !important;
  padding:4px !important;
  margin:0 !important;
  box-sizing:border-box !important;
}

/* Titolo */
#floatingPopup .scanmap-list-title-v3{
  grid-column:2 !important;
  margin:0 0 4px 0 !important;
  padding:0 !important;
  font-size:17px !important;
  line-height:1.15 !important;
  font-weight:800 !important;
  color:#fff !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:anywhere !important;
}

/* Descrizione breve */
#floatingPopup .scanmap-list-desc-v3{
  grid-column:2 !important;
  margin:0 !important;
  padding:0 !important;
  font-size:13px !important;
  line-height:1.3 !important;
  color:rgba(255,255,255,.82) !important;
  display:-webkit-box !important;
  -webkit-line-clamp:3 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
}

/* Espansione descrizione */
#floatingPopup .scanmap-list-item-v3.is-expanded .scanmap-list-desc-v3{
  display:block !important;
  -webkit-line-clamp:unset !important;
  overflow:visible !important;
}

/* Leggi tutto */
#floatingPopup .scanmap-list-more-v3{
  grid-column:2 !important;
  justify-self:start !important;
  border:none !important;
  background:transparent !important;
  color:#4db7ff !important;
  font-size:13px !important;
  font-weight:800 !important;
  padding:4px 0 0 0 !important;
  margin:0 !important;
  cursor:pointer !important;
}

/* Azioni */
#floatingPopup .scanmap-list-actions-v3{
  grid-column:1 / -1 !important;
  display:flex !important;
  justify-content:space-around !important;
  align-items:center !important;
  gap:8px !important;
  padding-top:10px !important;
  margin-top:2px !important;
  border-top:1px solid rgba(255,255,255,.12) !important;
  width:100% !important;
  box-sizing:border-box !important;
}

#floatingPopup .scanmap-list-action-v3{
  width:52px !important;
  height:52px !important;
  border-radius:16px !important;
  border:1px solid rgba(255,255,255,.12) !important;
  background:rgba(17,125,255,.92) !important;
  color:#fff !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:3px !important;
  text-decoration:none !important;
  padding:0 !important;
  margin:0 !important;
  box-sizing:border-box !important;
  box-shadow:0 8px 16px rgba(0,0,0,.22) !important;
}

#floatingPopup .scanmap-list-action-v3 .popup-action-icon{
  font-size:18px !important;
  line-height:1 !important;
}

#floatingPopup .scanmap-list-action-v3 .popup-action-label{
  font-size:8px !important;
  line-height:1 !important;
  font-weight:700 !important;
}

/* Evita che vecchi stili rendano i titoli verticali */
#floatingPopup .scanmap-list-content-v3 h1,
#floatingPopup .scanmap-list-content-v3 h2,
#floatingPopup .scanmap-list-content-v3 h3,
#floatingPopup .scanmap-list-content-v3 p{
  writing-mode:horizontal-tb !important;
  text-orientation:mixed !important;
  max-width:100% !important;
}

/* Mobile stretto */
@media(max-width:420px){
  #floatingPopup .scanmap-list-content-v3{
    grid-template-columns:72px minmax(0,1fr) !important;
    gap:9px 10px !important;
    padding:9px !important;
  }

  #floatingPopup .scanmap-list-img-v3{
    width:72px !important;
    height:72px !important;
    max-width:72px !important;
    max-height:72px !important;
  }

  #floatingPopup .scanmap-list-title-v3{
    font-size:15px !important;
  }

  #floatingPopup .scanmap-list-desc-v3{
    font-size:12px !important;
  }

  #floatingPopup .scanmap-list-action-v3{
    width:47px !important;
    height:47px !important;
    border-radius:14px !important;
  }
}

/* ==========================================================
   PATCH ACTION ICONS REFINE
   icone lista più eleganti, meno giocattolose
   ========================================================== */

#floatingPopup .popup-action-icon,
.popup-scroll .popup-action-icon{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:20px !important;
  height:20px !important;
  font-size:0 !important; /* nasconde eventuale testo emoji residuo */
  line-height:1 !important;
}

#floatingPopup .popup-action-icon svg,
.popup-scroll .popup-action-icon svg{
  display:block !important;
  width:20px !important;
  height:20px !important;
  stroke:#ffffff !important;
  fill:none !important;
  opacity:.98 !important;
}

#floatingPopup .scanmap-list-action-v3,
.popup-scroll .scanmap-list-action-v3,
#floatingPopup .popup-action.scanmap-action-refined,
.popup-scroll .popup-action.scanmap-action-refined{
  background:linear-gradient(180deg, rgba(20,116,255,.96), rgba(10,86,208,.96)) !important;
  border:1px solid rgba(255,255,255,.14) !important;
  box-shadow:0 8px 16px rgba(0,0,0,.22) !important;
}

#floatingPopup .scanmap-list-action-v3:hover,
.popup-scroll .scanmap-list-action-v3:hover,
#floatingPopup .popup-action.scanmap-action-refined:hover,
.popup-scroll .popup-action.scanmap-action-refined:hover{
  transform:translateY(-1px) !important;
  box-shadow:0 10px 18px rgba(0,0,0,.26) !important;
}

#floatingPopup .popup-action-label,
.popup-scroll .popup-action-label{
  font-size:8px !important;
  font-weight:700 !important;
  letter-spacing:.01em !important;
  color:#ffffff !important;
  opacity:.96 !important;
}

@media (max-width: 420px){
  #floatingPopup .popup-action-icon,
  .popup-scroll .popup-action-icon{
    width:18px !important;
    height:18px !important;
  }

  #floatingPopup .popup-action-icon svg,
  .popup-scroll .popup-action-icon svg{
    width:18px !important;
    height:18px !important;
  }
}

/* ==========================================================
   PATCH ACTION ICONS REFINE
   icone lista più eleganti, meno giocattolose
   ========================================================== */

#floatingPopup .popup-action-icon,
.popup-scroll .popup-action-icon{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:20px !important;
  height:20px !important;
  font-size:0 !important;
  line-height:1 !important;
}

#floatingPopup .popup-action-icon svg,
.popup-scroll .popup-action-icon svg{
  display:block !important;
  width:20px !important;
  height:20px !important;
  stroke:#ffffff !important;
  fill:none !important;
  opacity:.98 !important;
}

#floatingPopup .scanmap-list-action-v3,
.popup-scroll .scanmap-list-action-v3,
#floatingPopup .popup-action.scanmap-action-refined,
.popup-scroll .popup-action.scanmap-action-refined{
  background:linear-gradient(180deg, rgba(20,116,255,.96), rgba(10,86,208,.96)) !important;
  border:1px solid rgba(255,255,255,.14) !important;
  box-shadow:0 8px 16px rgba(0,0,0,.22) !important;
}

#floatingPopup .scanmap-list-action-v3:hover,
.popup-scroll .scanmap-list-action-v3:hover,
#floatingPopup .popup-action.scanmap-action-refined:hover,
.popup-scroll .popup-action.scanmap-action-refined:hover{
  transform:translateY(-1px) !important;
  box-shadow:0 10px 18px rgba(0,0,0,.26) !important;
}

#floatingPopup .popup-action-label,
.popup-scroll .popup-action-label{
  font-size:8px !important;
  font-weight:700 !important;
  letter-spacing:.01em !important;
  color:#ffffff !important;
  opacity:.96 !important;
}

@media (max-width: 420px){
  #floatingPopup .popup-action-icon,
  .popup-scroll .popup-action-icon{
    width:18px !important;
    height:18px !important;
  }

  #floatingPopup .popup-action-icon svg,
  .popup-scroll .popup-action-icon svg{
    width:18px !important;
    height:18px !important;
  }
}

/* PATCH ACTION ICONS FORCE */
#floatingPopup .popup-action-icon.scanmap-svg-action-icon{
  font-size:0 !important;
  width:21px !important;
  height:21px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}

#floatingPopup .popup-action-icon.scanmap-svg-action-icon svg{
  width:21px !important;
  height:21px !important;
  display:block !important;
  stroke:#fff !important;
  color:#fff !important;
  fill:none !important;
}

#floatingPopup .scanmap-action-refined{
  background:linear-gradient(180deg, rgba(20,116,255,.96), rgba(8,76,190,.96)) !important;
}

#floatingPopup .scanmap-action-refined[data-scanmap-icon-type="site"]{
  background:linear-gradient(180deg, #1789ff, #075fce) !important;
}

#floatingPopup .scanmap-action-refined[data-scanmap-icon-type="phone"]{
  background:linear-gradient(180deg, #168fff, #0866d9) !important;
}

#floatingPopup .scanmap-action-refined[data-scanmap-icon-type="walk"]{
  background:linear-gradient(180deg, #147cff, #0755bd) !important;
}

#floatingPopup .scanmap-action-refined[data-scanmap-icon-type="car"]{
  background:linear-gradient(180deg, #126fff, #0648a8) !important;
}

/* ==========================================================
   LIST ACTIONS PREMIUM REFINEMENT
   ========================================================== */

#floatingPopup .popup-buttons,
#floatingPopup .scanmap-list-actions-v3,
#floatingPopup .popup-actions{
  display:grid !important;
  grid-template-columns:repeat(4, minmax(0, 1fr)) !important;
  gap:10px !important;
  margin-top:14px !important;
  align-items:stretch !important;
}

#floatingPopup .popup-action,
#floatingPopup .scanmap-list-action-v3,
#floatingPopup .scanmap-action-refined{
  position:relative !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:7px !important;
  min-height:78px !important;
  padding:10px 6px 9px !important;
  border-radius:18px !important;
  text-decoration:none !important;
  background:
    linear-gradient(180deg, rgba(20,44,78,.96) 0%, rgba(12,28,52,.96) 100%) !important;
  border:1px solid rgba(110,170,255,.22) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 10px 22px rgba(0,0,0,.18) !important;
  backdrop-filter:blur(8px) !important;
  -webkit-backdrop-filter:blur(8px) !important;
  overflow:hidden !important;
}

#floatingPopup .popup-action::before,
#floatingPopup .scanmap-list-action-v3::before,
#floatingPopup .scanmap-action-refined::before{
  content:"" !important;
  position:absolute !important;
  inset:0 !important;
  border-radius:inherit !important;
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0)) !important;
  pointer-events:none !important;
}

#floatingPopup .popup-action:hover,
#floatingPopup .scanmap-list-action-v3:hover,
#floatingPopup .scanmap-action-refined:hover{
  transform:translateY(-1px) !important;
  border-color:rgba(110,190,255,.34) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    0 14px 28px rgba(0,0,0,.22) !important;
}

#floatingPopup .popup-action-icon{
  width:40px !important;
  height:40px !important;
  min-width:40px !important;
  min-height:40px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  border-radius:999px !important;
  background:linear-gradient(180deg, rgba(46,129,255,.18), rgba(46,129,255,.10)) !important;
  border:1px solid rgba(120,185,255,.22) !important;
  color:#ffffff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 6px 12px rgba(0,0,0,.16) !important;
}

#floatingPopup .popup-action-icon svg,
#floatingPopup .scanmap-svg-action-icon svg{
  width:20px !important;
  height:20px !important;
  display:block !important;
  stroke:#ffffff !important;
  opacity:.96 !important;
}

#floatingPopup .popup-action-label{
  display:block !important;
  font-size:12px !important;
  line-height:1.15 !important;
  font-weight:700 !important;
  color:#eef5ff !important;
  text-align:center !important;
  letter-spacing:.01em !important;
  white-space:normal !important;
}

#floatingPopup .popup-action[data-scanmap-icon-type="site"] .popup-action-icon,
#floatingPopup .scanmap-action-refined[data-scanmap-icon-type="site"] .popup-action-icon{
  background:linear-gradient(180deg, rgba(59,130,246,.22), rgba(59,130,246,.11)) !important;
}

#floatingPopup .popup-action[data-scanmap-icon-type="phone"] .popup-action-icon,
#floatingPopup .scanmap-action-refined[data-scanmap-icon-type="phone"] .popup-action-icon{
  background:linear-gradient(180deg, rgba(34,197,94,.22), rgba(34,197,94,.10)) !important;
}

#floatingPopup .popup-action[data-scanmap-icon-type="walk"] .popup-action-icon,
#floatingPopup .scanmap-action-refined[data-scanmap-icon-type="walk"] .popup-action-icon{
  background:linear-gradient(180deg, rgba(245,158,11,.22), rgba(245,158,11,.10)) !important;
}

#floatingPopup .popup-action[data-scanmap-icon-type="car"] .popup-action-icon,
#floatingPopup .scanmap-action-refined[data-scanmap-icon-type="car"] .popup-action-icon{
  background:linear-gradient(180deg, rgba(239,68,68,.22), rgba(239,68,68,.10)) !important;
}

@media (max-width: 640px){
  #floatingPopup .popup-buttons,
  #floatingPopup .scanmap-list-actions-v3,
  #floatingPopup .popup-actions{
    gap:8px !important;
  }

  #floatingPopup .popup-action,
  #floatingPopup .scanmap-list-action-v3,
  #floatingPopup .scanmap-action-refined{
    min-height:72px !important;
    padding:8px 4px 8px !important;
    border-radius:16px !important;
  }

  #floatingPopup .popup-action-icon{
    width:36px !important;
    height:36px !important;
    min-width:36px !important;
    min-height:36px !important;
  }

  #floatingPopup .popup-action-icon svg,
  #floatingPopup .scanmap-svg-action-icon svg{
    width:18px !important;
    height:18px !important;
  }

  #floatingPopup .popup-action-label{
    font-size:11px !important;
  }
}

/* ==========================================================
   LIST ACTIONS COMPACT FINAL
   riduce altezza pulsanti e impedisce taglio delle label
   ========================================================== */

#floatingPopup .popup-buttons,
#floatingPopup .scanmap-list-actions-v3,
#floatingPopup .popup-actions{
  gap:8px !important;
  margin-top:10px !important;
  padding-top:10px !important;
}

#floatingPopup .popup-action,
#floatingPopup .scanmap-list-action-v3,
#floatingPopup .scanmap-action-refined{
  min-height:58px !important;
  height:58px !important;
  padding:6px 4px 5px !important;
  border-radius:15px !important;
  gap:4px !important;
  overflow:hidden !important;
}

#floatingPopup .popup-action-icon{
  width:30px !important;
  height:30px !important;
  min-width:30px !important;
  min-height:30px !important;
  border-radius:999px !important;
}

#floatingPopup .popup-action-icon svg,
#floatingPopup .scanmap-svg-action-icon svg{
  width:16px !important;
  height:16px !important;
}

#floatingPopup .popup-action-label{
  display:block !important;
  font-size:9px !important;
  line-height:1.05 !important;
  height:auto !important;
  max-height:none !important;
  overflow:visible !important;
  white-space:nowrap !important;
  text-overflow:clip !important;
  transform:none !important;
  margin:0 !important;
  padding:0 !important;
}

/* Card leggermente più compatta */
#floatingPopup .scanmap-list-content-v3{
  padding:9px !important;
  gap:8px 11px !important;
}

#floatingPopup .scanmap-list-more-v3{
  padding-top:3px !important;
  font-size:13px !important;
}

@media(max-width:420px){
  #floatingPopup .popup-action,
  #floatingPopup .scanmap-list-action-v3,
  #floatingPopup .scanmap-action-refined{
    min-height:54px !important;
    height:54px !important;
    padding:5px 3px 4px !important;
    border-radius:14px !important;
  }

  #floatingPopup .popup-action-icon{
    width:28px !important;
    height:28px !important;
    min-width:28px !important;
    min-height:28px !important;
  }

  #floatingPopup .popup-action-icon svg,
  #floatingPopup .scanmap-svg-action-icon svg{
    width:15px !important;
    height:15px !important;
  }

  #floatingPopup .popup-action-label{
    font-size:8px !important;
  }
}

/* ==========================================================
   LANGUAGE RUNTIME FIX
   menu lingue topbar
   ========================================================== */

#langBtn{
  cursor:pointer !important;
  position:relative !important;
}

.scanmap-lang-menu-runtime{
  display:none;
  width:210px;
  max-height:55vh;
  overflow-y:auto;
  padding:8px;
  border-radius:18px;
  background:rgba(5,22,38,.98);
  border:1px solid rgba(90,180,255,.22);
  box-shadow:0 18px 38px rgba(0,0,0,.38);
  z-index:99999;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.scanmap-lang-menu-runtime.is-open{
  display:block;
}

.scanmap-lang-menu-item{
  width:100%;
  display:grid;
  grid-template-columns:32px 42px 1fr;
  align-items:center;
  gap:8px;
  border:none;
  border-radius:12px;
  background:transparent;
  color:#fff;
  padding:9px 10px;
  cursor:pointer;
  text-align:left;
}

.scanmap-lang-menu-item:hover{
  background:rgba(255,255,255,.08);
}

.scanmap-lang-menu-item span{
  font-size:20px;
  line-height:1;
}

.scanmap-lang-menu-item strong{
  font-size:13px;
  font-weight:800;
}

.scanmap-lang-menu-item em{
  font-style:normal;
  font-size:12px;
  color:rgba(255,255,255,.72);
}

@media(max-width:640px){
  .scanmap-lang-menu-runtime{
    width:190px;
    max-height:48vh;
  }
}

/* ==========================================================
   DESKTOP LANGUAGE FLAGS FIX
   usa immagini PNG per evitare FR/IT al posto delle bandiere
   ========================================================== */

#langBtn .scanmap-lang-img{
  width:26px !important;
  height:18px !important;
  object-fit:cover !important;
  border-radius:4px !important;
  display:block !important;
  flex:0 0 26px !important;
  box-shadow:0 1px 3px rgba(0,0,0,.25) !important;
}

.scanmap-lang-menu-item .scanmap-lang-img{
  width:28px !important;
  height:20px !important;
  object-fit:cover !important;
  border-radius:4px !important;
  display:block !important;
}

#langBtn .scanmap-lang-flag{
  display:none !important;
}

#langBtn{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  min-width:82px !important;
}

.scanmap-lang-menu-item{
  grid-template-columns:34px 42px 1fr !important;
}

/* ==========================================================
   NAVBAR FINAL: icone bianche su blu, AI fuori navbar
   ========================================================== */

/* Sfondo navbar inferiore blu coerente */
#navbar{
  background:
    radial-gradient(circle at top left, rgba(52,181,229,.18), transparent 38%),
    linear-gradient(180deg, rgba(7,38,70,.98), rgba(3,20,38,.98)) !important;
  border-top:1px solid rgba(255,255,255,.12) !important;
  box-shadow:0 -10px 28px rgba(0,0,0,.28) !important;
}

/* Nasconde AI centrale senza eliminare la logica */
#scanmap-ai-nav-btn,
#icon-transport.scanmap-ai-nav{
  display:none !important;
}

/* Ridistribuisce meglio le voci rimaste */
#navbar .icon-links{
  display:flex !important;
  align-items:center !important;
  justify-content:space-around !important;
  gap:0 !important;
  padding:7px 8px 8px !important;
}

#navbar .icon-links a{
  flex:1 1 0 !important;
  min-width:0 !important;
}

/* Icone navbar bianche: usa pseudo-icone monocromatiche */
#navbar img.icon,
#navbar .scanmap-nav-symbol{
  display:none !important;
}

#navbar .icon-wrapper::before{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:30px !important;
  height:30px !important;
  color:#ffffff !important;
  font-size:24px !important;
  line-height:1 !important;
  font-family:system-ui, -apple-system, "Segoe UI Symbol", sans-serif !important;
  font-weight:700 !important;
  text-shadow:0 0 12px rgba(255,255,255,.16) !important;
  filter:none !important;
}

/* Simboli bianchi più sobri rispetto alle emoji */
#icon-visit .icon-wrapper::before{content:"⌂" !important;}
#icon-lights .icon-wrapper::before{content:"✦" !important;}
#icon-shopping .icon-wrapper::before{content:"◇" !important;}
#icon-food .icon-wrapper::before{content:"♨" !important;}
#icon-hotel .icon-wrapper::before{content:"▱" !important;}
#icon-events .icon-wrapper::before{content:"☷" !important;}

/* Etichette navbar */
#navbar .icon-label{
  color:rgba(255,255,255,.94) !important;
  font-size:11px !important;
  line-height:1.05 !important;
  font-weight:600 !important;
  text-align:center !important;
  max-width:78px !important;
}

/* Voce attiva */
#navbar .icon-links a.active .icon-wrapper,
#navbar .icon-links a:hover .icon-wrapper{
  background:rgba(255,255,255,.08) !important;
  border-radius:16px !important;
}

/* Bottone AI laterale sotto LIST */
.scanmap-ai-side-btn{
  position:fixed !important;
  right:8px !important;
  top:calc(50% + 98px) !important;
  width:56px !important;
  height:56px !important;
  z-index:2470 !important;
  border:none !important;
  border-radius:18px !important;
  background:linear-gradient(180deg,#ff3b2f 0%,#c91512 100%) !important;
  color:#fff !important;
  box-shadow:0 0 22px rgba(255,55,45,.42),0 12px 24px rgba(0,0,0,.34) !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:2px !important;
  cursor:pointer !important;
  padding:0 !important;
}

.scanmap-ai-side-icon{
  font-size:17px !important;
  line-height:1 !important;
  font-weight:900 !important;
  letter-spacing:-.03em !important;
}

.scanmap-ai-side-text{
  font-size:10px !important;
  line-height:1 !important;
  font-weight:800 !important;
  letter-spacing:.04em !important;
}

/* Mantiene LIST sopra AI con spazio sufficiente */
#floatingMarker,
.floating-marker{
  top:50% !important;
  right:0 !important;
  transform:translateY(-50%) !important;
}

/* Colonna controlli sopra LIST */
.scanmap-map-controls-v2{
  top:calc(50% - 210px) !important;
  right:8px !important;
}

/* Desktop: controlli leggermente più larghi */
@media(min-width:701px){
  .scanmap-ai-side-btn{
    right:18px !important;
    top:calc(50% + 102px) !important;
    width:58px !important;
    height:58px !important;
  }

  .scanmap-map-controls-v2{
    right:18px !important;
    top:calc(50% - 145px) !important;
  }
}

/* Mobile stretto */
@media(max-width:420px){
  .scanmap-ai-side-btn{
    right:6px !important;
    top:calc(50% + 96px) !important;
    width:54px !important;
    height:54px !important;
    border-radius:17px !important;
  }

  #navbar .icon-label{
    font-size:10px !important;
  }

  #navbar .icon-wrapper::before{
    font-size:22px !important;
  }
}

/* ==========================================================
   PATCH NAVBAR/AI SIDE REFINEMENT
   AI uniforme a LIST + icone navbar più gradevoli
   ========================================================== */

/* AI laterale: stessa struttura visuale del bottone LIST, ma rosso */
.scanmap-ai-side-btn{
  right:8px !important;
  top:calc(50% + 98px) !important;
  width:56px !important;
  height:84px !important;
  padding:0 !important;
  border-radius:20px 0 0 20px !important;
  border:1px solid rgba(255,255,255,.18) !important;
  border-right:none !important;
  background:linear-gradient(180deg,#ff3b2f 0%,#c91512 100%) !important;
  color:#fff !important;
  box-shadow:0 10px 24px rgba(0,0,0,.34),0 0 20px rgba(255,55,45,.34) !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:5px !important;
  z-index:2470 !important;
}

/* icona AI più chiara e meno “badge” */
.scanmap-ai-side-icon{
  width:28px !important;
  height:28px !important;
  border-radius:999px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:0 !important;
  line-height:1 !important;
  background:rgba(255,255,255,.13) !important;
  border:1px solid rgba(255,255,255,.18) !important;
}

.scanmap-ai-side-icon::before{
  content:"✦" !important;
  font-size:19px !important;
  line-height:1 !important;
  color:#fff !important;
}

.scanmap-ai-side-text{
  font-size:10px !important;
  line-height:1 !important;
  font-weight:900 !important;
  letter-spacing:.08em !important;
  color:#fff !important;
}

/* LIST e AI devono sembrare stessa famiglia */
#floatingMarker,
.floating-marker{
  width:56px !important;
  height:84px !important;
  border-radius:20px 0 0 20px !important;
  border:1px solid rgba(255,255,255,.18) !important;
  border-right:none !important;
  background:rgba(5,22,38,.96) !important;
  box-shadow:0 10px 24px rgba(0,0,0,.34) !important;
}

/* Desktop */
@media(min-width:701px){
  .scanmap-ai-side-btn{
    right:0 !important;
    top:calc(50% + 98px) !important;
    width:58px !important;
    height:86px !important;
  }

  #floatingMarker,
  .floating-marker{
    right:0 !important;
    width:58px !important;
    height:86px !important;
  }
}

/* Mobile */
@media(max-width:420px){
  .scanmap-ai-side-btn{
    right:0 !important;
    top:calc(50% + 96px) !important;
    width:54px !important;
    height:80px !important;
    border-radius:18px 0 0 18px !important;
  }

  #floatingMarker,
  .floating-marker{
    width:54px !important;
    height:80px !important;
    border-radius:18px 0 0 18px !important;
  }
}

/* ==========================================================
   Navbar: sostituisce simboli brutti con icone più leggibili
   sempre bianche e coerenti
   ========================================================== */

/* togli i simboli precedenti */
#navbar .icon-wrapper::before{
  content:none !important;
  display:none !important;
}

/* usa icone emoji precedenti ma “spente”/monocromatiche quanto possibile */
#navbar img.icon{
  display:none !important;
}

#navbar .icon-wrapper{
  gap:5px !important;
}

#navbar .icon-wrapper::after{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:30px !important;
  height:30px !important;
  font-size:23px !important;
  line-height:1 !important;
  filter:grayscale(1) brightness(2.4) contrast(.85) !important;
  opacity:.96 !important;
  text-shadow:0 0 10px rgba(255,255,255,.10) !important;
}

#icon-visit .icon-wrapper::after{content:"🏛️" !important;}
#icon-lights .icon-wrapper::after{content:"🛎️" !important;}
#icon-shopping .icon-wrapper::after{content:"🛍️" !important;}
#icon-food .icon-wrapper::after{content:"🍴" !important;}
#icon-hotel .icon-wrapper::after{content:"🛏️" !important;}
#icon-events .icon-wrapper::after{content:"📣" !important;}

/* label più pulite */
#navbar .icon-label{
  color:rgba(255,255,255,.94) !important;
  font-size:11px !important;
  line-height:1.05 !important;
  font-weight:650 !important;
  letter-spacing:.01em !important;
}

/* evita che eventuale transport/AI occupi spazio */
#icon-transport,
#scanmap-ai-nav-btn{
  display:none !important;
}

/* ==========================================================
   PATCH AI SIDE BUTTON ALIGN FINAL
   AI identico a LIST, sotto LIST, attaccato al bordo destro
   ========================================================== */

/* LIST: riferimento visivo */
#floatingMarker,
.floating-marker{
  right:0 !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  width:58px !important;
  height:86px !important;
  border-radius:22px 0 0 22px !important;
  border:1px solid rgba(255,255,255,.18) !important;
  border-right:none !important;
  background:rgba(5,22,38,.96) !important;
  color:#fff !important;
  box-shadow:0 10px 24px rgba(0,0,0,.34) !important;
  z-index:2470 !important;
}

/* AI: stessa forma del LIST, solo rossa */
#scanmapAiSideBtn.scanmap-ai-side-btn,
.scanmap-ai-side-btn{
  position:fixed !important;
  right:0 !important;
  top:calc(50% + 96px) !important;
  transform:none !important;
  width:58px !important;
  height:86px !important;
  min-width:58px !important;
  max-width:58px !important;
  min-height:86px !important;
  max-height:86px !important;
  padding:0 !important;
  margin:0 !important;
  border-radius:22px 0 0 22px !important;
  border:1px solid rgba(255,255,255,.18) !important;
  border-right:none !important;
  background:linear-gradient(180deg,#ff4338 0%,#d71915 100%) !important;
  color:#fff !important;
  box-shadow:0 10px 24px rgba(0,0,0,.34), 0 0 22px rgba(255,55,45,.32) !important;
  z-index:2471 !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  overflow:hidden !important;
}

/* Icona AI centrata */
#scanmapAiSideBtn .scanmap-ai-side-icon,
.scanmap-ai-side-btn .scanmap-ai-side-icon{
  width:31px !important;
  height:31px !important;
  min-width:31px !important;
  min-height:31px !important;
  border-radius:999px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:rgba(255,255,255,.14) !important;
  border:1px solid rgba(255,255,255,.18) !important;
  font-size:0 !important;
  line-height:1 !important;
}

#scanmapAiSideBtn .scanmap-ai-side-icon::before,
.scanmap-ai-side-btn .scanmap-ai-side-icon::before{
  content:"✦" !important;
  font-size:19px !important;
  line-height:1 !important;
  color:#fff !important;
}

/* Testo AI */
#scanmapAiSideBtn .scanmap-ai-side-text,
.scanmap-ai-side-btn .scanmap-ai-side-text{
  display:block !important;
  font-size:11px !important;
  line-height:1 !important;
  font-weight:900 !important;
  letter-spacing:.05em !important;
  color:#fff !important;
  text-align:center !important;
}

/* Mobile stretto */
@media(max-width:420px){
  #floatingMarker,
  .floating-marker{
    width:56px !important;
    height:82px !important;
    border-radius:20px 0 0 20px !important;
  }

  #scanmapAiSideBtn.scanmap-ai-side-btn,
  .scanmap-ai-side-btn{
    right:0 !important;
    top:calc(50% + 92px) !important;
    width:56px !important;
    height:82px !important;
    min-width:56px !important;
    max-width:56px !important;
    min-height:82px !important;
    max-height:82px !important;
    border-radius:20px 0 0 20px !important;
  }
}

/* ==========================================================
   PATCH LIST + AI UNIFORMATI
   stessa dimensione, stesso allineamento, divisi solo da una linea
   ========================================================== */

/* LIST */
#floatingMarker,
.floating-marker{
  right: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 58px !important;
  height: 86px !important;
  min-width: 58px !important;
  max-width: 58px !important;
  min-height: 86px !important;
  max-height: 86px !important;
  padding: 0 !important;
  border-radius: 22px 0 0 0 !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  border-right: none !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  overflow: hidden !important;
  z-index: 2470 !important;
}

/* AI: stessa dimensione del LIST, attaccato sotto */
#scanmapAiSideBtn,
.scanmap-ai-side-btn{
  position: fixed !important;
  right: 0 !important;
  top: calc(50% + 43px) !important;   /* 50% + metà altezza del LIST */
  transform: none !important;
  width: 58px !important;
  height: 86px !important;
  min-width: 58px !important;
  max-width: 58px !important;
  min-height: 86px !important;
  max-height: 86px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 0 0 22px !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  border-top: none !important;        /* così resta una sola linea tra LIST e AI */
  border-right: none !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  overflow: hidden !important;
  z-index: 2471 !important;
}

/* Uniforma il contenuto interno */
#floatingMarker .scanmap-side-icon,
.floating-marker .scanmap-side-icon,
#scanmapAiSideBtn .scanmap-ai-side-icon,
.scanmap-ai-side-btn .scanmap-ai-side-icon{
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
}

#floatingMarker .scanmap-side-text,
.floating-marker .scanmap-side-text,
#scanmapAiSideBtn .scanmap-ai-side-text,
.scanmap-ai-side-btn .scanmap-ai-side-text{
  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  letter-spacing: .03em !important;
  text-align: center !important;
  color: #fff !important;
}

/* Mobile stretto */
@media (max-width: 420px){
  #floatingMarker,
  .floating-marker{
    width: 56px !important;
    height: 82px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    min-height: 82px !important;
    max-height: 82px !important;
    border-radius: 20px 0 0 0 !important;
  }

  #scanmapAiSideBtn,
  .scanmap-ai-side-btn{
    width: 56px !important;
    height: 82px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    min-height: 82px !important;
    max-height: 82px !important;
    top: calc(50% + 41px) !important;
    border-radius: 0 0 0 20px !important;
  }
}

/* ==========================================================
   SIDE TABS FINAL
   LIST + AI come blocco unico laterale
   ========================================================== */

:root{
  --scanmap-side-tab-w: 58px;
  --scanmap-side-tab-h: 82px;
  --scanmap-side-tabs-top: calc(50% - 41px);
}

/* LIST: metà superiore del blocco */
#floatingMarker,
.floating-marker{
  position:fixed !important;
  right:0 !important;
  top:var(--scanmap-side-tabs-top) !important;
  transform:none !important;

  width:var(--scanmap-side-tab-w) !important;
  height:var(--scanmap-side-tab-h) !important;
  min-width:var(--scanmap-side-tab-w) !important;
  max-width:var(--scanmap-side-tab-w) !important;
  min-height:var(--scanmap-side-tab-h) !important;
  max-height:var(--scanmap-side-tab-h) !important;

  padding:0 !important;
  margin:0 !important;
  box-sizing:border-box !important;

  border-radius:22px 0 0 0 !important;
  border:1px solid rgba(255,255,255,.18) !important;
  border-right:none !important;
  border-bottom:1px solid rgba(255,255,255,.22) !important;

  background:rgba(5,22,38,.96) !important;
  color:#fff !important;
  box-shadow:0 10px 24px rgba(0,0,0,.34) !important;

  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;

  writing-mode:horizontal-tb !important;
  letter-spacing:0 !important;
  overflow:hidden !important;
  z-index:2470 !important;
}

/* AI: metà inferiore del blocco, subito sotto LIST */
#scanmapAiSideBtn,
#scanmapAiSideBtn.scanmap-ai-side-btn,
.scanmap-ai-side-btn{
  position:fixed !important;
  right:0 !important;
  top:calc(var(--scanmap-side-tabs-top) + var(--scanmap-side-tab-h)) !important;
  transform:none !important;

  width:var(--scanmap-side-tab-w) !important;
  height:var(--scanmap-side-tab-h) !important;
  min-width:var(--scanmap-side-tab-w) !important;
  max-width:var(--scanmap-side-tab-w) !important;
  min-height:var(--scanmap-side-tab-h) !important;
  max-height:var(--scanmap-side-tab-h) !important;

  padding:0 !important;
  margin:0 !important;
  box-sizing:border-box !important;

  border-radius:0 0 0 22px !important;
  border:1px solid rgba(255,255,255,.18) !important;
  border-top:none !important;
  border-right:none !important;

  background:linear-gradient(180deg,#ff4338 0%,#d71915 100%) !important;
  color:#fff !important;
  box-shadow:0 10px 24px rgba(0,0,0,.34), 0 0 22px rgba(255,55,45,.30) !important;

  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;

  overflow:hidden !important;
  z-index:2470 !important;
}

/* contenuto LIST */
#floatingMarker .scanmap-list-icon,
.floating-marker .scanmap-list-icon{
  display:block !important;
  font-size:27px !important;
  line-height:1 !important;
  color:#fff !important;
}

#floatingMarker .scanmap-list-text,
.floating-marker .scanmap-list-text{
  display:block !important;
  font-size:11px !important;
  line-height:1 !important;
  font-weight:900 !important;
  letter-spacing:.04em !important;
  color:#fff !important;
}

/* contenuto AI */
#scanmapAiSideBtn .scanmap-ai-side-icon,
.scanmap-ai-side-btn .scanmap-ai-side-icon{
  width:31px !important;
  height:31px !important;
  min-width:31px !important;
  min-height:31px !important;
  border-radius:999px !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  background:rgba(255,255,255,.14) !important;
  border:1px solid rgba(255,255,255,.18) !important;
  font-size:0 !important;
  line-height:1 !important;
}

#scanmapAiSideBtn .scanmap-ai-side-icon::before,
.scanmap-ai-side-btn .scanmap-ai-side-icon::before{
  content:"✦" !important;
  font-size:19px !important;
  line-height:1 !important;
  color:#fff !important;
}

#scanmapAiSideBtn .scanmap-ai-side-text,
.scanmap-ai-side-btn .scanmap-ai-side-text{
  display:block !important;
  font-size:11px !important;
  line-height:1 !important;
  font-weight:900 !important;
  letter-spacing:.05em !important;
  color:#fff !important;
  text-align:center !important;
}

/* la colonna layer/posizione resta sopra il blocco LIST+AI */
.scanmap-map-controls-v2{
  right:8px !important;
  top:calc(var(--scanmap-side-tabs-top) - 112px) !important;
  z-index:2472 !important;
}

/* desktop */
@media(min-width:701px){
  :root{
    --scanmap-side-tab-w: 58px;
    --scanmap-side-tab-h: 82px;
    --scanmap-side-tabs-top: calc(50% - 41px);
  }

  .scanmap-map-controls-v2{
    right:18px !important;
    top:calc(var(--scanmap-side-tabs-top) - 112px) !important;
  }
}

/* mobile stretto */
@media(max-width:420px){
  :root{
    --scanmap-side-tab-w: 56px;
    --scanmap-side-tab-h: 80px;
    --scanmap-side-tabs-top: calc(50% - 40px);
  }

  #floatingMarker,
  .floating-marker{
    border-radius:20px 0 0 0 !important;
  }

  #scanmapAiSideBtn,
  #scanmapAiSideBtn.scanmap-ai-side-btn,
  .scanmap-ai-side-btn{
    border-radius:0 0 0 20px !important;
  }

  .scanmap-map-controls-v2{
    right:7px !important;
    top:calc(var(--scanmap-side-tabs-top) - 108px) !important;
  }
}

/* ==========================================================
   RESTORE SIDE TABS 2
   LIST + AI come blocco unico laterale
   ========================================================== */

:root{
  --scanmap-side-tab-w: 58px;
  --scanmap-side-tab-h: 82px;
  --scanmap-side-tabs-top: calc(50% - 41px);
}

#floatingMarker,
.floating-marker{
  position:fixed !important;
  right:0 !important;
  top:var(--scanmap-side-tabs-top) !important;
  transform:none !important;
  width:var(--scanmap-side-tab-w) !important;
  height:var(--scanmap-side-tab-h) !important;
  min-width:var(--scanmap-side-tab-w) !important;
  max-width:var(--scanmap-side-tab-w) !important;
  min-height:var(--scanmap-side-tab-h) !important;
  max-height:var(--scanmap-side-tab-h) !important;
  padding:0 !important;
  margin:0 !important;
  border-radius:22px 0 0 0 !important;
  border:1px solid rgba(255,255,255,.18) !important;
  border-right:none !important;
  border-bottom:1px solid rgba(255,255,255,.22) !important;
  box-sizing:border-box !important;
  background:rgba(5,22,38,.96) !important;
  color:#fff !important;
  box-shadow:0 10px 24px rgba(0,0,0,.34) !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  writing-mode:horizontal-tb !important;
  overflow:hidden !important;
  z-index:2470 !important;
}

#scanmapAiSideBtn,
#scanmapAiSideBtn.scanmap-ai-side-btn,
.scanmap-ai-side-btn{
  position:fixed !important;
  right:0 !important;
  top:calc(var(--scanmap-side-tabs-top) + var(--scanmap-side-tab-h)) !important;
  transform:none !important;
  width:var(--scanmap-side-tab-w) !important;
  height:var(--scanmap-side-tab-h) !important;
  min-width:var(--scanmap-side-tab-w) !important;
  max-width:var(--scanmap-side-tab-w) !important;
  min-height:var(--scanmap-side-tab-h) !important;
  max-height:var(--scanmap-side-tab-h) !important;
  padding:0 !important;
  margin:0 !important;
  border-radius:0 0 0 22px !important;
  border:1px solid rgba(255,255,255,.18) !important;
  border-top:none !important;
  border-right:none !important;
  box-sizing:border-box !important;
  background:linear-gradient(180deg,#ff4338 0%,#d71915 100%) !important;
  color:#fff !important;
  box-shadow:0 10px 24px rgba(0,0,0,.34), 0 0 22px rgba(255,55,45,.30) !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  overflow:hidden !important;
  z-index:2470 !important;
}

.scanmap-map-controls-v2{
  right:8px !important;
  top:calc(var(--scanmap-side-tabs-top) - 112px) !important;
  z-index:2472 !important;
}

@media(max-width:420px){
  :root{
    --scanmap-side-tab-w: 56px;
    --scanmap-side-tab-h: 80px;
    --scanmap-side-tabs-top: calc(50% - 40px);
  }

  #floatingMarker,
  .floating-marker{
    border-radius:20px 0 0 0 !important;
  }

  #scanmapAiSideBtn,
  #scanmapAiSideBtn.scanmap-ai-side-btn,
  .scanmap-ai-side-btn{
    border-radius:0 0 0 20px !important;
  }

  .scanmap-map-controls-v2{
    right:7px !important;
    top:calc(var(--scanmap-side-tabs-top) - 108px) !important;
  }
}

/* ==========================================================
   STATIC SIDE TABS: LIST + PERCORSI + AI
   nessun runtime, nessun loop
   ========================================================== */

:root{
  --scanmap-side-tab-w:58px;
  --scanmap-side-tab-h:72px;
  --scanmap-side-tabs-top:calc(50% - 108px);
}

/* LIST */
#floatingMarker,
.floating-marker{
  position:fixed !important;
  right:0 !important;
  top:var(--scanmap-side-tabs-top) !important;
  transform:none !important;
  width:var(--scanmap-side-tab-w) !important;
  height:var(--scanmap-side-tab-h) !important;
  min-width:var(--scanmap-side-tab-w) !important;
  max-width:var(--scanmap-side-tab-w) !important;
  min-height:var(--scanmap-side-tab-h) !important;
  max-height:var(--scanmap-side-tab-h) !important;
  border-radius:22px 0 0 0 !important;
  border:1px solid rgba(255,255,255,.18) !important;
  border-right:none !important;
  border-bottom:1px solid rgba(255,255,255,.22) !important;
  box-sizing:border-box !important;
  z-index:2470 !important;
}

/* PERCORSI */
#scanmapRoutesSideBtn{
  position:fixed !important;
  right:0 !important;
  top:calc(var(--scanmap-side-tabs-top) + var(--scanmap-side-tab-h)) !important;
  width:var(--scanmap-side-tab-w) !important;
  height:var(--scanmap-side-tab-h) !important;
  min-width:var(--scanmap-side-tab-w) !important;
  max-width:var(--scanmap-side-tab-w) !important;
  min-height:var(--scanmap-side-tab-h) !important;
  max-height:var(--scanmap-side-tab-h) !important;
  padding:0 !important;
  margin:0 !important;
  border-radius:0 !important;
  border:1px solid rgba(255,255,255,.18) !important;
  border-top:none !important;
  border-right:none !important;
  border-bottom:1px solid rgba(255,255,255,.22) !important;
  box-sizing:border-box !important;
  background:linear-gradient(180deg, rgba(18,128,190,.98), rgba(6,78,128,.98)) !important;
  color:#fff !important;
  box-shadow:0 10px 24px rgba(0,0,0,.30), 0 0 18px rgba(52,181,229,.20) !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:5px !important;
  cursor:pointer !important;
  overflow:hidden !important;
  z-index:2470 !important;
}

/* AI */
#scanmapAiSideBtn,
#scanmapAiSideBtn.scanmap-ai-side-btn,
.scanmap-ai-side-btn{
  position:fixed !important;
  right:0 !important;
  top:calc(var(--scanmap-side-tabs-top) + (var(--scanmap-side-tab-h) * 2)) !important;
  width:var(--scanmap-side-tab-w) !important;
  height:var(--scanmap-side-tab-h) !important;
  min-width:var(--scanmap-side-tab-w) !important;
  max-width:var(--scanmap-side-tab-w) !important;
  min-height:var(--scanmap-side-tab-h) !important;
  max-height:var(--scanmap-side-tab-h) !important;
  border-radius:0 0 0 22px !important;
}

/* Icona Percorsi */
#scanmapRoutesSideBtn .scanmap-routes-side-icon{
  width:29px !important;
  height:29px !important;
  border-radius:999px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:rgba(255,255,255,.14) !important;
  border:1px solid rgba(255,255,255,.18) !important;
}

#scanmapRoutesSideBtn .scanmap-routes-side-icon::before{
  content:"⌁" !important;
  font-size:21px !important;
  line-height:1 !important;
  color:#fff !important;
}

#scanmapRoutesSideBtn .scanmap-routes-side-text{
  display:block !important;
  font-size:9px !important;
  line-height:1 !important;
  font-weight:900 !important;
  letter-spacing:.03em !important;
  color:#fff !important;
  text-align:center !important;
  max-width:54px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

/* controlli layer/posizione sopra il blocco a 3 */
.scanmap-map-controls-v2{
  top:calc(var(--scanmap-side-tabs-top) - 112px) !important;
}

@media(max-width:420px){
  :root{
    --scanmap-side-tab-w:56px;
    --scanmap-side-tab-h:70px;
    --scanmap-side-tabs-top:calc(50% - 105px);
  }

  #floatingMarker,
  .floating-marker{
    border-radius:20px 0 0 0 !important;
  }

  #scanmapAiSideBtn,
  #scanmapAiSideBtn.scanmap-ai-side-btn,
  .scanmap-ai-side-btn{
    border-radius:0 0 0 20px !important;
  }

  .scanmap-map-controls-v2{
    top:calc(var(--scanmap-side-tabs-top) - 108px) !important;
  }
}

/* ==========================================================
   TOPBAR DARK FINAL - forza grafica nuova su tutte le mappe
   ========================================================== */

body .scanmap-topbar,
html body .scanmap-topbar{
  position:fixed !important;
  top:0 !important;
  left:0 !important;
  width:100% !important;
  height:74px !important;
  min-height:74px !important;
  padding:8px 14px !important;
  box-sizing:border-box !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(33,150,243,.18), transparent 34%),
    linear-gradient(180deg, rgba(3,22,40,.98), rgba(2,14,28,.98)) !important;
  border-bottom:1px solid rgba(255,255,255,.10) !important;
  box-shadow:0 8px 24px rgba(0,0,0,.26) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  z-index:3000 !important;
}

/* sinistra */
body .scanmap-topbar-left,
html body .scanmap-topbar-left{
  display:flex !important;
  align-items:center !important;
  min-width:0 !important;
}

body .scanmap-topbar-left a,
html body .scanmap-topbar-left a{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  color:inherit !important;
  text-decoration:none !important;
  min-width:0 !important;
}

/* logo */
body .scanmap-logo,
html body .scanmap-logo{
  width:50px !important;
  height:50px !important;
  min-width:50px !important;
  max-width:50px !important;
  flex:0 0 50px !important;
  border-radius:50% !important;
  overflow:hidden !important;
  background:transparent !important;
  box-shadow:0 0 0 1px rgba(255,255,255,.14), 0 6px 16px rgba(0,0,0,.25) !important;
}

body .scanmap-logo img,
html body .scanmap-logo img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  display:block !important;
}

/* titolo */
body .scanmap-brand,
html body .scanmap-brand{
  min-width:0 !important;
  line-height:1.05 !important;
}

body .scanmap-brand strong,
html body .scanmap-brand strong{
  display:block !important;
  color:#fff !important;
  font-size:20px !important;
  font-weight:850 !important;
  line-height:1.05 !important;
  letter-spacing:-.03em !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

body .scanmap-brand span,
body #pageTitleSubShell,
html body .scanmap-brand span,
html body #pageTitleSubShell{
  display:block !important;
  color:rgba(255,255,255,.76) !important;
  font-size:13px !important;
  font-weight:500 !important;
  line-height:1.15 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  max-width:48vw !important;
}

/* destra */
body .scanmap-topbar-right,
html body .scanmap-topbar-right{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:10px !important;
  flex-shrink:0 !important;
}

/* elimina il bottone lista/clipboard dalla topbar: ora la LIST è laterale */
body #shellListBtn,
html body #shellListBtn{
  display:none !important;
}

/* lingua */
body #langBtn,
html body #langBtn,
body .scanmap-topbar .top-btn#langBtn,
html body .scanmap-topbar .top-btn#langBtn{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  min-width:88px !important;
  width:auto !important;
  height:44px !important;
  padding:0 13px !important;
  border-radius:999px !important;
  background:rgba(255,255,255,.08) !important;
  border:1px solid rgba(255,255,255,.16) !important;
  color:#fff !important;
  box-shadow:0 8px 18px rgba(0,0,0,.22) !important;
}

body #langBtn .scanmap-lang-img,
html body #langBtn .scanmap-lang-img,
body #currentFlag,
html body #currentFlag{
  width:28px !important;
  height:20px !important;
  object-fit:cover !important;
  border-radius:4px !important;
  display:block !important;
  flex:0 0 28px !important;
}

body #langBtn .scanmap-lang-code,
html body #langBtn .scanmap-lang-code{
  color:#fff !important;
  font-size:15px !important;
  font-weight:850 !important;
  line-height:1 !important;
}

body #langBtn .scanmap-lang-caret,
html body #langBtn .scanmap-lang-caret{
  color:rgba(255,255,255,.72) !important;
  font-size:15px !important;
}

/* profilo solo icona */
body .scanmap-user-chip,
html body .scanmap-user-chip{
  width:52px !important;
  height:52px !important;
  min-width:52px !important;
  max-width:52px !important;
  padding:0 !important;
  border-radius:50% !important;
  overflow:hidden !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:rgba(255,255,255,.08) !important;
  border:1px solid rgba(255,255,255,.14) !important;
  box-shadow:0 8px 18px rgba(0,0,0,.22) !important;
}

body .scanmap-user-chip-copy,
html body .scanmap-user-chip-copy{
  display:none !important;
}

body .scanmap-user-chip-media,
html body .scanmap-user-chip-media{
  width:42px !important;
  height:42px !important;
  min-width:42px !important;
  margin:0 !important;
}

/* mappa sotto topbar */
body #map,
html body #map{
  top:74px !important;
}

/* desktop: topbar più compatta verticalmente */
@media(min-width:900px){
  body .scanmap-topbar,
  html body .scanmap-topbar{
    height:64px !important;
    min-height:64px !important;
    padding:7px 14px !important;
  }

  body .scanmap-logo,
  html body .scanmap-logo{
    width:44px !important;
    height:44px !important;
    min-width:44px !important;
    max-width:44px !important;
    flex-basis:44px !important;
  }

  body .scanmap-brand strong,
  html body .scanmap-brand strong{
    font-size:18px !important;
  }

  body .scanmap-brand span,
  body #pageTitleSubShell,
  html body .scanmap-brand span,
  html body #pageTitleSubShell{
    font-size:12px !important;
  }

  body #map,
  html body #map{
    top:64px !important;
  }
}

/* mobile */
@media(max-width:640px){
  body .scanmap-topbar,
  html body .scanmap-topbar{
    height:74px !important;
    min-height:74px !important;
    padding:8px 10px !important;
  }

  body .scanmap-logo,
  html body .scanmap-logo{
    width:46px !important;
    height:46px !important;
    min-width:46px !important;
    max-width:46px !important;
    flex-basis:46px !important;
  }

  body .scanmap-brand strong,
  html body .scanmap-brand strong{
    font-size:18px !important;
  }

  body .scanmap-brand span,
  body #pageTitleSubShell,
  html body .scanmap-brand span,
  html body #pageTitleSubShell{
    font-size:13px !important;
    max-width:45vw !important;
  }

  body #langBtn,
  html body #langBtn{
    min-width:82px !important;
    height:42px !important;
    padding:0 11px !important;
  }

  body .scanmap-user-chip,
  html body .scanmap-user-chip{
    width:50px !important;
    height:50px !important;
    min-width:50px !important;
    max-width:50px !important;
  }
}
