/* NextStopAround — caldo, ad alto contrasto, pensato per un pollice. */
:root {
  --bg: #fbf5ee; --card: #fffdfa; --ink: #24141c; --soft: #6b5360; --line: #e6d6c9;
  --brand: #5a1840; --brand-ink: #fff6ee; --accent: #f2a23a;
  --ok: #146c3c; --ok-bg: #dcf2e3; --bad: #b3261e; --bad-bg: #fbe3e0; --warn: #7a4a00; --warn-bg: #ffe9c2;
  --link: #7a2358; --marble: #f4f1ea; --marble-ink: #17110f; --radius: 16px;
  color-scheme: light dark;
  /* spazio coperto sopra (ora, tacca) e sotto (tasti, gesti) */
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
/* il telefono disegna l'app sotto le sue barre senza dire quanto sono alte (ui/screen.js) */
:root.under-bars { --safe-top: max(env(safe-area-inset-top, 0px), 36px); --safe-bottom: max(env(safe-area-inset-bottom, 0px), 48px); }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181014; --card: #241820; --ink: #f8ede6; --soft: #c0a8b5; --line: #43303b;
    --brand: #f2a23a; --brand-ink: #241008; --ok: #62d28f; --ok-bg: #153524; --bad: #ff9a90; --bad-bg: #44201d;
    --warn: #ffd28a; --warn-bg: #43300f; --link: #f6b766; --marble: #e9e4da;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: anywhere;
}
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
ul { list-style: none; padding: 0; }
h2 { font-size: 1.3rem; line-height: 1.2; }
h3 { font-size: 1.05rem; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.icon { width: 1.35em; height: 1.35em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.boot { padding: 40vh 24px 0; text-align: center; }

/* struttura */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--safe-top)) 16px 10px; background: #5a1840; color: #fff6ee;
}
.top__brand { font-weight: 800; font-size: 1.1rem; }
.top__day { font-size: .85rem; opacity: .85; text-transform: capitalize; }
.sync { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 0; border-radius: 99px; background: #f2a23a; color: #241008; font-size: .85rem; font-weight: 700; }
.sync--bad { background: #ffd5d0; color: #8b1a13; }
.main { max-width: 640px; margin: 0 auto; padding: 14px 16px calc(96px + var(--safe-bottom)); }
.view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.view__title { margin-top: 4px; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom);
}
.tab { flex: 1; display: grid; justify-items: center; gap: 2px; min-height: 64px; padding: 8px 2px; border: 0; border-top: 4px solid transparent; background: none; color: var(--soft); font-size: .78rem; font-weight: 700; }
.tab[aria-current] { color: var(--ink); border-top-color: var(--accent); }

/* pulsanti */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 16px;
  border: 2px solid transparent; border-radius: 14px; background: var(--card); border-color: var(--line);
  font-weight: 750; text-align: center; text-decoration: none; color: var(--ink); overflow-wrap: normal;
}
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn--big { min-height: 60px; font-size: 1.1rem; width: 100%; }
.btn--huge { min-height: 84px; font-size: 1.35rem; width: 100%; text-transform: uppercase; letter-spacing: .02em; }
.btn--small { min-height: 48px; padding: 6px 14px; font-size: .92rem; }
.btn--ghost { background: transparent; }
.btn--ok { background: #146c3c; border-color: #146c3c; color: #fff; min-height: 68px; font-size: 1.15rem; }
.btn--bad { background: #b3261e; border-color: #b3261e; color: #fff; }
.btn--badline { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn--choice { width: 100%; justify-content: flex-start; min-height: 56px; }
.btn--dashed { width: 100%; border-style: dashed; background: transparent; }
.btn--tile { flex-direction: column; gap: 4px; min-height: 68px; padding: 8px; font-size: .92rem; }
.btn--nav { width: 100%; min-height: 76px; font-size: clamp(1.05rem, 5.4vw, 1.3rem); text-transform: uppercase; letter-spacing: .02em; background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn--nav .icon { width: 1.4em; height: 1.4em; }
.is-busy { opacity: .65; }
.iconbtn { display: inline-grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 12px; background: none; }
.iconbtn--line { border: 2px solid var(--line); background: var(--card); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.contacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.contacts:has(> :only-child) { grid-template-columns: 1fr; }

/* campi */
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; position: relative; }
.field label, .field > span, legend { font-weight: 700; font-size: .92rem; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 52px; padding: 11px 13px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); font-size: 1.08rem;
}
textarea { resize: vertical; }
input:disabled { opacity: .6; }
.field--error input { border-color: var(--bad); background: var(--bad-bg); }
.field__hint { color: var(--soft); font-size: .88rem; }
.field__error { color: var(--bad); font-size: .88rem; font-weight: 700; }
.pw { position: relative; }
.pw input { padding-right: 58px !important; }
.pw__toggle { position: absolute; top: 2px; right: 3px; display: grid; place-items: center; width: 48px; height: 48px; border: 0; background: none; }
.row--civic { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.parcelform { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.suggest { display: grid; gap: 4px; }
.suggest__item { display: block; text-align: left; min-height: 52px; padding: 8px 13px; border: 2px solid var(--accent); border-radius: 12px; background: var(--card); }
.suggest__item span { color: var(--soft); font-size: .85rem; }
.check, .choice { display: flex; gap: 12px; align-items: center; min-height: 52px; }
.check input, .choice input, .pick input { width: 26px; height: 26px; flex: none; accent-color: #8a2a62; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
legend { padding: 0 0 8px; }
.choice { padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(input:disabled) { opacity: .55; }
.choice span { display: grid; }
.choice small { color: var(--soft); }
.filepick { display: grid; gap: 6px; font-weight: 700; font-size: .92rem; }
.file { min-height: 48px; max-width: 100%; }
.error { padding: 12px 14px; border-radius: 12px; background: var(--bad-bg); color: var(--bad); font-weight: 700; }

/* avvisi */
.notice, .note, .banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-weight: 650; }
.notice--info { background: var(--ok-bg); color: var(--ok); }
.notice--bad { background: var(--bad-bg); color: var(--bad); }
.note, .banner, .notice--warn { background: var(--warn-bg); color: var(--warn); }
.notice__body { display: grid; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.banner { width: 100%; align-items: center; min-height: 56px; border: 0; text-align: left; }
.banner span { flex: 1; }
.oldday, .dayover { max-width: 608px; margin: 10px auto 0; width: calc(100% - 32px); display: flex; }
.warnings { display: grid; gap: 8px; }
.warnings:empty { display: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; justify-self: start; padding: 3px 9px; border-radius: 99px; background: var(--line); font-size: .8rem; font-weight: 750; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--bad { background: var(--bad-bg); color: var(--bad); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(78px + var(--safe-bottom)); z-index: 20; max-width: 616px; margin: 0 auto; }
.toasts:empty { display: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: #24141c; color: #fff; box-shadow: 0 8px 24px #0006; font-weight: 650; }
.toast p { flex: 1; }
.toast--ok { background: #0f5730; }
.toast--bad { background: #8b1a13; }
.toast__action { min-height: 48px; padding: 0 14px; border: 2px solid #fff; border-radius: 10px; background: none; color: #fff; font-weight: 800; }
.bar { display: flex; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar__ok { background: #1f9455; }
.bar__bad { background: #d2463c; }
.empty, .finished, .working { display: grid; gap: 12px; justify-items: center; padding: 36px 8px; text-align: center; }
.empty .stack { width: 100%; margin-top: 8px; }
.finished > .icon, .working > .icon { width: 64px; height: 64px; color: var(--ok); }
.working .bar { width: 100%; }
.loading { text-align: center; color: var(--soft); font-weight: 650; padding: 8px; }

/* pannello dal basso */
.sheet { width: 100%; max-width: 640px; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: var(--bg); color: var(--ink); overflow: auto; }
.sheet::backdrop { background: #140a10b3; }
/* Con un pannello aperto la pagina sotto resta ferma: senza queste due regole un dito veloce (nel
   pannello arrivato in fondo, o sullo sfondo scuro) fa scorrere l'elenco delle fermate dietro. */
html:has(dialog.sheet[open]) { overflow: hidden; }
.sheet { overscroll-behavior: contain; }
.sheet__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 10px 8px 18px; background: var(--bg); }
.sheet__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 4px 16px calc(24px + var(--safe-bottom)); }
.sheet__foot { display: grid; gap: 10px; }
.sheet__text { color: var(--soft); }
.inline { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.facts dt { color: var(--soft); }
.facts dd { font-weight: 650; }

/* giro */
.progress { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: .92rem; }
.progress .bar { grid-column: 1 / -1; }
.next { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 10px 28px #3a10281f; }
.next__step { font-weight: 800; color: var(--link); font-size: .9rem; }
/* targa stradale in marmo */
.targa { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--marble); color: var(--marble-ink); border: 2px solid var(--marble-ink); border-radius: 8px; outline: 4px solid var(--marble); }
.targa__txt { flex: 1; min-width: 0; }
.targa__street { font: 700 1.6rem/1.12 Georgia, "Times New Roman", serif; text-transform: uppercase; }
.targa__city { margin-top: 4px; font-size: .95rem; }
.civic { display: inline-grid; place-items: center; min-width: 48px; min-height: 40px; padding: 2px 8px; border: 2px solid #17110f; border-radius: 8px; background: #f4f1ea; color: #17110f; font: 800 1.1rem Georgia, serif; text-transform: uppercase; }
.civic--hero { min-width: 76px; min-height: 68px; font-size: 2.1rem; }
.civic--long { font-size: .95rem; }
.civic--hero.civic--long { font-size: 1.35rem; }
.load { display: flex; align-items: center; gap: 14px; }
.load__count { display: grid; justify-items: center; min-width: 84px; padding: 8px; border-radius: 14px; background: var(--line); line-height: 1; }
.load__count strong { font-size: 2.4rem; }
.load__count span { font-size: .8rem; font-weight: 700; }
.load__count--many { background: #f2a23a; color: #241008; }
.load__who { font-size: 1.15rem; font-weight: 700; }
.verdict { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.verdict .btn { flex-direction: column; gap: 2px; min-height: 76px; padding: 6px 4px; font-size: 1rem; line-height: 1.2; }
.next__more { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.list__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.street { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.street__name { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-top: 8px; font-family: Georgia, serif; text-transform: uppercase; font-size: 1rem; border-bottom: 3px solid var(--ink); }
.street__name small { font: 600 .75rem system-ui, sans-serif; color: var(--soft); }
.street__stops { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.stop { display: flex; gap: 6px; align-items: stretch; content-visibility: auto; contain-intrinsic-size: auto 68px; }
.stop__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; }
.stop--current .stop__main { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.stop--ok .stop__main, .stop--bad .stop__main { opacity: .72; }
.stop__num { display: grid; place-items: center; min-width: 30px; font-weight: 800; color: var(--soft); }
.stop--ok .stop__num { color: var(--ok); }
.stop--bad .stop__num { color: var(--bad); }
.stop__txt { flex: 1; min-width: 0; display: grid; gap: 3px; }
.stop__txt strong { font-weight: 650; }
.stop__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.stop__tags:empty { display: none; }
.stop__count { padding: 5px 10px; border-radius: 10px; background: #f2a23a; color: #241008; font-weight: 850; }
.move { display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.parcels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.parcel { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-align: left; }
.parcel__txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.parcel__code { color: var(--soft); font-size: .84rem; }
.parcel__more { color: var(--soft); }

/* aggiungi */
.scanbig { display: grid; justify-items: center; gap: 6px; width: 100%; padding: 34px 16px; border: 0; border-radius: 24px; background: linear-gradient(150deg, #7a2358, #43102f); color: #fff6ee; text-align: center; box-shadow: 0 14px 30px #43102f45; }
.scanbig .icon { width: 64px; height: 64px; color: #f8b45a; }
.scanbig strong { font-size: 1.5rem; }
.scanbig span { opacity: .85; font-size: .95rem; }
.scanbig--claim { padding: 28px 16px; }
.scanbig--second { padding: 14px 16px; background: var(--card); color: inherit; border: 2px solid var(--line); box-shadow: none; }
.scanbig--second .icon { width: 32px; height: 32px; color: var(--accent); }
.scanbig--second strong { font-size: 1.1rem; }
.claim__count { display: grid; gap: 4px; text-align: center; }
.claim__count p { margin: 0; }
.claim__big { font-size: 1.15rem; }
.claim__big strong { font-size: 2.6rem; line-height: 1.1; }
.claim__ask { display: grid; gap: 8px; padding: 12px; border: 2px solid var(--bad); border-radius: 16px; background: var(--card); }
.claim__ask p { margin: 0; overflow-wrap: anywhere; }
.claim__code { display: block; color: var(--soft); font-size: .84rem; font-weight: 400; }
.claim__mine, .claim__log li { display: flex; gap: 10px; align-items: flex-start; }
.claim__mine span, .claim__ask .parcel__txt span { display: block; }
.claim__log { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .9rem; }
.claim__log span { min-width: 0; overflow-wrap: anywhere; }
.mapping { display: grid; gap: 10px; }
.mapping__col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.mapping__col strong, .mapping__col small { display: block; overflow-wrap: anywhere; }
.mapping__col small { color: var(--soft); }
.photo { display: block; width: 100%; max-height: 46vh; object-fit: contain; border-radius: 14px; background: #0002; }
.shot summary { min-height: 48px; display: list-item; padding: 12px 0; font-weight: 700; cursor: pointer; }
.raw { margin: 0; white-space: pre-wrap; font-size: .85rem; padding: 12px; border-radius: 12px; background: var(--card); }
.heard { text-align: center; font-size: 1.1rem; }
.preview { display: grid; gap: 8px; }
.preview:empty { display: none; }
.preview__list { display: grid; gap: 4px; }
.preview__list li { display: grid; padding: 8px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.preview__list span { color: var(--soft); font-size: .85rem; }

/* organizza e sede */
.lead { font-size: 1.15rem; font-weight: 700; }
.summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats div { display: flex; flex-direction: column-reverse; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.stats dt { color: var(--soft); font-size: .82rem; }
.stats dd { font-size: 1.5rem; font-weight: 850; }
.streets { margin: 0; padding-left: 28px; display: grid; gap: 4px; font-family: Georgia, serif; text-transform: uppercase; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.card { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; min-height: 64px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); text-align: left; }
.card__head { display: flex; justify-content: space-between; gap: 10px; }
/* un nome lungo va a capo, l'etichetta accanto ("Attiva", la zona breve) resta intera */
.card__head > strong { min-width: 0; overflow-wrap: anywhere; }
.card__head > :last-child:not(strong) { flex: 0 1 auto; max-width: 55%; text-align: right; }
.card__head > .card__state, .card__head > .badge { flex: none; max-width: none; white-space: nowrap; }
.card__head span, .card__meta { color: var(--soft); font-size: .88rem; }
.card--off { opacity: .6; }
.block { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assign { position: sticky; top: calc(62px + var(--safe-top)); z-index: 1; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 0; background: var(--bg); }
.pick { display: flex; align-items: center; gap: 10px; }
.pick .parcel { flex: 1; min-width: 0; }
.rejected { display: grid; gap: 10px; }
.rejected li { display: grid; padding: 10px 12px; border-radius: 12px; background: var(--bad-bg); color: var(--bad); overflow-wrap: anywhere; }
.rejected--note li { background: var(--warn-bg); color: var(--warn); }
.lock__rejected .rejected { max-height: 36vh; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.fieldnote { color: var(--warn); font-size: .84rem; font-weight: 650; overflow-wrap: anywhere; }

/* accesso */
.login { max-width: 440px; margin: 0 auto; padding: calc(36px + var(--safe-top)) 20px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.login__brand { display: grid; justify-items: center; gap: 8px; text-align: center; }
.login__brand img { border-radius: 18px; }
.login__brand h1 { font-size: 2rem; }
.login__brand p { color: var(--soft); }
.login__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

/* stazione, turni e blocco fuori turno */
.login__kind .btn { min-height: 52px; font-size: .95rem; line-height: 1.2; }
.login--password h1 { font-size: 1.6rem; }
.station { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; border: 2px dashed var(--accent); border-radius: 14px; background: var(--card); }
.station__txt { display: grid; }
.station__txt span { color: var(--soft); font-size: .82rem; font-weight: 700; }
.station__code { font: 800 1.35rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; white-space: nowrap; user-select: all; }
.created__code, .created__user { font-family: ui-monospace, Menlo, Consolas, monospace; user-select: all; }
/* nell’elenco dell’azienda ogni codice sta con la sua stazione */
.cards > li.stack + li.stack { margin-top: 12px; }
@media (max-width: 300px) { .login__brand h1 { font-size: 1.6rem; } }
.turn { font-weight: 650; }
.grace { max-width: 608px; margin: 10px auto 0; width: calc(100% - 32px); }
.lock { position: fixed; inset: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink); overflow: auto; overscroll-behavior: contain; }
html:has(dialog.lock[open]) { overflow: hidden; }
.lock__body { max-width: 440px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px;
  padding: calc(32px + var(--safe-top)) max(20px, env(safe-area-inset-right)) calc(28px + var(--safe-bottom)) max(20px, env(safe-area-inset-left)); }
.lock__head { display: grid; justify-items: center; gap: 8px; text-align: center; }
.lock__head .icon { width: 56px; height: 56px; color: var(--accent); }
.lock__head h1 { font-size: 1.8rem; }
.lock__next { font-size: 1.15rem; font-weight: 700; }

@media (max-width: 340px) { .btn { padding: 8px 10px; } .targa__street { font-size: 1.3rem; } }
@media (prefers-reduced-motion: no-preference) { .btn, .stop__main { transition: transform .08s; } .btn:active, .stop__main:active { transform: scale(.98); } }

/* frazioni e carico */
.loadview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.sector { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.sector__head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; }
.sector__txt { flex: 1; min-width: 0; display: grid; }
.sector__txt small { color: var(--soft); }
.sector__count { font-weight: 850; }
.sector--done .sector__head { border-color: var(--ok); background: var(--ok-bg); }
.parcel[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-bg); }
.found { display: grid; gap: 6px; padding: 14px; border-radius: 16px; background: var(--card); border: 3px solid var(--accent); text-align: center; }
.found__tag { display: flex; justify-content: center; align-items: baseline; gap: 10px; }
.is-closed .parcel { border-color: var(--bad); background: var(--bad-bg); }
.hours small { display: block; margin-top: 2px; font-weight: 500; opacity: .8; }
/* Fermata con più indirizzi vicini */
.halt { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 12px; }
.halt__addr { border: 2px solid var(--line, #e4d6d0); border-radius: 14px; padding: 10px; display: grid; gap: 8px; }
.halt__addr.is-done { opacity: .6; }
.halt__head { display: flex; gap: 10px; align-items: center; width: 100%; background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; min-height: 48px; }
.halt__head .stop__txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.halt__count { display: grid; text-align: center; font-size: .8rem; }
.halt__count strong { font-size: 1.8rem; line-height: 1; }
.stop__addr { display: block; font-size: .92rem; }
.stop__addr .slotnum { margin-left: 6px; }
.found__near { font-weight: 700; }

/* Furgone visto dall'alto: 4 quadrati, ognuno davanti / mezzo / fondo */
.van { display: grid; gap: 4px; width: 100%; max-width: 340px; margin: 0 auto; text-align: center; }
.van__end { margin: 0; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.van__floor { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; border: 3px solid var(--ink); border-radius: 18px 18px 10px 10px; background: var(--card); color: var(--ink, #241008); }
.van__quad { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px; padding: 3px; border: 2px solid #8a6f65; border-radius: 10px; }
.van__num { grid-column: 1; grid-row: 1 / span 3; align-self: center; font-size: 1.7rem; line-height: 1; }
.van__cell { grid-column: 2; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 28px; padding: 0 4px; border-radius: 6px; background: rgba(138, 111, 101, .16); font-size: .85rem; }
.van__cell strong { font-size: 1rem; }
.van__cell.is-on { background: #f2a23a; color: #241008; font-weight: 850; outline: 3px solid #241008; outline-offset: -3px; }
.van--small { width: 88px; flex: none; margin: 0; gap: 0; }
.van--small .van__floor { gap: 2px; padding: 2px; border-width: 2px; border-radius: 8px 8px 5px 5px; background: #fff; color: #241008; border-color: #241008; }
.van--small .van__quad { grid-template-columns: 12px minmax(0, 1fr); padding: 2px; gap: 2px; border-width: 1px; border-radius: 4px; }
.van--small .van__num { font-size: .95rem; }
.van--small .van__cell { min-height: 10px; padding: 0; border-radius: 2px; background: #e8ddd6; }
.van--small .van__cell.is-on { background: #241008; outline: 0; }
.slot { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 12px; border-radius: 14px; background: #f2a23a; color: #241008; font-weight: 700; }
.slot__txt { display: grid; gap: 2px; text-align: left; }
.slot__txt strong { font-size: 1.45rem; line-height: 1.15; }
.slotnum { display: inline-block; padding: 3px 8px; border-radius: 8px; background: #f2a23a; color: #241008; font-weight: 850; font-size: .85rem; white-space: nowrap; }
.found__tag { flex-wrap: wrap; }
.found__tag strong { font-size: 3.4rem; line-height: 1; }
.found__tag .found__depth { flex-basis: 100%; font-size: 2.4rem; }
.modes__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.modes__one { position: relative; display: block; }
.modes__one input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.modes__one span { display: grid; align-content: start; gap: 4px; height: 100%; padding: 8px 6px; border: 2px solid var(--line, #e4d6d0); border-radius: 12px; background: var(--card); text-align: center; }
.modes__one strong { font-size: 1.5rem; line-height: 1; }
.modes__one small { font-size: .75rem; line-height: 1.2; }
.modes__one input:checked + span { border-color: var(--accent); background: #fde9c8; color: #241008; }
.modes__one input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.sheet--toasttop .toasts { top: calc(12px + var(--safe-top)); bottom: auto; }

/* codici a barre e carico rapido */
.sheet--full { height: 100dvh; max-height: 100dvh; margin: 0 auto; border-radius: 0; }
.sheet--full .sheet__body { gap: 10px; }
.cam { position: relative; height: 30dvh; min-height: 180px; overflow: hidden; border-radius: 16px; background: #000; }
.cam__video { width: 100%; height: 100%; object-fit: cover; }
.cam__guide { position: absolute; inset: 12% 5%; border: 3px solid var(--accent); border-radius: 12px; pointer-events: none; }
.cam__status { position: absolute; left: 8px; right: 8px; bottom: 4px; margin: 0; text-align: center; color: #fff; font-weight: 700; font-size: .85rem; text-shadow: 0 1px 4px #000; }
.cam__torch { position: absolute; top: 6px; right: 6px; width: auto; min-height: 40px; padding: 4px 12px; background: #000a; color: #fff; }
.cam__torch[aria-pressed="true"] { background: var(--accent); color: #241008; }
.cam--tall { height: 44dvh; min-height: 260px; }
.cam--tall .cam__guide { inset: 6% 4% 10%; }
.burst__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.burst__head p { margin: 0; }
.burst__num { font-size: 2.4rem; }
.burst__totals { font-size: .9rem; opacity: .85; }
.burst__msg { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--card); font-weight: 700; text-align: center; }
.burst__msg--ok { background: var(--ok-bg); }
.burst__msg--bad { background: var(--warn-bg); }
.burst__card { padding: 10px 12px; border-radius: 14px; border: 2px solid var(--ok); background: var(--ok-bg); }
.burst__card p { margin: 0; }
.burst__card--bad { border-color: var(--warn); background: var(--warn-bg); }
.burst__place { font-size: 1.4rem; font-weight: 800; }
/* mappa del giro */
.map__canvas { scroll-margin-top: 72px; flex: none; height: 48dvh; min-height: 260px; border-radius: 16px; overflow: hidden; background: #e9e4da; z-index: 0; }
.map__canvas .leaflet-control-attribution { font-size: .7rem; }
.pin__box { background: none; border: 0; }
.pin { display: grid; place-items: center; width: 30px; height: 30px; box-sizing: border-box; border-radius: 50%; border: 2px solid #fff; background: #7a2358; color: #fff; font: 800 .8rem/1 system-ui, sans-serif; box-shadow: 0 1px 5px #0007; }
.pin--ok { background: #146c3c; opacity: .75; }
.pin--bad { background: #b3261e; opacity: .85; }
.pin--start { background: #241008; }
.pin--about { border: 3px dashed #f8b45a; }
.pin--here { background: #f8b45a; color: #241008; opacity: 1; transform: scale(1.3); }
.map--dots .pin:not(.pin--here):not(.pin--start) { width: 12px; height: 12px; margin: 9px; font-size: 0; border-width: 1px; }
.map__card { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: var(--card); }
.map__card p { margin: 0; }
.map__list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.map__num { display: grid; place-items: center; flex: none; min-width: 34px; height: 34px; border-radius: 50%; background: #7a2358; color: #fff; font-weight: 800; }
.map__row--ok .map__num { background: #146c3c; }
.map__row--bad .map__num { background: #b3261e; }
.map__row[aria-current="true"] { outline: 3px solid var(--accent); }
.map__row[aria-current="true"] .map__num { background: #f8b45a; color: #241008; }
.codes { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--warn); background: var(--warn-bg); }
.codes--ok { border-color: var(--ok); background: var(--ok-bg); }
.codes__text { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; flex: 1 1 200px; }
.codes__text span { display: grid; min-width: 0; }
.codes__text small { color: var(--soft); overflow-wrap: anywhere; }
.codes .btn { width: auto; flex: 0 0 auto; }
.codes__list { flex: 1 1 100%; list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.codes__list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--soft); }
.codes__list li span { overflow-wrap: anywhere; min-width: 0; }
.codes__remove { flex: 0 0 auto; width: 48px; height: 48px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: inherit; font-size: 1.5rem; line-height: 1; }
.fast__count p { margin: 0 0 4px; }
.fast__count .btn { margin-top: 8px; }
.fast__retracted { margin-top: 8px; }
.fast__card { display: grid; gap: 6px; padding: 12px; border-radius: 16px; background: var(--card); border: 3px solid var(--line); text-align: center; }
.fast__card p { margin: 0; }
.fast__card--ok { border-color: var(--ok); animation: flash .7s ease-out; }
.fast__card--again { border-color: var(--accent); }
.fast__card--bad { border-color: var(--bad); animation: flash-bad .7s ease-out; }
@keyframes flash { from { background: var(--ok-bg); transform: scale(1.03); } }
@keyframes flash-bad { from { background: var(--bad-bg); transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .fast__card { animation: none !important; } }
.fast__card--old { opacity: .5; }
.fast__card--old::before { content: 'Pacco di prima'; font-weight: 800; }
.fast__again { font-weight: 800; color: var(--warn); }
.fast__stop { font-size: 1.5rem; font-weight: 700; }
.fast__stop strong { font-size: 3rem; line-height: 1; }
.fast__big { font-size: 1.8rem; font-weight: 800; }
.fast__code { overflow-wrap: anywhere; color: var(--soft); font-size: .85rem; }
.fast__place { display: flex; align-items: center; justify-content: center; gap: 16px; }
.fast__place .van { flex: 0 0 auto; }
.fast__place .found__tag { margin: 0; justify-content: flex-start; text-align: left; max-width: 190px; }
.fast__place .found__tag strong { font-size: 2.8rem; }
.fast__place .found__tag .found__depth { font-size: 2rem; }

/* fine giornata, ritorno alla base, da completare e promemoria */
.finished.closed { padding-bottom: 8px; }
.giro .finished { padding: 12px 8px 4px; }
.base__address { font-size: 1.25rem; font-weight: 700; }
.base__back { gap: 8px; }
.giro__end { margin-top: 12px; }
.sheet__foot--stick { position: sticky; bottom: 0; z-index: 1; margin: 0 -16px calc(-24px - var(--safe-bottom)); padding: 10px 16px calc(14px + var(--safe-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.todo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); }
.todo__head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0; border: 0; background: none; text-align: left; }
.todo__txt { flex: 1; min-width: 0; display: grid; gap: 4px; }
.todo__note { color: var(--soft); font-size: .88rem; font-weight: 650; }
.remindbar { border: 3px solid var(--accent); }
.remind { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; border: 3px solid var(--accent); border-radius: 16px; background: var(--card); }
.remind__what { font-size: 1.25rem; font-weight: 800; }
.sheet--question .sheet__head h2 { font-size: 1.1rem; line-height: 1.3; }

/* ---------- ogni formato di telefono: tacca, barra di stato, schermi stretti, in orizzontale ---------- */
.top { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.tabs { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.toasts { left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); }
.login { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
/* un pannello a tutto schermo arriva sotto l'ora e la batteria: il titolo scende */
.sheet--full .sheet__head { padding-top: calc(12px + var(--safe-top)); }
.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 340px) { .pair .btn { gap: 4px; padding: 8px 4px; font-size: .92rem; } }
@media (max-width: 300px) { .pair { grid-template-columns: minmax(0, 1fr); } }
@media (orientation: landscape) and (max-height: 500px) {
  .cam--tall { height: 58dvh; min-height: 180px; }
  .map__canvas { height: 60dvh; min-height: 200px; }
  .tab { min-height: 52px; padding: 4px 2px; }
}


/* civico mancante: evidente sul pacco e sulla fermata */
.civic--missing { border-style: dashed; border-color: #8b1a13; color: #8b1a13; background: #ffe9c2; }
.nocivic { display: flex; align-items: center; gap: 7px; justify-self: stretch; padding: 7px 10px; border: 2px solid var(--bad); border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-size: .92rem; font-weight: 800; line-height: 1.25; text-align: left; overflow-wrap: normal; }
.nocivic > span { min-width: 0; overflow-wrap: anywhere; }
.parcel__txt .nocivic, .stop__txt .nocivic, .map__card .nocivic { margin-top: 4px; font-size: .82rem; padding: 5px 8px; }
/* note lunghe dentro un'etichetta: vanno a capo */
.badge--wrap { max-width: 100%; border-radius: 10px; text-align: left; }
/* barra del lettore delle etichette */
.reader { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.reader__text { color: var(--soft); font-size: .92rem; font-weight: 650; }
.bar--busy .bar__ok { background: repeating-linear-gradient(45deg, #1f9455 0 10px, #43b877 10px 20px); background-size: 28px 100%; animation: busybar .9s linear infinite; }
@keyframes busybar { to { background-position: 28px 0; } }
@media (prefers-reduced-motion: reduce) { .bar--busy .bar__ok { animation: none; } }
.login__title { text-align: center; }

/* ricerca della stazione e avviso di nuova versione */
.search__who { display: block; font-weight: 700; color: var(--accent); }
.update { position: fixed; top: calc(8px + var(--safe-top)); left: 12px; right: 12px; z-index: 30; max-width: 616px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--card); color: inherit; border: 2px solid var(--accent); box-shadow: 0 8px 24px #0006; font-weight: 650; }
.update p { flex: 1; margin: 0; }
.update .btn { width: auto; }

/* chi lavora oggi e domani: il limite dell'abbonamento sempre in vista, righe grandi da toccare */
.seats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0 0 12px; padding: 12px; border: 3px solid var(--accent); border-radius: var(--radius); background: var(--card); }
.seats__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seats__tab { display: grid; gap: 2px; min-height: 56px; padding: 6px; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); color: inherit; font: inherit; }
.seats__tab[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.seats__headline { margin: 0; font-size: 1.2rem; font-weight: 800; line-height: 1.35; }
.seats__headline--full { color: var(--warn); }
.seats__warning:empty { display: none; }
.seats__warning .notice { margin: 0; }
.seats__filter { align-self: flex-start; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--link); font: inherit; font-weight: 700; text-decoration: underline; }
.seats__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; list-style: none; margin: 0 0 12px; padding: 0; }
.seat { display: flex; align-items: stretch; border: 2px solid var(--line); border-radius: 14px; background: var(--card); }
.seat[hidden] { display: none; }
.seat--on { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.seat--off .seat__text { opacity: .6; }
.seat__tick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; }
.seat__tick input { width: 30px; height: 30px; flex: none; accent-color: #146c3c; }
.seat__text { display: grid; min-width: 0; overflow-wrap: anywhere; }
.seat__text small { color: var(--soft); }
.seat__edit { flex: none; width: 52px; border: 0; border-left: 2px solid var(--line); background: none; color: inherit; }

/* contrassegno: oro pieno e testo scuro, si legge al sole anche con il tema scuro */
.cash { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: #ffd23f; color: #1d1200; border: 3px solid #1d1200; }
.cash__total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; font-weight: 800; font-size: 1.15rem; }
.cash__total strong, .cash--halt strong, .cash--done strong { font-size: 2rem; line-height: 1.1; font-weight: 900; white-space: nowrap; }
.cash__list { display: grid; gap: 4px; border-top: 2px solid #1d120055; padding-top: 6px; }
.cash__list li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .92rem; font-weight: 650; }
.cash__list span { min-width: 0; }
.cash__list strong { white-space: nowrap; font-size: 1.1rem; }
.cash__rest { font-size: .85rem; font-weight: 650; }
.cash--halt, .cash--done { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin: 0; font-weight: 800; }
.cash--done { border-width: 2px; }
.cash--done strong { font-size: 1.5rem; }
.cash--check { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: .98rem; }
.cash--ask .cash__total strong { font-size: 2.6rem; }
.badge.badge--cash { max-width: 100%; border-radius: 8px; background: #ffd23f; color: #1d1200; font-weight: 850; overflow-wrap: break-word; text-align: left; }
.btn__cash { display: block; font-size: .85rem; font-weight: 850; text-transform: none; }
.btn.btn--money { flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding-left: 4px; padding-right: 4px; line-height: 1.2; text-align: center; }

/* navigazione: tasto principale grande con l'indirizzo scritto, il secondo sotto */
.nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.nav .btn { width: 100%; justify-content: flex-start; text-align: left; line-height: 1.2; }
.nav__txt { display: grid; gap: 2px; min-width: 0; }
.nav__where { font-size: .95rem; font-weight: 650; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.nav__txt small { font-size: .82rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.nav .btn--nav { min-height: 68px; padding: 8px 14px; font-size: 1.1rem; }
.nav .btn--nav2 { min-height: 52px; padding-top: 6px; padding-bottom: 6px; }
.nav--small .btn--nav { min-height: 60px; font-size: 1.05rem; }

/* da controllare */
.check-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; border-radius: 14px; border: 3px solid var(--warn); background: var(--warn-bg); }
.check-box__why { display: flex; gap: 10px; align-items: flex-start; color: var(--warn); font-weight: 650; }
.check-box .btn { width: 100%; }
.check-box .btn--ghost { background: var(--card); }
.banner--check { border: 3px solid var(--warn); }
@media (max-width: 340px) {
  .cash { padding: 10px; }
  .cash__total strong, .cash--halt strong { font-size: 1.7rem; }
  .cash--ask .cash__total strong { font-size: 2rem; }
  .nav .btn { gap: 8px; }
  .slot { gap: 8px; }
  .slot__txt strong { font-size: 1.05rem; overflow-wrap: break-word; }
  .badge.badge--cash { font-size: .72rem; padding-left: 6px; padding-right: 6px; }
}
/* telefoni molto stretti: le vie non si spezzano a metà parola e il giro resta in alto */
@media (max-width: 300px) {
  .targa__street { font-size: 1.05rem; }
  .civic--hero { min-width: 3rem; width: auto; font-size: 1.4rem; }
  .giro > .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .giro > .pair .btn { min-height: 52px; }
  .nav .btn--nav { font-size: .98rem; text-transform: none; }
  .nav .btn { padding-left: 10px; padding-right: 10px; }
}
