/* Dijelo v0.4 - stile "carta e china": blu e giallo spenti, titoli League Spartan, icone disegnate a mano */
:root {
  --primary: #3D63A6;          /* blu polveroso, THEME_PRIMARY */
  --primary-dark: #2C4C86;     /* THEME_PRIMARY_DARK */
  --accent: #F2C230;           /* giallo spento, THEME_ACCENT */
  --accent-dark: #DDAC17;
  --primary-tint: #E8EEF8;
  --notte: #2B3640;
  --ink: #2B3640;
  --ink-2: #66727C;
  --line: #E3E6E2;
  --line-2: #CDD4CF;
  --bg: #F7F5F0;
  --bg-2: #EEEBE3;
  --surface: #ffffff;
  --ok: #2F7A47;
  --warn: #8A5A00;
  --err: #A33A3A;
  --focus: #3D63A6;

  --st-inviata: #3D63A6;          --st-inviata-bg: #E8EEF8;
  --st-presa_in_carico: #2F7D73;  --st-presa_in_carico-bg: #E1F1EE;
  --st-risposta_ricevuta: #6A4FA3; --st-risposta_ricevuta-bg: #EEE9F7;
  --st-sollecitata: #8A5A00;      --st-sollecitata-bg: #FCEFCF;
  --st-senza_risposta: #A33A3A;   --st-senza_risposta-bg: #F9E4E2;
  --st-risolta: #2F7A47;          --st-risolta-bg: #E2F2E6;

  /* macchie di colore delle categorie */
  --m0: #F6D77A; --m1: #A9C5E8; --m2: #B9DCC4; --m3: #F2B8A2;
  --m4: #D9C8EE; --m5: #F5C6D6; --m6: #C9E3E8; --m7: #E8D3A9;
  /* le stesse macchie in versione intensa: contorno dei segnaposti */
  --k0: #C9961A; --k1: #4E7FC4; --k2: #4A9466; --k3: #CF6A4A;
  --k4: #8B6CC0; --k5: #C45F87; --k6: #3B93A3; --k7: #A07E3E;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --shadow: 0 2px 4px rgba(43, 54, 64, .04), 0 8px 24px rgba(43, 54, 64, .07);
  --shadow-up: 0 -8px 28px rgba(43, 54, 64, .12);
  --font: "Dijelo Cifre", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-titoli: "League Spartan", "Atkinson Hyperlegible", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.5; color: var(--ink); min-height: 100%;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .28 0 0 0 0 .22 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; }
