/* Mirafiori nel tempo — foglio di stile.
   Palette «Atlante sabaudo» (31.10.2026): carta color pietra chiara,
   inchiostro blu notte, il blu Savoia per ciò che si può toccare, il
   vermiglio solo per i luoghi dei fatti. Serif per ciò che si legge (titoli, testi,
   anni), sans per ciò che si usa (tasti, etichette, didascalie). */
:root {
  /* «Pastello Torino» (Claude Design, 3.11.2026): fondo caldo, riquadri quasi
     pieni, il nero per ciò che si tocca, i pastelli per raggruppare. */
  --carta: #EBE2CE;
  --carta-chiara: #FBF7EC;
  --carta-2: #EFE4CC;
  --inchiostro: #121212;
  --tenue: #4A4338;
  --tenue-2: #6B6354;
  --accento: #121212;
  --accento-scuro: #000000;
  --accento-testo: #F6EEDD;
  --accento-velo: rgba(18, 18, 18, .07);
  --evidenza: #F2B8D2;
  --segno: #D4552C;
  --oro: #E0A63A;
  --scuro: #121212;
  --scuro-2: #2A2A2A;
  --linea: #E2D7BF;
  --confermato: #A9D6A5; --confermato-testo: #0F3D1F;
  --una-fonte: #F4D35E; --una-fonte-testo: #4A3500;
  --incerta: #F4B2A0; --incerta-testo: #7A1F0C;
  --pastello-giallo: #F4D35E; --pastello-azzurro: #B7C4EA; --pastello-rosa: #F2B8D2;
  --pastello-verde: #A9D6A5; --pastello-pesca: #F4B58F; --pastello-lilla: #CDBDE6;
  --vetro: rgba(251, 247, 236, .97);
  --ombra: 0 10px 30px rgba(60, 45, 20, .16);
  --ombra-2: 0 18px 40px rgba(60, 45, 20, .18);
  --ombra-forte: 0 18px 48px rgba(40, 30, 10, .32);
  --tempo: 134px;
  --raggio: 28px;
  --raggio-xl: 32px; --raggio-l: 28px; --raggio-m: 22px; --raggio-s: 20px;
  --font-titolo: "Bricolage Grotesque", system-ui, sans-serif;
  --font-ui: "DM Sans", system-ui, sans-serif;
  --serif: var(--font-ui);
  --sans: var(--font-ui);
  --margine: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--serif);
  color: var(--inchiostro); background: var(--carta);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; color: inherit; }
.nascosta { display: none !important; }

/* z-index 0: cosi' i segnaposti, che stanno dentro la carta, restano sotto
   l'ingresso e le immagini a tutto schermo. */
#mappa { position: fixed; inset: 0; z-index: 0; }
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { bottom: var(--tempo); }
.maplibregl-ctrl-bottom-left { left: 4px; }
.maplibregl-ctrl-attrib.maplibregl-compact { background: var(--vetro); font-family: var(--sans); font-size: 11px; }
.maplibregl-ctrl-scale { background: var(--vetro); border-color: var(--tenue); color: var(--tenue); font-family: var(--sans); font-size: 10px; }
.maplibregl-popup-content {
  font-family: var(--serif); color: var(--inchiostro); max-width: 280px; font-size: .88rem; line-height: 1.4;
  border-radius: 10px; padding: 12px 14px; box-shadow: var(--ombra);
}

/* Il vetro: tutti i riquadri sopra la carta sono fatti allo stesso modo. */
.testata, .comandi .gruppo, .scheda, .pannellino, .indice, .caricamento {
  background: var(--vetro);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--ombra);
}

/* --- angolo in alto a sinistra: anno ed epoca, poi i comandi --- */
.angolo {
  position: fixed; top: var(--margine); left: var(--margine); z-index: 5;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  pointer-events: none;
}
.angolo > * { pointer-events: auto; }
.testata { border-radius: var(--raggio); padding: 10px 18px 12px; min-width: 176px; }
.testata .titolo { font-family: var(--sans); font-size: .66rem; font-weight: 600; color: var(--tenue); letter-spacing: .14em; text-transform: uppercase; }
.testata .anno {
  font-size: 3rem; font-weight: 700; color: var(--accento); line-height: 1; margin-top: 4px;
  font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.02em;
}
.testata .epoca-nome { font-style: italic; font-size: .92rem; color: var(--inchiostro); margin-top: 4px; }
.testata .epoca-nome:empty { display: none; }
.testata .nota { font-family: var(--sans); font-size: .68rem; color: var(--tenue); margin-top: 4px; }
.testata .nota:empty { display: none; }

