/* Stile ripreso da ../css/map.css (Palermo Hub): Titillium Web, pannelli bianchi traslucidi,
   bordi blu tenui, accento arancio #e07800, selezione verde #00cb9b */
:root {
  --ink: #1a2a50;
  --ink-2: #2a3a68;
  --ink-3: #4a5a88;
  --ink-4: #7080a8;
  --line: rgba(30, 60, 160, 0.14);
  --line-soft: rgba(30, 60, 160, 0.1);
  --panel: rgba(255, 255, 255, 0.97);
  --panel-bg: rgba(248, 251, 255, 0.98);
  --blue: #2458c8;
  --accent: #e07800;
  --ok: #00cb9b;
  --shadow: 0 4px 20px rgba(30, 60, 160, 0.13);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Titillium Web', 'Segoe UI', system-ui, sans-serif;
  background: #eef2f9;
  color: var(--ink);
  height: 100vh;
  overflow: hidden;
  position: relative;
}
#map { position: absolute; inset: 0; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ── titolo ── */
#titlebar { flex: none; padding: 8px 16px 7px; background: var(--panel); }
.tb-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tb-kicker { font-size: 14px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.tb-date { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
#titlebar h1 { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.2; margin-top: 1px; }

/* ── toolbar ── */
#map-toolbar {
  position: absolute; left: 0; top: 92px; z-index: 100;
  background: var(--panel); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-left: none; border-radius: 0 14px 14px 0;
  padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  box-shadow: 4px 2px 18px rgba(30, 60, 160, 0.13);
}
/* controlli 3D nel pannello destro */
.rp-3d { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-bg); }
.rp-3d[hidden] { display: none; }
.tbp-row { display: flex; align-items: center; gap: 8px; }
.tbp-label { font-size: 11px; font-weight: 600; color: var(--ink-3); white-space: nowrap; min-width: 92px; }
.tbp-row input[type="range"] { flex: 1; accent-color: var(--blue); height: 3px; }
.tbp-val { font-size: 11px; font-weight: 700; color: var(--blue); min-width: 38px; text-align: right; }
.tb-group { display: flex; flex-direction: column; gap: 3px; }
.tb-sep { width: 28px; height: 1px; background: var(--line); margin: 3px 0; }
.tb-btn {
  width: 40px; height: 40px; border: none; background: transparent; border-radius: 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-2); font-size: 9px; font-weight: 700; font-family: inherit; letter-spacing: .04em;
  transition: background .15s, color .15s; flex-shrink: 0; padding: 0; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.tb-btn svg { width: 16px; height: 16px; }
.tb-lbl { font-size: 7.5px; font-weight: 700; letter-spacing: .04em; color: inherit; opacity: .7; line-height: 1; }
.tb-btn:hover { background: #f0f5ff; color: var(--accent); }
.tb-btn.active, .tb-btn.tb-toggle.on { background: var(--blue); color: #fff; }
.tb-btn.tb-toggle.on::after { content: ''; position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
#compass-svg { width: 22px; height: 22px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.seg-btn { flex: 1; border: 0; background: transparent; padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; font-family: inherit; }
.seg-btn.active { background: var(--blue); color: #fff; }
.seg-btn:not(.active):hover { color: var(--accent); }

/* ── pannello destro ── */
#rp-wrap {
  position: absolute; right: 0; top: 0; height: 100%; z-index: 850;
  display: flex; align-items: stretch;
  transform: translateX(calc(100% - 20px));
  transition: transform .42s cubic-bezier(.22, 1, .36, 1);
}
#rp-wrap.open { transform: translateX(0); }
#rp-toggle {
  width: 20px; height: 60px; align-self: center; flex-shrink: 0; padding: 0;
  background: var(--panel); border: 1px solid var(--line); border-right: none; border-radius: 8px 0 0 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); box-shadow: -4px 0 16px rgba(30, 60, 160, .1);
}
#rp-toggle:hover { background: #f0f5ff; color: var(--accent); }
#rp-toggle-icon { transition: transform .38s cubic-bezier(.22, 1, .36, 1); }
#rp-wrap.open #rp-toggle-icon { transform: rotate(180deg); }

#right-panel {
  width: 370px; height: 100%;
  background: var(--panel-bg); border: 1px solid var(--line); border-right: none;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: -6px 0 28px rgba(30, 60, 160, .12);
}
.rp-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--panel); flex: none; }
.rp-tab { flex: 1; border: 0; background: transparent; padding: 11px 4px 10px; font: 700 11px/1 inherit; font-family: inherit; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rp-tab:hover { color: var(--accent); }
.rp-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.rp-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.rp-scroll[hidden] { display: none; }
.rp-scroll { overflow-y: auto; padding: 14px 14px 28px; flex: 1; scrollbar-width: thin; }
.rp-sec { margin-bottom: 18px; }
.rp-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.rp-sub { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-4); margin-left: 4px; }
.note { font-size: 12px; color: var(--ink-3); line-height: 1.45; margin-top: 8px; }

