/* Seetizen · Mappa interattiva (nuova interfaccia) */
:root { --m-alto: 76px; --vetro: rgba(255, 253, 246, .9); --ombra: 0 24px 60px -28px rgba(16, 51, 38, .55); }
.mappa-body { overflow: hidden; height: 100vh; height: 100dvh; }
.m-app { position: relative; height: calc(100vh - var(--m-alto)); height: calc(100dvh - var(--m-alto)); overflow: hidden; background: #e9e6dc; }
#m-map { position: absolute; inset: 0; z-index: 0; background: #e9e6dc; font-family: 'Inter', sans-serif; }
.m-tiles-chiare { filter: grayscale(1) contrast(.9) brightness(1.06); opacity: .62; }
.leaflet-container { font-family: 'Inter', sans-serif; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255, 253, 246, .8) !important; border-radius: 8px 0 0 0; }

/* ---------- Vetro: pannelli flottanti ---------- */
.m-vetro { background: var(--vetro); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border: 1px solid rgba(255, 255, 255, .6); box-shadow: var(--ombra); }

/* ---------- Pannello di comando (sinistra) ---------- */
.m-pannello { position: absolute; z-index: 600; top: 16px; left: 16px; bottom: 16px; width: 380px; border-radius: 26px; display: flex; flex-direction: column; overflow: hidden; }
.m-testa { position: relative; z-index: 30; padding: 22px 22px 14px; } /* la lista dei risultati della ricerca sta sopra schede e pulsanti */
.m-testa .kicker { font-size: 10.5px; }
.m-titolo { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 10px; }
.m-titolo h1 { font-family: 'Fraunces', serif; font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: -.02em; color: #103326; }
.m-titolo h1 em { color: #1d5c45; }
.m-contatore { text-align: right; line-height: 1.1; }
.m-contatore b { display: block; font-family: 'Fraunces', serif; font-weight: 400; font-size: 24px; color: #103326; font-variant-numeric: tabular-nums; }
.m-contatore span { font-size: 10.5px; color: #5f6b63; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }

/* Ricerca */
.m-cerca { position: relative; z-index: 30; margin: 14px 0 0; }
.m-cerca input { width: 100%; padding: 12px 40px 12px 42px; border-radius: 16px; border: 1px solid rgba(16, 51, 38, .12); background: #fffdf6; font-size: 14px; color: #17261f; outline: none; transition: border-color .2s, box-shadow .2s; }
.m-cerca input:focus { border-color: #1d5c45; box-shadow: 0 0 0 4px rgba(159, 216, 67, .25); }
.m-cerca > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #5f6b63; font-size: 14px; }
.m-cerca kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-family: 'Inter', sans-serif; font-size: 11px; color: #5f6b63; border: 1px solid rgba(16, 51, 38, .14); border-radius: 6px; padding: 1px 6px; background: #f5f3ea; }
.m-risultati { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; background: #fffdf6; border: 1px solid rgba(16, 51, 38, .1); border-radius: 16px; box-shadow: var(--ombra); max-height: 320px; overflow-y: auto; padding: 6px; display: none; }
.m-risultati.aperti { display: block; }
.m-risultati .gruppo-t { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #5f6b63; padding: 8px 10px 4px; }
.m-risultati button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; color: #17261f; }
.m-risultati button:hover, .m-risultati button.sel { background: #f5f3ea; }
.m-risultati button i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: rgba(159, 216, 67, .25); color: #1d5c45; flex-shrink: 0; }
.m-risultati button small { display: block; color: #5f6b63; font-size: 11.5px; }
.m-risultati .vuoto { padding: 12px; font-size: 13px; color: #5f6b63; }

/* Schede dei temi */
.m-tab { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; margin: 0 22px; padding: 4px; border-radius: 16px; background: rgba(16, 51, 38, .06); }
.m-tab button { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; color: #5f6b63; transition: color .25s; }
.m-tab button i { font-size: 15px; }
.m-tab button.attiva { color: #f5f3ea; }
.m-tab button .pallino { position: absolute; top: 6px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: #f47b38; box-shadow: 0 0 0 2px var(--vetro); transform: scale(0); transition: transform .25s; }
.m-tab button.con-livelli .pallino { transform: scale(1); }
.m-tab-ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; border-radius: 12px; background: #103326; box-shadow: 0 8px 18px -10px rgba(16, 51, 38, .8); }

/* Contenuto della scheda */
.m-corpo { flex: 1; overflow-y: auto; padding: 18px 22px 22px; scrollbar-width: thin; }
.m-sezione + .m-sezione { margin-top: 20px; }
.m-etichetta { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: #5f6b63; margin-bottom: 10px; }
.m-etichetta button { text-transform: none; letter-spacing: 0; font-size: 12px; color: #1d5c45; text-decoration: underline; text-underline-offset: 3px; }
.m-nota { font-size: 12.5px; line-height: 1.55; color: #5f6b63; background: rgba(245, 243, 234, .8); border-radius: 14px; padding: 11px 13px; display: flex; gap: 9px; }
.m-nota i { color: #f47b38; margin-top: 2px; }

/* Interruttore */
.m-switch { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px; background: #fffdf6; border: 1px solid rgba(16, 51, 38, .09); text-align: left; transition: border-color .2s, background-color .2s; }
.m-switch:hover { border-color: rgba(29, 92, 69, .45); }
.m-switch .ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--c, #1d5c45); color: #fff; font-size: 14px; flex-shrink: 0; }
.m-switch .t { flex: 1; min-width: 0; }
.m-switch b { display: block; font-size: 13.5px; color: #17261f; font-weight: 600; line-height: 1.3; }
.m-switch small { display: block; font-size: 11.5px; color: #5f6b63; margin-top: 1px; }
.m-switch .lev { width: 38px; height: 22px; border-radius: 999px; background: rgba(16, 51, 38, .18); position: relative; flex-shrink: 0; transition: background-color .25s; }
.m-switch .lev::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
.m-switch[aria-pressed="true"] { border-color: #1d5c45; background: #fff; }
.m-switch[aria-pressed="true"] .lev { background: #1d5c45; }
.m-switch[aria-pressed="true"] .lev::after { transform: translateX(16px); }
.m-switch + .m-switch { margin-top: 8px; }
.m-switch.piccolo { padding: 9px 12px; border-radius: 13px; }
.m-switch.piccolo .ico { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
.m-switch.piccolo b { font-size: 12.5px; }

/* Pillole */
.m-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(16, 51, 38, .13); background: #fffdf6; font-size: 12.5px; font-weight: 500; color: #17261f; transition: background-color .2s, color .2s, border-color .2s, transform .15s; }
.m-pill:hover { border-color: #1d5c45; }
.m-pill:active { transform: scale(.96); }
.m-pill.attiva { background: #103326; border-color: #103326; color: #f5f3ea; }
.m-pill .dot { width: 9px; height: 9px; border-radius: 50%; }
.m-pill .n { font-size: 11px; opacity: .6; font-variant-numeric: tabular-nums; }
.m-pill-riga { display: flex; flex-wrap: wrap; gap: 6px; }
.m-segmento { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(16, 51, 38, .06); }
.m-segmento button { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px; border-radius: 10px; font-size: 12.5px; font-weight: 600; color: #5f6b63; transition: background-color .2s, color .2s; }
.m-segmento button.attiva { background: #fffdf6; color: #103326; box-shadow: 0 4px 12px -6px rgba(16, 51, 38, .4); }

/* Elenco di luoghi */
.m-elenco { display: grid; gap: 2px; max-height: 280px; overflow-y: auto; margin-top: 10px; }
.m-elenco button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; font-size: 13px; text-align: left; color: #17261f; transition: background-color .15s; }
.m-elenco button:hover { background: #fffdf6; }
.m-elenco button i { color: var(--c, #1d5c45); font-size: 11px; width: 14px; text-align: center; }
.m-elenco button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-elenco button small { color: #5f6b63; font-size: 11px; white-space: nowrap; }

/* Legenda */
.m-legenda { margin-top: 12px; }
.m-legenda .bar { height: 9px; border-radius: 999px; }
.m-legenda .v { display: flex; justify-content: space-between; font-size: 11px; color: #5f6b63; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Livelli attivi */
.m-piede { padding: 12px 22px 16px; border-top: 1px solid rgba(16, 51, 38, .08); }
.m-attivi { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; align-items: center; }
.m-attivi .vuoto { font-size: 12px; color: #5f6b63; }
.m-attivo { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 10px; border-radius: 999px; background: #103326; color: #f5f3ea; font-size: 11.5px; font-weight: 600; }
.m-attivo i.fa-xmark { color: rgba(245, 243, 234, .6); font-size: 10px; }
.m-attivo:hover { background: #c8452c; }

/* ---------- Linea del tempo (in basso) ---------- */
.m-tempo { position: absolute; z-index: 550; left: 412px; right: 84px; bottom: 16px; border-radius: 22px; padding: 12px 18px 10px 12px; display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 16px; align-items: center; }
.m-tempo.nascosta { pointer-events: none; }
.m-play { width: 48px; height: 48px; border-radius: 50%; background: #103326; color: #9fd843; display: grid; place-items: center; font-size: 16px; box-shadow: 0 10px 22px -10px rgba(16, 51, 38, .7); transition: transform .2s, background-color .2s; }
.m-play:hover { transform: scale(1.06); }
.m-play.attivo { background: #f47b38; color: #fff; }
.m-anno { font-family: 'Fraunces', serif; font-size: 34px; line-height: 1; color: #103326; font-variant-numeric: tabular-nums; min-width: 4.6ch; }
.m-anno small { display: block; font-family: 'Inter', sans-serif; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #5f6b63; font-weight: 600; margin-top: 3px; }
.m-tempo-barra { position: relative; }
.m-isto { display: flex; align-items: flex-end; gap: 1px; height: 38px; margin: 0 9px; }
.m-isto span { flex: 1; min-width: 1px; border-radius: 2px 2px 0 0; background: rgba(29, 92, 69, .22); transition: height .35s cubic-bezier(.16, 1, .3, 1), background-color .2s; }
.m-isto span.dentro { background: #1d5c45; }
.m-range { position: relative; height: 24px; margin-top: -2px; }
.m-range .traccia { position: absolute; left: 9px; right: 9px; top: 50%; height: 4px; margin-top: -2px; border-radius: 999px; background: rgba(16, 51, 38, .14); }
.m-range .riemp { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: #1d5c45; }
.m-range input { position: absolute; inset: 0; width: 100%; height: 24px; margin: 0; background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none; }
.m-range input::-webkit-slider-runnable-track { background: transparent; height: 24px; }
.m-range input::-moz-range-track { background: transparent; }
.m-range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: #fff; border: 3px solid #1d5c45; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); cursor: grab; }
.m-range input::-moz-range-thumb { pointer-events: auto; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid #1d5c45; cursor: grab; }
.m-estremi { display: flex; justify-content: space-between; font-size: 10.5px; color: #5f6b63; margin: 0 4px; font-variant-numeric: tabular-nums; }

/* ---------- Scheda di dettaglio (destra) ---------- */
.m-scheda { position: absolute; z-index: 650; top: 16px; right: 16px; bottom: 16px; width: 380px; border-radius: 26px; overflow: hidden; display: flex; flex-direction: column; transform: translateX(calc(100% + 32px)); visibility: hidden; }
.m-scheda.aperta { visibility: visible; }
.m-scheda-testa { position: relative; padding: 20px 22px 18px; background: #103326; color: #f5f3ea; }
.m-scheda-testa .kicker { color: rgba(245, 243, 234, .62); font-size: 10.5px; }
.m-scheda-testa h2 { font-family: 'Fraunces', serif; font-weight: 400; font-size: 28px; line-height: 1.05; letter-spacing: -.015em; margin-top: 10px; padding-right: 30px; }
.m-scheda-testa p { font-size: 12.5px; color: rgba(245, 243, 234, .68); margin-top: 6px; }
.m-chiudi { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(245, 243, 234, .12); color: #f5f3ea; transition: background-color .2s, transform .2s; }
.m-chiudi:hover { background: rgba(245, 243, 234, .22); transform: rotate(90deg); }
.m-scheda-corpo { flex: 1; overflow-y: auto; padding: 20px 22px 24px; }
.m-numeri { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.m-numero { background: #fffdf6; border: 1px solid rgba(16, 51, 38, .08); border-radius: 16px; padding: 12px 14px; }
.m-numero b { display: block; font-family: 'Fraunces', serif; font-weight: 400; font-size: 26px; line-height: 1; color: #103326; font-variant-numeric: tabular-nums; }
.m-numero span { font-size: 11.5px; color: #5f6b63; }
.m-barre { display: grid; gap: 10px; }
.m-barre .t { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 4px; }
.m-barre .t span:first-child { font-weight: 600; color: #17261f; display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.m-barre .t span:last-child { color: #5f6b63; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-barre .b { height: 7px; border-radius: 999px; background: rgba(16, 51, 38, .07); overflow: hidden; }
.m-barre .b i { display: block; height: 100%; border-radius: 999px; transform-origin: left; }
.m-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.m-chips span { font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: #f5f3ea; color: #1d5c45; border: 1px solid rgba(16, 51, 38, .08); }
.m-righe { border-top: 1px solid rgba(16, 51, 38, .08); }
.m-righe div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(16, 51, 38, .08); font-size: 13px; }
.m-righe dt { color: #5f6b63; }
.m-righe dd { margin: 0; font-weight: 600; text-align: right; }
.m-vai { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding: 13px 16px; border-radius: 16px; background: #103326; color: #f5f3ea; font-size: 13.5px; font-weight: 600; transition: background-color .2s; }
.m-vai:hover { background: #1d5c45; }
.m-vai i { color: #9fd843; }
.m-coord { font-size: 11px; color: #5f6b63; margin-top: 14px; font-variant-numeric: tabular-nums; }

/* ---------- Comandi della mappa (destra) ---------- */
.m-comandi { position: absolute; z-index: 560; right: 16px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 20px; }
.m-comandi button { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #103326; font-size: 14px; transition: background-color .2s, color .2s; position: relative; }
.m-comandi button:hover { background: rgba(16, 51, 38, .07); }
.m-comandi button.attivo { background: #103326; color: #9fd843; }
.m-comandi hr { border: 0; height: 1px; background: rgba(16, 51, 38, .1); margin: 2px 6px; }
.m-comandi button[data-tip]:hover::after { content: attr(data-tip); position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); white-space: nowrap; background: #103326; color: #f5f3ea; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 9px; pointer-events: none; }
.con-scheda .m-comandi { right: 412px; }
.con-scheda .m-tempo { right: 412px; }
.m-tempo, .m-comandi { transition: right .45s cubic-bezier(.16, 1, .3, 1); }

/* Indicatore di caricamento */
.m-carica { position: absolute; z-index: 700; left: 50%; top: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #103326; opacity: 0; pointer-events: none; transition: opacity .25s; }
.m-carica.vis { opacity: 1; }
.m-carica i { color: #1d5c45; }

/* Indicazioni sulla mappa */
.m-tip { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; color: #17261f; border: 0; border-radius: 10px; padding: 6px 10px; box-shadow: 0 10px 24px -12px rgba(16, 51, 38, .5); }
.m-tip small { display: block; font-weight: 500; color: #5f6b63; }
.m-segno { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; border: 2.5px solid #fff; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .55); transition: transform .2s; }
.m-segno:hover { transform: scale(1.15); }
.m-segno.piccolo { width: 20px; height: 20px; font-size: 9px; border-width: 2px; }
.m-segno.scelto { transform: scale(1.3); box-shadow: 0 0 0 4px rgba(159, 216, 67, .55), 0 6px 14px -6px rgba(0, 0, 0, .55); }
.m-io { width: 18px; height: 18px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(37, 99, 235, .5); animation: m-pulsa 2s infinite; }
@keyframes m-pulsa { 0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .5); } 70% { box-shadow: 0 0 0 18px rgba(37, 99, 235, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); } }

/* ---------- Telefono e tablet: pannello e scheda diventano fogli dal basso ---------- */
.m-maniglia { display: none; }
@media (max-width: 1023px) {
    .m-pannello { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 62%; border-radius: 24px; transform: translateY(calc(100% - 172px)); transition: transform .45s cubic-bezier(.16, 1, .3, 1); }
    .m-pannello.esteso { transform: none; }
    .m-maniglia { display: block; width: 100%; padding: 10px 0 2px; }
    .m-maniglia span { display: block; width: 42px; height: 5px; border-radius: 999px; background: rgba(16, 51, 38, .2); margin: 0 auto; }
    .m-testa { padding: 6px 18px 10px; }
    .m-titolo { margin-top: 6px; }
    .m-titolo h1 { font-size: 24px; }
    .m-cerca { margin-top: 10px; }
    .m-cerca kbd { display: none; }
    .m-tab { margin: 0 18px; }
    .m-corpo { padding: 16px 18px 18px; }
    .m-piede { display: none; }
    .m-tempo { left: 8px; right: 8px; bottom: calc(172px + 16px); padding: 10px 12px 8px 10px; gap: 10px; grid-template-columns: auto minmax(0, 1fr); }
    .m-tempo .m-anno { display: none; }
    .m-pannello.esteso ~ .m-tempo { opacity: 0; pointer-events: none; }
    .m-play { width: 42px; height: 42px; }
    .m-scheda { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 72%; transform: translateY(calc(100% + 24px)); z-index: 680; }
    .m-comandi { top: 12px; right: 12px; transform: none; flex-direction: column; padding: 4px; border-radius: 16px; }
    #c-piu, #c-meno, #c-confine { display: none; } /* su telefono si zooma con due dita */
    .m-comandi button { width: 38px; height: 38px; }
    .m-comandi hr { display: none; }
    .m-comandi button[data-tip]:hover::after { display: none; }
    .con-scheda .m-comandi { right: 12px; }
    .con-scheda .m-tempo { right: 8px; opacity: 0; pointer-events: none; }
}
