* { box-sizing: border-box; margin: 0; }
:root { --panel-offset: 350px; --ease-pan: cubic-bezier(.4,0,.2,1); }
html, body { height: 100%; font-family: 'Titillium Web', system-ui, sans-serif;     overflow-x: hidden; }
#map { position: absolute; inset: 0; }
#panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: 350px; min-width: 350px; max-width: 500px;
  overflow-y: auto; overflow-x: hidden; resize: horizontal;
  background: #0e0e13; color: #e8e8e8; border-left: 1px solid rgba(255,255,255,.15);
  padding: 12px 14px; font-size: 13px; z-index: 5;
  transition: transform .3s var(--ease-pan);
}
#panel.collapsed { transform: translateX(100%); }
#panelToggle {
  position: fixed; top: 50%; right: var(--panel-offset); transform: translateY(-50%);
  width: 20px; height: 56px; background: rgba(30,30,38,.95); border: 1px solid rgba(255,255,255,.4);
  color: #e8e8e8;
  border-right: none; border-radius: 4px 0 0 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 13px; z-index: 20;
  box-shadow: -2px 0 8px rgba(0,0,0,.5);
  transition: right .3s var(--ease-pan);
}
.toolbarBtn.mobile-only, .mobile-only-sep { display: none; }
@media (max-width: 768px) {
  #panel { width: min(350px, 88vw); }
  /* Su mobile la linguetta laterale è sostituita dal pulsante "Pannello" in toolbar. */
  #panelToggle { display: none; }
  .toolbarBtn.mobile-only { display: flex; }
  .mobile-only-sep { display: block; }
}
#panelBody h2 { font-size: 15px; margin-bottom: 6px; color: #f0f0f0; }
#panelBody h3 { font-size: 11px; text-transform: uppercase; color: #999; margin: 10px 0 4px; }
#panelBody p { font-size: 12px; margin: 2px 0; }
#panelBody p.hint { font-size: 11px; color: #999; font-style: italic; margin: 6px 0; }
#panelNote { font-size: 10.5px; color: #999; font-style: italic; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.15); }
#panelTitle { font-size: 18px; font-weight: 700; color: #ff9900; margin-bottom: 2px; }
#panelSubtitle { font-size: 11.5px; color: #999; margin-bottom: 10px; }
#panelNote a { color: #ff9070; }