/* ── card ── */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-card {
  background: #fff; border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 10px 10px 10px 12px; cursor: pointer; text-align: left; min-height: 84px;
  transition: box-shadow .18s, border-color .18s, background .18s;
}
.rp-card:hover { box-shadow: 0 2px 12px rgba(30, 60, 160, .13); border-color: rgba(224, 120, 0, .35); background: #fffdf9; }
.rp-card.active { background: #f0f8f4; border-color: var(--ok); }
.rp-card-line { width: 28px; height: 4px; border-radius: 2px; margin-bottom: 6px; }
.rp-card-title { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.rp-card-desc { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; margin-top: 3px; }

/* ── controlli ── */
.ctl-row { display: flex; align-items: center; gap: 10px; }
.ctl-row span { font-size: 12px; font-weight: 600; color: var(--ink-2); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { flex: 1; width: 100%; accent-color: var(--blue); }
.mix-ends { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.pill {
  margin-top: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 14px; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

/* ── legenda ── */
.lg-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 3px 0; font-size: 12.5px; color: var(--ink-2); }
.lg-sw { width: 22px; height: 14px; border-radius: 3px; border: 1px solid rgba(26, 42, 80, .18); }
.lg-sw.none { background: repeating-linear-gradient(45deg, #fff, #fff 3px, #e6ebf5 3px, #e6ebf5 6px); }
.lg-pct { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 600; }
.lg-bar { grid-column: 2 / 4; height: 3px; background: #e6ebf5; border-radius: 2px; margin-top: -2px; }
.lg-bar i { display: block; height: 100%; border-radius: 2px; background: var(--ink-4); }

/* ── KPI ── */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 9px 11px; }
.kpi b { display: block; font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; display: block; margin-top: 2px; }

/* ── ranking zone ── */
.upl-list { display: flex; flex-direction: column; gap: 4px; }
.upl-wrap { display: flex; gap: 4px; align-items: stretch; }
.upl-cmp { flex: 0 0 34px; border: 1px solid var(--line-soft); background: #fff; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--ink-3); }
.upl-cmp:hover { border-color: var(--accent); color: var(--accent); }
.upl-row {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 1fr 52px; gap: 2px 8px; align-items: center; width: 100%;
  background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 6px 10px; cursor: pointer; text-align: left;
}
.upl-row:hover { border-color: rgba(224, 120, 0, .45); background: #fffdf9; }
.upl-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.upl-val { font-size: 13px; font-weight: 700; color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; }
.upl-meta { font-size: 11px; color: var(--ink-4); grid-column: 1 / 3; }

.rp-credits p { font-size: 12px; color: var(--ink-3); line-height: 1.5; margin-bottom: 6px; }
.rp-credits ul { margin: 0 0 6px; padding-left: 18px; }
.rp-credits li { font-size: 12px; color: var(--ink-3); line-height: 1.5; margin-bottom: 4px; }
.rp-credits a { color: var(--blue); }

/* ── legenda in mappa (come app precedente) ── */
#map-legends { position: absolute; bottom: 20px; left: 64px; z-index: 10; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.map-legend {
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(30, 60, 160, 0.13); border-radius: 10px; padding: 10px 13px;
  box-shadow: 0 3px 14px rgba(30, 60, 160, 0.11); max-width: 260px;
}
.map-legend[hidden] { display: none; }
.map-legend-title { font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.map-legend .lg-row { grid-template-columns: 18px 1fr; font-size: 11px; color: #5a6a98; padding: 1px 0; }
.map-legend .lg-sw { width: 14px; height: 14px; }
.lg-quota-bar { height: 10px; border-radius: 3px; border: 1px solid rgba(26, 42, 80, .18); min-width: 180px; }
.lg-quota-ticks { display: flex; justify-content: space-between; font-size: 10px; color: #5a6a98; margin-top: 2px; }

/* ── scala e attribuzioni (come app precedente) ── */
#map-scale {
  position: absolute;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  pointer-events: none;
  transition: right 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

#map-scale.panel-open {
  right: 406px; /* 370px panel + 20px toggle + 16px margine */
}

#map-scale-bar {
  height: 5px;
  background: #1e3ca0;
  border: 1.5px solid #fff;
  border-top: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
  min-width: 30px;
}

#map-scale-label {
  font-family: 'Titillium Web', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #1e3ca0;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
  line-height: 1;
}


#attrib-wrap {
  position: absolute;
  bottom: 6px;
  right: 28px;
  z-index: 960;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 4px;
  pointer-events: auto;
  transition: right 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

#attrib-wrap.panel-open {
  right: 406px;
}

/* Nascondi logo e attributi quando il pannello info è aperto */
#info-panel.open ~ #ods-logo,
#info-panel.open ~ #attrib-wrap {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#attrib-btn {
  background-color: transparent;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
  border: none;
  border-radius: 0;
  width: 24px;
  height: 24px;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  transition: opacity 0.15s;
}

#attrib-btn:hover {
  opacity: 0.7;
}

#attrib-btn[aria-expanded="true"] {
  opacity: 0.7;
}

#attrib-panel {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 4px;
  padding: 4px 7px;
  font-family: 'Titillium Web', sans-serif;
  font-size: 10px;
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  max-width: 320px;
  white-space: normal;
  text-align: right;
  margin-bottom: 2px;
}

#attrib-panel a {
  color: #ff9900;
  text-decoration: none;
}

#attrib-panel a:hover {
  text-decoration: underline;
}

/* ════════════════════════════════════════

/* ── logo OpenDataSicilia ── */
#ods-logo { position: absolute; bottom: 55px; right: 20px; z-index: 960; display: block; opacity: .85; transition: right .42s cubic-bezier(.22, 1, .36, 1), opacity .2s; }
#ods-logo:hover { opacity: 1; }
#ods-logo img { height: 60px; width: auto; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
#ods-logo.panel-open { right: 406px; }

/* ── popup / toast ── */
.maplibregl-popup-content { font-family: 'Titillium Web', sans-serif; border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); color: var(--ink); }
.pp-title { font-size: 14px; font-weight: 700; }
.pp-sub { font-size: 11px; color: var(--ink-4); margin-bottom: 4px; }
.pp-row { display: flex; justify-content: space-between; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.pp-row b { font-variant-numeric: tabular-nums; }
#toast {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 900;
  background: var(--ink); color: #fff; font-size: 13px; padding: 8px 16px; border-radius: 999px; box-shadow: var(--shadow);
}