h1, h2 { font-family: var(--font-titoli); color: var(--primary); letter-spacing: .01em; }
h1 { font-size: 1.9rem; font-weight: 800; text-transform: uppercase; }
h2 { font-size: 1.35rem; }
.titolino { font-family: var(--font); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
i.ph { line-height: 1; }

/* ---------- barra superiore delle pagine ---------- */
.appbar { background: rgba(255,255,255,.92); backdrop-filter: blur(6px); color: var(--ink); position: sticky; top: 0; z-index: 900; box-shadow: 0 1px 0 var(--line); }
.appbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.appbar a, .appbar button { color: var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand img { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand strong { font-family: var(--font-titoli); font-weight: 800; font-size: 1.35rem; color: var(--primary); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; }
.brand small { font-size: .82rem; color: var(--ink-2); }
.appbar nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.appbar nav a { text-decoration: none; padding: 8px 12px; border-radius: var(--r-sm); font-weight: 600; }
.appbar nav a:hover { background: var(--bg); color: var(--ink); }
.appbar nav a[aria-current="page"] { background: var(--primary-tint); color: var(--primary-dark); }
.icon-btn { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r); border: 0; background: transparent; cursor: pointer; font-size: 1.5rem; text-decoration: none; }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.bottoni .btn { white-space: nowrap; }
.appbar .icon-btn:hover { background: var(--bg); }
.appbar .titolo { font-family: var(--font-titoli); color: var(--primary); font-size: 1.25rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.solo-mobile { display: none; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap-stretta { max-width: 720px; margin: 0 auto; padding: 0 16px; }
main.pagina { padding: 24px 0 56px; }
.footer { color: var(--ink-2); font-size: .88rem; padding: 18px 0 calc(28px + var(--safe-b)); border-top: 1px solid var(--line); }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }

/* ---------- pulsanti e moduli ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px;
  font: inherit; font-weight: 700; font-size: 1rem; border-radius: var(--r); border: 1.5px solid var(--line-2);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--ink); box-shadow: 0 3px 0 var(--accent-dark); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-dark); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--ink); }
.btn-blu { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-blu:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline { border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-tint); border-color: var(--primary-dark); color: var(--primary-dark); }
.btn-danger { border-color: var(--err); color: var(--err); }
.btn-danger:hover { background: #fbe9ec; border-color: var(--err); color: var(--err); }
.btn-link { border-color: transparent; background: transparent; color: var(--primary); padding-left: 4px; padding-right: 4px; }
.btn-link:hover { border-color: transparent; text-decoration: underline; color: var(--primary-dark); }
.btn-lg { min-height: 56px; font-size: 1.08rem; padding: 10px 22px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn i { font-size: 1.25em; }
.azioni { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-items: center; margin-top: 18px; }
.azioni .spinta { margin-right: auto; }

label, .label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .98rem; }
.hint { display: block; font-weight: 400; color: var(--ink-2); font-size: .9rem; margin-top: 2px; }
.opz { font-weight: 400; color: var(--ink-2); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 48px; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-tint); }
.campo { margin-bottom: 16px; }
.riga { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; min-height: 44px; padding-top: 4px; }
.check input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--primary); }
.contatore { text-align: right; font-size: .85rem; color: var(--ink-2); margin-top: 4px; }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.avviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); margin-bottom: 16px;
  background: var(--primary-tint); color: var(--notte); font-size: .95rem; }
.avviso i { font-size: 1.35rem; flex: none; }
.avviso-err { background: #fbe9ec; color: #7a1f2e; }
.avviso-ok { background: #e0f2eb; color: #004d33; }
.avviso-warn { background: #fbf0e0; color: #5c3700; }

/* ---------- card, pillole, elenchi ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .85rem;
  font-weight: 700; white-space: nowrap; background: var(--bg); color: var(--ink); }
.pill i { font-size: 1.05rem; }
.st { color: var(--c); background: var(--cb); }
.st-inviata { --c: var(--st-inviata); --cb: var(--st-inviata-bg); }
.st-presa_in_carico { --c: var(--st-presa_in_carico); --cb: var(--st-presa_in_carico-bg); }
.st-risposta_ricevuta { --c: var(--st-risposta_ricevuta); --cb: var(--st-risposta_ricevuta-bg); }
.st-sollecitata { --c: var(--st-sollecitata); --cb: var(--st-sollecitata-bg); }
.st-senza_risposta { --c: var(--st-senza_risposta); --cb: var(--st-senza_risposta-bg); }
.st-risolta { --c: var(--st-risolta); --cb: var(--st-risolta-bg); }

.voci { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.voce { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 14px; background: var(--surface);
  border-radius: var(--r); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .12s; }
.voce:hover { color: var(--ink); transform: translateY(-1px); }

.voce .testo { flex: 1; min-width: 0; }
.voce .tit { font-weight: 700; font-size: 1rem; display: block; color: var(--ink); }
.voce .sub { color: var(--ink-2); font-size: .9rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voce .pill { flex: none; }
.vuoto { text-align: center; color: var(--ink-2); padding: 28px 16px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); }
.paginazione { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 18px; }

/* ---------- icone di categoria: china + macchia di colore ---------- */
.cat-ico { position: relative; flex: none; width: 48px; height: 48px; display: inline-block; }
.cat-ico::before { content: ""; position: absolute; inset: 2px; background: var(--mc, var(--m0));
  -webkit-mask: var(--macchia, url(/static/schizzi/macchia-0.svg)) center / contain no-repeat;
  mask: var(--macchia, url(/static/schizzi/macchia-0.svg)) center / contain no-repeat; }
.cat-ico img { position: absolute; inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); }
.cat-ico.grande { width: 72px; height: 72px; }
.cat-ico.grande img { inset: 13px; width: calc(100% - 26px); height: calc(100% - 26px); }
.cat-ico.piccola { width: 36px; height: 36px; }
.cat-ico.piccola img { inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
.mc0 { --mc: var(--m0); --macchia: url(/static/schizzi/macchia-0.svg); }
.mc1 { --mc: var(--m1); --macchia: url(/static/schizzi/macchia-1.svg); }
.mc2 { --mc: var(--m2); --macchia: url(/static/schizzi/macchia-2.svg); }
.mc3 { --mc: var(--m3); --macchia: url(/static/schizzi/macchia-0.svg); }
.mc4 { --mc: var(--m4); --macchia: url(/static/schizzi/macchia-1.svg); }
.mc5 { --mc: var(--m5); --macchia: url(/static/schizzi/macchia-2.svg); }
.mc6 { --mc: var(--m6); --macchia: url(/static/schizzi/macchia-0.svg); }
.mc7 { --mc: var(--m7); --macchia: url(/static/schizzi/macchia-1.svg); }
.colline { display: block; width: 100%; height: 70px; background: url(/static/schizzi/colline.svg) bottom / 100% 100% no-repeat; margin-top: 24px; }

/* ---------- home: mappa a tutto schermo ---------- */
.home { position: fixed; inset: 0; display: grid; grid-template-columns: 1fr; background: var(--bg-2); }
#mappa-home { position: absolute; inset: 0; z-index: 1; }
.home-top { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; z-index: 500; display: flex; gap: 8px; }
.home-top .icon-btn { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); width: 48px; height: 48px; }
.cerca { flex: 1; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 6px 0 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.cerca input { border: 0 !important; box-shadow: none !important; min-height: 0; height: 44px; padding: 0; background: transparent; }
.cerca i { color: var(--ink-2); font-size: 1.25rem; }
.cerca-risultati { position: absolute; top: 56px; left: 56px; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); list-style: none; margin: 0; padding: 4px 0; max-height: 50vh; overflow: auto; }
.cerca-risultati:empty { display: none; }
.cerca-risultati button { width: 100%; text-align: left; background: none; border: 0; padding: 10px 14px; font: inherit; font-size: .95rem; cursor: pointer; }
.cerca-risultati button:hover { background: var(--primary-tint); }
.cerca-risultati .info { padding: 10px 14px; color: var(--ink-2); font-size: .92rem; }
.mio-punto { position: absolute; right: 12px; z-index: 500; bottom: calc(var(--sheet-h, 300px) + 12px); background: var(--surface) !important;
  border: 1px solid var(--line) !important; box-shadow: var(--shadow); color: var(--primary) !important; width: 48px; height: 48px; }

.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 600; background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-up); padding: 8px 16px calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px;
  max-height: 70vh; transition: transform .25s ease; }
