/* Dove esplodono le bombe a Roma (approfondimenti/bombe-a-roma.html e il gemello inglese): la mappa, l'elenco, i filtri
   e i grafici di bombe.js, nei colori e nei caratteri dell'atlante. Si carica dopo vc.css; ogni classe comincia con bb-.
   Gli anni hanno i colori della mappa originale, la scala «Ambra»: una sola tinta, dall'arancio chiaro del 2023 al bruno
   del 2027, più chiara verso gli anni recenti col tema scuro, verificata come scala ordinale sulla mappa nei due temi.
   Il 29 novembre 2026 erano una scala di grigi, per lasciare l'oro alle impennate; il 30 novembre Jacopo ha chiesto i
   colori, perché sulla base grigia della mappa i grigi non si distinguevano. I municipi della carta piccola restano grigi.
   Un anno nuovo vuole il suo --bb-yAAAA e --bb-tAAAA (bombe.js avvisa nella console, e intanto lo disegna grigio). */
:root {
  --bb-y2023: #E0943C; --bb-y2024: #C97621; --bb-y2025: #A05812; --bb-y2026: #6E3B09; --bb-y2027: #4F2802;
  --bb-t2023: #1A1A1A; --bb-t2024: #1A1A1A; --bb-t2025: #FFFFFF; --bb-t2026: #FFFFFF; --bb-t2027: #FFFFFF;  /* il numero dentro un segno con più episodi */
  --bb-m0: #f1f2ee; --bb-m1: #e2e5df; --bb-m2: #d3d7d0; --bb-m3: #c3c8c0;  /* municipi: nessun episodio, 1-2, 3-7, 8 o più */
  --bb-off: #dfe3dc;  /* le barre dei mesi fuori dal periodo scelto */
  --bb-edge: #1d2220;  /* i confini dei municipi nella carta piccola: grigio scurissimo (chiaro col tema scuro, dove il nero sparirebbe) */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bb-y2023: #7E4A14; --bb-y2024: #B06A1E; --bb-y2025: #E59A45; --bb-y2026: #F7C98F; --bb-y2027: #FFE7C7;  /* col tema scuro i recenti sono i più chiari */
    --bb-t2023: #FFFFFF; --bb-t2024: #FFFFFF; --bb-t2025: #0e1110; --bb-t2026: #0e1110; --bb-t2027: #0e1110;
    --bb-m0: #161a18; --bb-m1: #1f2421; --bb-m2: #29302c; --bb-m3: #343b37;
    --bb-off: #2b312e;
    --bb-edge: #9aa19c;
  }
}
:root[data-theme="dark"] {
  --bb-y2023: #7E4A14; --bb-y2024: #B06A1E; --bb-y2025: #E59A45; --bb-y2026: #F7C98F; --bb-y2027: #FFE7C7;
  --bb-t2023: #FFFFFF; --bb-t2024: #FFFFFF; --bb-t2025: #0e1110; --bb-t2026: #0e1110; --bb-t2027: #0e1110;
  --bb-m0: #161a18; --bb-m1: #1f2421; --bb-m2: #29302c; --bb-m3: #343b37;
  --bb-off: #2b312e;
  --bb-edge: #9aa19c;
}

/* ── la testata della sezione: il titolo sopra la mappa, il contatore degli episodi (segue i filtri) sopra l’elenco ── */
.bb-head { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: end; gap: 12px 0; }  /* le colonne di .bb-layout */
.bb-head > div { min-width: 0; }
.bb > .wrap > .bb-head { max-width: none; }  /* vc.css ferma le testate di sezione a 820px: questa va larga quanto mappa ed elenco */
/* il contatore in un cerchio, centrato sopra l'elenco degli episodi (la colonna di 360px a destra) */
.bb-total { justify-self: center; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 148px; height: 148px; margin: 0; border: 2px solid var(--ink); border-radius: 50%; background: var(--surface); text-align: center; }
.bb-total b { display: block; font-size: 3.4rem; font-weight: 750; font-stretch: 108%; line-height: 0.9; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bb-total span { display: block; margin-top: 4px; font-size: var(--step--1); color: var(--ink-2); }

/* ── mappa ed elenco: la mappa con i filtri sotto, l'elenco accanto alto quanto la colonna, senza allungarla ── */
.bb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; margin-top: 18px; border: 1px solid var(--rule); border-radius: 2px; background: var(--surface); }
.bb-mapcol { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#bb-map { flex: none; height: clamp(480px, calc(100vh - 220px), 760px); background: var(--land); border-radius: 2px 0 0 0; }
.bb-panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--rule); contain: size; }

