/* Chip sulla mappa e schermata di guida (indicazioni, velocita', avvisi, pulsanti) */

/* ===== guida nell'app: mappa intera che ruota, svolta in alto, arrivo in basso ===== */
body.navigating .panel { display: none; }
body.navigating #map { top: 0 !important; bottom: 0 !important; height: auto !important; visibility: visible !important; }
body.navigating .maplibregl-ctrl-top-right { display: none; }
/* pulsanti dei livelli in alto sulla mappa, a destra del pannello */
.map-chips { position: fixed; top: 18px; left: calc(18px + 406px + 14px); z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.chip { pointer-events: auto; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--linea); background: var(--carta-solida); color: var(--muto); font-weight: 700; font-size: 13px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
.chip svg { width: 17px; height: 17px; }
/* chip acceso: tutti uguali, grigio scuro e scritta bianca; solo l'icona ha il colore dei suoi segnaposto */
.chip[aria-pressed="true"] { color: #fff; background: #2A2A30; border-color: #2A2A30; }
#chip-fuel[aria-pressed="true"] svg { color: #38BDF8; }
#chip-cam[aria-pressed="true"] svg { color: #FBBF24; }
#chip-food[aria-pressed="true"] svg { color: #4ADE80; }
#chip-view[aria-pressed="true"] svg { color: #C4B5FD; }
.chip { flex: none; white-space: nowrap; }
.chip:disabled { cursor: default; opacity: .75; }
.chip small { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; background: var(--nebbia); }
body.navigating .map-chips { display: none; }
.nav { position: fixed; inset: 0; z-index: 15; pointer-events: none; }
.nav > * { pointer-events: auto; }
.nav-head { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; display: grid; gap: 8px; pointer-events: none; }
.nav-head > * { pointer-events: auto; }
.nav-top { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center;
  padding: 12px 14px; border-radius: 12px; background: var(--nav-bg, var(--header-bg)); color: #fff; box-shadow: inset 0 -4px 0 var(--blu), 0 10px 24px rgba(0, 0, 0, 0.3); }
.nav-man { display: grid; justify-items: center; gap: 3px; }
.nav-man b { font-family: var(--cond); font-size: 20px; font-weight: 800; font-style: italic; line-height: 1; }
.nav-icon { width: 58px; height: 58px; flex: none; border-radius: 10px; background: var(--blu); color: #fff; display: grid; place-items: center; }
.nav-icon svg { width: 46px; height: 46px; }
.nav-main { min-width: 0; display: grid; gap: 3px; }
.nav-main b { font-family: var(--cond); font-size: 26px; font-weight: 800; line-height: 1.05;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nav-main span { font-size: 14px; font-weight: 600; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-main span:empty { display: none; }
.nav-then { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 4px -14px -12px; padding: 7px 14px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.15); border-radius: 0 0 12px 12px; background: rgba(0, 0, 0, 0.22); font-size: 14px; font-weight: 700; }
.nav-then-icon svg { width: 24px; height: 24px; display: block; }
.nav-then #nav-then-text { font-weight: 500; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-foot { position: absolute; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: grid; gap: 8px; pointer-events: none; }
.nav-foot > * { pointer-events: auto; }
.nav-foot-row { display: flex; align-items: flex-end; justify-content: space-between; pointer-events: none; }
.nav-foot-row > * { pointer-events: auto; }
.nav-bottom { display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px; background: var(--carta-solida); color: var(--ink); border: 1px solid var(--linea); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
.nav-eta { flex: 1; min-width: 0; display: grid; }
.nav-eta b { font-family: var(--cond); font-size: 25px; font-weight: 800; line-height: 1.05; }
.nav-eta span { font-size: 13px; color: var(--muto); font-weight: 600; }
.nav-btn { height: 46px; min-width: 46px; padding: 0 10px; border-radius: 8px; border: 1.5px solid var(--linea); background: var(--input-bg); color: var(--ink);
  font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.nav-btn svg { width: 20px; height: 20px; }
.nav-exit { background: var(--blu); border-color: var(--blu); color: var(--on-acc); font-family: var(--cond); font-weight: 800; font-style: italic; text-transform: uppercase; padding: 0 16px; }
.nav-recenter { margin-left: auto; height: 46px; padding: 0 18px 0 14px; border-radius: 999px; border: 0; display: flex; align-items: center; gap: 8px;
  background: var(--carta-solida); color: var(--blu-testo); font-weight: 800; font-size: 15px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); cursor: pointer; }
.nav-recenter svg { width: 18px; height: 18px; }
.nav-speed { display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--carta-solida); color: var(--ink); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.nav-speed b { font-family: var(--cond); font-size: 26px; font-weight: 800; line-height: 1; min-width: 2ch; text-align: center; }
.nav-speed small { font-size: 11px; font-weight: 700; color: var(--muto); }
.nav-limit { width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 5px solid #E11D27; color: #111;
  display: grid; place-items: center; font: 800 16px/1 system-ui, sans-serif; }
.nav-speed.over b { color: #E11D27; }
.nav-curve { display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; background: #FACC15; color: #17130A; font-weight: 800; font-size: 16px; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3); }
.nav-curve svg { width: 30px; height: 30px; flex: none; }
.nav-poi { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--fuel); color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3); }
@keyframes heartbeat { 0% { transform: scale(1); } 12% { transform: scale(1.25); } 25%, 100% { transform: scale(1); } }
@keyframes poi-ring { 0% { transform: scale(1); opacity: .75; } 50% { transform: scale(2.1); opacity: 0; } 100% { transform: scale(2.1); opacity: 0; } }
.nav-poi-icon { position: relative; animation: heartbeat 2s ease-in-out infinite; width: 30px; height: 30px; flex: none; border-radius: 50%; background: #fff; color: var(--fuel); display: grid; place-items: center; }
.nav-poi-icon svg { width: 18px; height: 18px; color: var(--fuel); position: relative; z-index: 1; }
.nav-poi-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #fff; opacity: 0; animation: poi-ring 2s cubic-bezier(.2, .7, .3, 1) infinite; }
.nav-poi-ring:nth-child(2) { animation-delay: .14s; }
.nav-poi-ring:nth-child(3) { animation-delay: .28s; }
.nav-me { width: 46px; height: 46px; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45)); }
.nav-me-fixed { position: absolute; left: 50%; margin: -23px 0 0 -23px; pointer-events: none; }
.nav-me svg { width: 100%; height: 100%; display: block; }

.legal { margin: auto 0 0; padding-top: 18px; font-size: 11.5px; color: var(--muto); text-align: center; }  /* sempre in fondo al pannello */

/* in guida: nuova destinazione, sopra le indicazioni (vedi js/19-nuova-meta.js) */
.nav-meta { position: absolute; z-index: 3; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; display: grid; gap: 8px;
  padding: 10px; border-radius: 16px; background: var(--carta-solida); color: var(--ink); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); pointer-events: auto; }
.nav-meta[hidden] { display: none; }
.nav.cerca-meta .nav-head { visibility: hidden; }  /* mentre si cerca, niente indicazioni sotto o intorno al riquadro */
.meta-riga { display: flex; gap: 8px; }
.meta-riga input { flex: 1; min-width: 0; height: 48px; box-sizing: border-box; padding: 0 14px; border: 1px solid var(--linea); border-radius: 12px;
  background: var(--input-bg); color: var(--ink); font: 600 16px var(--font); }
.meta-riga input:focus { outline: 2px solid var(--blu); outline-offset: 0; }
.meta-x { all: unset; padding: 0 12px; border-radius: 12px; font: 700 14.5px var(--font); color: var(--ink); cursor: pointer; }
.meta-x:focus-visible { outline: 2px solid var(--blu); }
.meta-sug { list-style: none; margin: 0; padding: 0; display: grid; max-height: 46vh; overflow-y: auto; }
.meta-sug[hidden] { display: none; }
.meta-sug button { all: unset; box-sizing: border-box; width: 100%; display: grid; gap: 2px; min-height: 52px; padding: 8px 10px; border-radius: 10px;
  font: 700 15.5px var(--font); cursor: pointer; }
.meta-sug button small { font-weight: 500; font-size: 13px; color: var(--muto); }
.meta-sug li + li { border-top: 1px solid var(--linea); }
.meta-sug button:hover, .meta-sug button:focus-visible { background: var(--nebbia); outline: none; }
.meta-proposta { display: grid; gap: 4px; padding: 4px 4px 2px; }
.meta-proposta[hidden] { display: none; }
.meta-proposta b { font-size: 19px; font-weight: 800; }
.meta-proposta span { font-size: 15px; font-weight: 700; color: var(--muto); }
.meta-proposta p { margin: 4px 0 6px; font-size: 13.5px; line-height: 1.4; color: var(--muto); }
.meta-vai { all: unset; box-sizing: border-box; height: 52px; border-radius: 999px; text-align: center; background: var(--blu); color: #FFFFFF;
  font: 800 17px/52px var(--font); cursor: pointer; }
.meta-vai:disabled { opacity: 0.5; }
.meta-vai:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* comandi tondi sulla destra (sopra la velocita' e la barra in basso), come Google Maps */
.nav-lato { display: grid; gap: 10px; justify-self: end; pointer-events: none; }
.nav-tondo { pointer-events: auto; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--carta-solida); color: var(--ink); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28); cursor: pointer; }
.nav-tondo svg { width: 24px; height: 24px; }
.nav-tondo:focus-visible { outline: 3px solid var(--blu); outline-offset: 2px; }
#nav-voice.nav-tondo[aria-pressed="false"] { color: var(--muto); }
.nav-tondo[aria-expanded="true"] { background: #2A2A30; color: #fff; }  /* riquadro aperto: ritoccandolo si chiude */
.benz-titolo { flex: 1; align-self: center; padding-left: 4px; font-size: 18px; font-weight: 800; }
.benz-riga { display: flex; justify-content: space-between; gap: 10px; }
.benz-riga span { font-weight: 800; color: var(--blu-testo); white-space: nowrap; }
.benz-nota { margin: 0; padding: 0 4px 2px; font-size: 13px; color: var(--muto); }
.benz-nota:empty { display: none; }
