/* PERKYSCAN — essenziale. Palette Perky. */
:root {
  --blu: #0084ce;
  --rosso: #e41e26;
  --giallo: #ffc91c;
  --navy: #141a2a;
  --bg: #f4f6fa;
  --card: #ffffff;
  --linea: #e2e6ef;
  --testo: #1b2130;
  --tenue: #6b7280;
  /* --- scala tipografica e profondità (design tokens) --- */
  --r-s: 10px;
  --r-m: 14px;
  --r-g: 18px;
  --ombra-1: 0 1px 2px rgba(20,26,42,.05), 0 4px 14px rgba(20,26,42,.05);
  --ombra-2: 0 10px 26px rgba(20,26,42,.10);
  --ombra-3: 0 26px 64px rgba(20,26,42,.16);
  --tenue-2: #8a90a2;
  --focus: 0 0 0 3px rgba(0,132,206,.16);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--testo);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------- accesso */
.centro { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px)); gap: 16px; }
.card-accesso {
  width: 100%; max-width: 430px; background: var(--card); border: 1px solid var(--linea);
  border-radius: 18px; padding: 30px 26px; box-shadow: 0 10px 30px rgba(20,26,42,.08);
}
.testata { display: flex; align-items: center; gap: 12px; }
.testata h1 { margin: 0; font-size: 21px; letter-spacing: -.3px; }
.testata small { color: var(--tenue); font-size: 11.5px; letter-spacing: .06em; }
.logo {
  width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blu), var(--navy)); color: #fff; font-weight: 800; font-size: 20px;
}
.logo.piccolo { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }
.sottotitolo { color: var(--tenue); font-size: 13.5px; margin: 16px 0 18px; }