/* la legenda, in un angolo della mappa */
.bb-legend { position: absolute; right: 10px; bottom: 30px; z-index: 4; display: flex; flex-direction: column; gap: 6px; padding: 7px 9px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--rule); border-radius: 2px; font-size: 0.72rem; color: var(--ink-2); pointer-events: none; }
.bb-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin: 0 4px 0 8px; vertical-align: -1px; }
.bb-legend i:first-child { margin-left: 0; }
.bb-lg-cl { display: flex; align-items: center; gap: 8px; }
.bb-lg-prov { display: none; }
.bb-show-prov .bb-lg-prov { display: block; }
.bb-lg-prov i { border-radius: 2px; }
.bb-cld { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--bb-y2023) 0 20%, var(--bb-y2024) 0 40%, var(--bb-y2025) 0 60%, var(--bb-y2026) 0 100%); }
.bb-cld b, .bb-cl b { width: calc(100% - 8px); height: calc(100% - 8px); border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 10px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }

/* ── i filtri sotto la mappa: il periodo (riproduci, intervallo, periodi rapidi, istogramma dei mesi), poi il bersaglio ── */
.bb-filters { border-top: 1px solid var(--rule); padding: 12px 18px 14px; }
.bb-label { margin: 0; font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }
.bb-tf-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 4px; }
.bb-tf-range { margin: 0; font-size: var(--step-1); font-weight: 700; line-height: 1.15; }
.bb-tf-range small { display: block; margin-top: 2px; font-size: var(--step--1); font-weight: 400; color: var(--ink-2); }
.bb-tf-presets { display: flex; flex-wrap: wrap; gap: 5px; margin-left: auto; }
.bb-tf-presets button, .bb-chip, .bb-ych { min-height: 30px; padding: 5px 10px; border: 1px solid var(--rule); border-radius: 2px; background: var(--bg); color: var(--ink); font-size: var(--step--1); font-weight: 600; line-height: 1; cursor: pointer; }
.bb-tf-presets button:hover, .bb-chip:hover, .bb-ych:hover { border-color: var(--ink-2); }
.bb-tf-presets button[aria-pressed="true"], .bb-ych[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.bb-tf-row { display: flex; align-items: flex-start; gap: 14px; }
.bb-tf-play { width: 42px; height: 42px; flex: none; margin-top: 10px; display: grid; place-items: center; background: var(--ink); color: var(--bg); border: 0; border-radius: 2px; cursor: pointer; }
.bb-tf-play svg { width: 18px; height: 18px; fill: currentColor; }
.bb-tf-play:hover { background: var(--ink-2); }
.bb-tf-play[aria-pressed="true"] { background: var(--ink-2); }
.bb-tf-track { position: relative; flex: 1; min-width: 0; height: 84px; }
#bb-tf-hist { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#bb-tf-hist .hb-bar { shape-rendering: crispEdges; }
#bb-tf-hist .hb-axis { font-size: 10px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
#bb-tf-hist .hb-tick { stroke: var(--rule); }
#bb-tf-hist .hb-base { stroke: var(--ink); stroke-width: 1; }
#bb-tf-hist .hb-sel { fill: var(--ink); opacity: 0.05; }
#bb-tf-hist .hb-hit { fill: transparent; cursor: pointer; }
#bb-tf-hist .hb-handle line { stroke: var(--ink); stroke-width: 2; }
#bb-tf-hist .hb-handle rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
#bb-tf-hist .hb-handle.is-focus rect { stroke: var(--focus); stroke-width: 2.5; }
.bb-tf-track input[type="range"] { -webkit-appearance: none; appearance: none; position: absolute; left: 0; top: 0; width: 100%; height: 74px; margin: 0; background: none; pointer-events: none; outline: none; }
.bb-tf-track input[type="range"]::-webkit-slider-runnable-track { height: 74px; background: none; border: 0; }
.bb-tf-track input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 16px; height: 74px; background: transparent; border: 0; cursor: ew-resize; }
.bb-tf-track input[type="range"]::-moz-range-track { height: 74px; background: none; border: 0; }
.bb-tf-track input[type="range"]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 74px; background: transparent; border: 0; border-radius: 0; cursor: ew-resize; }
.bb-tftip { position: absolute; top: 0; z-index: 5; display: none; padding: 5px 8px; border-radius: 2px; background: var(--ink); color: var(--bg); font-size: 0.75rem; line-height: 1.3; white-space: nowrap; pointer-events: none; transform: translate(-50%, -100%); }
.bb-tftip b { font-variant-numeric: tabular-nums; }
.bb-cat { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.bb-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.bb-chip { display: inline-flex; align-items: center; gap: 7px; }
.bb-chip .bb-n, .bb-ych .bb-n { font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bb-chip[aria-pressed="false"] { color: var(--muted); background: transparent; }

/* il mese che si sta riproducendo, sulla mappa, e le esplosioni di quel mese */
.bb-playm { position: absolute; left: 14px; bottom: 30px; z-index: 5; display: none; padding: 8px 12px; background: var(--surface); border: 1px solid var(--ink); border-radius: 2px; font-size: var(--step-2); font-weight: 700; line-height: 1.1; pointer-events: none; }
.bb-playm small { display: block; font-size: var(--step--1); font-weight: 400; color: var(--ink-2); }
.bb-playm.is-on { display: block; }
.bb-boom { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 15; pointer-events: none; }
.bb-boom span, .bb-boom svg { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); }
.bb-boom .bb-ring { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--c); animation: bb-ring 1.4s ease-out forwards; }
.bb-boom svg { width: 34px; height: 34px; fill: var(--c); stroke: var(--surface); stroke-width: 1.2; animation: bb-star 1.4s ease-out forwards; }
@keyframes bb-ring { 0% { transform: translate(-50%, -50%) scale(0.3); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(3.2); opacity: 0; } }
@keyframes bb-star { 0% { transform: translate(-50%, -50%) scale(0) rotate(0); opacity: 1; } 18% { transform: translate(-50%, -50%) scale(1.25) rotate(20deg); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(0.7) rotate(40deg); opacity: 0; } }