.sheet .maniglia { align-self: center; width: 44px; height: 24px; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sheet .maniglia::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); }
.sheet .sheet-corpo { overflow: auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.sheet.chiuso .sheet-corpo { display: none; }
.sheet-intesta { display: flex; justify-content: space-between; align-items: baseline; }
.sheet-intesta h2 { margin: 0; font-size: 1.05rem; text-transform: uppercase; }
.sheet .brand-side { display: none; }
.menu { position: fixed; inset: 0; z-index: 1200; background: rgba(17,32,43,.45); display: none; }
.menu.aperto { display: block; }
.menu-pannello { position: absolute; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); background: var(--surface); padding: 16px;
  display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-up); }
.menu-pannello .brand { color: var(--ink); margin-bottom: 14px; }

.menu-pannello a.voce-menu { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border-radius: var(--r);
  color: var(--ink); text-decoration: none; font-weight: 600; }
.menu-pannello a.voce-menu:hover { background: var(--primary-tint); }
.menu-pannello a.voce-menu i { font-size: 1.4rem; color: var(--primary); }
.menu-pannello .nota { margin-top: auto; font-size: .85rem; color: var(--ink-2); }

/* segnaposti sulla mappa */
.pin { width: 40px; height: 48px; }
.pin > div { position: relative; width: 40px; height: 48px; }
.pin .tondo { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 3px solid var(--k, var(--primary)); box-shadow: 0 2px 6px rgba(43,54,64,.25);
  display: flex; align-items: center; justify-content: center; }