/* ── PANEL TAB BAR (Flussi / Coroplettiche) ─────────────────────────── */
.panel-tabbar {
  display: flex; margin: -12px -14px 12px; border-bottom: 1px solid rgba(255,255,255,.15);
}
.panel-tab {
  flex: 1; padding: 10px 6px; font-family: inherit; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: #999; background: transparent;
  border: none; border-bottom: 2px solid transparent; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.panel-tab:hover { color: #f0f0f0; background: rgba(255,255,255,.05); }
.panel-tab.active { color: #ff9900; border-bottom-color: #ff9900; }
.panel-tab + .panel-tab { border-left: 1px solid rgba(255,255,255,.15); }

.panel-view { display: none; }
.panel-view.active { display: block; }

/* ── COROPLETTICHE: pulsanti layer ──────────────────────────────────── */
#coroLayerBtns { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }
.layer-btn {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600;
  color: #ccc; background: rgba(255,255,255,.05); border: 1.5px solid rgba(255,255,255,.12);
  transition: background .15s, color .15s, border-color .15s;
}
.layer-btn:hover { color: #f0f0f0; background: rgba(255,255,255,.09); }
.layer-btn.active { color: #fff; background: rgba(255,153,0,.18); border-color: #ff9900; }
.layer-swatch { width: 26px; height: 8px; border-radius: 3px; flex-shrink: 0; }

.coro-biv-btns { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }

/* ── COROPLETTICHE BIVARIATE: legenda griglia 3x3 ───────────────────── */
.coro-leg-hint { font-size: 9.5px; color: #999; margin-bottom: 10px; }
.coro-biv-wrap { display: flex; gap: 6px; align-items: stretch; margin-bottom: 2px; }
.coro-biv-axis-y {
  writing-mode: vertical-rl; transform: rotate(180deg); text-align: center;
  font-size: 9.5px; color: #999; flex-shrink: 0; white-space: nowrap;
}
.coro-biv-axis-x { font-size: 9.5px; color: #999; text-align: right; margin: 3px 0 8px; }
.coro-biv-grid {
  display: grid;
  grid-template-columns: 28px repeat(3, 38px);
  gap: 3px;
}
.coro-biv-corner { }
.coro-biv-colhead { font-size: 8px; color: #999; text-align: center; align-self: end; padding-bottom: 2px; white-space: nowrap; }
.coro-biv-rowhead {
  display: flex; align-items: center; justify-content: flex-end;
  font-size: 8px; color: #999; padding-right: 3px; text-align: right; white-space: nowrap;
}
.coro-biv-cell { aspect-ratio: 1; border-radius: 2px; cursor: pointer; transition: opacity .15s; }
.coro-biv-cell.off { opacity: .25; }
.coro-biv-rank-vals { display: flex; gap: 10px; font-size: 10.5px; color: #999; margin-left: 20px; }

/* ── COROPLETTICHE: legenda ─────────────────────────────────────────── */
#coroLegend { font-size: 11px; }
.coro-leg-title { font-size: 11px; font-weight: 700; color: #f0f0f0; margin-bottom: 1px; }
.coro-leg-unit { font-size: 9.5px; color: #999; margin-bottom: 8px; }
.coro-leg-scale { display: flex; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.coro-leg-bar { display: flex; flex-direction: column; width: 16px; border-radius: 3px; overflow: hidden; }
.coro-leg-bar div { flex: 1; min-height: 16px; cursor: pointer; transition: opacity .15s; }
.coro-leg-bar div.off { opacity: .3; }
.coro-leg-labels { display: flex; flex-direction: column; justify-content: space-between; }
.coro-leg-labels span { font-size: 10px; color: #999; line-height: 1; }
.coro-leg-nodata { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: #999; cursor: pointer; user-select: none; padding: 2px; border-radius: 3px; transition: opacity .15s, background .15s; }
.coro-leg-nodata:hover { background: rgba(255,255,255,.08); }
.coro-leg-nodata.off { opacity: .35; }
.coro-leg-nodata i { width: 14px; height: 14px; border-radius: 3px; background: #3a3a42; flex-shrink: 0; }

/* ── COROPLETTICHE: donut chart distribuzione classi ────────────────── */
.coro-donut-card { margin: 12px 0 14px; }
.coro-donut-svg-wrap { display: flex; justify-content: center; margin-bottom: 8px; }
.coro-donut-svg { width: 100%; height: auto; max-width: 150px; display: block; overflow: visible; }
.coro-donut-total { font-size: 15px; font-weight: 700; fill: #f0f0f0; font-family: inherit; }
.coro-donut-sublabel { font-size: 8px; fill: #999; font-family: inherit; text-transform: uppercase; letter-spacing: .05em; }
.coro-donut-legend { display: flex; flex-direction: column; gap: 2px; }
.coro-donut-leg-row { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 5px; }
.coro-donut-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.coro-donut-leg-label { font-size: 10px; color: #ccc; flex: 1; }
.coro-donut-leg-bar-wrap { width: 40px; height: 3px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.coro-donut-leg-bar { height: 100%; border-radius: 2px; }
.coro-donut-leg-count { font-size: 10px; color: #e8e8e8; font-weight: 600; min-width: 26px; text-align: right; }
.coro-donut-leg-pct { font-size: 10px; color: #999; min-width: 32px; text-align: right; }

/* ── COROPLETTICHE: ranking top/bottom ──────────────────────────────── */
.coro-rank-section { margin-top: 14px; }
.coro-rank-section h4 {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: #999; margin: 0 0 4px;
}
.coro-rank-row {
  padding: 3px 2px; font-size: 11.5px; cursor: pointer; border-radius: 4px;
}
.coro-rank-row:hover { background: rgba(255,255,255,.07); }
.coro-rank-row .rank-top { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; }
.coro-rank-row .rank-idx { color: #666; flex-shrink: 0; width: 14px; text-align: right; }
.coro-rank-row .rank-name { color: #e8e8e8; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coro-rank-row .rank-val { color: #ff9900; font-weight: 600; flex-shrink: 0; }
.coro-rank-row .bar { margin-left: 20px; }
.coro-rank-row .bar i { background: #ff9900; }
.coro-rank-row .bar i.neg { background: #3d7fff; }

/* ── TOOLTIP 2 righe (nome comune + valore coropletica) ─────────────── */
.comune-hover-tooltip.coro { white-space: normal; text-align: center; line-height: 1.4; }
.comune-hover-tooltip.coro .coro-val { display: block; font-weight: 400; color: #ffcc70; font-size: 11px; }
.dest { font-size: 12px; padding: 3px 0; }
.dest .top { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.dest .pct { color: #999; flex: none; }
.bar { height: 4px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 2px; }
.bar i.out { background: #ff4400; }
.bar i.in { background: #fbeb7c; }
.divbar { position: relative; height: 6px; background: #eee; border-radius: 2px; }
.divbar::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: #999; }
.divbar i { position: absolute; top: 0; height: 100%; border-radius: 2px; }
.divbar i.pos { background: #3d7fff; }
.divbar i.neg { background: #ff4400; }

.statTiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 8px; }
.statTile {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; padding: 10px 4px 8px; text-align: center;
}
.statTile .val { font-size: 18px; font-weight: 700; color: #ff9900; line-height: 1.1; }
.statTile .lbl { font-size: 9px; text-transform: uppercase; letter-spacing: .3px; color: #999; margin-top: 4px; line-height: 1.25; }

.numRow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.numCell {
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px; padding: 8px 4px; text-align: center;
}
.numCell .val { font-size: 14px; font-weight: 600; color: #e8e8e8; }
.numCell .val.pos { color: #3d7fff; }
.numCell .val.neg { color: #ff4400; }
.numCell .lbl { font-size: 9px; text-transform: uppercase; letter-spacing: .3px; color: #999; margin-top: 3px; line-height: 1.25; }

#odsLogo {
  position: absolute; right: calc(var(--panel-offset) + 12px); bottom: 40px; z-index: 5;
  display: block; line-height: 0;
  transition: right .3s var(--ease-pan);
}
#odsLogo img { width: 60px; display: block; }

.maplibregl-ctrl-bottom-right {
  transform: translateX(calc(-1 * var(--panel-offset)));
  transition: transform .3s var(--ease-pan);
}

#mapToolbar {
  position: fixed; top: 90px; left: 12px; z-index: 20;
  display: flex; flex-direction: column;
  background: rgba(10,10,15,.85); border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.toolbarBtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 56px; height: 52px; background: none; border: none; cursor: pointer;
  color: #e8e8e8; font-size: 9px; font-family: inherit; text-transform: uppercase; letter-spacing: .03em;
  transition: background .15s, color .15s;
}
.toolbarBtn + .toolbarBtn { border-top: 1px solid rgba(255,255,255,.12); }
.toolbarBtn:hover { background: rgba(255,255,255,.08); }
.toolbarBtn svg { width: 18px; height: 18px; fill: currentColor; }
.toolbarBtn.toggleBtn.active { background: #ff9900; color: #111; }
.toolbarBtn.toggleBtn.active:hover { background: #ffaa22; }
.toolbarSep { height: 1px; background: rgba(255,255,255,.12); }
@media (max-width: 768px) {
  #mapToolbar { top: 90px; left: 8px; }
  .toolbarBtn { width: 46px; height: 44px; font-size: 8px; }
  .toolbarBtn svg { width: 16px; height: 16px; }
}

#legend {
  position: absolute; left: 12px; bottom: 24px; z-index: 5;
  background: rgba(10,10,15,.85); color: #f0f0f0; border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px; padding: 10px 12px; font-size: 12px; max-width: 230px;
}
#legend h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #aaa; margin-bottom: 6px; }
#legend #legendHint { text-transform: none; font-size: 10px; letter-spacing: 0; color: #777; }
#legend .legend-row { display: flex; align-items: center; gap: 7px; margin: 4px 0; padding: 2px 4px; border-radius: 3px; }
#legend .legend-row[data-kind] { cursor: pointer; user-select: none; transition: background .15s, opacity .15s; }
#legend .legend-row[data-kind]:hover { background: rgba(255,255,255,.08); }
#legend .legend-row[data-kind].off { opacity: .35; }
#legend .swatch { display: inline-block; flex: none; }
#legend .swatch.line { width: 16px; height: 3px; border-radius: 2px; }
#legend .swatch.dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(255,255,255,.6); }

#coroMapLegend {
  position: absolute; left: 12px; bottom: 24px; z-index: 5;
  background: rgba(10,10,15,.85); color: #f0f0f0; border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px; padding: 10px 12px; font-size: 12px; max-width: 230px;
}

.flow-popup { z-index: 999; }
.flow-popup .maplibregl-popup-content {
  background: #0a0a0f; color: #ffffff; font-size: 13px; padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.25); border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.flow-popup .maplibregl-popup-content strong { color: #3d7fff; font-size: 13px; }
.flow-popup .maplibregl-popup-content p { margin: 4px 0 0; }
.flow-popup .maplibregl-popup-content p.pos { color: #3d7fff; font-weight: 600; }
.flow-popup .maplibregl-popup-content p.neg { color: #ff9900; font-weight: 600; }
.flow-popup .maplibregl-popup-tip { border-top-color: #0a0a0f; border-bottom-color: #0a0a0f; }
.flow-popup .maplibregl-popup-close-button { color: #f0f0f0; }

.comune-hover-tooltip {
  position: absolute; z-index: 6; pointer-events: none;
  transform: translate(-50%, -130%);
  background: #0a0a0f; color: #f0f0f0; font-size: 12px; font-weight: 600;
  padding: 4px 8px; border: 1px solid rgba(255,255,255,.25); border-radius: 3px;
  white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

/* ── BARRA DI RICERCA INTELLIGENTE ───────────────────────────────────── */
#geoSearchArea {
  position: fixed; bottom: 40px;
  left: calc(50% - var(--panel-offset) / 2); transform: translateX(-50%);
  z-index: 10; display: flex; flex-direction: column-reverse;
  gap: 6px; align-items: center;
  width: clamp(280px, 42vw, 420px);
  transition: left .3s var(--ease-pan);
}

#geoChips {
  display: none; flex-wrap: wrap; gap: 5px;
  justify-content: center; width: 100%;
}
.geo-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(10,10,15,.85); border: 1px solid rgba(255,255,255,.2); border-radius: 20px;
  padding: 4px 6px 4px 10px; font-size: 11px; font-weight: 600;
  color: #f0f0f0; box-shadow: 0 2px 8px rgba(0,0,0,.35); white-space: nowrap;
}
.geo-chip-close {
  background: none; border: none; cursor: pointer; padding: 1px 3px;
  line-height: 1; color: inherit; opacity: .6; font-size: 10px;
  display: flex; align-items: center;
}
.geo-chip-close:hover { opacity: 1; }
.geo-chip-resetall {
  background: rgba(192,48,48,.15); border-color: rgba(255,110,80,.4);
  color: #ff9070; cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: 11px; padding: 4px 10px; border-radius: 20px;
}
.geo-chip-resetall:hover { background: rgba(192,48,48,.28); }

#geoSearchbar {
  position: relative; display: flex; align-items: center;
  background: #0e0e13; border: 1px solid rgba(255,255,255,.2);
  border-radius: 28px; box-shadow: 0 4px 18px rgba(0,0,0,.5); width: 100%; height: 46px;
}
.geo-si {
  flex-shrink: 0; padding: 0 8px 0 16px; color: #999;
  pointer-events: none; display: flex; align-items: center;
}
#geoSearchInput {
  flex: 1; background: transparent; border: none; outline: none;
  color: #f0f0f0; font-size: 13.5px; min-width: 0; font-family: inherit;
}
#geoSearchInput::placeholder { color: #888; }
#geoSearchClear {
  background: none; border: none; cursor: pointer;
  color: #999; padding: 6px 8px; font-size: 12px; flex-shrink: 0;
}
#geoSearchClear:hover { color: #f0f0f0; }
.geo-sep {
  width: 1px; height: 20px; background: rgba(255,255,255,.2);
  flex-shrink: 0; margin: 0 4px;
}
#geoFilterBtn {
  position: relative; flex-shrink: 0; width: 34px; height: 34px; margin-right: 7px;
  background: #ff9900; border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff; transition: background .15s;
}
#geoFilterBtn:hover { filter: brightness(1.1); }
#geoFilterBtn.active { background: #3d7fff; }
#geoFilterBadge {
  position: absolute; top: -2px; right: -2px;
  background: #3d7fff; color: #fff; border-radius: 50%;
  width: 14px; height: 14px; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; pointer-events: none;
}
#geoSearchDD {
  display: none; position: absolute; bottom: calc(100% + 8px);
  left: 0; right: 0;
  background: #0e0e13; border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
  max-height: 320px; overflow-y: auto; z-index: 20;
}
#geoSearchDD.open { display: block; }
.geo-dd-cat {
  padding: 8px 14px 4px; font-size: 10px; font-weight: 700;
  color: #999; text-transform: uppercase; letter-spacing: .06em;
}
.geo-dd-item {
  padding: 7px 14px; display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 12.5px; color: #e8e8e8;
}
.geo-dd-item:hover, .geo-dd-item.focused { background: rgba(255,255,255,.08); }
.geo-dd-badge {
  margin-left: auto; font-size: 10px; padding: 2px 7px;
  border-radius: 10px; font-weight: 700; background: rgba(255,255,255,.12); color: #ccc;
}
.geo-dd-empty { padding: 16px 14px; color: #999; font-size: 12.5px; text-align: center; }
#geoSearchDD mark { background: rgba(255,153,0,.35); color: #fff; border-radius: 2px; }

/* ── MODALE FILTRI ────────────────────────────────────────────────────── */
#geoFilterOverlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 30;
}
#geoFilterOverlay.open { display: block; }
#geoFilterModal {
  display: none; position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #0e0e13; border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.6);
  z-index: 31; width: 300px; max-width: 94vw;
  max-height: 88vh; overflow-y: auto; font-family: inherit;
}
#geoFilterModal.open { display: block; }
.gfm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 15px; border-bottom: 1px solid rgba(255,255,255,.15);
}
.gfm-header h3 { font-size: 13.5px; font-weight: 700; color: #f0f0f0; }
#geoModalClose {
  background: none; border: none; cursor: pointer;
  color: #999; font-size: 14px; padding: 4px;
}
#geoModalClose:hover { color: #f0f0f0; }
.gfm-group { padding: 11px 15px; border-bottom: 1px solid rgba(255,255,255,.15); }
.gfm-group label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: #999; margin-bottom: 7px;
}
.gfm-group select {
  width: 100%; padding: 7px 10px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2); border-radius: 6px;
  color: #f0f0f0; font-size: 12.5px; outline: none; font-family: inherit;
}
.gfm-group select option { background: #0e0e13; color: #f0f0f0; }
.gfm-group select:disabled { color: #777; background: rgba(255,255,255,.04); }
.gfm-group select:focus { border-color: #ff9900; }
.gfm-footer { display: flex; gap: 8px; padding: 13px 15px; flex-wrap: wrap; }
#geoModalReset {
  flex: 1; padding: 9px; border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px; background: none; color: #e8e8e8;
  font-size: 12px; cursor: pointer; font-family: inherit;
}
#geoModalReset:hover { border-color: #f06060; color: #f06060; }
#geoModalApply {
  flex: 1.5; padding: 9px; border: none; border-radius: 6px;
  background: #ff4400; color: #fff;
  font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
}
#geoModalApply:hover { filter: brightness(1.1); }

/* ── MODALE INFORMAZIONI (slide dall'alto) ───────────────────────────── */
#infoOverlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:1100; }
#infoOverlay.open { display:block; }

#infoModalWrap {
  position:fixed; top:0; left:50%;
  transform:translate(-50%,-100%);
  width:80vw; z-index:1200;
  transition:transform .38s cubic-bezier(.4,0,.2,1);
  pointer-events:none;
}
#infoModalWrap.open { transform:translate(-50%,0); pointer-events:auto; }

#infoModalTab {
  position:fixed; top:0; left:50%; transform:translateX(-50%);
  width:140px; height:30px;
  background:#0e0e13; border:1px solid rgba(255,255,255,.2); border-top:none;
  border-radius:0 0 8px 8px; cursor:pointer; color:#aaa;
  display:flex; align-items:center; justify-content:center; gap:5px;
  font-size:11.5px; font-weight:600; font-family:inherit;
  box-shadow:-2px 4px 12px rgba(0,0,0,.35);
  transition:background .15s, color .15s;
  pointer-events:auto; z-index:1200;
}
#infoModalTab:hover { background:#1a1a22; color:#f0f0f0; }
#infoTabArrow { transition:transform .35s cubic-bezier(.4,0,.2,1); }
#infoModalTab.open #infoTabArrow { transform:rotate(180deg); }

#infoModal {
  width:100%; height:75vh;
  background:#0e0e13; border:1px solid rgba(255,255,255,.2);
  border-radius:0 0 12px 12px; box-shadow:0 8px 30px rgba(0,0,0,.6);
  overflow:hidden; font-family:inherit;
  display:flex; flex-direction:column; position:relative;
}
#infoClose { background:none; border:none; cursor:pointer; color:#999; font-size:14px; padding:4px; }
#infoClose:hover { color:#f0f0f0; }

.info-tabbar { display:flex; border-bottom:1px solid rgba(255,255,255,.15); background:#0e0e13; flex-shrink:0; }
.info-tab {
  flex:1; padding:9px 4px; font-size:12px; font-weight:600;
  background:none; border:none; cursor:pointer;
  color:#999; border-bottom:2px solid transparent;
  transition:color .2s, border-color .2s;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.info-tab:hover { color:#f0f0f0; }
.info-tab.active { color:#ff9900; border-bottom-color:#ff9900; }

.info-panel { display:none; overflow-y:auto; flex:1; }
.info-panel.active { display:block; }

.info-section { padding:14px 16px; }
.info-row { font-size:13.5px; color:#e8e8e8; line-height:1.6; margin-bottom:10px; }
.info-row:last-child { margin-bottom:0; }
.info-row a { color:#ff9900; text-decoration:none; word-break:break-all; font-size:12.5px; }
.info-row a:hover { text-decoration:underline; }
.info-text { font-size:13.5px; color:#e8e8e8; line-height:1.6; margin:0 0 10px; }
.info-text:last-child { margin-bottom:0; }
.info-text strong { color:#f0f0f0; }
.mi-link { color:#ff9900; text-decoration:none; }
.mi-link:hover { text-decoration:underline; }

#infoTotop {
  position:absolute; bottom:16px; right:16px;
  width:34px; height:34px; border-radius:50%;
  background:#ff9900; color:#111; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  font-size:1rem; line-height:1;
  box-shadow:0 2px 8px rgba(0,0,0,.4);
  opacity:0; pointer-events:none;
  transition:opacity .25s, transform .25s;
  z-index:10;
}
#infoTotop.visible { opacity:1; pointer-events:auto; }
#infoTotop:hover { transform:translateY(-2px); }

.analisi-title { font-size:15px; font-weight:700; color:#ff9900; margin:0 0 8px; line-height:1.4; }
.analisi-h3 { font-size:13.5px; font-weight:700; color:#ff9900; margin:14px 0 6px; text-transform:uppercase; letter-spacing:.05em; }
.analisi-sep { border:none; border-top:1px solid rgba(255,255,255,.12); margin:14px 0; }
.analisi-list { font-size:13.5px; color:#e8e8e8; line-height:1.6; padding-left:1.3em; margin:0 0 10px; }
.analisi-list li { margin-bottom:4px; }
.analisi-footer { font-size:12px; color:#999; }

.guida-icon { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; background:rgba(255,255,255,.08); border-radius:5px; color:#ff9900; vertical-align:-5px; margin-right:3px; flex:none; }
.guida-icon svg { width:13px; height:13px; fill:currentColor; }
.guida-list li { display:flex; align-items:flex-start; gap:0; }
.guida-list li .guida-icon { margin-top:1px; }

.analisi-table-wrap { overflow-x:auto; margin:0 0 12px; }
.analisi-table { width:100%; border-collapse:collapse; font-size:12.5px; color:#e8e8e8; }
.analisi-table th, .analisi-table td { padding:5px 8px; text-align:right; white-space:nowrap; border-bottom:1px solid rgba(255,255,255,.1); }
.analisi-table th:first-child, .analisi-table td:first-child { text-align:left; }
.analisi-table th { color:#999; font-weight:600; text-transform:uppercase; font-size:10.5px; letter-spacing:.03em; }
.analisi-table td.pos { color:#3d7fff; font-weight:600; }
.analisi-table td.neg { color:#ff9900; font-weight:600; }
#analisiRegioniChart .dest .pct { color:#bbb; }

@media (max-width:768px) {
  #infoModalWrap { width:96vw; }
  .info-tab { font-size:11px; padding:10px 2px; }
  #infoModalTab {
    position: static; width: 46px; height: 44px;
    border-top: 1px solid rgba(255,255,255,.12); border-left: none; border-right: none; border-bottom: none;
    border-radius: 0; transform: none; box-shadow: none;
    flex-direction: column; gap: 3px; background: none;
    font-size: 8px; text-transform: uppercase; letter-spacing: .03em; color: #e8e8e8;
  }
  #infoModalTab:hover { background: rgba(255,255,255,.08); }
  #infoModalTab.open { background: #ff9900; color: #111; }
  #infoTabLabel { font-size: 7px; line-height: 1.15; text-align: center; }
  #infoTabArrow { display: none; }
}

@media (max-width: 768px) {
  #geoSearchArea { left: 50%; width: min(320px, 82vw); }
}