/* ── l'elenco (anche la versione in testo della mappa) ── */
.bb-lhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--rule); font-size: var(--step--1); color: var(--ink-2); }
.bb-lhead span:first-child { font-weight: 700; color: var(--ink); }
.bb-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.bb-err { padding: 18px; }
.bb-item { border-bottom: 1px solid var(--rule); }
.bb-item button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 3px 10px; width: 100%; padding: 11px 16px; cursor: pointer; }
.bb-item button:hover, .bb-item button:focus-visible, .bb-item.is-on button { background: var(--bg); }
.bb-item button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.bb-item .bb-sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-top: 4px; }
.bb-item .bb-sw.is-sq, .bb-sw.is-sq { border-radius: 2px; }
.bb-item .bb-d { font-size: 0.75rem; line-height: 1.4; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bb-item .bb-q { grid-column: 3; grid-row: 1 / span 3; align-self: center; justify-self: end; max-width: 140px; padding-left: 8px; text-align: right; font-size: var(--step-1); font-weight: 700; line-height: 1.1; }
.bb-item .bb-q small { display: block; margin-top: 3px; font-size: 0.75rem; font-weight: 500; color: var(--ink-2); }
.bb-item .bb-t { grid-column: 2; font-size: var(--step--1); font-weight: 700; line-height: 1.3; }
.bb-item .bb-s { grid-column: 2; font-family: var(--font-body); font-size: var(--step--1); line-height: 1.35; color: var(--ink-2); }

/* ── i segni: un pulsante per luogo (24px da toccare attorno a un punto di 16) ── */
.bb-mkb { position: absolute; top: 0; left: 0; width: 24px; height: 24px; padding: 0; margin: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bb-mkb:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-radius: 50%; }
.bb-mk { width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface), 0 1px 3px rgba(0, 0, 0, 0.35); display: grid; place-items: center; font-size: 10px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--tc, #fff); transition: transform 0.12s; }
.bb-mk.is-multi { width: 21px; height: 21px; }
.bb-mk.is-zone { outline: 1.5px dashed var(--ink); outline-offset: 3px; }
.bb-mk.is-prov { border-radius: 3px; }
.bb-mkb:hover .bb-mk, .bb-mkb:focus-visible .bb-mk { transform: scale(1.35); }
/* i gruppi: dentro una ciambella degli anni, in mezzo il numero */
.bb-clb { position: absolute; top: 0; left: 0; padding: 0; margin: 0; border: 0; background: none; cursor: zoom-in; display: grid; place-items: center; z-index: 10; -webkit-tap-highlight-color: transparent; }
.bb-clb:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 50%; }
.bb-cl { width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface), 0 1px 4px rgba(0, 0, 0, 0.35); transition: transform 0.12s; }
.bb-cl b { font-size: 11px; }
.bb-clb:hover .bb-cl, .bb-clb:focus-visible .bb-cl { transform: scale(1.12); }

