/* ComeOggi - segnalazioni degli utenti (PATCH28-SEGNALAZIONI). Token del sito
   (v2.css): chiaro e scuro seguono --c-*, i colori dei fenomeni sono propri e
   leggibili su entrambi i fondi (icona bianca su bollo pieno). */
:root {
  --sg-hail: #7c3aed; --sg-storm: #c2410c; --sg-heavy_rain: #1d4ed8; --sg-flood: #0e7490;
  --sg-snow: #475569; --sg-fog: #6b7280; --sg-wind: #047857;
}
.sg-t--hail { --sg-c: var(--sg-hail); } .sg-t--storm { --sg-c: var(--sg-storm); }
.sg-t--heavy_rain { --sg-c: var(--sg-heavy_rain); } .sg-t--flood { --sg-c: var(--sg-flood); }
.sg-t--snow { --sg-c: var(--sg-snow); } .sg-t--fog { --sg-c: var(--sg-fog); } .sg-t--wind { --sg-c: var(--sg-wind); }

/* --- riquadro nella scheda ------------------------------------------------- */
.sg-box__corpo { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 640px) { .sg-box__corpo { grid-template-columns: 220px 1fr; } }
.sg-mini { width: 100%; max-width: 220px; margin: 0 auto; aspect-ratio: 1; }
.sg-mini svg { width: 100%; height: 100%; display: block; }
.sg-mini__a { fill: color-mix(in srgb, var(--c-brand, #0878bc) 6%, transparent); stroke: var(--c-bordo-forte, #b8cbd8); stroke-width: 1; }
.sg-mini__a--d { fill: none; stroke-dasharray: 3 4; }
.sg-mini__n, .sg-mini__k { fill: var(--c-testo-soft, #496476); font: 600 10px/1 system-ui, sans-serif; text-anchor: middle; }
.sg-mini__k { text-anchor: start; font-weight: 500; }
.sg-mini__c { fill: var(--c-testo, #17364a); }
.sg-mini__p circle { fill: var(--sg-c); stroke: var(--c-superficie, #fff); stroke-width: 2; }
.sg-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sg-voce { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; padding: 10px 12px;
  border: 1px solid var(--c-bordo, #dbe4ea); border-radius: 12px; background: var(--c-superficie, #fff); }
.sg-voce__c { display: grid; gap: 2px; line-height: 1.4; color: var(--c-testo-soft); font-size: var(--t-piccolo, .9rem); min-width: 0; }
.sg-voce__c b { color: var(--c-testo); font-size: 1rem; }
.sg-voce__c b small { font-weight: 500; color: var(--c-testo-soft); }
.sg-voce__v { font-size: var(--t-micro, .78rem); }
.sg-voce__b { grid-column: 2; display: flex; gap: 8px; flex-wrap: wrap; }
.sg-mini-b { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--c-bordo-forte);
  background: var(--c-superficie); color: var(--c-testo); font: inherit; font-weight: 600; cursor: pointer; }
.sg-mini-b:disabled { opacity: .5; }
.sg-bollo { width: 36px; height: 36px; border-radius: 50%; background: var(--sg-c); color: #fff; display: grid; place-items: center; }
.sg-ico { width: 20px; height: 20px; }
.sg-eta--sbiadita { opacity: .62; }
.sg-eta--vecchia { opacity: .38; }
.sg-vuota { color: var(--c-testo-soft); font-size: var(--t-piccolo, .9rem); line-height: 1.5; }
.sg-azioni { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.sg-cta { gap: 8px; min-height: 48px; }
.sg-nota, .sg-stato { margin: 10px 0 0; color: var(--c-testo-soft); font-size: var(--t-piccolo, .9rem); line-height: 1.5; }
.sg-stato:empty { display: none; }
.sg-come { margin-top: 8px; font-size: var(--t-piccolo, .9rem); color: var(--c-testo-soft); line-height: 1.5; }
.sg-come > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--v1-link, var(--c-brand-forte)); }
.sg-come p { margin: 0 0 8px; }

/* --- invito in home ---------------------------------------------------------- */
.sg-invito { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; }
.sg-invito .sg-bollo { width: 44px; height: 44px; }
.sg-invito h2 { margin: 0; font-family: var(--f-display); font-size: var(--t-h2, 1.25rem); color: var(--c-testo); }
.sg-invito p { margin: 2px 0 0; color: var(--c-testo-soft); line-height: 1.5; font-size: var(--t-piccolo, .9rem); }
.sg-invito .sg-azioni { grid-column: 1 / -1; margin-top: 0; }

/* --- bottone flottante --------------------------------------------------------- */
.sg-fab { position: fixed; right: 16px; z-index: 40; bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 20px 0 16px; border-radius: 999px;
  background: #c2410c; color: #fff; font: 700 1rem/1 var(--f-testo, system-ui, sans-serif); text-decoration: none;
  border: 0; box-shadow: 0 6px 20px rgba(0, 0, 0, .28); cursor: pointer; }
.sg-fab:hover { background: #9a3412; }
.sg-fab:focus-visible, .sg-tile:focus-visible, .sg-primario:focus-visible, .sg-mini-b:focus-visible, .sg-x:focus-visible,
.sg-toast button:focus-visible { outline: 3px solid var(--c-focus, #e8b840); outline-offset: 2px; }
.sg-fab svg { width: 24px; height: 24px; }
/* sulla mappa: tondo a meta' altezza, lontano da barra del tempo, legenda e zoom */
.sg-fab--mappa { bottom: auto; top: 52vh; width: 60px; min-height: 60px; height: 60px; padding: 0; justify-content: center; }
.sg-fab--mappa .sg-fab__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sg-fab--mappa svg { width: 28px; height: 28px; }
.mappa--foglio .sg-fab--mappa { display: none; }
.sg-fab--home { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
html.sg-bloccato { overflow: hidden; }

/* --- foglio della scelta rapida -------------------------------------------- */
.sg-velo { position: fixed; inset: 0; z-index: 1000; background: rgba(8, 20, 30, .5); display: flex; align-items: flex-end; justify-content: center; }
.sg-velo[hidden] { display: none; }
.sg-foglio { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--c-fondo, #f6f8fa); color: var(--c-testo, #17364a);
  border-radius: 20px 20px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 30px rgba(0, 0, 0, .25); }
@media (min-width: 640px) { .sg-velo { align-items: center; } .sg-foglio { border-radius: 20px; } }
.sg-foglio__t { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sg-foglio__t h2 { margin: 0; font-family: var(--f-display, inherit); font-size: 1.35rem; }
.sg-x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--c-bordo, #dbe4ea); background: var(--c-superficie, #fff);
  color: var(--c-testo, #17364a); display: grid; place-items: center; cursor: pointer; font-size: 1.2rem; flex: none; }
.sg-griglia { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 420px) { .sg-griglia { grid-template-columns: repeat(3, 1fr); } }
.sg-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px; padding: 12px 8px;
  border-radius: 16px; border: 2px solid color-mix(in srgb, var(--sg-c, var(--c-bordo-forte)) 45%, transparent);
  background: var(--c-superficie, #fff); color: var(--c-testo, #17364a); font: 600 .95rem/1.25 var(--f-testo, system-ui, sans-serif);
  text-align: center; cursor: pointer; }
.sg-tile:hover { border-color: var(--sg-c, var(--c-testo)); }
.sg-tile__i { width: 40px; height: 40px; color: var(--sg-c); }
.sg-tile small { display: block; font-weight: 500; color: var(--c-testo-soft); font-size: .8rem; }
.sg-dim { --sg-c: var(--sg-hail); }
.sg-dim__p { display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #c7d2fe 60%, #94a3b8);
  border: 1px solid #94a3b8; }
.sg-dim__p--q { width: 32px; height: 32px; background: none; color: var(--c-testo-soft); font-weight: 700; }
.sg-danni { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; min-height: 44px; font-weight: 600; }
.sg-danni input { width: 22px; height: 22px; accent-color: var(--sg-hail); }
.sg-piccolo { margin: 12px 0 0; font-size: .85rem; line-height: 1.5; color: var(--c-testo-soft, #496476); }
.sg-piccolo a, .sg-link { color: var(--v1-link, var(--c-brand-forte, #076a9b)); }
.sg-link { background: none; border: 0; font: inherit; padding: 8px 0; cursor: pointer; text-decoration: underline; }
.sg-attesa { margin: 8px 0 12px; font-weight: 600; line-height: 1.5; }
.sg-primario { width: 100%; min-height: 52px; border-radius: 14px; border: 0; background: var(--c-brand, #0878bc); color: #fff;
  font: 700 1rem/1 var(--f-testo, system-ui, sans-serif); cursor: pointer; margin-top: 8px; }
.sg-esito { border-radius: 14px; padding: 12px 14px; border: 1px solid var(--c-bordo); background: var(--c-superficie); line-height: 1.5; }
.sg-esito p { margin: 4px 0 0; color: var(--c-testo-soft); }
.sg-esito--si { border-left: 4px solid #047857; }
.sg-esito--attesa { border-left: 4px solid #b45309; }

/* --- "C'e' ancora?" e messaggi ---------------------------------------------- */
.sg-toast { position: fixed; left: 12px; right: 12px; bottom: calc(144px + env(safe-area-inset-bottom, 0px)); z-index: 45; max-width: 520px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 12px 12px 16px; border-radius: 16px;
  background: var(--c-testo, #17364a); color: var(--c-fondo, #fff); box-shadow: 0 8px 26px rgba(0, 0, 0, .3); line-height: 1.4; font-weight: 600; }
.sg-toast[hidden] { display: none; }
.sg-toast > span:first-child { flex: 1 1 200px; }
.sg-toast__b { display: flex; gap: 8px; }
.sg-toast__b button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.sg-toast .sg-x { width: 36px; height: 36px; background: transparent; color: inherit; border-color: transparent; }

/* --- livello sulla mappa ------------------------------------------------------ */
.sg-pin { border-radius: 50%; background: var(--sg-c); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); display: grid; place-items: center; }
.sg-pin svg { width: 18px; height: 18px; }
.leaflet-marker-icon.sg-eta--sbiadita { opacity: .6 !important; }
.leaflet-marker-icon.sg-eta--vecchia { opacity: .35 !important; }
@media (prefers-reduced-motion: no-preference) { .sg-eta--fresca.sg-pin { animation: sg-pulsa 2.4s ease-out infinite; } }
@keyframes sg-pulsa { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sg-c) 55%, transparent); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
/* sulla mappa la domanda sta in alto: in basso ci sono barra del tempo e bottone */
.v2--mappa .sg-toast { bottom: auto; top: calc(150px + env(safe-area-inset-top, 0px)); }