/* ── mobile: pannello come bottom sheet ── */
@media (max-width: 720px) {
  #titlebar h1 { font-size: 14px; }
  #map-legends { left: 64px; bottom: 34px; }  /* a destra della toolbar (56px), non sotto */
  .map-legend { max-width: calc(100vw - 64px - 80px); padding: 7px 10px; }
  body:has(#rp-wrap.open) #ods-logo, body:has(#rp-wrap.open) #map-legends, body:has(#rp-wrap.open) #attrib-wrap, body:has(#rp-wrap.open) #map-scale { opacity: 0; pointer-events: none; transition: opacity .3s; }
  #map-scale.panel-open, #attrib-wrap.panel-open { right: 28px; }
  #ods-logo.panel-open { right: 20px; }
  #ods-logo { bottom: 34px; }
  #rp-wrap { top: auto; bottom: 0; right: 0; left: 0; height: 58%; flex-direction: column; transform: translateY(calc(100% - 22px)); }
  #rp-wrap.open { transform: translateY(0); }
  #rp-toggle { width: 60px; height: 22px; align-self: center; border-radius: 8px 8px 0 0; border: 1px solid var(--line); border-bottom: none; }
  #rp-toggle-icon { transform: rotate(90deg); }
  #rp-wrap.open #rp-toggle-icon { transform: rotate(270deg); }
  #right-panel { width: 100%; border-left: none; }
}
@media (prefers-reduced-motion: reduce) { #rp-wrap, #rp-toggle-icon { transition: none; } }

/* ── confronto a slider (solo Rilievo) ── */
.map-ov { position: absolute; inset: 0; z-index: 5; pointer-events: none; visibility: hidden; }
.map-ov.on { visibility: visible; }
#cmp { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
#cmp[hidden] { display: none; }
#cmp-line { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(26, 42, 80, .35); }
#cmp-handle {
  position: absolute; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  background: #fff; color: var(--ink-2); border: 1px solid rgba(26, 42, 80, .35); box-shadow: 0 2px 8px rgba(26, 42, 80, .3);
  display: flex; align-items: center; justify-content: center; cursor: ew-resize; pointer-events: auto; touch-action: none; padding: 0;
}
#cmp-handle:hover, #cmp-handle:focus-visible { color: var(--accent); }
.cmp-tag { position: absolute; top: 150px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cmp-l { left: 62px; }
.cmp-r { right: 380px; }
@media (max-width: 720px) { .cmp-l { left: 8px; } .cmp-r { right: 8px; } }

/* ── Panoramica / Tecnico ── */
.vista-switch { margin-bottom: 14px; }
[data-vista][hidden] { display: none !important; }
.verdetto { margin-top: 10px; padding: 9px 11px; background: #f0f8f4; border: 1px solid var(--ok); border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.upl-badge { grid-column: 1 / 3; justify-self: start; font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3); background: #fff; }
.upl-badge.usa { color: #0a7a5f; border-color: var(--ok); background: #f0f8f4; }
.upl-badge.verifica { color: #a85800; border-color: var(--accent); background: #fff6e8; }
.vt-msg { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; padding: 10px 0; }
.rp-scroll canvas { max-width: 100%; }
.vt-chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.vt-det { margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.vt-det summary { cursor: pointer; font-weight: 600; }
.vt-det table { width: 100%; border-collapse: collapse; margin-top: 6px; font-variant-numeric: tabular-nums; }
.vt-det th, .vt-det td { text-align: right; padding: 2px 4px; border-bottom: 1px solid var(--line-soft); }
.vt-det th:first-child, .vt-det td:first-child { text-align: left; }
canvas[hidden] + .btn-png { display: none; }
.btn-png { display: block; margin: 6px 0 0 auto; padding: 3px 10px; font-size: 11px; }

/* ── Panoramica (qualità del dato) ── */
.pan-testa { margin: 14px 0 16px; }
.pan-grande { font-size: 34px; font-weight: 900; line-height: 1.05; color: var(--ink); }
.pan-grande .num { color: var(--blue); }
.pan-sotto { font-size: 13px; line-height: 1.5; color: var(--ink-2); margin-top: 8px; }
.num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.caso-box { margin-bottom: 10px; }
.caso { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-family: inherit; color: var(--ink-2); }
.caso:hover, .caso.evid { border-color: var(--accent); }
.caso.evid { background: #fff7e0; box-shadow: 0 0 0 2px var(--accent); }
.caso-t { display: block; font-size: 13px; color: var(--ink); margin-bottom: 4px; }
.caso-txt { font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.caso-box .pill { margin-top: 6px; }
#cmp-close { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); pointer-events: auto; }
.pan-cose { font-size: 13px; line-height: 1.5; color: var(--ink-2); margin: 14px 0 4px; padding: 10px 12px; background: #f3f7ff; border-radius: 10px; }

/* ── Tecnico ── */
.tec-sez { margin-top: 16px; }
.tec-scroll { overflow-x: auto; max-width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; }
.tec-tab { border-collapse: collapse; font-size: 11.5px; line-height: 1.4; min-width: 100%; }
.tec-tab th, .tec-tab td { padding: 5px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.tec-tab th { position: sticky; top: 0; background: #f3f7ff; color: var(--ink); font-weight: 700; white-space: nowrap; }
.tec-tab td:nth-child(n+3) { min-width: 180px; }
.tec-grafico { position: relative; height: 220px; margin-top: 6px; }
.tec-lista { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.tec-scroll:has(.tec-impila) { border: 0; overflow: visible; }
.tec-impila, .tec-impila tbody { display: block; }
.tec-impila tr[data-intestazione] { display: none; }
.tec-impila tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.tec-impila td { display: block; border: 0; padding: 0; min-width: 0; overflow-wrap: anywhere; }
.tec-impila td:nth-child(1) { font-weight: 700; color: var(--ink); font-size: 12px; }
.tec-impila td:nth-child(2) { text-align: right; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tec-impila td:nth-child(n+3) { grid-column: 1 / -1; font-size: 11px; line-height: 1.4; color: var(--ink-3); }
.tec-impila td:nth-child(n+3)::before { content: attr(data-label) ": "; font-weight: 700; color: var(--ink-2); }
.tec-impila td:nth-child(4) { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; }

.tec-mappa { margin-top: 6px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: var(--accent); background: transparent; border: 1px solid var(--accent); border-radius: 6px; cursor: pointer; }
.tec-mappa:hover { background: var(--accent); color: #fff; }

/* segnaposto dei tre casi sulla mappa */
.segnaposto { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: var(--ink); color: #fff; font: 700 13px/1 'Titillium Web', sans-serif; display: grid; place-items: center; padding: 0; cursor: pointer; box-shadow: 0 1px 6px rgba(0,0,0,.45); }
.segnaposto.evid, .segnaposto:hover, .segnaposto:focus-visible { background: var(--accent); outline: 2px solid #fff; }

.tec-gruppo { margin: 14px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); border-bottom: 2px solid var(--accent); padding-bottom: 3px; }

/* tooltip del valore Δ sulle celle vettoriali */
.tip-diff .maplibregl-popup-content { padding: 6px 10px; font-size: 12px; line-height: 1.35; color: var(--ink); pointer-events: none; }
.tip-diff strong { font-size: 14px; }
.tip-diff .tip-riga { color: #5a6a98; font-size: 11px; }
.tip-diff { pointer-events: none; }

/* legenda come filtro */
.map-legend .lg-row.filtrabile { cursor: pointer; border-radius: 4px; }
.map-legend .lg-row.filtrabile:hover { background: rgba(37, 87, 214, .08); }
.map-legend .lg-row.filtrabile:focus-visible { outline: 2px solid #2557d6; outline-offset: 1px; }
.map-legend .lg-row.sel { font-weight: 700; color: var(--ink); background: rgba(37, 87, 214, .12); }
.map-legend .lg-row.off { opacity: .4; }
.lg-reset { margin: 6px 0 2px; padding: 3px 8px; font-size: 11px; border: 1px solid rgba(26, 42, 80, .25); border-radius: 6px; background: #fff; color: #2557d6; cursor: pointer; }
.lg-reset[hidden] { display: none; }