/* i comandi di MapLibre nei colori dell'atlante: «Raggruppa» e «Provincia» uniti in un blocco solo, largo quanto la voce più lunga */
.bb .maplibregl-map { font: 13px/1.45 var(--font-display); }
.bb .maplibregl-ctrl-attrib { font-size: 10px; background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--ink-2); }
.bb .maplibregl-ctrl-attrib a { color: var(--ink-2) !important; }
.bb .maplibregl-ctrl-group { border-radius: 2px !important; box-shadow: none !important; border: 1px solid var(--ink-2); background: var(--surface) !important; }
.bb .maplibregl-ctrl-group button + button { border-top: 1px solid var(--rule) !important; }
:root[data-theme="dark"] .bb .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bb .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); } }
.bb-cltoggle button { width: auto !important; height: 32px !important; padding: 0 10px !important; display: inline-flex !important; align-items: center; gap: 7px; font: 600 12px/1 var(--font-display); color: var(--ink); background: var(--surface); }
.bb-cltoggle button[aria-pressed="false"] { color: var(--muted); }
.bb-cltoggle button[aria-pressed="false"] .bb-cld { opacity: 0.45; }
.bb-cltoggle .bb-cld { width: 18px; height: 18px; }
.bb-cltoggle .bb-cld b { font-size: 0; }
.bb .maplibregl-ctrl-top-right { display: flex; flex-direction: column; align-items: stretch; }
.bb .maplibregl-ctrl-top-right .bb-cltoggle button { width: 100% !important; justify-content: flex-start; }
.bb .maplibregl-ctrl-top-right .bb-cltoggle:has(+ .bb-provtoggle) { border-bottom: 0; border-radius: 2px 2px 0 0 !important; }
.bb .maplibregl-ctrl-top-right .maplibregl-ctrl.bb-provtoggle { margin-top: 0; border-top: 0; border-radius: 0 0 2px 2px !important; }
.bb-provtoggle button { border-top: 1px solid var(--rule) !important; }
.bb-provico { width: 20px; height: 18px; flex: none; color: var(--ink); }
.bb-provtoggle button[aria-pressed="false"] .bb-provico { color: var(--muted); opacity: 0.6; }
/* «Negli ultimi 12 mesi» in cima allo stesso blocco: un calendario con «12» nel colore dell'anno più recente */
.bb .maplibregl-ctrl-top-right .maplibregl-ctrl.bb-lasttoggle { border-bottom: 0; border-radius: 2px 2px 0 0 !important; }
.bb .maplibregl-ctrl-top-right .maplibregl-ctrl.bb-lasttoggle + .bb-cltoggle { margin-top: 0; border-top: 0; border-radius: 0 !important; }
.bb .maplibregl-ctrl-top-right .maplibregl-ctrl.bb-lasttoggle + .bb-cltoggle:not(:has(+ .bb-provtoggle)) { border-radius: 0 0 2px 2px !important; }
.bb-lasttoggle + .bb-cltoggle button { border-top: 1px solid var(--rule) !important; }
.bb-lastico { width: 20px; height: 18px; flex: none; color: var(--ink); }
.bb-lastico text { font: 700 8.4px/1 var(--font-display); fill: var(--yl, var(--ink)); }  /* --yl: il colore dell'anno più recente, da bombe.js */
.bb-lasttoggle button[aria-pressed="false"] .bb-lastico { color: var(--muted); opacity: 0.6; }
.bb-zoomreset button { display: grid !important; place-items: center; }
.bb-zoomreset svg { width: 17px; height: 17px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bb-zoomreset circle { fill: var(--ink); stroke: none; }

/* il suggerimento al passaggio e la scheda dell'episodio */
.bb-tt .maplibregl-popup-content { background: var(--ink); color: var(--bg); border-radius: 2px; box-shadow: none; font: 12px/1.35 var(--font-display); padding: 5px 8px; }
.bb-tt .maplibregl-popup-tip { border-top-color: var(--ink) !important; border-bottom-color: var(--ink) !important; }
.bb-card { max-width: 320px !important; }
.bb-card .maplibregl-popup-content { max-height: 56vh; overflow-y: auto; padding: 14px 16px; background: var(--surface); color: var(--ink); border: 1px solid var(--ink-2); border-radius: 2px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22); font-family: var(--font-display); }
.bb-card .maplibregl-popup-tip { border-top-color: var(--ink-2) !important; border-bottom-color: var(--ink-2) !important; }
.bb-card .maplibregl-popup-close-button { width: 28px; height: 28px; color: var(--ink-2); font-size: 20px; }
.bb .maplibregl-popup { z-index: 20; }
.bb-pop + .bb-pop { border-top: 1px solid var(--rule); margin-top: 14px; padding-top: 14px; }
.bb-pop p { margin: 0; }
.bb-pop .bb-pd { font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bb-pop h3 { margin: 4px 0 2px; font-size: var(--step-1); font-weight: 700; line-height: 1.2; }
.bb-pop .bb-pl { font-size: var(--step--1); color: var(--ink-2); }
.bb-pop .bb-pm { margin-top: 6px; font-size: var(--step--1); }
.bb-pop .bb-pm span + span::before { content: " · "; color: var(--muted); }
.bb-pop .bb-px { margin-top: 8px; font-family: var(--font-body); font-size: var(--step-0); line-height: 1.45; }
.bb-pop .bb-pp { margin-top: 8px; font-size: 0.72rem; color: var(--muted); }
.bb-pop .bb-src { margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--rule); list-style: none; }
.bb-pop .bb-src li { margin-top: 6px; font-size: 0.78rem; line-height: 1.35; }
.bb-pop .bb-src a { text-decoration-color: var(--muted); }
.bb-pop .bb-src b { font-weight: 700; }
.bb-pop .bb-src time { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }

/* ── da leggere: una scheda per articolo o documento (l'immagine di anteprima della testata, la testata, il titolo, la data),
   dal più recente; l'immagine nel grigio dell'atlante, a colori al passaggio ── */
.bb-reads { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.bb-rd { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 12px 14px 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: 2px; color: inherit; text-decoration: none; transition: border-color 0.15s; }
.bb-rd:hover, .bb-rd:focus-visible { border-color: var(--ink-2); }
.bb-rd-img { position: relative; display: block; margin: -12px -14px 4px; aspect-ratio: 2 / 1; overflow: hidden; border-bottom: 1px solid var(--rule); border-radius: 1px 1px 0 0;
  background: repeating-linear-gradient(135deg, var(--bg) 0 9px, var(--rule) 9px 10px); }
.bb-rd-img img { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15); }
.bb-rd:hover .bb-rd-img img, .bb-rd:focus-visible .bb-rd-img img { filter: none; }
.bb-rd-src { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }
.bb-rd-ext { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.bb-rd-t { font-size: var(--step-0); font-weight: 700; line-height: 1.25; }
.bb-rd:hover .bb-rd-t { text-decoration: underline; text-underline-offset: 2px; }
.bb-rd-by { margin-top: auto; padding-top: 2px; font-size: var(--step--1); color: var(--ink-2); }

/* ── per municipio e quartiere: i pulsanti degli anni (uno alla volta), la carta dei municipi e due grafici a barre
   impilate per anno; bombe.js disegna gli SVG alla larghezza della cella, così il testo tiene la sua misura ── */
.bb-ch-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.bb-ch-head .chart-sub { margin: 0; font-size: var(--step-1); font-weight: 700; color: var(--ink); }
.bb-ch-years { display: flex; flex-wrap: wrap; gap: 6px; }
.bb-ych { display: inline-flex; align-items: center; gap: 7px; }
.bb-ych .bb-sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px var(--surface); }
.bb-ych[aria-pressed="true"] .bb-n { color: var(--bg); opacity: 0.75; }
.bb-ych[aria-pressed="true"] .bb-sw { box-shadow: 0 0 0 1.5px var(--ink); }
/* «Ultimi 12 mesi» tra gli anni dei grafici: lo stesso calendario del tasto sulla mappa, più piccolo */
.bb-ych .bb-lastico { width: 16px; height: 14px; color: currentColor; }
.bb-ych[aria-pressed="true"] .bb-lastico text { fill: currentColor; }
.bb-ch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 40px; }
.bb-ch-cell { margin: 0; min-width: 0; }
.bb-ch-cell h3 { margin: 0; font-size: var(--step-1); font-weight: 700; line-height: 1.25; }
.bb-ch-note { margin: 3px 0 12px; font-size: var(--step--1); color: var(--ink-2); }
.bb-ch-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: -4px 0 6px; font-size: 0.75rem; color: var(--ink-2); }
.bb-ch-legend span { display: inline-flex; align-items: center; gap: 5px; }
.bb-ch-legend i { width: 11px; height: 11px; background: var(--c); box-shadow: inset 0 0 0 1px var(--rule); }
.bb-ch-grid svg { display: block; width: 100%; height: auto; overflow: visible; }
.bb-ch-grid svg text { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
/* i confini: 1px sullo schermo a qualunque larghezza della carta (non-scaling-stroke vince sullo stroke-width che bombe.js
   scala col viewBox); al passaggio il municipio si contorna più spesso */
.bb-chm path { stroke: var(--bb-edge); stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.bb-chm:hover path, .bb-chm:focus-visible path { stroke: var(--ink); stroke-width: 2.5px; }
.bb-chm:focus { outline: none; }
.bb-chlab { fill: var(--ink); text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-linejoin: round; }
.bb-chlab .bb-n { font-weight: 700; }
.bb-chpt { stroke: var(--surface); pointer-events: none; }
.bb-chax { font-size: 12px; fill: var(--ink-2); }
.bb-chax.is-m { font-size: 11.5px; fill: var(--muted); }
.bb-chtot { font-size: 12px; font-weight: 700; fill: var(--ink); }
.bb-chgl { stroke: var(--grid); stroke-width: 1; }
.bb-chrow:hover .bb-chbg { fill: var(--surface); }
.bb-ch-empty { font-size: var(--step--1); color: var(--muted); }
.bb-chtip { position: fixed; z-index: 60; display: none; max-width: 260px; padding: 6px 9px; border-radius: 2px; background: var(--ink); color: var(--bg); font: 0.75rem/1.4 var(--font-display); pointer-events: none; }
.bb-chtip b { font-weight: 700; }
.bb-chtip .bb-chq { opacity: 0.75; }

/* ── metodo e fonti ── */
.bb-dl { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.bb-press { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 18px 0 0; font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }
.bb-press img { display: block; height: 30px; width: auto; opacity: 0.85; }
.bb-press a:hover img, .bb-press a:focus-visible img { opacity: 1; }
:root[data-theme="dark"] .bb-press img { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bb-press img { filter: invert(1); } }

@media (max-width: 1179px) {
  .bb-reads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-ch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .bb-head { grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; }  /* l'elenco va sotto la mappa: il cerchio resta accanto al titolo */
  .bb-total { width: 112px; height: 112px; }
  .bb-total b { font-size: 2.6rem; }
  .bb-layout { grid-template-columns: minmax(0, 1fr); }
  #bb-map { height: 70vh; min-height: 400px; border-radius: 2px 2px 0 0; scroll-margin-top: 64px; }
  .bb-panel { border-left: 0; border-top: 1px solid var(--rule); contain: none; }
  .bb-list { max-height: 70vh; }
  .bb-filters { padding: 12px 14px; }
  .bb-tf-presets { margin-left: 0; }
  .bb-cat { display: block; }
  .bb-cat .bb-label { margin-bottom: 8px; }
  .bb-item button, .bb-lhead { padding-left: 14px; padding-right: 14px; }
  .bb-legend { right: 8px; bottom: 28px; }
  .bb-card { max-width: 270px !important; }
  .bb-card .maplibregl-popup-content { max-height: 38vh; }
  .bb-ch-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .bb-reads { grid-template-columns: minmax(0, 1fr); }
  .bb-rd-img { aspect-ratio: 5 / 2; }
  .bb-total { width: 92px; height: 92px; border-width: 1.5px; }
  .bb-total b { font-size: 2.1rem; }
  .bb-total span { margin-top: 2px; font-size: 0.72rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bb-mk, .bb-cl { transition: none; }
  .bb-boom .bb-ring { animation: none; opacity: 0; }
  .bb-boom svg { animation: none; }
}
@media (forced-colors: active) { .bb-mk, .bb-cl, .bb-cld, .bb-legend i, .bb-sw { forced-color-adjust: none; } }