/* --- comandi: gruppi di tasti, come in un visore --- */
.comandi { display: flex; flex-direction: column; gap: 8px; }
.comandi .gruppo { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; }
.comandi button {
  width: 40px; height: 40px; border: 0; background: transparent; color: var(--inchiostro);
  font-family: var(--sans); font-size: .95rem; font-weight: 500;
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.comandi button + button { border-top: 1px solid var(--linea); }
.comandi button:hover { background: var(--accento-velo); }
.comandi button.attivo { background: var(--accento); color: #fff; }
#zoom-piu, #zoom-meno { font-size: 1.3rem; font-weight: 400; }
.bussola { display: inline-block; transform: rotate(-90deg); color: var(--accento); font-size: .9rem; transition: transform .1s linear; }
.comandi button.attivo .bussola { color: #fff; }

.pannellino {
  position: fixed; top: 150px; left: 72px; z-index: 8; width: 280px;
  background: var(--carta-chiara); border-radius: var(--raggio); padding: 12px 14px;
  font-size: .82rem; line-height: 1.45; font-family: var(--sans);
  max-height: calc(100vh - var(--tempo) - 170px); overflow-y: auto;
}
.pannellino label { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; cursor: pointer; }
.pannellino input[type="checkbox"] { accent-color: var(--accento); margin-top: 2px; }
.pannellino p { margin: 0 0 6px; }

/* --- scheda del fatto: un cartellino da museo --- */
.scheda {
  position: fixed; right: var(--margine); bottom: calc(var(--tempo) + var(--margine)); z-index: 5; width: min(460px, 36vw); min-width: 360px;
  border-radius: var(--raggio); overflow: hidden;
  display: flex; flex-direction: column; max-height: calc(100vh - var(--tempo) - 2 * var(--margine));
}
.scheda-barra {
  display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--linea);
  font-family: var(--sans); flex: none;
}
.scheda-barra button { border: 0; background: none; font-size: 1.25rem; line-height: 1; width: 30px; height: 30px; border-radius: 8px; color: var(--inchiostro); }
.scheda-barra button:hover:not(:disabled) { background: var(--accento-velo); }
.scheda-barra button:disabled { opacity: .25; cursor: default; }
.scheda-anno { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; color: var(--accento); min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.scheda-breve { display: none; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--serif); font-size: .92rem; }
.scheda.ridotta .scheda-breve { display: block; }
.scheda.ridotta .scheda-barra { cursor: pointer; border-bottom: 0; }
.etichetta { margin-left: auto; font-size: .64rem; font-weight: 600; letter-spacing: .04em; padding: 3px 8px; border-radius: 20px; color: #fff; font-family: var(--sans); white-space: nowrap; }
.etichetta.confermato { background: var(--confermato); }
.etichetta.una-fonte { background: var(--una-fonte); }
.etichetta.data-incerta { background: var(--incerta); }
.etichetta:empty { display: none; }
#scheda-riduci { font-size: 1.1rem; }
.scheda-corpo { overflow-y: auto; padding: 0 18px 16px; scrollbar-width: thin; }
.scheda.ridotta .scheda-corpo { display: none; }
.scheda h2 { margin: 14px 0 8px; font-size: 1.32rem; line-height: 1.22; font-weight: 600; letter-spacing: -.005em; text-wrap: balance; }
.scheda p { margin: 0 0 10px; font-size: .94rem; line-height: 1.55; }
.curiosita { border-left: 3px solid var(--oro); padding: 8px 12px; background: rgba(201, 146, 46, .1); border-radius: 0 8px 8px 0; font-style: italic; }
.curiosita:empty { display: none; }
.curiosita::before { content: "Curiosità"; display: block; font-style: normal; font-family: var(--sans); font-size: .64rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #9a6c18; margin-bottom: 2px; }
.scheda-fonti { font-family: var(--sans); font-size: .72rem !important; color: var(--tenue); border-top: 1px solid var(--linea); padding-top: 10px; margin-top: 4px !important; }
.scheda-fonti a { color: var(--tenue); }
.scheda-fonti a:hover { color: var(--accento); }
.scheda-azioni { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.scheda-azioni button {
  border: 1px solid var(--linea); background: #fff; border-radius: 20px; padding: 6px 14px;
  font-size: .78rem; font-weight: 500; font-family: var(--sans); transition: border-color .15s, background .15s;
}
.scheda-azioni button:hover { border-color: var(--accento); }
#rivedi { background: var(--accento); color: #fff; border-color: var(--accento); }
#rivedi:hover { background: var(--accento-scuro); }
.cifre { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px 14px; margin: 4px 0 14px; padding: 10px 0; border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.cifre:empty { display: none; }
.cifra { display: flex; flex-direction: column; min-width: 0; }
.cifra b { font-size: 1.4rem; font-weight: 700; color: var(--accento); line-height: 1.05; font-variant-numeric: tabular-nums lining-nums; }
.cifra span { font-size: .7rem; color: var(--tenue); font-family: var(--sans); line-height: 1.3; margin-top: 2px; }
.cursore-riga { display: flex; align-items: center; gap: 8px; }
.cursore-riga input { flex: 1; accent-color: var(--accento); }
button.testuale { border: 0; background: none; color: var(--accento); padding: 4px 0; font-family: var(--sans); font-size: .8rem; font-weight: 500; }
.mobile { pointer-events: none; will-change: transform; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }

/* L'immagine apre la scheda, a tutta larghezza, come in una sala. */
.scheda-immagine { margin: 0 -18px; position: relative; background: var(--scuro); }
.scheda-immagine:empty { display: none; }
.scheda-immagine .apri-grande { display: block; position: relative; }
/* L'immagine intera, mai ritagliata: le foto d'archivio hanno formati di
   ogni tipo, e un ritaglio taglia proprio ciò che documentano. */
.scheda-immagine img.eroe { width: 100%; height: auto; max-height: 340px; object-fit: contain; display: block; cursor: zoom-in; background: var(--scuro); transition: opacity .25s; }
.scheda-immagine .conta {
  position: absolute; right: 10px; top: 10px; background: rgba(20, 16, 12, .7); color: #fff;
  font-family: var(--sans); font-size: .68rem; font-weight: 600; padding: 3px 8px; border-radius: 20px;
}
.scheda-immagine .ingrandisci {
  position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(20, 16, 12, .6); color: #fff; display: grid; place-items: center; font-size: .85rem; pointer-events: none;
}
.scheda-immagine figcaption {
  font-family: var(--sans); font-size: .7rem; color: #cfd6dc; line-height: 1.4; padding: 8px 18px 10px; background: var(--scuro);
}
.scheda-immagine figcaption b { color: #fff; }

.scheda-immagine figcaption i { color: #8e9ba6; }
.galleria { display: flex; gap: 6px; padding: 0 18px 10px; background: var(--scuro); overflow-x: auto; scrollbar-width: none; }
.galleria button { flex: none; width: 52px; height: 38px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: var(--scuro-2); opacity: .6; transition: opacity .15s, border-color .15s; }
.galleria button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galleria button:hover { opacity: .9; }
.galleria button.attiva { border-color: #fff; opacity: 1; }

/* --- ingresso, caricamento, immagini a tutto schermo --- */
.caricamento {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4;
  border-radius: 20px; padding: 10px 18px; font-size: .85rem; color: var(--tenue); font-family: var(--sans);
}
.intro {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(23, 34, 44, .35), rgba(10, 16, 22, .72)); padding: 16px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.intro-scheda {
  background: var(--carta-chiara); border-radius: 18px; box-shadow: var(--ombra-forte); overflow: hidden;
  display: grid; grid-template-columns: 340px 1fr; max-width: 860px; width: 100%;
  animation: entra .5s cubic-bezier(.2, .8, .2, 1);
}
@keyframes entra { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.intro-figura { margin: 0; position: relative; background: var(--scuro); min-height: 100%; }
.intro-figura img { width: 100%; height: 100%; object-fit: cover; display: block; filter: sepia(.25) contrast(1.05); }
.intro-figura figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px 12px; font-family: var(--sans); font-size: .68rem; color: #eee4d4;
  background: linear-gradient(transparent, rgba(20, 16, 12, .8));
}
.intro-testo { padding: 36px 40px 30px; }
.intro-sopra { font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--oro); font-family: var(--sans); }
.intro h1 { margin: 10px 0 14px; font-size: 2.7rem; line-height: 1.02; color: var(--inchiostro); font-weight: 700; letter-spacing: -.02em; }
.intro p { margin: 0 0 18px; font-size: 1.04rem; line-height: 1.55; color: #2e3d49; }
.intro-cifre { display: flex; gap: 22px; margin: 0 0 22px; padding: 12px 0; border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.intro-cifre:empty { display: none; }
.intro-cifre div { display: flex; flex-direction: column; }
.intro-cifre b { font-size: 1.5rem; color: var(--accento); line-height: 1; font-variant-numeric: lining-nums; }
.intro-cifre span { font-family: var(--sans); font-size: .68rem; color: var(--tenue); margin-top: 4px; }
.intro-azioni { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.intro-azioni button {
  border: 0; border-radius: 30px; padding: 12px 22px; background: var(--accento); color: #fff;
  font-family: var(--sans); font-size: .9rem; font-weight: 600; transition: background .15s, transform .15s;
}
.intro-azioni button:hover { background: var(--accento-scuro); transform: translateY(-1px); }
.intro-azioni button.secondario { background: #fff; color: var(--inchiostro); border: 1px solid var(--linea); }
.intro-azioni button.secondario:hover { border-color: var(--accento); background: #fff; }
.intro-nota { font-family: var(--sans); font-size: .74rem !important; color: var(--tenue) !important; margin: 0 !important; }

.lightbox {
  position: fixed; inset: 0; z-index: 30; background: rgba(10, 16, 22, .95);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 72px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; box-shadow: 0 8px 40px rgba(0,0,0,.6); border-radius: 4px; }
.lightbox-testo { color: #dfe6eb; font-family: var(--serif); font-size: .9rem; max-width: 760px; text-align: center; margin-top: 14px; line-height: 1.5; cursor: auto; }
.lightbox-testo a { color: #fff; }
.lightbox-conta { color: #8e9ba6; font-family: var(--sans); font-size: .72rem; margin-top: 10px; letter-spacing: .1em; }
.lightbox-conta:empty { display: none; }
.lightbox-chiudi, .lightbox-freccia {
  position: absolute; border: 0; background: rgba(255, 255, 255, .1); color: #fff; border-radius: 50%;
  display: grid; place-items: center; transition: background .15s;
}
.lightbox-chiudi:hover, .lightbox-freccia:hover { background: rgba(255, 255, 255, .22); }
.lightbox-chiudi { top: 16px; right: 16px; width: 40px; height: 40px; font-size: 1rem; }
.lightbox-freccia { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 1.8rem; line-height: 1; }
.lightbox-freccia.sinistra { left: 14px; }
.lightbox-freccia.destra { right: 14px; }
.crediti { border-top: 1px solid var(--linea); padding-top: 8px; color: var(--tenue); font-size: .72rem; }
.crediti a { color: var(--tenue); }

/* --- toast delle animazioni --- */
.toast {
  /* Nello spazio fra la testata e la scheda: sopra la scheda copriva ‹ ›. */
  position: fixed; top: var(--margine); left: 236px; right: calc(max(360px, min(460px, 36vw)) + 32px);
  margin-inline: auto; width: fit-content; max-width: 520px; z-index: 6; text-align: center;
  background: rgba(23, 34, 44, .9); color: #fff; border-radius: 24px; padding: 9px 18px;
  font-family: var(--sans); font-size: .84rem; line-height: 1.35; box-shadow: var(--ombra);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: cala .35s ease-out;
}
@keyframes cala { from { opacity: 0; transform: translateY(-8px); } }
.toast:empty { display: none; }

/* --- linea del tempo --- */
.linea-tempo {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--tempo); z-index: 7;
  display: flex; gap: 16px; align-items: center; padding: 0 28px 0 18px;
  background: var(--carta-chiara); border-top: 1px solid var(--linea);
  box-shadow: 0 -4px 20px rgba(40, 30, 20, .08);
}
.riproduci {
  width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accento); color: #fff;
  font-size: 1rem; flex: none; box-shadow: 0 2px 8px rgba(30, 91, 134, .35); transition: background .15s, transform .15s;
}
.riproduci:hover { background: var(--accento-scuro); transform: scale(1.05); }
.cursore-box { flex: 1; position: relative; padding-top: 2px; }

/* Le epoche: una fascia colorata con il nome, sopra le tacche. */
.ere { position: relative; height: 18px; margin-bottom: 4px; }
.era {
  position: absolute; top: 0; bottom: 0; border-radius: 4px; overflow: hidden;
  font-family: var(--sans); font-size: .6rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  color: rgba(23, 34, 44, .8); line-height: 18px; padding: 0 4px; white-space: nowrap; text-overflow: clip;
  cursor: pointer; transition: filter .15s, color .15s;
}
.era:hover { filter: brightness(.95); color: var(--inchiostro); }
.era.attiva { color: var(--inchiostro); box-shadow: inset 0 -2px 0 var(--oro); }

.tacche { position: relative; height: 26px; }
.tacca {
  position: absolute; top: 2px; width: 8px; height: 8px; background: var(--segno); border-radius: 50%;
  transform: translateX(-50%); cursor: pointer; opacity: .55; border: 1.5px solid var(--carta-chiara);
  transition: transform .15s, opacity .15s;
}
/* Il bersaglio è più grande del pallino: 8 px non si prendono col dito. */
.tacca::before { content: ""; position: absolute; inset: -4px -1px; }
@media (max-width: 700px) { .tacca { width: 6px; height: 6px; border-width: 1px; } }
.tacca:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.tacca:hover { opacity: 1; transform: translateX(-50%) scale(1.5); z-index: 2; }
.tacca.passata { opacity: .85; }
.tacca.attiva { opacity: 1; background: var(--oro); transform: translateX(-50%) scale(1.6); box-shadow: 0 0 0 2px rgba(201, 146, 46, .35); z-index: 2; }
.tacca-nota {
  position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 10; pointer-events: none;
  background: var(--inchiostro); color: #fff; border-radius: 10px; padding: 6px 10px; width: max-content; max-width: 260px;
  font-family: var(--sans); font-size: .74rem; line-height: 1.3; box-shadow: var(--ombra);
  display: flex; gap: 8px; align-items: center;
}
.tacca-nota img { width: 44px; height: 34px; object-fit: cover; border-radius: 4px; flex: none; }
.tacca-nota b { color: #f2c46d; margin-right: 4px; }

/* Il cursore disegnato a mano: lo stesso su tutti i browser. */
#cursore { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; margin: 0; background: transparent; --p: 100%; }
#cursore::-webkit-slider-runnable-track {
  height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accento) var(--p), var(--linea) var(--p));
}
#cursore::-moz-range-track { height: 5px; border-radius: 3px; background: var(--linea); }
#cursore::-moz-range-progress { height: 5px; border-radius: 3px; background: var(--accento); }
#cursore::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7.5px; border-radius: 50%;
  background: #fff; border: 4px solid var(--accento); box-shadow: 0 1px 6px rgba(0,0,0,.25); cursor: grab;
}
#cursore::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 4px solid var(--accento); box-shadow: 0 1px 6px rgba(0,0,0,.25); cursor: grab; }
#cursore:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.1); }
.secoli { position: relative; height: 16px; font-size: .66rem; color: var(--tenue); font-family: var(--sans); font-variant-numeric: tabular-nums; }
.secolo { position: absolute; transform: translateX(-50%); top: 2px; }

/* --- segnaposti --- */
.segnaposto {
  width: 14px; height: 14px; border-radius: 50%; background: var(--segno);
  border: 2.5px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35); cursor: pointer; transition: transform .15s;
}
.segnaposto:hover { transform: scale(1.25); }
.segnaposto.scomparso { background: #8a949c; }
.segnaposto.corrente { width: 20px; height: 20px; background: var(--oro); box-shadow: 0 0 0 5px rgba(201, 146, 46, .3), 0 1px 5px rgba(0,0,0,.35); }

/* --- legenda con i campioni dei segni --- */
.pannellino .voce { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.pannellino .voce p { margin: 0; }
.campione { width: 18px; height: 18px; border-radius: 4px; flex: none; margin-top: 1px; }
.campione.edificio { background: #dcd6ca; box-shadow: inset -3px -3px 0 #a7a196; }
.campione.isolato { background: linear-gradient(90deg, #e4e2da, #6f8794); }
.campione.confine { background: rgba(23, 34, 44, .07); border: 2px dashed #a87710; box-shadow: 0 0 0 3px rgba(201, 146, 46, .18); }
.campione.modello { background: linear-gradient(160deg, #5d6b78 0 45%, #e6dcc6 45%); border-radius: 3px; }
.campione.acqua-antica { background: #9cbfd0; border: 1px solid #7fa6bd; }
.campione.mura { background: #d9bf93; border: 1.5px solid #6b4f2e; }
.campione.ipotesi { background: repeating-linear-gradient(45deg, #d8c3a0 0 3px, #8c9a86 3px 6px); }
.campione.punto { background: var(--segno); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #ccc; }
.campione.rotta { background: repeating-linear-gradient(90deg, var(--segno) 0 3px, transparent 3px 7px); height: 4px; margin-top: 7px; }

/* L'oscuramento di guerra: sopra la carta, sotto tutto il resto. */
#buio { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(12, 16, 32, .55), rgba(6, 8, 18, .92)); }

/* Il testo si legge tutto: niente righe nascoste dietro «Continua». */
#continua { margin: 0 0 10px; }

/* --- indice dei fatti --- */
.indice-tasto { font-size: .7rem !important; font-weight: 500; font-family: var(--sans); border: 1px solid var(--linea) !important;
  border-radius: 20px !important; padding: 0 10px !important; width: auto !important; height: 24px !important; margin-left: 4px; background: #fff !important; }
.indice-tasto:hover { border-color: var(--accento) !important; }
.scheda.ridotta .indice-tasto { display: none; }
.indice { position: fixed; right: var(--margine); top: var(--margine); bottom: calc(var(--tempo) + var(--margine)); width: 380px; z-index: 9;
  background: var(--carta-chiara); border-radius: var(--raggio); display: flex; flex-direction: column; }
.indice-testa { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--linea); font-size: 1.1rem; }
.indice-testa button { border: 0; background: none; font-size: 1rem; width: 32px; height: 32px; border-radius: 8px; }
.indice-testa button:hover { background: var(--accento-velo); }
.indice-corpo { overflow-y: auto; padding: 4px 12px 16px; }
.indice-epoca { font-family: var(--sans); font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accento); margin: 16px 6px 6px; display: flex; align-items: center; gap: 8px; }
.indice-epoca::after { content: ""; flex: 1; height: 1px; background: var(--linea); }
.indice-voce { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 6px; border-radius: 8px; font-size: .9rem; line-height: 1.3; }
.indice-voce:hover, .indice-voce.attiva { background: var(--accento-velo); }
.indice-voce .a { color: var(--accento); font-weight: 700; min-width: 40px; font-variant-numeric: tabular-nums; }
.indice-voce .t { flex: 1; }
.indice-voce img, .indice-voce .vuota { width: 44px; height: 32px; border-radius: 5px; object-fit: cover; flex: none; background: var(--linea); }
.indice-voce .film { font-family: var(--sans); font-size: .6rem; font-weight: 600; color: var(--tenue); border: 1px solid var(--linea); border-radius: 10px; padding: 1px 6px; flex: none; }

/* --- filmato d'epoca, come un tooltip --- */
.filmato { position: fixed; left: 72px; bottom: calc(var(--tempo) + 40px); z-index: 7; width: 340px;
  background: var(--scuro); color: #e6ebef; border-radius: var(--raggio); box-shadow: var(--ombra-forte); overflow: hidden;
  transition: width .3s, opacity .3s; animation: sale .35s ease-out; }
@keyframes sale { from { opacity: 0; transform: translateY(10px); } }
.filmato.grande { width: min(760px, calc(100vw - 440px)); }
.filmato-barra { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 14px; font-size: .78rem; font-weight: 500; font-family: var(--sans); }
.filmato-barra::before { content: "▶ Filmato"; font-size: .6rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #f2c46d; flex: none; }
.filmato-barra span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filmato-barra button { border: 0; background: none; color: #e6ebef; font-size: .95rem; width: 28px; height: 28px; border-radius: 6px; }
.filmato-barra button:hover { background: rgba(255,255,255,.1); }
.filmato-schermo { aspect-ratio: 16 / 9; background: #000; }
.filmato-schermo video, .filmato-schermo iframe { width: 100%; height: 100%; display: block; background: #000; border: 0; }
.filmato-link { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: #000 center / cover no-repeat; text-decoration: none; }
.filmato-link span { background: rgba(200, 30, 30, .92); color: #fff; font: 600 .85rem var(--sans); padding: 9px 14px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.filmato-link span small { font-weight: 400; opacity: .85; }
.filmato-link:hover span { background: #e02424; }
.filmato-fonte { font-size: .66rem; padding: 6px 14px 9px; color: #9aa7b1; font-family: var(--sans); }
.filmato-fonte a { color: #dfe6eb; }

/* --- telefono --- */
@media (max-width: 720px) {
  :root { --tempo: 78px; --margine: 8px; }
  .solo-schermo-grande { display: none !important; }
  /* Anno a sinistra, comandi a destra: una riga sola in alto. */
  .angolo { right: var(--margine); flex-direction: row; justify-content: space-between; }
  .testata { padding: 7px 12px 9px; min-width: 0; border-radius: 12px; }
  .testata .titolo { font-size: .58rem; }
  .testata .anno { font-size: 2rem; }
  .testata .epoca-nome { font-size: .78rem; max-width: 190px; }
  .comandi { gap: 6px; }
  .comandi button { width: 38px; height: 38px; }
  .pannellino { left: var(--margine); right: 56px; top: 90px; width: auto; max-height: calc(100vh - var(--tempo) - 130px); }
  /* Aperta, la scheda si ferma sotto i comandi: prima copriva ≡ e ?. */
  .scheda { left: var(--margine); right: var(--margine); width: auto; min-width: 0; max-height: calc(100dvh - var(--tempo) - 300px); min-height: 0; }
  /* (il filmato ora sta dentro la scheda: con la scheda aperta si vede; prima qui si nascondeva e sul telefono i video non c'erano mai) */
  .scheda-barra button { width: 40px; height: 40px; }
  .segnaposto { width: 18px; height: 18px; }
  .scheda-corpo { padding: 0 14px 12px; }
  .scheda-immagine { margin: 0 -14px; }
  .scheda-immagine img.eroe { max-height: 240px; }
  .galleria button { width: 44px; height: 32px; }
  .scheda-immagine figcaption, .galleria { padding-left: 14px; padding-right: 14px; }
  .scheda-anno { min-width: 50px; font-size: 1rem; }
  .scheda h2 { font-size: 1.12rem; margin-top: 12px; }
  .scheda p { font-size: .88rem; }
  .cifre { grid-template-columns: repeat(3, 1fr); gap: 4px 8px; }
  .cifra b { font-size: 1.05rem; }
  .cifra span { font-size: .62rem; }
  /* Sul telefono la didascalia sta in alto, sotto l'anno e a sinistra dei comandi. */
  .toast { top: 96px; left: var(--margine); right: 56px; width: auto; max-width: none; margin: 0; font-size: .78rem; border-radius: 12px; animation: none; }
  .linea-tempo { padding: 0 14px 0 10px; gap: 10px; }
  .riproduci { width: 42px; height: 42px; }
  .era { font-size: 0; padding: 0; }
  .ere { height: 10px; margin-bottom: 4px; }
  .secolo.minore { display: none; }
  .tacca { width: 7px; height: 7px; }
  /* Scala e crediti sopra la scheda ripiegata, non dietro. */
  .maplibregl-ctrl-bottom-left { bottom: calc(var(--tempo) + 58px); }
  .maplibregl-ctrl-scale { display: none; }
  .indice { left: var(--margine); right: var(--margine); width: auto; top: var(--margine); }
  .filmato { left: var(--margine); right: 56px; width: auto; bottom: auto; top: 150px; }
  .filmato.grande { width: auto; right: var(--margine); }
  .intro { align-items: flex-end; padding: 0; }
  .intro-scheda { grid-template-columns: 1fr; border-radius: 18px 18px 0 0; max-height: 100%; overflow-y: auto; }
  .intro-figura { height: 170px; min-height: 0; }
  .intro-testo { padding: 20px 20px 22px; }
  .intro h1 { font-size: 2rem; margin: 6px 0 10px; }
  .intro p { font-size: .95rem; margin-bottom: 14px; }
  .intro-cifre { gap: 16px; margin-bottom: 16px; }
  .intro-cifre b { font-size: 1.2rem; }
  .intro-azioni button { flex: 1; white-space: nowrap; padding: 12px 14px; }
  .lightbox { padding: 60px 12px 20px; }
  .lightbox-freccia { top: auto; bottom: 18px; transform: none; width: 42px; height: 42px; }
}

/* --- accessibilità --- */
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; }
/* Chi ha chiesto meno movimento al sistema non riceve transizioni. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Il ritratto in piedi sul luogo di un comizio (Berlinguer, 1980) */
.ritratto { pointer-events: none; transition: opacity .3s; }
.ritratto img { display: block; height: 170px; width: auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
@media (max-width: 700px) { .ritratto img { height: 140px; } }
.campione.strada { background: #fbfaf5; border: 2px solid #c3baa9; border-radius: 3px; height: 6px; margin-top: 6px; }
/* Durante una scena i segnaposti degli altri fatti si nascondono */
body.in-scena .segnaposto { display: none; }

/* Il filmato dentro la scheda, al posto della foto */
.scheda .filmato { position: static; width: auto; inset: auto; margin: 0; border-radius: 0; box-shadow: none; z-index: auto; display: block; }
.scheda .filmato.grande { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(960px, 92vw); z-index: 60; box-shadow: var(--ombra-forte); border-radius: var(--raggio); }
.scheda .filmato.nascosta { display: none !important; }
.scheda.con-filmato .scheda-immagine { display: none; }
.insegna { pointer-events: none; background: #0d2a4a; color: #fff; padding: 6px 12px; border-radius: 3px; font-family: var(--sans); text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,.35); border-top: 3px solid #f2c230; transition: opacity .3s; }
.insegna b { display: block; font-size: 13px; letter-spacing: .12em; }
.insegna span { display: block; font-size: 10px; opacity: .85; letter-spacing: .08em; text-transform: uppercase; }

/* ======================================================================
   «Pastello Torino» (Claude Design, 3.11.2026): i componenti.
   Sopra le regole di prima, che restano per la struttura; qui forme,
   colori e caratteri. Misure da COMPONENTI.md (1440 px).
   ====================================================================== */
body { font-family: var(--font-ui); }
.testata, .comandi .gruppo, .scheda, .pannellino, .indice, .caricamento {
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 0; box-shadow: var(--ombra);
}

/* testata: il riquadro giallo */
.angolo { gap: 24px; }
.testata { background: var(--pastello-giallo); border-radius: var(--raggio-l); padding: 18px 22px 20px; width: 304px; }
.testata .titolo { font-family: var(--font-ui); font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--inchiostro); }
.testata .anno { font-family: var(--font-titolo); font-size: 100px; font-weight: 800; letter-spacing: -.03em; line-height: .95; color: var(--inchiostro); margin-top: 8px; }
.testata .epoca-nome { display: inline-block; font-style: normal; background: var(--inchiostro); color: var(--accento-testo); font-size: 16px; padding: 6px 16px; border-radius: 999px; margin-top: 12px; }
.testata .nota { display: inline-block; border: 1.5px solid var(--inchiostro); color: var(--inchiostro); border-radius: 999px; padding: 4px 14px; font-size: 13px; margin-top: 8px; }

/* comandi: una pillola nera */
.comandi { background: var(--scuro); border-radius: 34px; padding: 10px; gap: 6px; width: 68px; box-shadow: var(--ombra); }
.comandi .gruppo { background: transparent; box-shadow: none; border-radius: 0; gap: 6px; -webkit-backdrop-filter: none; backdrop-filter: none; }
.comandi button { width: 48px; height: 48px; border-radius: 50%; color: var(--accento-testo); font-size: 1.1rem; }
.comandi button + button { border-top: 0; }
.comandi button:hover { background: rgba(255, 255, 255, .12); }
.comandi button.attivo, #vista { }
.comandi button.attivo { background: var(--evidenza); color: var(--inchiostro); }
#vista { background: var(--evidenza); color: var(--inchiostro); font-weight: 700; }
.bussola, .comandi button.attivo .bussola { color: inherit; }
.pannellino { background: var(--carta-chiara); border-radius: var(--raggio-xl); padding: 16px 18px; left: 112px; top: 248px; }

/* scheda */
.scheda { top: var(--margine); bottom: calc(var(--tempo) + 2px); max-height: none; width: 460px; min-width: 0; background: var(--carta-chiara);
  border-radius: var(--raggio-xl); box-shadow: var(--ombra-2); }
.scheda.ridotta { top: auto; }
.scheda-barra { padding: 14px 14px 10px; gap: 8px; border-bottom: 0; }
#prec, #succ, .scheda-anno { background: var(--inchiostro); color: var(--accento-testo); height: 44px; }
#prec { border-radius: 999px 0 0 999px; width: 40px; padding-left: 8px; margin-right: -8px; }
#succ { border-radius: 0 999px 999px 0; width: 40px; padding-right: 8px; margin-left: -8px; }
.scheda-barra #prec:hover:not(:disabled), .scheda-barra #succ:hover:not(:disabled) { background: var(--scuro-2); }
.scheda-barra #prec:disabled, .scheda-barra #succ:disabled { opacity: 1; color: rgba(246, 238, 221, .3); }
.scheda-anno { font-family: var(--font-titolo); font-size: 24px; font-weight: 700; display: grid; place-items: center; min-width: 76px; color: var(--accento-testo); }
.scheda-breve { font-family: var(--font-titolo); font-weight: 600; }
.indice-tasto { background: transparent !important; border: 1.5px solid var(--inchiostro) !important; height: 44px !important; padding: 0 18px !important;
  font-size: 15px !important; font-weight: 500; }
.indice-tasto:hover { background: var(--accento-velo) !important; }
.etichetta { font-size: 13px; font-weight: 700; letter-spacing: 0; padding: 6px 14px; border-radius: 999px; }
.etichetta.confermato { background: var(--confermato); color: var(--confermato-testo); }
.etichetta.una-fonte { background: var(--una-fonte); color: var(--una-fonte-testo); }
.etichetta.data-incerta { background: var(--incerta); color: var(--incerta-testo); }
#scheda-riduci { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--inchiostro); }
.scheda-corpo { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.scheda-corpo > * { margin: 0 !important; }
.scheda-corpo > .nascosta { display: none !important; }
.scheda-immagine { margin: 0; border-radius: var(--raggio-m); overflow: hidden; flex: none; }
.scheda-immagine img.eroe { max-height: 300px; }
.scheda-immagine figcaption { color: #E8DFCC; font-size: 12px; padding: 8px 14px 10px; }
.scheda-immagine figcaption i { color: #B5AC9A; }
.galleria { padding: 0 14px 10px; }
.galleria button { border-radius: 10px; }
.scheda h2 { font-family: var(--font-titolo); font-size: 28px; font-weight: 700; letter-spacing: -.01em; line-height: 1.12; padding: 4px 4px 0; }
.cifre { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0; border: 0; }
.cifra { border-radius: var(--raggio-s); padding: 14px 16px; background: var(--pastello-giallo); }
.cifra:nth-child(2) { background: var(--pastello-azzurro); }
.cifra:nth-child(3) { background: var(--pastello-rosa); grid-column: 1 / -1; }
.cifra b { font-family: var(--font-titolo); font-size: 36px; font-weight: 800; color: var(--inchiostro); line-height: 1; letter-spacing: -.02em; }
.cifra span { font-size: 13px; color: var(--inchiostro); margin-top: 6px; }
.scheda-azioni { gap: 8px; }
.scheda-azioni button { height: 46px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--inchiostro); background: transparent; font-size: 15px; font-weight: 500; }
.scheda-azioni button:hover { background: var(--accento-velo); border-color: var(--inchiostro); }
#rivedi { background: var(--evidenza); color: var(--inchiostro); border-color: var(--evidenza); font-weight: 700; }
#rivedi:hover { background: #ECA3C3; }
#scheda-testo { background: var(--carta-2); border-radius: var(--raggio-s); padding: 14px 16px; font-size: 15px; line-height: 1.5; }
button.testuale { color: var(--inchiostro); font-weight: 700; text-decoration: underline; font-size: 14px; align-self: flex-start; }
.curiosita { background: var(--pastello-pesca); border: 0; border-radius: var(--raggio-s); padding: 14px 16px; font-style: normal; font-size: 15px; line-height: 1.5; }
.curiosita::before { color: var(--inchiostro); font-weight: 700; }
.scheda-fonti { border-top: 0; font-size: 12px !important; padding: 0 6px; color: var(--tenue); }
.scheda-fonti a:hover { color: var(--inchiostro); }

/* indice */
.indice { top: var(--margine); right: var(--margine); bottom: calc(var(--tempo) + 2px); border-radius: var(--raggio-xl); width: 400px; }
.indice-testa { border-bottom: 0; font-family: var(--font-titolo); font-size: 22px; padding: 18px 20px 8px; }
.indice-testa button { border-radius: 50%; border: 1.5px solid var(--inchiostro); }
.indice-epoca { display: inline-flex; background: var(--inchiostro); color: var(--accento-testo); border-radius: 999px; padding: 5px 14px; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.indice-epoca::after { display: none; }
.indice-voce { border-radius: 14px; padding: 8px; font-size: 15px; }
.indice-voce .a { font-family: var(--font-titolo); color: var(--inchiostro); }
.indice-voce img, .indice-voce .vuota { border-radius: 10px; }

/* filmato */
.filmato { background: var(--scuro); border-radius: var(--raggio-m); }
.scheda .filmato { border-radius: var(--raggio-m); overflow: hidden; }
.filmato-barra { font-size: 13px; color: var(--accento-testo); min-height: 34px; }
.filmato-barra::before { color: var(--accento-testo); font-weight: 700; }
.filmato-barra button { color: var(--accento-testo); border-radius: 50%; }
.filmato-link span { background: #FF6A4D; color: var(--inchiostro); border-radius: 999px; padding: 10px 20px; font-weight: 700; }
.filmato-link:hover span { background: #FF8166; }
.filmato-fonte { color: #B5AC9A; font-size: 12px; }
.filmato-fonte a { color: var(--accento-testo); }

/* didascalia della scena */
.toast { top: var(--margine); left: 352px; right: 508px; background: var(--scuro); color: var(--accento-testo); border-radius: 22px; font-size: 18px; line-height: 1.3;
  padding: 12px 22px; max-width: 560px; box-shadow: var(--ombra); }

/* linea del tempo: un oggetto solo */
.linea-tempo { left: var(--margine); right: var(--margine); bottom: 18px; height: 98px; border-radius: 30px; border-top: 0; background: var(--carta-chiara);
  box-shadow: var(--ombra); padding: 0 28px 0 20px; gap: 20px; }
.riproduci { width: 56px; height: 56px; background: var(--inchiostro); color: var(--accento-testo); font-size: 1.15rem; box-shadow: none; }
.riproduci:hover { background: var(--accento-scuro); }
.cursore-box { padding-top: 0; }
.ere { height: 28px; margin-bottom: 6px; }
.era { border-radius: 14px; font-size: 12px; font-weight: 700; letter-spacing: .04em; line-height: 28px; padding: 0 12px; color: var(--inchiostro); }
.era.attiva { background: var(--inchiostro) !important; color: var(--accento-testo); box-shadow: none; }
/* i fatti sul binario, non in una riga a parte: il fatto corrente è il cursore */
.tacche { position: absolute; left: 0; right: 0; top: 34px; height: 26px; pointer-events: none; z-index: 2; }
.tacca { top: 50%; width: 9px; height: 9px; border: 0; opacity: .9; transform: translate(-50%, -50%); pointer-events: auto; }
.tacca:hover { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
.tacca.passata { opacity: 1; }
.tacca.attiva { opacity: 1; transform: translate(-50%, -50%); box-shadow: none; background: var(--segno); }
.tacca.attiva.sotto { opacity: 0; pointer-events: none; }
#cursore { height: 26px; position: relative; z-index: 1; }
#cursore::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--inchiostro) var(--p), rgba(107, 99, 84, .25) var(--p)); }
#cursore::-moz-range-track { height: 4px; background: rgba(107, 99, 84, .25); }
#cursore::-moz-range-progress { height: 4px; background: var(--inchiostro); }
#cursore::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -11px; background: var(--carta-chiara); border: 5px solid var(--inchiostro); box-shadow: 0 0 0 4px rgba(224, 166, 58, .35); }
#cursore::-moz-range-thumb { width: 16px; height: 16px; background: var(--carta-chiara); border: 5px solid var(--inchiostro); }
.secoli { font-size: 12px; color: var(--tenue); margin-top: 2px; }
.tacca-nota { top: auto; bottom: 46px; background: var(--carta-chiara); color: var(--inchiostro); border-radius: 16px; padding: 8px 12px; font-size: 13px; box-shadow: var(--ombra-2); }
.tacca-nota img { border-radius: 10px; }
.tacca-nota b { color: var(--inchiostro); font-family: var(--font-titolo); }
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { bottom: var(--tempo); }

/* segnaposti e cartelli sulla carta */
.segnaposto.corrente { background: var(--oro); box-shadow: 0 0 0 5px rgba(224, 166, 58, .3), 0 1px 5px rgba(0,0,0,.35); }
.insegna { background: var(--scuro); color: var(--accento-testo); border-radius: 14px; border-top: 0; padding: 8px 14px; font-family: var(--font-ui); }
.insegna b { font-family: var(--font-titolo); font-size: 18px; letter-spacing: 0; }

/* ingresso: per ora il riquadro giallo, «Dal principio» nero e «Oggi» col bordo */
.intro-scheda { background: var(--carta-chiara); border-radius: var(--raggio-xl); }
.intro-testo { background: var(--carta-chiara); }
.intro-sopra { color: var(--inchiostro); font-weight: 700; }
.intro h1 { font-family: var(--font-titolo); font-weight: 800; letter-spacing: -.03em; background: var(--pastello-giallo); display: inline-block; padding: 8px 16px 10px; border-radius: var(--raggio-s); }
.intro p { color: var(--tenue); }
.intro-cifre { border: 0; padding: 0; gap: 10px; flex-wrap: wrap; }
.intro-cifre div { border-radius: var(--raggio-s); padding: 10px 14px; background: var(--pastello-giallo); }
.intro-cifre div:nth-child(2) { background: var(--pastello-azzurro); }
.intro-cifre div:nth-child(3) { background: var(--pastello-rosa); }
.intro-cifre div:nth-child(4) { background: var(--pastello-verde); }
.intro-cifre b { font-family: var(--font-titolo); font-weight: 800; color: var(--inchiostro); }
.intro-cifre span { color: var(--inchiostro); }
.intro-azioni button { background: var(--inchiostro); color: var(--accento-testo); border-radius: 999px; height: 48px; padding: 0 24px; }
.intro-azioni button:hover { background: #000; }
.intro-azioni button.secondario { background: transparent; color: var(--inchiostro); border: 1.5px solid var(--inchiostro); }
.intro-azioni button.secondario:hover { background: var(--accento-velo); }

/* scena in corso: l'interfaccia si fa da parte */
.testata, .comandi, .linea-tempo { transition: opacity .25s, padding .25s, height .25s; }
body.in-scena .testata { padding: 10px 18px; width: auto; display: flex; align-items: center; gap: 12px; }
body.in-scena .testata .titolo, body.in-scena .testata .nota { display: none; }
body.in-scena .testata .anno { font-size: 42px; margin: 0; }
body.in-scena .testata .epoca-nome { margin: 0; }

/* telefono */
@media (max-width: 720px) {
  :root { --tempo: 96px; --margine: 8px; }
  .testata { width: auto; padding: 8px 14px 10px; border-radius: 20px; }
  .testata .titolo { display: none; }
  .testata .anno { font-size: 56px; margin-top: 0; }
  .testata .epoca-nome { font-size: 13px; padding: 4px 12px; margin-top: 6px; max-width: 190px; }
  .comandi { width: auto; padding: 6px; border-radius: 26px; }
  .comandi button { width: 40px; height: 40px; }
  .scheda { top: auto; width: auto; bottom: calc(var(--tempo) + 4px); }
  .scheda-anno { font-size: 20px; min-width: 60px; }
  #prec, #succ, .scheda-anno, .indice-tasto { height: 40px !important; }
  .scheda h2 { font-size: 22px; }
  .cifra b { font-size: 26px; }
  .cifra { padding: 10px 12px; }
  .toast { top: 110px; left: var(--margine); right: 64px; font-size: 14px; border-radius: 16px; }
  .linea-tempo { left: 6px; right: 6px; bottom: 6px; height: 84px; border-radius: 24px; padding: 0 14px 0 10px; gap: 10px; }
  .riproduci { width: 46px; height: 46px; }
  .ere { height: 12px; margin-bottom: 6px; }
  .era { font-size: 0; padding: 0; line-height: 12px; border-radius: 6px; }
  .tacche { top: 12px; }
  .tacca { width: 7px; height: 7px; }
  .indice { width: auto; left: var(--margine); }
  .pannellino { left: var(--margine); top: 110px; }
  .intro h1 { font-size: 2rem; }
  body.in-scena .testata .anno { font-size: 32px; }
}
.era[data-da="1939"] { font-size: 10px; padding: 0 4px; text-align: center; }
@media (max-width: 1280px) and (min-width: 721px) { .toast { font-size: 15px; padding: 10px 16px; } }
/* in scena la testata è una pillola: col nome dell'epoca solo dove c'è posto */
@media (max-width: 1500px) { body.in-scena .testata .epoca-nome { display: none; } }
body.in-scena .toast { left: 220px; }
@media (max-width: 720px) { body.in-scena .toast { left: var(--margine); } }
/* «confermato» e il tasto Indice non servono (il proprietario, 3.11.2026):
   restano solo le etichette che avvertono, «una fonte» e «data incerta» */
.etichetta.confermato, #indice-apri { display: none !important; }
/* giro di correzioni dagli screenshot (3.11.2026) */
.scheda-anno { white-space: nowrap; padding: 0 12px; min-width: 76px; width: auto; }
.scheda-anno.lungo { font-size: 19px; }
.testata .epoca-nome { border-radius: 18px; line-height: 1.25; }
@media (min-width: 721px) { .maplibregl-ctrl-bottom-left { left: 104px; bottom: calc(var(--tempo) + 4px); } }
/* niente filtri (il proprietario, 3.11.2026): restano accesi i valori di
   sempre (regia, confine, edifici, foto aerea solo nell'anno di oggi) */
#livelli-apri, #livelli { display: none !important; }
@media (min-width: 721px) {
  .pannellino { max-height: calc(100vh - var(--tempo) - 264px); width: 320px; }
  /* la scheda è alta quanto il suo contenuto, non un foglio mezzo vuoto */
  .scheda { bottom: auto; max-height: calc(100vh - var(--tempo) - var(--margine) - 2px); }
  .scheda-corpo { min-height: 0; }
}
@media (max-width: 720px) {
  /* aperta, la scheda lascia vedere anno e comandi */
  .scheda { max-height: calc(100dvh - var(--tempo) - 130px); }
  .scheda-corpo { overflow-y: auto; }
}
/* schermi bassi (portatili): la colonna dei comandi finiva sotto la linea del tempo */
@media (min-width: 721px) and (max-height: 820px) {
  .angolo { gap: 14px; }
  .testata { padding: 12px 18px 14px; width: 260px; }
  .testata .anno { font-size: 68px; margin-top: 4px; }
  .testata .epoca-nome { font-size: 14px; padding: 4px 12px; margin-top: 8px; }
  .comandi { padding: 6px; gap: 2px; width: 52px; border-radius: 26px; }
  .comandi .gruppo { gap: 2px; }
  .comandi button { width: 40px; height: 40px; font-size: 1rem; }
  .pannellino { left: 92px; }
  .maplibregl-ctrl-bottom-left { left: 86px; }
}

/* --- scala e crediti della carta: discreti (il proprietario, 3.11.2026) ---
   La scala non c'è più; i crediti di OpenStreetMap (obbligatori per la
   licenza) restano, piccolissimi, sotto la linea del tempo. */
.maplibregl-ctrl-scale { display: none !important; }
.maplibregl-ctrl-bottom-left { left: auto !important; right: 26px; bottom: 0 !important; }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-attrib.maplibregl-compact { background: transparent !important; box-shadow: none !important;
  font-size: 9px !important; opacity: .55; margin: 0 0 2px !important; min-height: 0; padding: 0 4px !important; }
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button { transform: scale(.7); opacity: .6; }
.maplibregl-ctrl-attrib:hover { opacity: 1; }
@media (max-width: 720px) { .maplibregl-ctrl-bottom-left { right: 10px; } }

/* --- linea del tempo proporzionata: etichette che ci stanno, anni piccoli --- */
.era { font-size: 11px; padding: 0 8px; text-overflow: ellipsis; }
.era[data-da="1939"] { font-size: 11px; padding: 0 8px; }
.secoli { font-size: 10.5px; }
@media (max-width: 720px) {
  .era, .era[data-da="1939"] { font-size: 0; padding: 0; }
}
/* tre cifre: su una riga, più piccole (la terza a tutta larghezza lasciava
   un grande vuoto, il proprietario: «patrimonio UNESCO») */
.cifre:has(.cifra:nth-child(3)) { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cifre:has(.cifra:nth-child(3)) .cifra { padding: 12px 12px; grid-column: auto; }
.cifre:has(.cifra:nth-child(3)) .cifra b { font-size: 26px; }
.cifre:has(.cifra:nth-child(3)) .cifra span { font-size: 12px; }
/* il filmato nella scheda: niente ingrandimento (restava senza via d'uscita) */
.scheda .filmato.grande { position: static; transform: none; width: auto; }

/* il filmato nella scheda: dentro la colonna flex si schiacciava a pochi px */
.scheda-corpo > .filmato { flex: none; }
.scheda .filmato .filmato-schermo { aspect-ratio: 16 / 9; height: auto; width: 100%; flex: none; }
/* il cartellino «una fonte» non serve (il proprietario, 3.11.2026): resta
   solo «data incerta», che avvisa di date discordanti */
.etichetta.una-fonte { display: none !important; }
/* niente pillola in alto a ogni fatto, niente «?» (il proprietario, 3.11.2026) */
#didascalia-animazione, #legenda-apri { display: none !important; }
/* con il filmato restano anche le foto, più basse, sotto (il proprietario:
   il fotogramma del film di via Millelire non si vedeva) */
.scheda.con-filmato .scheda-immagine:not(:empty) { display: block; }
.scheda.con-filmato .scheda-immagine img.eroe { max-height: 190px; }
/* nessun cartellino di certezza (il proprietario, 3.11.2026) */
.etichetta.data-incerta, #scheda-certezza { display: none !important; }

/* il riduci come prima (il proprietario, 3.11.2026): tondo col bordo, a destra */
#scheda-riduci { margin-left: auto; }
.scheda-anno.lungo { font-size: 19px; }
/* le cifre non vanno a capo («7 h 22 min») */
.cifra b { white-space: nowrap; }
.cifre:has(.cifra:nth-child(3)) .cifra b { font-size: 22px; }
/* epoche: grigie davanti, accesa quella in corso, sbiadite dietro */
.era { background: #DEDAD2; color: #6B6354; transition: background .3s, color .3s, opacity .3s; }
.era.passata { background: var(--col); color: var(--inchiostro); opacity: .5; }
.era.attiva { background: var(--col) !important; color: var(--inchiostro); opacity: 1; box-shadow: inset 0 0 0 2px var(--inchiostro); }
.era:hover { background: var(--col); color: var(--inchiostro); }
.sugg-trappola { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* --- lingua --- */
.intro-lingua { display: inline-flex; gap: 0; border: 1.5px solid var(--inchiostro); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.intro-lingua button { border: 0; background: transparent; padding: 6px 14px; font: 600 13px var(--font-ui); color: var(--inchiostro); }
.intro-lingua button.attiva { background: var(--inchiostro); color: var(--accento-testo); }
.intro-come { margin: 0 0 16px; padding-left: 18px; color: var(--tenue); font-size: 15px; line-height: 1.5; }
.intro-come li { margin-bottom: 4px; }
#lingua { font: 700 13px var(--font-ui); letter-spacing: .04em; }
html[lang="en"] .curiosita::before { content: "Did you know"; }
html[lang="en"] .filmato-barra::before { content: "▶ Film"; }
/* niente «Vai sul posto» e «Rivedi la scena» (il proprietario, 3.11.2026) */
.scheda-azioni, #vai-luogo, #rivedi { display: none !important; }
/* --- suggerimenti: una finestra centrata, senza scorrimento --- */
.sugg-velo { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(18, 18, 18, .35); padding: 16px; }
.sugg-velo.nascosta { display: none; }
.sugg-finestra { position: relative; width: min(460px, 100%); background: var(--carta-chiara); border-radius: var(--raggio-xl); box-shadow: var(--ombra-forte);
  padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 10px; font-family: var(--font-ui); }
.sugg-finestra h3 { font-family: var(--font-titolo); font-size: 22px; margin: 0; padding-right: 36px; }
.sugg-finestra .tenue { color: var(--tenue); margin: 0; font-size: 14px; }
.sugg-chiudi { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--inchiostro); background: transparent; font-size: 14px; }
.sugg-fatto { display: flex; align-items: center; gap: 8px; margin: 0 !important; font-size: 13px; background: var(--carta-2); border-radius: 999px; padding: 5px 6px 5px 12px; }
.sugg-fatto.nascosta { display: none; }
.sugg-fatto span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg-fatto button { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(18,18,18,.08); font-size: 11px; }
.sugg-finestra textarea, .sugg-finestra input[type="text"], .sugg-finestra input[type="email"] { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px;
  border: 1.5px solid var(--linea); border-radius: 12px; padding: 9px 11px; background: #fff; color: var(--inchiostro); }
.sugg-finestra textarea { resize: none; height: 96px; }
.sugg-finestra textarea:focus, .sugg-finestra input:focus { outline: none; border-color: var(--inchiostro); }
.sugg-riga { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sugg-check { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; border: 1.5px solid var(--linea); border-radius: 12px; padding: 9px 12px; background: #fff; width: fit-content; cursor: pointer; }
.sugg-check input { width: 18px; height: 18px; accent-color: var(--inchiostro); }
.sugg-privacy { margin: 0 !important; font-size: 12px; color: var(--tenue); }
.sugg-fondo { display: flex; align-items: center; gap: 12px; }
.sugg-fondo #sugg-invia { margin: 0; }
.sugg-esito { font-size: 13px; font-weight: 500; }
@media (max-width: 520px) { .sugg-riga { grid-template-columns: 1fr; } }
#sugg-invia { height: 42px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--inchiostro); color: var(--accento-testo); font-weight: 700; }
#sugg-invia:disabled { opacity: .5; }
.sugg-finestra { box-sizing: border-box; width: min(460px, calc(100vw - 32px)); max-width: 100%; }
.sugg-velo { grid-template-columns: minmax(0, auto); }
/* le cifre lunghe («14 Oct 1980») non escono dalla tessera */
.cifra b { font-size: clamp(22px, 2.2vw, 36px); overflow: hidden; text-overflow: ellipsis; }
.cifre:has(.cifra:nth-child(3)) .cifra b { font-size: clamp(18px, 1.6vw, 22px); }

/* Ingresso essenziale (2.11.2026): niente immagine, niente cifre, un tasto solo */
.intro-scheda { grid-template-columns: 1fr; max-width: 520px; }
.intro-testo { padding: 34px 36px 26px; }
.intro .intro-guida { color: var(--tenue); font-size: 15px; margin-bottom: 20px; }
.intro-nota { margin-top: 4px !important; }
@media (max-width: 720px) { .intro-testo { padding: 22px 20px 24px; } }

/* scheda ripiegata: resta dov'è, in alto a destra (il proprietario, 3.11.2026) */
@media (min-width: 721px) { .scheda.ridotta { top: var(--margine); bottom: auto; } }
#scheda-riduci { display: grid; place-items: center; padding: 0; }
/* ▶ e la freccia del riavvolgi al centro esatto del tondo */
.riproduci { display: grid; place-items: center; padding: 0; line-height: 1; }
.riproduci svg { display: block; }

/* il tasto del volume sopra il filmato, ben visibile (il proprietario, 3.11.2026) */
.filmato-video { position: relative; }
#filmato-audio { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px 0 10px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(17, 17, 17, .78); color: #fff; font-family: var(--sans); font-size: 14px; font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: background .15s, transform .15s; }
#filmato-audio:hover { background: #000; transform: scale(1.04); }
#filmato-audio.acceso { background: rgba(246, 238, 221, .92); color: var(--inchiostro); }
#filmato-audio svg { display: block; flex: none; }

/* Telefono, linea del tempo ripensata (il proprietario, 3.11.2026): i fatti
   sono tacche piccole e discrete sul binario, sotto il cursore (prima il
   cerchio del cursore finiva sotto i puntini); le frecce ‹ › della scheda
   sono grandi e in evidenza; toccando la linea compare il titolo del fatto. */
@media (max-width: 720px) {
  .tacche { top: 19px; z-index: 0; pointer-events: none; }
  #cursore { z-index: 3; }
  .tacca { width: 3px; height: 8px; border-radius: 2px; opacity: .35; background: var(--inchiostro); pointer-events: none; }
  .tacca.passata { opacity: .8; background: var(--segno); }
  .tacca.attiva { opacity: 0; }
  .tacca-nota { bottom: 70px; max-width: 240px; transform: translateX(-50%); font-size: 13px; line-height: 1.3; z-index: 6; }
  .tacca-nota b { display: block; font-size: 15px; margin: 0 0 2px; }
  #prec, #succ { width: 48px !important; height: 48px !important; font-size: 26px; font-weight: 700; background: var(--pastello-giallo) !important; color: var(--inchiostro) !important; border-radius: 50% !important; margin: 0 !important; padding: 0 !important; display: grid; place-items: center; }
  #prec:disabled, #succ:disabled { opacity: .35 !important; color: var(--inchiostro) !important; }
  .scheda-anno { background: transparent !important; color: var(--inchiostro) !important; min-width: 64px; }
  .scheda-barra { gap: 6px; }
}

/* Telefono, la barra della scheda a posti fissi (il proprietario, 3.11.2026:
   «non voglio che le posizioni cambino»): ‹ sempre all'estrema sinistra,
   › sempre all'estrema destra, al centro anno e titolo. Il centro apre e
   chiude la scheda, al posto del tasto riduci. */
@media (max-width: 720px) {
  .scheda-barra { display: grid !important; grid-template-columns: 48px minmax(0, 1fr) 48px; grid-template-areas: "prec anno succ" "prec breve succ";
    align-items: center; column-gap: 10px; row-gap: 0; padding: 10px 12px !important; cursor: pointer; }
  #prec { grid-area: prec; }
  #succ { grid-area: succ; }
  .scheda-anno { grid-area: anno; justify-self: center; height: auto !important; min-width: 0; font-size: 22px !important; line-height: 1.1; }
  .scheda-breve { grid-area: breve; justify-self: stretch; text-align: center; font-size: 14px; }
  .scheda:not(.ridotta) .scheda-barra { grid-template-areas: "prec anno succ"; }
  #scheda-riduci, #indice-apri { display: none !important; }
}

/* Telefono, il dettaglio aperto (il proprietario, 3.11.2026): la barra con
   ‹ anno › resta in basso, dov'era da chiusa, con anche il titolo; il testo
   si apre sopra; una ✕ in alto a destra lo chiude. */
.scheda-chiudi { display: none; }
@media (max-width: 720px) {
  .scheda { flex-direction: column-reverse; }
  .scheda:not(.ridotta) .scheda-barra { grid-template-areas: "prec anno succ" "prec breve succ"; border-top: 1px solid var(--linea); }
  .scheda:not(.ridotta) .scheda-breve { display: block; }
  .scheda-corpo { overflow-y: auto; min-height: 0; padding-top: 48px !important; }
  .scheda:not(.ridotta) .scheda-chiudi { display: grid; place-items: center; position: absolute; top: 10px; right: 10px; z-index: 3;
    width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--inchiostro); color: var(--accento-testo); font-size: 18px; cursor: pointer; }
}

/* Niente zoom della pagina sul telefono (il proprietario, 3.11.2026: «poi non
   riesco più a tornare indietro»): il doppio tocco non ingrandisce; la carta
   si ingrandisce ancora con due dita, perché quei gesti li gestisce lei. */
html, body { touch-action: manipulation; }

/* Telefono: la colonna dei comandi resta sempre uguale, anche durante le
   scene (il proprietario, 3.11.2026). Prima nelle scene si svuotava (un
   puntino nero), poi spariva: compariva e scompariva a ogni fatto. */
@media (max-width: 720px) {
  body.in-scena .comandi { opacity: 1; }
  body.in-scena .comandi .gruppo:not(:first-child) { display: flex; }
}

/* Il pannello «Vista» (inclinazione, orientamento, nord), ridisegnato (il
   proprietario, 3.11.2026): titolo con la ✕, valori in gradi, cursori larghi,
   un tasto vero per il nord. Sul telefono sta a sinistra dei comandi. */
#vista-pannello { width: 260px; padding: 14px 16px 16px; }
.vista-testa { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.vista-testa b { font-family: var(--font-titolo); font-size: 17px; }
#vista-chiudi { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--inchiostro); color: var(--accento-testo); cursor: pointer; display: grid; place-items: center; font-size: 14px; }
.vista-riga { display: block !important; padding: 8px 0 !important; }
.vista-nome { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.vista-nome b { font-variant-numeric: tabular-nums; }
.vista-riga input[type="range"] { width: 100%; accent-color: var(--inchiostro); height: 28px; margin: 0; }
.vista-nord { margin-top: 8px; width: 100%; height: 42px; border: 0; border-radius: 999px; background: var(--pastello-giallo); color: var(--inchiostro);
  font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.vista-nord:hover { filter: brightness(.96); }
@media (max-width: 720px) {
  #vista-pannello { left: auto !important; right: 62px; width: min(250px, calc(100vw - 80px)); max-height: none; }
}

/* Cifre (audit 3.11.2026): mai tagliate, mai coi puntini. Corte: quadrati in
   fila; lunghe: una riga per cifra, il numero a sinistra e la spiegazione accanto. */
.cifra b { overflow: visible !important; text-overflow: clip !important; }
.cifra span { overflow-wrap: break-word; hyphens: auto; }
.cifre.lista { grid-template-columns: 1fr !important; gap: 8px !important; }
.cifre.lista .cifra { grid-column: auto !important; flex-direction: row; align-items: center; gap: 14px; padding: 12px 16px !important; }
.cifre.lista .cifra b { flex: 0 0 auto; max-width: 52%; white-space: normal !important; font-size: 22px !important; line-height: 1.1; }
.cifre.lista .cifra span { margin: 0; font-size: 13px !important; line-height: 1.35; }
@media (max-width: 720px) { .cifre.lista .cifra b { font-size: 19px !important; } }

/* il filmato non si chiude più: chiuso non si poteva rivedere (il proprietario, 3.11.2026) */
#filmato-chiudi { display: none !important; }
#filmato-audio.nascosta { display: none !important; }
/* le spiegazioni delle cifre cominciano con la maiuscola */
.cifra span::first-letter { text-transform: uppercase; }

.intro-nota a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* La colonna dei comandi resta sempre intera e piena, anche durante le
   scene, sul computer come sul telefono (il proprietario, 3.11.2026) */
body.in-scena .comandi { opacity: 1 !important; display: flex !important; }
body.in-scena .comandi .gruppo { display: flex; }
@media (max-width: 720px) { body.in-scena .comandi .gruppo.solo-schermo-grande { display: none; } }