.scelta-negozio { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 16px; }
.negozio {
  padding: 16px 10px; border-radius: 12px; border: 2px solid var(--linea); background: #fff;
  font-family: inherit; font-weight: 800; font-size: 14px; letter-spacing: .03em;
  color: var(--testo); cursor: pointer; transition: all .15s;
}
.negozio.montenero.scelto { border-color: var(--blu); background: #eef7fd; color: var(--blu); }
.negozio.washington.scelto { border-color: var(--rosso); background: #fdefef; color: var(--rosso); }

.campo { display: block; margin-bottom: 13px; }
.campo span {
  display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--tenue); margin-bottom: 6px;
}
input[type=text], input[type=password], input[type=number] {
  width: 100%; padding: 12px; font-size: 15px; font-family: inherit;
  border: 1.5px solid var(--linea); border-radius: 10px; outline: none;
}
input:focus { border-color: var(--blu); box-shadow: 0 0 0 3px rgba(0,132,206,.14); }

/* --- campo password con occhietto --- */
.campo-password { position: relative; }
.campo-password input { padding-right: 48px; }
.occhietto {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px;
  background: transparent; color: var(--tenue); cursor: pointer;
  display: grid; place-items: center; transition: background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.occhietto:hover { background: #eef2f7; color: var(--testo); }
.occhietto:focus-visible { outline: 2px solid var(--blu); outline-offset: 1px; }
.occhietto .ico-nascondi { display: none; }
.occhietto.attivo .ico-mostra { display: none; }
.occhietto.attivo .ico-nascondi { display: block; }

.pulsante {
  border: 0; border-radius: 10px; padding: 12px 16px; font-size: 14.5px; font-weight: 700;
  font-family: inherit; cursor: pointer; background: var(--navy); color: #fff;
}
.pulsante:hover { filter: brightness(1.15); }
.pulsante:disabled { opacity: .5; cursor: not-allowed; }
.pulsante.principale { width: 100%; }
.pulsante.chiaro { background: #fff; color: var(--testo); border: 1.5px solid var(--linea); }
.pulsante.piccolo { padding: 8px 12px; font-size: 13px; border-radius: 9px; }
.errore {
  background: #fdefef; border: 1px solid #f6c9cb; color: #a8121a;
  border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px;
}
/* box del blocco anti-tentativi (nome dedicato: .blocco è già usato dalla mappa) */
.avviso-blocco {
  display: flex; align-items: center; gap: 9px; justify-content: center;
  background: #fff7e6; border: 1.5px solid #f5c977; color: #8a5a00;
  border-radius: 11px; padding: 12px 14px; font-size: 14px; font-weight: 600;
  margin-top: 12px;
}
.avviso-blocco b { font-size: 18px; font-variant-numeric: tabular-nums; }
.blocco-icona { font-size: 17px; line-height: 1; }

/* ---------------------------------------------------------- app */
.barra {
  background: var(--navy); color: #fff;
  /* viewport-fit=cover: SENZA questo l'header finisce SOTTO la status bar dell'iPhone
     (orologio e icone di sistema disegnati sopra "Inventario"/"Esci"). */
  padding: calc(10px + env(safe-area-inset-top, 0px)) 18px 10px;
  display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 20;
}
.barra .titolo { font-weight: 800; font-size: 15px; }
.barra .titolo small { display: block; font-weight: 600; font-size: 11px; opacity: .7; letter-spacing: .06em; }
/* La pillola col nome del negozio sta a SINISTRA, accanto al marchio.
   Prima aveva margin-left:auto che la spingeva a destra insieme ai pulsanti. */
.pillola {
  padding: 6px 14px; border-radius: 999px;
  font-weight: 800; font-size: 12px; letter-spacing: .08em; color: #fff;
  white-space: nowrap;
}

/* Barra divisa in due: a sinistra marchio + negozio + Inventario, a destra solo Esci. */
.barra-sinistra { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.barra-destra { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

@media (max-width: 520px) {
  .barra-sinistra { gap: 7px; }
  .barra-sinistra .pulsante { padding: 7px 10px; font-size: 12px; }
  .pillola { padding: 5px 10px; font-size: 11px; letter-spacing: .04em; }
}

main { max-width: 1000px; margin: 0 auto; padding: 22px 18px 60px; }
.sezione {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--tenue); margin: 0 0 12px;
}
.sezione + .portali { margin-bottom: 8px; }

.portali { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ---- Portali essenziali (24/10/2026) --------------------------------
   I portali si aprono in una scheda nuova del browser: dentro PERKYSCAN non
   possono funzionare. Qui c'è solo l'apertura + il copia-codice. */
.portale-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 12px; background: #fff;
  border: 1px solid #e0e6ee; box-shadow: 0 2px 8px rgba(20,26,42,.06);
}
.portale-testa-card { display: flex; align-items: center; gap: 10px; }
.portale-bollo {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
}
.portale-nome-card { display: flex; flex-direction: column; min-width: 0; }
.portale-nome-card b { font-size: 15px; color: #141A2A; }
.portale-nome-card small { font-size: 11.5px; color: #6b7688; }
.portale-card > a.pulsante { text-decoration: none; text-align: center; }
.portale-copia { display: flex; gap: 6px; }
.portale-copia input {
  flex: 1; min-width: 0; font-size: 13px; padding: 6px 9px;
  border-radius: 8px; border: 1px solid #cdd6e2; font-family: inherit;
}
.portale-copia input:focus { outline: none; border-color: #0084CE; }

/* ---- Credenziali della sede ----------------------------------------
   Griglia a 3 colonne FISSE (etichetta | valore | pulsanti).
   Prima usavo flex + flex-wrap: quando il valore era lungo i pulsanti
   andavano a capo a caso e i box risultavano disallineati e brutti.
   Con la griglia tutte le schede restano allineate. */
/* Le credenziali in GRIGLIA: le schede restano affiancate e della stessa
   larghezza, invece di stirarsi a tutta pagina. */
.credenziali {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px; margin-top: 4px; align-items: start;
}
.cred-riga {
  padding: 11px 14px; border-radius: 10px; background: #fff;
  border: 1px solid #e0e6ee;
}
.cred-titolo {
  font-weight: 800; color: #141A2A; font-size: 13.5px;
  letter-spacing: .02em; margin-bottom: 6px;
}
.cred-campo {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center; column-gap: 10px;
  padding: 5px 0; font-size: 13px;
  border-top: 1px solid #f0f3f7;
}
.cred-campo:first-of-type { border-top: none; }
.cred-lab { color: #6b7688; font-size: 12px; text-transform: lowercase; }
.cred-val {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12.5px; color: #141A2A;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cred-val.segreta { letter-spacing: .12em; }
.cred-val.assente { color: #B0B8C4; font-style: italic; }
.cred-azioni { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.cred-manca {
  font-size: 12.5px; color: #9a6b1f; background: #fff8e6;
  border-left: 3px solid #FFC91C; padding: 7px 10px; border-radius: 0 5px 5px 0;
  line-height: 1.4;
  /* Non deve spezzarsi in una colonna stretta: occupa la larghezza della scheda. */
  display: block; width: 100%; white-space: normal;
}
@media (max-width: 520px) {
  .cred-campo { grid-template-columns: 64px minmax(0, 1fr); row-gap: 5px; }
  .cred-azioni { grid-column: 2; justify-content: flex-start; }
}
.porta-nota-fine { margin-top: 18px; }
@media (max-width: 760px) { .portali { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .portali { grid-template-columns: 1fr; } }
.portale {
  position: relative; overflow: hidden;
  border: 0; border-radius: 16px; padding: 24px 20px; cursor: pointer; text-align: left;
  color: #fff; font-family: inherit; display: flex; flex-direction: column; gap: 4px;
  min-height: 130px; box-shadow: 0 8px 22px rgba(20,26,42,.14);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s ease;
}
.portale:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(20,26,42,.22); }
.portale:active { transform: translateY(-1px) scale(.995); }
/* riflesso morbido in alto a destra: dà profondità alla card */
.portale::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 85% at 88% 0%, rgba(255,255,255,.20), rgba(255,255,255,0) 62%);
}
.portale .nome { font-size: 24px; font-weight: 800; letter-spacing: -.4px; color: var(--accento, #fff); }
.portale .desc { font-size: 12.5px; opacity: .85; }
.portale .freccia { margin-top: auto; font-size: 12px; font-weight: 800; letter-spacing: .06em; opacity: .95; }
/* sfondo chiaro (es. giallo InPost) → testo scuro, altrimenti illeggibile */
.portale.chiaro { color: var(--navy); }
.portale.chiaro .desc, .portale.chiaro .freccia { color: var(--navy); opacity: .8; }

.nota { font-size: 12.5px; color: var(--tenue); line-height: 1.6; margin: 12px 0 30px; }

.scanner { max-width: 560px; }
.video {
  background: #05070c; border-radius: 14px; overflow: hidden; aspect-ratio: 4/3;
  display: grid; place-items: center;
}
.video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.segnaposto { color: #8b95a9; font-size: 13.5px; }
.comandi { display: flex; gap: 9px; margin-top: 12px; }
.codice {
  margin-top: 14px; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--linea); border-radius: 12px; padding: 12px 14px;
}
.codice span {
  flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 16px; font-weight: 700; word-break: break-all;
}

/* ---------------------------------------------------------- credenziali */
/* Le regole che stavano qui (.credenziali a 3 colonne, .cred-riga in flex,
   .cred-manca senza sfondo) sono state RIMOSSE il 24/10/2026: usavano le stesse
   classi della sezione credenziali nuova e la sovrascrivevano, producendo schede
   di larghezze diverse (183px / 186px / 492px) con il testo "non inserita"
   spezzato in colonna. Ora c'è una sola definizione, più in alto nel file.
   Restano solo le classi .cred / .cred-testa / .mini, che non sono più usate
   dalla pagina Portali ma potrebbero servire altrove. */
.cred {
  background: #fff; border: 1px solid var(--linea); border-radius: 14px; padding: 14px;
  box-shadow: 0 4px 14px rgba(20,26,42,.05);
}
.cred-testa {
  font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--navy); margin-bottom: 10px;
}
.cred-etichetta { font-size: 11px; font-weight: 700; color: var(--tenue); width: 62px; flex: none; }
.mini {
  border: 1.5px solid var(--linea); background: #fff; color: var(--testo);
  border-radius: 9px; padding: 9px 12px; font-size: 12.5px; font-weight: 700;
  font-family: inherit; cursor: pointer; flex: none; min-height: 40px;
}
.mini:hover { border-color: var(--blu); color: var(--blu); }
.mini:active { background: #eef7fd; }

.avviso {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 50;
  background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; box-shadow: 0 8px 22px rgba(20,26,42,.25);
  max-width: 90vw; text-align: center;
}
.avviso.errore { background: var(--rosso); }

/* ---------------------------------------------------------- pulizie */
/* Blocco delle operazioni distruttive: deve "spaventare" un po'. */
.pulizia-blocco {
  margin-top: 22px; padding-top: 16px; border-top: 2px solid #f0d0d6;
}
.pulizia-titolo { font-size: 14px; font-weight: 800; color: var(--rosso); margin-bottom: 6px; }
.pulizia-riepilogo {
  background: #f6f7fa; border: 1px solid #dde2ea; border-radius: 11px;
  padding: 12px 14px; font-size: 14px; margin: 14px 0;
}
.pulsante.pericoloso {
  background: var(--rosso); border-color: #b3151c; color: #fff;
  font-weight: 800; width: 100%; min-height: 50px; font-size: 15px;
}
.pulsante.pericoloso:disabled { opacity: .45; }

/* Il pulsante "Modalità" serve solo da telefono: su PC non ha senso. */
.solo-telefono { display: none; }
@media (max-width: 720px), (pointer: coarse) {
  .solo-telefono { display: inline-flex; }
}

/* ---------------------------------------------------------- stato rete */
/* Barra rossa in alto: l'operatore deve capire SUBITO che è offline. */
.stato-rete {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: var(--rosso); color: #fff; text-align: center;
  padding: 8px 14px; font-size: 13px; font-weight: 700;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}

/* ---------------------------------------------------------- annulla ritiro */
/* Compare dopo un ritiro: corregge all'istante il pacco sbagliato. */
.annulla-ritiro {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(22px + 54px); z-index: 51;
  display: flex; align-items: center; gap: 10px;
  background: #1f7a4d; color: #fff;
  padding: 9px 12px 9px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 8px 22px rgba(20,26,42,.3);
  max-width: 92vw;
}
.annulla-ritiro .pulsante.ok {
  background: #fff; color: #1f7a4d; border: 0;
  font-weight: 800; padding: 6px 12px; border-radius: 999px;
}
.annulla-ritiro .pulsante.ok:disabled { opacity: .55; }
.annulla-tempo { font-variant-numeric: tabular-nums; opacity: .85; font-size: 12.5px; }

/* ---------------------------------------------------------- inventario */
#cerca { margin-bottom: 26px; }

.nuovo {
  background: #fff; border: 1px solid var(--linea); border-radius: 14px;
  padding: 16px; box-shadow: 0 4px 14px rgba(20,26,42,.05); margin-bottom: 8px;
}
.nuovo-riga { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.nuovo-riga + .nuovo-riga { margin-top: 10px; }
.nuovo .campo { flex: 1; min-width: 190px; margin-bottom: 0; }
.nuovo .campo.stretto { flex: none; width: 84px; min-width: 84px; }
.codice-campo { flex: 1; min-width: 220px; }

/* Riga del codice: campo + pulsante fotocamera.
   NB: la regola `.campo span` (0,1,1) renderebbe questo span un blocco a larghezza
   piena, mandando il pulsante a capo: serve una specificità maggiore (0,2,0). */
.campo .codice-riga {
  display: flex; gap: 8px; align-items: center; margin-bottom: 0;
  text-transform: none; letter-spacing: normal; font-size: 15px;
}
.codice-riga input { flex: 1; min-width: 0; }
.solo-telefono { display: none; }
@media (hover: none) { .solo-telefono { display: inline-flex; align-items: center; } }
.badge-corriere {
  padding: 9px 14px; border-radius: 999px; color: #fff; font-size: 12.5px;
  font-weight: 700; white-space: nowrap; margin-bottom: 2px;
}
.nota.forte { color: var(--navy); font-weight: 600; margin: 14px 0 0; }

/* pulsante di scansione: fisso, sempre a portata di pollice */
.fab {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 45; display: flex; align-items: center; gap: 9px;
  border: 0; border-radius: 999px; padding: 15px 22px; cursor: pointer;
  background: var(--blu); color: #fff; font-family: inherit; font-weight: 800;
  font-size: 15.5px; letter-spacing: .01em;
  box-shadow: 0 10px 26px rgba(0,132,206,.45), 0 2px 6px rgba(20,26,42,.25);
}
.fab:hover { filter: brightness(1.08); }
.fab:active { transform: scale(.97); }
.fab-ico { font-size: 20px; line-height: 1; }
@media (max-width: 560px) { .fab { left: 18px; right: 18px; justify-content: center; } }
main { padding-bottom: 36px; }   /* il pulsante "Scansiona" è stato rimosso */

/* scanner live */
#veloScan { align-items: center; }
.scan-panel {
  background: #fff; width: 100%; max-width: 560px; border-radius: 18px 18px 0 0;
  padding: 16px; max-height: 92vh; overflow-y: auto;
}
@media (min-width: 620px) { .scan-panel { border-radius: 18px; } }
.scan-testa { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.scan-testa strong { font-size: 15px; }

/* sull'inventario il messaggio di conferma va sotto l'header
   (in basso coprirebbe il pulsante di scansione). */
.pg-inventario .avviso {
  top: calc(var(--barra-h, 66px) + 10px + env(safe-area-inset-top, 0px));
  bottom: auto;
}

/* La barra di ricerca è DENTRO l'header (.barra-inv): header e campo di ricerca
   sono un blocco unico che resta sempre in alto. Niente position:fixed qui:
   l'header è sticky e il campo lo segue sempre. */
.barra-inv { display: block; padding-bottom: 12px; }
.barra-inv .barra-alta { display: flex; align-items: center; gap: 14px; }
.cerca-riga { display: flex; gap: 8px; align-items: stretch; margin-top: 10px; }
.cerca-riga #cerca { flex: 1 1 auto; min-width: 0; margin: 0; }
.cerca-riga #vaiPacco { flex: 0 0 auto; white-space: nowrap; }
.cerca-info { margin: 7px 0 0; font-size: 12.5px; color: #c7d0e2; }
.cerca-info b { color: #fff; }

/* Testo d'aiuto sotto la ricerca: spiega in chiaro cosa si può scrivere.
   Su schermi stretti il placeholder lungo si tronca, questa riga resta. */
.cerca-aiuto { margin: 6px 0 0; font-size: 12px; line-height: 1.4; color: #c7d0e2; opacity: .95; }
@media (max-width: 420px) { .cerca-aiuto { font-size: 11.5px; } }
/* Placeholder in MAIUSCOLO e ben leggibile: deve dire subito a cosa serve. */
#cerca::placeholder { color: #9fb0c8; font-weight: 600; letter-spacing: .02em; opacity: 1; }
#cerca:focus::placeholder { color: #7f90a8; }

/* ---------- importazione dal registro ---------- */
.check-riga {
  display: flex; align-items: flex-start; gap: 9px; margin: 14px 0;
  font-size: 13.5px; color: var(--testo); cursor: pointer;
}
.check-riga input { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.esito-import { margin: 14px 0 4px; }
.esito-import .imp-tot {
  font-weight: 800; color: var(--navy); margin-bottom: 10px; font-size: 15px;
}
.esito-import .imp-avviso {
  background: #fff8e6; border: 1px solid #f2d98a; color: #8a6d1a;
  border-radius: 10px; padding: 9px 11px; font-size: 12.5px; margin-bottom: 10px;
}
.esito-import .imp-blocco { border-top: 1px solid var(--linea); padding: 8px 0; }
.esito-import .imp-blocco-testa {
  font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--tenue); margin-bottom: 5px;
}
.esito-import .imp-riga { font-size: 13px; padding: 1px 0; }
.esito-import .imp-sig {
  display: inline-block; min-width: 18px; font-weight: 800; color: var(--blu); margin-right: 4px;
}

/* ---------- trascinamento & spostamento ---------- */
.pacco .p-presa { color: #c2c8d4; font-size: 13px; flex: none; margin-left: 1px; }
.pacco { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

body.in-drag { cursor: grabbing; }
body.in-drag .pacco.ghost {
  position: fixed; z-index: 100; pointer-events: none; margin: 0;
  opacity: .95; transform: scale(1.03); box-shadow: 0 12px 26px rgba(20,26,42,.3);
  border-color: var(--blu);
}
.pacco.trascinato { opacity: .28; }

.slot.sopra { border-color: var(--blu); background: #eef7fd; box-shadow: 0 0 0 2px rgba(0,132,206,.35); }
.indicatore { height: 4px; border-radius: 3px; background: var(--blu); margin: 2px 0; }

.banner-sposta {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 70;
  display: flex; align-items: center; gap: 12px; max-width: 94vw;
  background: var(--giallo); color: var(--navy); font-weight: 700; font-size: 13.5px;
  padding: 11px 14px; border-radius: 12px; box-shadow: 0 8px 22px rgba(20,26,42,.25);
}
.banner-sposta .banner-txt { line-height: 1.35; }
.banner-sposta .pulsante { min-height: 34px; padding: 6px 12px; }
body.sposta-mode .slot { outline: 2px dashed var(--giallo); outline-offset: 2px; cursor: copy; }
body.sposta-mode .slot .aggiungi { opacity: .35; }

/* campo compilato dall'OCR: va CONTROLLATO dall'operatore */
input.da-ocr { border-color: var(--giallo); background: #fffbe9; box-shadow: 0 0 0 3px rgba(255,201,28,.28); }

/* riga "Corriere": scelta manuale (l'etichetta la imposta da sola se scansionata) */
.corriere-riga { align-items: center; margin-top: 12px !important; }
.eti-chetta {
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tenue); flex: none;
}
.corrieri { display: flex; gap: 8px; flex-wrap: wrap; }
.corr {
  border: 2px solid var(--linea); background: #fff; color: var(--testo);
  border-radius: 10px; padding: 9px 13px; font-family: inherit; font-size: 13px;
  font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 7px;
  min-height: 42px;
}
.corr .punto { width: 11px; height: 11px; }
.corr:hover { border-color: var(--blu); }
.corr.scelto { border-color: var(--blu); background: #eef7fd; color: var(--blu); box-shadow: 0 0 0 3px rgba(0,132,206,.14); }

/* ---------- header: deve stare nella larghezza del telefono ---------- */
@media (max-width: 620px) {
  .barra { padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; gap: 8px; }
  .barra-inv { padding-bottom: 12px; }
  .barra .titolo { font-size: 13px; }
  .barra .titolo small { display: none; }
  .barra .pillola { padding: 5px 10px; font-size: 11px; }
  .barra .pulsante.piccolo { padding: 8px 10px; font-size: 12px; }
  .logo.piccolo { width: 32px; height: 32px; font-size: 14px; }
}
@media (max-width: 430px) {
  .barra .titolo { display: none; }        /* restano logo + sede + pulsanti */
}

.mappa { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.blocco {
  background: #fff; border: 1px solid var(--linea); border-radius: 16px;
  padding: 14px; box-shadow: 0 4px 14px rgba(20,26,42,.05); min-width: 0;
}
.blocco-testa {
  font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--navy); margin-bottom: 12px;
}
.blocco-testa small {
  font-weight: 600; font-size: 11px; color: var(--tenue); text-transform: none;
  letter-spacing: 0; margin-left: 6px;
}
/* 3 riquadri per riga: i nomi si leggono per intero, niente più tagli. */
.slot-griglia { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.slot-griglia.una { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 820px) { .slot-griglia { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
/* sotto i 700px due colonne taglierebbero di nuovo i nomi: una sola, larga tutta. */
@media (max-width: 700px) { .slot-griglia { grid-template-columns: minmax(0, 1fr); gap: 10px; } }

.slot {
  background: var(--bg); border: 1px solid var(--linea); border-radius: 11px;
  padding: 8px; display: flex; flex-direction: column; min-height: 92px; min-width: 0;
}
.slot-testa {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--tenue); padding: 2px 2px 7px; min-width: 0;
}
.slot-testa > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aggiungi {
  border: 0; background: var(--navy); color: #fff; width: 26px; height: 26px;
  border-radius: 8px; font-size: 16px; line-height: 1; cursor: pointer; flex: none;
  display: grid; place-items: center;
}
.aggiungi:hover { filter: brightness(1.2); }
.slot-lista { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 220px; min-width: 0; }
.slot-vuoto { font-size: 11.5px; color: #b3b9c7; font-style: italic; padding: 4px 2px; }

.pacco {
  display: flex; align-items: center; gap: 7px; width: 100%; text-align: left; min-width: 0;
  border: 1px solid var(--linea); background: #fff; border-radius: 9px;
  padding: 8px 9px; font-family: inherit; font-size: 13px; font-weight: 700;
  color: var(--testo); cursor: pointer; transition: transform .06s, box-shadow .12s;
}
.pacco:hover { box-shadow: 0 3px 10px rgba(20,26,42,.12); }
.pacco:active { transform: scale(.98); }
.pacco.off { opacity: .22; }
.pacco.match { border-color: var(--giallo); box-shadow: 0 0 0 2px rgba(255,201,28,.55); }
.p-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.punto { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.punto.grande { width: 15px; height: 15px; }
.p-colli { font-size: 11.5px; font-weight: 800; color: var(--blu); flex: none; }
.p-nota { font-size: 12px; flex: none; }

/* scheda dettaglio */
.velo {
  position: fixed; inset: 0; background: rgba(20,26,42,.5); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
@media (min-width: 620px) { .velo { align-items: center; padding: 20px; } }
.scheda {
  background: #fff; width: 100%; max-width: 520px; border-radius: 18px 18px 0 0;
  padding: 20px; max-height: 88vh; overflow-y: auto;
}
@media (min-width: 620px) { .scheda { border-radius: 18px; } }
.scheda-testa {
  display: flex; align-items: center; gap: 10px; font-size: 18px;
  padding-bottom: 12px; border-bottom: 3px solid var(--linea); margin-bottom: 14px;
}
.schede-righe { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0 0 16px; }
.schede-righe dt { font-size: 11.5px; font-weight: 800; color: var(--tenue); text-transform: uppercase; letter-spacing: .05em; }
.schede-righe dd { margin: 0; font-size: 14px; }
.schede-righe code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.scheda-azioni { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }

/* ---- Posizione a 2 cifre nel modulo "Nuovo pacco" (PC) ---------------- */
.posizione-num {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: #eef4fa; border: 1px solid #cfe0ef;
}
.posizione-num label { display: block; font-size: 13px; color: #141A2A; margin-bottom: 7px; }
.posizione-riga { display: flex; gap: 8px; }
#posizioneCifre {
  flex: 0 0 92px; font-size: 24px; font-weight: 700; letter-spacing: 4px;
  text-align: center; padding: 7px 8px; border-radius: 9px;
  border: 2px solid #b9cde0; background: #fff; color: #141A2A; font-family: inherit;
}
#posizioneCifre:focus { outline: none; border-color: #0084CE; box-shadow: 0 0 0 3px rgba(0,132,206,.15); }
#posizioneCifre::placeholder { color: #9aabbd; letter-spacing: 2px; font-size: 15px; }
#btnMettiPosizione { flex: 1; }
.posizione-aiuto { font-size: 12px; color: #55657a; margin-top: 7px; line-height: 1.45; }
.posizione-aiuto b { color: #141A2A; }
.posizione-esito { font-size: 12.5px; margin-top: 6px; min-height: 15px; color: #1d7a3e; }
.posizione-esito.errore { color: #C0392B; }

/* ---- Spostamento scrivendo le 2 cifre (PC) ---------------------------- */
.sposta-num {
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed #d8dee8;
  font-size: 13px;
}
.sposta-num-riga { display: flex; gap: 8px; margin-top: 7px; }
#spostaNum {
  flex: 1; min-width: 0; font-size: 22px; font-weight: 700; letter-spacing: 3px;
  text-align: center; padding: 8px 10px; border-radius: 9px;
  border: 2px solid #cdd6e2; background: #fff; color: #141A2A; font-family: inherit;
}
#spostaNum:focus { outline: none; border-color: #0084CE; box-shadow: 0 0 0 3px rgba(0,132,206,.15); }
#spostaNumBtn { flex: 0 0 auto; padding: 0 18px; }
.sposta-num-aiuto { font-size: 12px; color: #6b7688; margin-top: 7px; line-height: 1.45; }
.sposta-num-aiuto b { color: #141A2A; }
.sposta-num-esito { font-size: 12.5px; margin-top: 7px; min-height: 16px; color: #1d7a3e; }
.sposta-num-esito.errore { color: #C0392B; }
.pulsante.ritira { background: #0a7a3f; }

/* ---------------------------------------------------------- splash di avvio */
/* Appare una volta per login. La classe .splash-attivo la mette su <html> uno
   script inline nell'<head> di app.html, prima del primo disegno: così non si
   vede mai l'app "sbucare" dietro. */
.splash {
  position: fixed; inset: 0; z-index: 200;
  background: #fff;
  display: none; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px
           calc(env(safe-area-inset-bottom, 0px) + 16px);
  opacity: 1; transition: opacity .42s ease;
  cursor: pointer;
}
html.splash-attivo .splash { display: flex; }
.splash.via { opacity: 0; pointer-events: none; }
.splash picture { display: block; }
.splash img {
  display: block; width: auto; height: auto;
  max-width: min(88vw, 470px);
  max-height: min(72vh, 620px);
  -webkit-user-select: none; user-select: none;
}
.splash-salta {
  position: absolute; left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  text-align: center; font-size: 12.5px; font-weight: 600;
  letter-spacing: .04em; color: #9aa2b1;
  opacity: 0; animation: splashSaltaIn .5s ease 1.6s forwards;
}
@keyframes splashSaltaIn { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .splash img { max-width: min(70vw, 320px); }
  .splash-salta { animation: none; opacity: 1; }
}



/* ==================================================================
   RIFINITURE — logo reale, animazioni, micro-interazioni, responsive
   ================================================================== */

/* ---------- logo reale (immagine) ---------- */
.logo-img { width: 62px; height: 62px; flex: none; display: block; }
img.logo { background: none; }
.logo-img, img.logo { -webkit-user-drag: none; user-select: none; }

/* ---------- transizioni di base ---------- */
input[type=text], input[type=password], input[type=number] {
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.pulsante { transition: filter .16s ease, transform .1s ease, box-shadow .16s ease; }
.pulsante:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.negozio {
  position: relative;
  transition: transform .16s cubic-bezier(.2,.7,.3,1), border-color .16s ease,
              background .16s ease, color .16s ease, box-shadow .16s ease;
}
.negozio:hover { transform: translateY(-1px); border-color: #cfd7e6; box-shadow: 0 4px 12px rgba(20,26,42,.07); }
.negozio.scelto:hover { transform: none; }
.mini { transition: border-color .15s ease, color .15s ease, background .15s ease, transform .1s ease; }
.mini:active { transform: scale(.97); }
.cred, .nuovo, .slot { transition: box-shadow .18s ease, border-color .18s ease; }
.cred:hover { box-shadow: 0 10px 24px rgba(20,26,42,.09); }

/* pallino colore della sede sui due pulsanti di scelta */
.negozio::before {
  content: ""; position: absolute; top: 10px; right: 10px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--linea);
}
.negozio.montenero::before { background: var(--blu); }
.negozio.washington::before { background: var(--rosso); }

/* ---------- animazioni d'ingresso ---------- */
@keyframes sale    { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes scivola { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: none; } }
@keyframes veloIn  { from { opacity: 0; } to { opacity: 1; } }

.card-accesso  { animation: sale .42s cubic-bezier(.2,.75,.3,1) both; }
.errore        { animation: scivola .26s ease-out both; }
.avviso-blocco { animation: scivola .3s ease-out both; }
.avviso        { animation: sale .28s ease-out both; }
.velo          { animation: veloIn .22s ease-out both; }
.scheda        { animation: sale .3s cubic-bezier(.2,.75,.3,1) both; }

/* ---------- splash: l'immagine entra con delicatezza, l'uscita sfuma ---------- */
@keyframes splashImg { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.splash { transition: opacity .5s ease; }
.splash img { animation: splashImg .55s cubic-bezier(.2,.75,.3,1) both; }

/* ---------- telefono: il form del pacco si impila (niente campi schiacciati) ---------- */
@media (max-width: 620px) {
  .nuovo-riga { flex-direction: column; align-items: stretch; }
  .nuovo .campo { flex: none; width: 100%; min-width: 0; }
  .nuovo .campo.stretto { width: 96px; }
  .codice-campo { width: 100%; min-width: 0; }
  .corriere-riga { flex-direction: column; align-items: flex-start; gap: 8px; }
  .logo-img { width: 54px; height: 54px; }
}

/* ---------- login: un fondo morbido invece del vuoto piatto ---------- */
.centro { background: radial-gradient(900px 480px at 50% 0%, #eef6fd 0%, var(--bg) 70%); }

/* ---------- schermi larghi: usa lo spazio ---------- */
@media (min-width: 1100px) {
  main { max-width: 1180px; }
  .card-accesso { max-width: 470px; padding: 34px 32px; box-shadow: 0 26px 64px rgba(20,26,42,.13); }
  .centro { background: radial-gradient(1200px 600px at 50% -6%, #e9f3fc 0%, var(--bg) 60%); }
}

/* ---------- chi preferisce meno movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- installa come app (PWA) ---------- */
.installa-bar {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  background: #fff; border: 1px solid var(--linea); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 22px;
  box-shadow: 0 4px 14px rgba(20,26,42,.05);
  animation: sale .3s ease-out both;
}
.installa-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.installa-txt b { font-size: 14px; color: var(--navy); }
.installa-txt span { font-size: 12.5px; color: var(--tenue); line-height: 1.35; }
.installa-bar .pulsante { flex: none; }
.installa-login { width: 100%; max-width: 430px; }
@media (max-width: 560px) {
  .installa-bar { flex-direction: column; align-items: stretch; gap: 10px; }
}
/* Il pulsante "Installa" nell'header esiste solo su schermi larghi: sul
   telefono l'installazione avviene dal menu del browser / "Aggiungi a Home". */
@media (max-width: 760px) { .installa-btn { display: none; } }

/* ---------- blocchi utili SOLO al PC (non sul telefono) ----------
   App desktop per Windows, estensione Chrome, stato estensione: sul telefono non
   servono a nulla e facevano solo rumore. Si nascondono quando lo schermo è
   piccolo E il dispositivo è touch (hover: none) — così su un PC con la finestra
   stretta restano visibili. */
@media (max-width: 820px) and (hover: none) {
  .solo-pc { display: none !important; }
}

/* ---------- sessione scanner dal telefono (lato PC) ---------- */
.scan-pc-bar {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  background: linear-gradient(180deg, #ffffff, #f6f9fd);
  border: 1px solid var(--linea); border-radius: 14px; padding: 14px 16px; margin-bottom: 22px;
  box-shadow: 0 4px 14px rgba(20,26,42,.05);
}
.scan-pc-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scan-pc-txt b { font-size: 14px; color: var(--navy); }
.scan-pc-txt span { font-size: 12.5px; color: var(--tenue); line-height: 1.35; }
.scan-pc-bar .pulsante { flex: none; }
@media (max-width: 560px) { .scan-pc-bar { flex-direction: column; align-items: stretch; gap: 10px; } }

.qr-box {
  display: grid; place-items: center; background: #fff; border: 1px solid var(--linea);
  border-radius: 14px; padding: 14px; margin: 14px 0 8px; min-height: 220px;
}
.qr-box img { display: block; width: 100%; max-width: 260px; height: auto; }
.qr-box .segnaposto { color: var(--tenue); font-size: 13px; text-align: center; }
.qr-url {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: var(--tenue);
  word-break: break-all; text-align: center; margin-bottom: 6px;
}
.scan-live { margin-top: 14px; border-top: 1px solid var(--linea); padding-top: 12px; }
.scan-live-testa {
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tenue); margin-bottom: 8px;
}
.scan-live-lista { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.scan-ev {
  background: var(--bg); border: 1px solid var(--linea); border-radius: 10px; padding: 8px 11px; font-size: 13px;
}
.scan-ev b { color: var(--navy); }
.scan-ev span { color: var(--tenue); }

/* ---------- colli: stepper − / + nella scheda pacco ---------- */
.stepper-box { display: flex; align-items: center; gap: 10px; }
.stepper {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--linea);
  background: #fff; color: var(--navy); font-size: 19px; font-weight: 800; line-height: 1;
  cursor: pointer; display: grid; place-items: center; flex: none;
  transition: background .15s ease, border-color .15s ease;
}
.stepper:hover { background: #eef7fd; border-color: var(--blu); }
.stepper:active { transform: scale(.94); }
#colli-val { min-width: 1.8em; text-align: center; font-weight: 800; font-size: 15px; color: var(--navy); }

/* ---------- gestione spazi (mappa) ---------- */
.sezione-riga { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sezione-riga .sezione { margin: 0; }

.mappa-vuota {
  background: #fff; border: 1px dashed var(--linea); border-radius: 16px;
  padding: 22px 18px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.mappa-vuota .nota { margin: 0; max-width: 460px; }
.mappa-vuota .pulsante { margin-top: 6px; }

.spazi-lista { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.spazi-divisore { border: 0; border-top: 1px solid var(--linea); margin: 16px 0 12px; }
.spazio-riga {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg); border: 1px solid var(--linea); border-radius: 12px; padding: 9px 11px;
  min-width: 0;
}
.spazio-nome { min-width: 0; }
.spazio-nome strong { color: var(--navy); font-size: 13.5px; }
.spazio-sub { font-size: 11.5px; color: var(--tenue); margin-top: 1px; }
.spazio-az { display: flex; gap: 6px; flex: none; }
.pulsante.pericolo { color: #c62828; border-color: #f0c9c9; }
.pulsante.pericolo:hover { background: #fdecec; border-color: #e59a9a; }

/* ==================================================================
   PASS UX/UI — layout desktop, dialoghi interni, badge, filtri
   ================================================================== */

/* ---------- 1 · dialoghi interni (sostituiscono i popup del browser) ---------- */
.pulsante.ok { background: var(--blu); color: #fff; }
.pulsante.ok:hover { filter: brightness(1.1); }
.pulsante.rosso { background: var(--rosso); color: #fff; }
.pulsante.rosso:hover { filter: brightness(1.08); }
.velo-dlg { align-items: center; padding: 20px; }
.dlg {
  background: #fff; width: 100%; max-width: 420px; border-radius: var(--r-g);
  padding: 22px 20px 18px; box-shadow: var(--ombra-3);
  animation: sale .28s cubic-bezier(.2,.75,.3,1) both;
}
.dlg-titolo { margin: 0 0 8px; font-size: 17px; color: var(--navy); letter-spacing: -.2px; }
.dlg-testo { margin: 0 0 18px; font-size: 14px; line-height: 1.55; color: var(--tenue); white-space: pre-line; }
.dlg-azioni { display: flex; flex-direction: column; gap: 9px; }
@media (min-width: 560px) { .dlg-azioni { flex-direction: row; justify-content: flex-end; } }

/* ---------- 2 · layout desktop a due colonne (form | mappa) ---------- */
.inv-registro { margin-top: 26px; }
.inv-mappa { margin-top: 26px; }
@media (min-width: 1000px) {
  .inv-main {
    display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    gap: 22px 26px; align-items: start;
  }
  .inv-form     { grid-column: 1; grid-row: 1; }
  .inv-registro { grid-column: 1; grid-row: 2; margin-top: 0; }
  .inv-mappa    { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
  /* nella colonna stretta il form si impila: niente campi schiacciati */
  .inv-form .nuovo-riga { flex-direction: column; align-items: stretch; }
  .inv-form .nuovo .campo,
  .inv-form .codice-campo,
  .inv-form .nuovo .campo.stretto { flex: none; width: 100%; min-width: 0; }
}

/* ---------- 3 · badge conteggio + stato ripiano ---------- */
.slot.vuoto { border-style: dashed; }
.slot.pieno { border-color: #ecc36a; background: #fffdf6; }
.slot-testa > .slot-conteggio { flex: none; overflow: visible; text-overflow: clip; }
.slot-testa > .slot-nome { flex: 1; min-width: 0; }
.slot-conteggio {
  min-width: 21px; text-align: center; font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 1px 6px; line-height: 16px; flex: none;
}
.slot-conteggio.c0 { background: #eef1f6; color: var(--tenue-2); }
.slot-conteggio.c1 { background: #e6f2fb; color: var(--blu); }
.slot-conteggio.c2 { background: #fff2cf; color: #8a5a00; }

/* ---------- 4 · etichette filtri rapidi ---------- */
.filtri { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.chip-filtro {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--linea); background: #fff; color: var(--testo);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip-filtro:hover { border-color: #cfd7e6; }
.chip-filtro.attivo { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip-filtro .punto { width: 9px; height: 9px; }

/* ---------- 6 · tipografia e livelli ---------- */
.sezione { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .09em; }
.sezione::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--blu); flex: none; }
.nuovo, .blocco, .cred { box-shadow: var(--ombra-1); }
.blocco { border-radius: var(--r-g); }
.scheda { box-shadow: var(--ombra-3); }
input:focus, select:focus { box-shadow: var(--focus); }

/* ---------------------------------------------------------- codice telefono */
/* Codice a 6 cifre: alternativa al QR, leggibile e dettabile. */
.codice-phone {
  margin: 16px 0 18px; padding: 16px; border-radius: 14px;
  background: #0d2418; border: 1.5px solid #2e9b5d; text-align: center;
}
.codice-phone-testa { font-size: 12.5px; font-weight: 700; color: #9fb0c8; margin-bottom: 10px; }
.codice-phone-val {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 42px; font-weight: 800; letter-spacing: 10px;
  color: #a9f0c6; font-variant-numeric: tabular-nums; line-height: 1.1;
}
.codice-phone-hint { margin-top: 10px; font-size: 12px; color: #6b8fa8; line-height: 1.5; }
.codice-phone-hint b { color: #9fb0c8; }

/* ---------------------------------------------------------- QR ripiego */
/* Il QR resta disponibile ma richiuso: il codice a 6 cifre è il metodo principale. */
.qr-ripiego {
  margin-top: 18px; border-top: 1px solid #e3e8ef; padding-top: 14px;
}
.qr-ripiego > summary {
  font-size: 12.5px; color: #8494ab; cursor: pointer; list-style: none;
  text-align: center; -webkit-tap-highlight-color: transparent;
}
.qr-ripiego > summary::-webkit-details-marker { display: none; }
.qr-ripiego > summary::before { content: "▸ "; }
.qr-ripiego[open] > summary::before { content: "▾ "; }

/* ---------------------------------------------------------- scelta del posto (mobile) */
.scan-posto { margin-top: 14px; padding-top: 12px; border-top: 1px solid #24324c; }
.scan-posto-t { font-size: 13px; font-weight: 700; color: #cfe0f5; margin-bottom: 8px; }
.scan-posto-riga { margin-bottom: 8px; }
.scan-posto select {
  width: 100%; min-height: 48px; border-radius: 11px;
  border: 1px solid #2c4063; background: #16233c; color: #eef1f7;
  font-family: inherit; font-size: 15px; padding: 0 12px;
  -webkit-appearance: none; appearance: none;
}
.scan-posto-esito { font-size: 13px; color: #a9f0c6; min-height: 18px; line-height: 1.4; }
.scan-posto-esito.errore { color: #ffd0a8; }

/* ---- INSERIMENTO NUMERICO (solo WASHINGTON) ----------------------------
   Campo grande: si usa col guanto e spesso senza guardare bene. Le due cifre
   devono leggersi a colpo d'occhio. */
.scan-num-riga { display: flex; gap: 10px; align-items: stretch; }
#numPosto {
  flex: 1; min-width: 0;
  font-size: 34px; font-weight: 700; letter-spacing: 6px; text-align: center;
  padding: 10px 12px; border-radius: 12px;
  border: 2px solid #4a5a72; background: #0f1520; color: #fff;
  font-family: inherit; -webkit-appearance: none; appearance: none;
}
#numPosto::placeholder { color: #5c6c85; letter-spacing: 2px; font-weight: 500; }
#numPosto:focus { outline: none; border-color: #4da3e0; box-shadow: 0 0 0 3px rgba(77,163,224,.25); }
#btnNumPosto {
  flex: 0 0 auto; padding: 0 22px; font-size: 17px; font-weight: 700;
  border-radius: 12px; border: none; background: #4da3e0; color: #06121f;
  -webkit-appearance: none; appearance: none;
}
#btnNumPosto:active { transform: scale(.97); }
.scan-num-aiuto { font-size: 12px; color: #9fb0c8; line-height: 1.5; margin: 8px 0 4px; }
.scan-num-aiuto b { color: #e8eef7; }
.scan-num-link {
  background: none; border: none; padding: 4px 0; margin: 0;
  color: #7fb8dd; font-size: 12px; text-decoration: underline; font-family: inherit;
}

/* ---------------------------------------------------------- posto suggerito (PC) */
.posto-suggerito {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(22px + 54px + 54px); z-index: 52;
  display: flex; align-items: center; gap: 10px;
  background: #1f3b6b; color: #fff; border: 1px solid #2e5ea8;
  padding: 10px 12px 10px 16px; border-radius: 999px;
  font-size: 13.5px; box-shadow: 0 8px 22px rgba(20,26,42,.3);
  max-width: 92vw;
}
.posto-suggerito .ps-testo b { color: #a9d4ff; }
.posto-suggerito .pulsante.ok { background: #fff; color: #1f3b6b; border: 0; font-weight: 800; }

/* ---------------------------------------------------- pulsante collega telefono */
/* Nella barra in alto dell'inventario: è qui che serve, non nei portali. */
.btn-telefono {
  border-color: #2e9b5d !important;
  background: #14402a !important;
  color: #a9f0c6 !important;
  font-weight: 700;
}
.btn-telefono.off {
  animation: pulsa-telefono 2.2s ease-in-out infinite;
}
@keyframes pulsa-telefono {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,155,93,.5); }
  50% { box-shadow: 0 0 0 6px rgba(46,155,93,0); }
}
.btn-telefono.on {
  background: #16324d !important;
  border-color: #2e5ea8 !important;
  color: #a9d4ff !important;
}
/* Su schermi stretti resta solo l'icona: la barra non deve andare a capo. */
@media (max-width: 720px) {
  .btn-telefono .testo-telefono { display: none; }
  .btn-telefono { font-size: 17px; padding: 6px 10px; }
}