.pin .tondo img { width: 24px; height: 24px; }
.pin .punta { width: 0; height: 0; margin: -2px auto 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--k, var(--primary)); }
.bollino { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%; color: #fff;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(43,54,64,.3); flex: none; }
.bollino i { font-size: 11px; }
.pin .bollino { position: absolute; top: -5px; right: -6px; }
.b-senza_risposta { background: var(--st-senza_risposta); }
.b-sollecitata { background: #C27C0E; }
.b-risolta { background: var(--st-risolta); }
.b-vuoto { background: #fff; border-color: var(--line-2); box-shadow: none; }
.popup-segn { font-family: var(--font); min-width: 190px; }
.popup-segn strong { display: block; font-size: 1rem; }
.popup-segn .sub { color: var(--ink-2); font-size: .88rem; margin-bottom: 6px; }
.popup-segn a.btn { min-height: 38px; margin-top: 8px; color: var(--ink); }
.leaflet-container { font-family: var(--font); background: var(--bg-2); }
.leaflet-tile-pane { filter: saturate(.45) brightness(1.04) contrast(.94); }
.punto-gps { width: 18px; height: 18px; border-radius: 50%; background: var(--primary); border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(61,99,166,.18); }

/* ---------- flusso di segnalazione ---------- */
.flusso { max-width: 600px; margin: 0 auto; padding: 16px 16px calc(24px + var(--safe-b)); min-height: calc(100dvh - 60px); display: flex; flex-direction: column; }
.passo { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.passo[hidden] { display: none; }
.progresso { display: flex; flex-direction: column; gap: 6px; }
.progresso .barre { display: flex; gap: 6px; }
.progresso .barre span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.progresso .barre span.on { background: var(--primary); }
.progresso .etichetta { font-size: .9rem; color: var(--ink-2); }
.passo h2 { font-size: 1.45rem; margin: 0; }
.passo .lead { margin: 0; color: var(--ink-2); }
.passo-fondo { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.mappa-flusso { height: 46vh; min-height: 260px; border-radius: var(--r); box-shadow: var(--shadow); }
.posizione-box { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--r); }
.posizione-box .ico, .riepilogo-box .ico { flex: none; width: 44px; height: 44px; border-radius: var(--r); background: var(--primary-tint);
  color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.posizione-box .testo { flex: 1; min-width: 0; }
.posizione-box .sub, .riepilogo-box .sub { font-size: .88rem; color: var(--ink-2); display: block; }
.posizione-box strong, .riepilogo-box strong { display: block; }
.cerca-flusso { display: flex; gap: 8px; }
.cerca-flusso .btn { flex: none; }
.lista-risultati { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.lista-risultati:empty { display: none; }
.lista-risultati button { width: 100%; text-align: left; background: none; border: 0; padding: 12px; font: inherit; font-size: .95rem; cursor: pointer; }
.lista-risultati li + li button { border-top: 1px solid var(--line); }
.lista-risultati button:hover { background: var(--primary-tint); }
.lista-risultati .info { padding: 12px; color: var(--ink-2); font-size: .92rem; }

.vicina { background: var(--surface); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.vicina .corpo { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.vicina .tit { font-size: 1.1rem; font-weight: 700; }
.vicina .meta { display: flex; flex-wrap: wrap; gap: 8px; }
.vicina .azione { padding: 0 14px 14px; }

.tessere { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tessera { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 104px; padding: 10px 8px;
  border-radius: var(--r); font: inherit; font-size: .95rem; font-weight: 700; text-align: center; color: var(--ink); background: var(--surface);
  border: 0; box-shadow: var(--shadow); cursor: pointer; transition: transform .12s; }
.tessera:hover { transform: translateY(-2px); }
.tessere { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lista-tipi { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.lista-tipi li + li { border-top: 1px solid var(--line); }
.lista-tipi button { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px;
  background: none; border: 0; font: inherit; font-size: 1rem; text-align: left; color: var(--ink); cursor: pointer; }
.lista-tipi button:hover, .lista-tipi button:focus-visible { background: color-mix(in srgb, var(--mc) 38%, #fff); }
.lista-tipi button[aria-current="true"] { background: color-mix(in srgb, var(--mc) 55%, #fff); font-weight: 700; }
.lista-tipi button i { color: var(--ink-2); font-size: 1.1rem; }
.torna-cat { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 4px 0 10px; font: inherit; cursor: pointer; min-height: 44px; text-align: left; }
.torna-cat .freccia { font-size: 1.3rem; color: var(--primary); }
.torna-cat .nome { font-family: var(--font-titoli); font-size: 1.3rem; font-weight: 700; color: var(--primary); line-height: 1.1; }
.torna-cat .sub { display: block; font-size: .85rem; color: var(--ink-2); font-family: var(--font); font-weight: 400; }
.scelta-fatta { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.scelta-fatta .testo { flex: 1; min-width: 0; }
.scelta-fatta .sub { display: block; font-size: .88rem; color: var(--ink-2); }
.tipi { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  font: inherit; font-size: .95rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.riepilogo-box { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--r); }
.destinatario { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--r); }
.destinatario i { font-size: 1.5rem; color: var(--primary); }
.destinatario .sub { font-size: .88rem; color: var(--ink-2); display: block; }
.otp-input { font-size: 2rem !important; letter-spacing: .45em; text-align: center; font-variant-numeric: tabular-nums; max-width: 280px; margin: 0 auto; display: block; }
.esito { text-align: center; padding: 24px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.esito > i { font-size: 4.5rem; color: var(--ok); }
.bozza { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--primary-tint); border-radius: var(--r); font-size: .95rem; }
.bozza .testo { flex: 1; }

/* ---------- scheda segnalazione ---------- */
.banner { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); color: var(--c); background: var(--cb); }
.banner i { font-size: 1.8rem; flex: none; }
.banner strong { display: block; font-size: 1.08rem; }
.banner span { font-size: .92rem; }
.scheda { display: grid; grid-template-columns: 1fr; gap: 16px; }
.testa { display: flex; align-items: center; gap: 14px; }
.testa h1 { font-size: 1.5rem; margin: 0 0 2px; }
.dati { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .96rem; }
.dati dt { color: var(--ink-2); }
.dati dd { margin: 0; overflow-wrap: anywhere; }
.crono { list-style: none; margin: 0; padding: 0; }
.crono li { display: flex; gap: 12px; }
.crono .asse { display: flex; flex-direction: column; align-items: center; }
.crono .nodo { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--c, var(--primary)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.crono .filo { flex: 1; width: 2px; min-height: 18px; background: var(--c, var(--primary)); }
.crono li:last-child .filo { display: none; }
.crono .txt { padding-bottom: 14px; min-width: 0; }
.crono .txt strong { display: block; font-size: 1rem; }
.crono .txt span { color: var(--ink-2); font-size: .9rem; }
.crono li.futuro .nodo { background: transparent; border: 2px solid var(--line-2); }
.crono li.futuro .filo { background: var(--line-2); }
.crono li.futuro strong { color: var(--ink-2); }
.messaggio { white-space: pre-wrap; background: var(--bg); border-radius: var(--r); padding: 10px 12px; margin-top: 6px; font-size: .95rem; color: var(--ink); }
.bottoni { display: flex; gap: 10px; }
.bottoni .btn-primary { flex: 1; }

/* ---------- elenco ---------- */
.contatori { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.contatori a { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--r); padding: 12px; text-decoration: none;
  color: var(--ink); box-shadow: var(--shadow); outline: 2px solid transparent; transition: transform .12s; }
.contatori a:hover { transform: translateY(-1px); color: var(--ink); }
.contatori a.on { outline-color: var(--c); background: var(--cb); }
.contatori .tondo { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--cb); display: flex; align-items: center; justify-content: center; }
.contatori .tondo img { width: 24px; height: 24px; }
.contatori b { display: block; font-family: var(--font-titoli); font-size: 1.6rem; line-height: 1; color: var(--c); font-variant-numeric: tabular-nums; }
.contatori span { font-size: .78rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.sintesi { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--ink-2); font-size: .94rem; margin-bottom: 16px; }
.sintesi b { color: var(--ink); }
.filtri { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 16px; }
.filtri .campo { margin: 0; }

/* ---------- admin ---------- */
.tabella { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.tabella th, .tabella td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .95rem; }
.tabella th { background: var(--bg); font-size: .85rem; color: var(--ink-2); font-weight: 700; }
.tabella tr:hover td { background: #fafbfb; }
.scroll { overflow-x: auto; }
.badge { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font-weight: 700; }
.badge-err { background: #fbe9ec; color: var(--err); }
.badge-ok { background: #e0f2eb; color: var(--ok); }
.flash { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 2000; background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: var(--r); box-shadow: var(--shadow-up); font-weight: 600; }

/* catalogo a due colonne */
.catalogo { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.cat-lista { background: var(--surface); border-radius: var(--r); overflow: hidden; position: sticky; top: 76px; box-shadow: var(--shadow); }
.cat-lista ul { list-style: none; margin: 0; padding: 0; }
.cat-lista li { border-bottom: 1px solid var(--line); }
.cat-lista li.trascina { opacity: .4; }
.cat-lista li.sopra { box-shadow: inset 0 3px 0 var(--primary); }
.cat-lista a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--ink); text-decoration: none; }
.cat-lista a:hover { background: var(--bg); }
.cat-lista a[aria-current="true"] { background: var(--primary-tint); box-shadow: inset 4px 0 0 var(--primary); }

.cat-lista .nome { flex: 1; min-width: 0; font-weight: 600; }
.cat-lista .nome small { display: block; font-weight: 400; color: var(--ink-2); font-size: .82rem; }
.cat-lista .off { opacity: .55; }
.maniglia-drag { cursor: grab; color: var(--ink-2); font-size: 1.2rem; flex: none; background: none; border: 0; padding: 4px; }
.cat-lista form { padding: 10px; }
.cat-pannello .intesta { display: grid; grid-template-columns: auto 1fr 1fr; gap: 12px; align-items: end; }
.icona-scelta { width: 72px; height: 72px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface);
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.icona-scelta:hover { border-color: var(--primary); }
.icone-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; padding: 12px; margin-top: 12px;
  background: var(--bg); border-radius: var(--r); }
.icone-griglia[hidden] { display: none; }
.icone-griglia button { height: 56px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; padding: 8px; }
.icone-griglia button img { width: 32px; height: 32px; }
.icone-griglia button:hover, .icone-griglia button[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); background: var(--primary-tint); }
.tipi-tab { width: 100%; border-collapse: collapse; margin-top: 8px; }
.tipi-tab th { text-align: left; font-size: .82rem; color: var(--ink-2); padding: 6px 8px; border-bottom: 1px solid var(--line); font-weight: 700; }
.tipi-tab td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tipi-tab tr.trascina td { opacity: .4; }
.tipi-tab tr.sopra td { box-shadow: inset 0 3px 0 var(--primary); }
.tipi-tab input[type=text], .tipi-tab input[type=email] { min-height: 40px; padding: 6px 10px; }
.tipi-tab input.manca { border-color: var(--err); background: #FDF4F3; }
.tipi-tab input.manca::placeholder { color: var(--err); }
.tipi-tab tr.info-riga td { background: var(--bg); }
.tipi-tab tr.info-riga[hidden] { display: none; }
.tipi-tab tr.spento td:not(:last-child) { opacity: .5; }
.interruttore { position: relative; width: 44px; height: 26px; flex: none; display: inline-block; }
.interruttore input { opacity: 0; width: 0; height: 0; position: absolute; }
.interruttore span { position: absolute; inset: 0; background: var(--line-2); border-radius: 13px; cursor: pointer; transition: background .15s; }
.interruttore span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.interruttore input:checked + span { background: var(--ok); }
.interruttore input:checked + span::before { transform: translateX(18px); }
.interruttore input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.barra-salva { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 18px; margin: 18px -18px -18px;
  border-radius: 0 0 var(--r) var(--r); display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.barra-salva .stato-mod { margin-right: auto; font-size: .9rem; color: var(--ink-2); }

/* ---------- dashboard admin ---------- */
.kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi .card { padding: 16px; }
.kpi .card + .card, .griglia-dash .card + .card, .scheda .card + .card { margin-top: 0; }
.kpi b { display: block; font-family: var(--font-titoli); font-size: 2.1rem; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.kpi span { display: block; margin-top: 6px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.kpi small { display: block; margin-top: 4px; font-size: .85rem; color: var(--ink-2); }
.griglia-dash { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.griglia-dash .largo { grid-column: 1 / -1; }
.barre-sett { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 8px; }
.barre-sett .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.barre-sett .bar { width: 100%; max-width: 32px; background: var(--primary); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.barre-sett .bar .conf { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); border-radius: 2px; }
.barre-sett .et { font-size: .7rem; color: var(--ink-2); margin-top: 4px; white-space: nowrap; }
.barre-sett .n { font-size: .72rem; color: var(--ink); font-weight: 700; margin-bottom: 2px; }
.legenda { display: flex; gap: 16px; font-size: .85rem; color: var(--ink-2); margin-top: 8px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.imbuto { display: flex; flex-direction: column; gap: 8px; }
.imbuto .riga-i { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; font-size: .92rem; }
.imbuto .barra { height: 22px; background: var(--primary-tint); border-radius: 6px; overflow: hidden; }
.imbuto .barra span { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.distr { display: flex; height: 26px; border-radius: 8px; overflow: hidden; margin: 6px 0 10px; }
.distr span { display: block; height: 100%; background: var(--c); }
.periodo { display: inline-flex; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); padding: 4px; gap: 2px; }
.periodo a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .9rem; }
.periodo a[aria-current="true"] { background: var(--primary); color: #fff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- responsive ---------- */
@media (min-width: 900px) {
  .home { grid-template-columns: 400px 1fr; }
  #mappa-home { position: relative; grid-column: 2; inset: auto; height: 100%; }
  .sheet { position: relative; grid-column: 1; grid-row: 1; border-radius: 0; max-height: none; height: 100%;
    box-shadow: 2px 0 12px rgba(17,32,43,.10); padding: 0 0 16px; transform: none !important; }
  .sheet .maniglia { display: none; }
  .sheet.chiuso .sheet-corpo { display: flex; }
  .sheet .brand-side { display: flex; align-items: center; gap: 10px; padding: 16px; }
  .sheet .brand-side .brand { color: var(--ink); }
  .sheet .brand-side nav { margin-left: auto; display: flex; gap: 2px; }
  .sheet .brand-side nav a { color: var(--primary); font-size: 1.4rem; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); }
  .sheet .brand-side nav a:hover { background: var(--primary-tint); }
  .sheet .sheet-cta, .sheet .sheet-corpo { padding: 0 16px; }
  .sheet .sheet-cta { padding-top: 16px; }
  .home-top { left: 416px; right: auto; width: min(480px, calc(100% - 432px)); }
  .home-top .apri-menu { display: none; }
  .cerca-risultati { left: 0; }
  .mio-punto { bottom: 24px !important; }
  .scheda { grid-template-columns: 1.1fr 1fr; align-items: start; }
  body { font-size: 17px; }
}
@media (max-width: 899px) {
  .solo-desktop { display: none !important; }
  .solo-mobile { display: inline-flex; }
}
@media (max-width: 420px) {
  .bottoni .btn-outline span { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .riga { grid-template-columns: 1fr; gap: 0; }
  .filtri { grid-template-columns: 1fr 1fr; }
  .filtri .campo:first-child { grid-column: 1 / -1; }
  .contatori { grid-template-columns: repeat(2, 1fr); }
  .kpi { grid-template-columns: repeat(2, 1fr); }
  .griglia-dash { grid-template-columns: 1fr; }
  .imbuto .riga-i { grid-template-columns: 110px 1fr 56px; }
  .catalogo { grid-template-columns: 1fr; }
  .cat-lista { position: static; }
  .cat-pannello .intesta { grid-template-columns: auto 1fr; }
  .cat-pannello .intesta .campo:last-child { grid-column: 1 / -1; }
  .tipi-tab .col-email { display: none; }
  .appbar nav.solo-desktop { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }


/* =================== v0.4 =================== */

/* icona a china nei pulsanti e nel menu */
.ico-china { width: 30px; height: 30px; flex: none; margin: -6px 0; }
.menu-pannello .ico-china { width: 26px; height: 26px; margin: 0; }

/* ---------- home ---------- */
body.con-cta { padding-bottom: calc(92px + var(--safe-b)); }
.home-testa { padding: calc(14px + env(safe-area-inset-top, 0px)) 0 4px; }
.home-testa .domanda { margin: 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: clamp(13px, 3.9vw, 17px); color: var(--ink-2); }
.home-logo-riga { display: flex; align-items: center; gap: 8px; }
.home-logo-riga .apri-menu { margin-left: auto; align-self: flex-start; background: var(--surface); box-shadow: var(--shadow); width: 48px; height: 48px; color: var(--ink); }
.logo-home { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.logo-home .disegno { height: clamp(72px, 22vw, 104px); width: auto; flex: none; }
.logo-home .testo { display: flex; flex-direction: column; min-width: 0; }
.logo-home .scritta { height: clamp(40px, 12.5vw, 58px); width: auto; align-self: flex-start; }
.logo-home .paese { font-family: var(--font-titoli); font-weight: 700; color: var(--ink); line-height: 1;
  font-size: clamp(1.05rem, 5vw, 1.45rem); margin: 2px 0 0 4px; white-space: nowrap; }
.home-corpo { display: flex; flex-direction: column; gap: 16px; padding-top: 10px; padding-bottom: 8px; }
.home-corpo .card + .card { margin-top: 0; }
.mappa-striscia { position: relative; display: block; height: 140px; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow);
  background: var(--bg-2); text-decoration: none; }
#mappa-anteprima { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
#mappa-anteprima .leaflet-control-attribution { font-size: 9px; }
#mappa-anteprima .pt { fill: #fff; }
.pt-k0 { stroke: var(--k0); } .pt-k1 { stroke: var(--k1); } .pt-k2 { stroke: var(--k2); } .pt-k3 { stroke: var(--k3); }
.pt-k4 { stroke: var(--k4); } .pt-k5 { stroke: var(--k5); } .pt-k6 { stroke: var(--k6); } .pt-k7 { stroke: var(--k7); }
#mappa-anteprima .pt-risolta { opacity: .45; }
.mappa-striscia .etichetta { position: absolute; z-index: 2; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--primary-dark); font-weight: 700; font-size: .92rem; padding: 7px 12px; border-radius: 999px; box-shadow: var(--shadow); }
.mappa-striscia .etichetta i { font-size: 1.15rem; }
.mappa-striscia:hover .etichetta { background: var(--primary-tint); }
.contatori.contatori-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.contatori-3 a { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; }
.contatori-3 .tondo { width: 34px; height: 34px; }
.contatori-3 .tondo img { width: 20px; height: 20px; }
.contatori-3 span span { font-size: .72rem; }
.sezione { display: flex; flex-direction: column; gap: 10px; }
.sez-intesta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sez-intesta h2 { margin: 0; font-size: 1.05rem; text-transform: uppercase; }
.footer .wrap-stretta { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
.cta-fissa { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; padding: 14px 16px calc(14px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 70%, rgba(247,245,240,0)); }
.cta-fissa .btn { max-width: 688px; margin: 0 auto; }
.voce .sub + .sub { font-size: .84rem; }

/* ---------- card di benvenuto / tre passi a china ---------- */
.bv { position: relative; padding: 14px 12px 12px; }
.bv-tit { margin: 2px 44px 10px 4px; font-size: 1.1rem; color: var(--ink); text-transform: none; }
.bv-chiudi { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: none;
  color: var(--ink-2); font-size: 1.25rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bv-chiudi:hover { background: var(--bg); }
.bv-passi { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 16px 1fr 16px 1fr; column-gap: 2px; }
.bv-passo { text-align: center; min-width: 0; }
.bv-passo svg { display: block; width: 100%; max-width: 92px; height: auto; margin: 0 auto; overflow: visible; }
.bv-passo h3 { font-family: var(--font-titoli); font-size: .98rem; margin: 4px 0 3px; line-height: 1.1; }
.bv-passo p { margin: 0; font-size: .8rem; line-height: 1.3; color: var(--ink-2); }
.bv-freccia { align-self: start; margin-top: 30px; }
.bv-freccia svg { width: 16px; height: 22px; overflow: visible; }
.bv-piede { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between;
  align-items: baseline; gap: 8px; font-size: .82rem; color: var(--ink-2); }
.bv-piede a { font-weight: 700; white-space: nowrap; }
.bv-china { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bv .tr { stroke-dasharray: 1 1; }
.bv-pill { fill: var(--st-risolta-bg); stroke: var(--st-risolta); }
.bv-pallino { fill: var(--st-inviata); opacity: 0; }
.bv-verde { stroke: var(--st-risolta); stroke-width: 2.8; }
.bv.anima .tr { animation: bv-tratto var(--t, .45s) ease-out var(--d, 0s) both; }
.bv.anima .bv-macchia { transform-box: fill-box; transform-origin: center; animation: bv-macchia .4s cubic-bezier(.3, 1.5, .5, 1) var(--d, 0s) both; }
.bv.anima .bv-cade { transform-box: fill-box; transform-origin: 50% 100%; animation: bv-cade .55s ease-out var(--d, 0s) both; }
.bv.anima .bv-arriva { transform-box: fill-box; transform-origin: center; animation: bv-arriva .5s ease-out var(--d, 0s) both; }
.bv.anima .bv-compare, .bv.anima .bv-testi { animation: bv-compare .4s ease-out var(--d, 0s) both; }
.bv.anima .bv-pallino { animation: bv-sparisci .2s ease-out var(--d, 0s) both; }
.bv.anima .bv-pill { animation-timing-function: ease-out; animation-fill-mode: both; }
@keyframes bv-tratto { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes bv-macchia { from { opacity: 0; transform: scale(.3) rotate(-8deg); } }
@keyframes bv-cade { 0% { opacity: 0; transform: translateY(-18px); } 55% { opacity: 1; transform: translateY(2px) scaleY(.94); }
  75% { transform: translateY(-2px); } 100% { transform: none; } }
@keyframes bv-arriva { from { opacity: 0; transform: translate(-10px, 6px) rotate(-10deg); } }
@keyframes bv-compare { from { opacity: 0; } }
@keyframes bv-risolvi { from { fill: var(--st-inviata-bg); stroke: var(--st-inviata); } }
@keyframes bv-sparisci { from { opacity: 1; } to { opacity: 0; } }
.bv:not(.anima) .bv-pill { animation: none !important; }

/* ---------- avviso "solo una mail" ---------- */
.solo-mail { background: #FBF3D9; border-left: 4px solid var(--accent); border-radius: var(--r-sm); padding: 12px 14px; margin: 14px 0; font-size: .95rem; }
.solo-mail p { margin: 0 0 6px; }
.solo-mail p:last-child { margin: 0; }
.solo-mail .dijelo strong { font-family: var(--font-titoli); font-size: 1.1em; color: var(--primary-dark); }
.solo-mail .emergenze { display: flex; align-items: center; gap: 6px; color: var(--err); font-weight: 700; }
.solo-mail .emergenze i { font-size: 1.15rem; }
.solo-mail.compatto { font-size: .86rem; margin: 12px 0 0; }

/* ---------- flusso di segnalazione ---------- */
.passo-fondo { position: sticky; bottom: 0; z-index: 5; background: var(--bg); margin: auto -16px 0; padding: 12px 16px calc(12px + var(--safe-b));
  box-shadow: 0 -10px 18px -12px rgba(43,54,64,.18); }
.flusso { padding-bottom: 0; }
.mappa-flusso { height: 40dvh; }
.senza-luogo { align-self: center; }
.desc-nota { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; color: var(--ink-2); margin-top: 4px; }
.desc-nota i { margin-right: 4px; }
.lista-tipi .nome-tipo { display: flex; flex-direction: column; min-width: 0; }
.lista-tipi .sotto { font-size: .84rem; color: var(--ink-2); font-weight: 400; }

/* ---------- mappa a schermo intero ---------- */
@media (max-width: 899px) { .home .sheet { max-height: 46dvh; } }
.home-top > .icon-btn { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); width: 48px; height: 48px; }
.mappa-strumenti { position: absolute; z-index: 550; right: 12px; top: calc(72px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 8px; }
.mappa-strumenti .icon-btn { position: static; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--primary); width: 48px; height: 48px; }
.mappa-strumenti .icon-btn[aria-expanded="true"] { background: var(--primary-tint); }
.legenda-mappa { position: absolute; z-index: 700; right: 12px; top: calc(72px + env(safe-area-inset-top, 0px)); width: min(310px, calc(100% - 24px));
  max-height: calc(100dvh - 200px); overflow: auto; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 14px 14px; }
.leg-intesta { display: flex; align-items: center; justify-content: space-between; }
.leg-intesta h2 { margin: 0; font-size: 1.05rem; }
.leg-sez { margin: 8px 0 6px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.leg-cat, .leg-stati { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.leg-cat label { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 0; min-height: 40px; cursor: pointer; }
.leg-cat input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.leg-pin { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 3px solid var(--k); flex: none; }
.leg-pin .cat-ico { width: 24px; height: 24px; }
.leg-pin .cat-ico::before { display: none; }
.leg-pin .cat-ico img { inset: 1px; width: 22px; height: 22px; }
.leg-stati li { display: flex; align-items: center; gap: 10px; font-size: .92rem; min-height: 30px; }
.leg-risolte { margin-top: 10px; font-size: .92rem; }

/* ---------- admin: opzioni dei tipi ---------- */
.opz-tipo { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }

@media (min-width: 900px) {
  .mappa-strumenti { top: auto; bottom: 24px; }
  .legenda-mappa { top: auto; bottom: 24px; right: 72px; }
  .bv-passo p { font-size: .88rem; }
}
@media (max-width: 640px) {
  .opz-tipo { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .contatori-3 a { padding: 8px; }
  .contatori-3 b { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bv * { animation: none !important; }
}
