.svg-map-root, #svgMapContainer svg { width: 100%; height: auto; display:block; }
.ciro-svg-popup {
  position: absolute;
  z-index: 9999;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(0,0,0,0.12);
  padding: 8px;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  max-width: 360px;
  font-size: 13px;
  overflow: hidden;
}
.ciro-popup-title { font-weight: 700; margin-bottom:6px; }
.ciro-popup-bubbles {
  /* Use multi-column layout so many bubbles wrap into columns instead of expanding horizontally */
  column-gap: 8px;
  column-count: 2;
  max-height: 240px;
  overflow-y: auto;
}
.ciro-bubble { display:inline-block; background:#f3f4f6; padding:6px 8px; border-radius:999px; font-size:12px; color:#111; border:1px solid rgba(0,0,0,0.06); margin:4px; }
.ciro-bubble:empty { display:none; }
.ciro-map-legend { margin-top:8px; }
.ciro-legend-gradient { display:flex; align-items:center; gap:8px; }
.ciro-legend-label { font-size:12px; color:#333; }
.ciro-legend-gradient .grad-bar { width:180px; height:12px; border-radius:6px; background: linear-gradient(90deg, rgb(220,50,50), rgb(63,176,76)); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.03); }
/* updated gradient: min (white) -> max (red) */
.ciro-legend-gradient .grad-bar { background: linear-gradient(90deg, #ffffff, rgb(220,50,50)); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04); }

/* small gray swatch for explicit zero values */
.zero-swatch { width: 16px; height: 12px; background: #d0d0d0; border-radius: 3px; border: 1px solid rgba(0,0,0,0.06); display:inline-block; }

/* Legend avg marker */
.ciro-legend-gradient { display:flex; align-items:center; gap:8px; position:relative; }
.ciro-legend-gradient .grad-bar { position:relative; }
.ciro-legend-avg { margin-left:8px; font-size:12px; color:#333; }
.ciro-legend-gradient .avg-marker {
  position: absolute;
  top: -6px;
  width: 2px;
  height: 24px;
  background: rgba(0,0,0,0.6);
  border-radius: 1px;
  transform: translateX(-50%);
}

/* Responsive: single column on very narrow screens */
@media (max-width: 420px) {
  .ciro-popup-bubbles { column-count: 1; max-height: 180px; }
  .ciro-svg-popup { max-width: 260px; }
  /* Make legend more mobile-friendly: stack items, allow scrolling if needed */
  .ciro-map-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    padding: 6px 4px;
    max-height: 30vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ciro-legend-gradient {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .ciro-legend-gradient .grad-bar { width: 140px; height:10px; }
  .ciro-legend-label, .ciro-legend-avg { font-size: 12px; }
  .zero-swatch { width: 14px; height: 10px; }
  /* mobile full-width bottom sheet */
  .ciro-svg-popup.mobile-sheet {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    max-width: none !important;
    width: calc(100% - 16px) !important;
    height: 42vh !important;
    border-radius: 12px 12px 6px 6px !important;
    padding: 10px 12px !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
  }
  .ciro-svg-popup.mobile-sheet .ciro-popup-body {
    overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right:6px;
  }
  .ciro-svg-popup .close-sheet {
    position: absolute; right: 10px; top: 8px; background: transparent; border: none; font-size: 18px; color: #444;
  }
}

/* Header/title above the map */
.ciro-map-header { text-align: left; margin-bottom: 6px; }
.ciro-map-header h3 { margin: 0 0 6px 0; font-size: 18px; font-weight: 700; color: #111827; }

/* Hover behavior for paths: lift slightly and grow in place */
/* Ensure transforms originate from the path's center and don't affect layout horizontally */
#svgMapContainer svg path {
  transition: transform 150ms ease, fill 200ms ease, stroke 120ms ease;
  transform-origin: center center;
  transform-box: fill-box;
  will-change: transform;
  vector-effect: non-scaling-stroke;
}

/* When hovered, translate up a bit and scale up */

#svgMapContainer svg path.hover-lift {
  /* minimal upward movement and slight scale, no lateral shift */
  transform: translateY(-4px) scale(1.04) !important;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.08));
  stroke: #2563EB; /* blue on hover */
  stroke-width: 1.6px;
  stroke-linejoin: round;
}

/* cloned hover path that sits above others */
.hover-clone {
  pointer-events: none;
  /* ensure clone uses same visual rules but sits above */
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.08));
}

/* Default path border */
/* Default path border */
#svgMapContainer svg path {
  stroke: #ffffff;
  stroke-width: 0.8px;
  stroke-linejoin: round;
}

/* Popup tweaks to avoid being hidden by SVG */
.ciro-svg-popup { pointer-events: auto; }
/* Enable smooth touch scrolling inside the bubbles area */
.ciro-popup-bubbles { -webkit-overflow-scrolling: touch; }

/* make bubbles inside the popup visually smaller on desktop */
.ciro-svg-popup .ciro-bubble {
  font-size: 10px !important;
  padding: 4px 6px !important;
}

/* Ensure SVG container behaves responsively */
.svg-map-root, #svgMapContainer { width: 100%; height: auto; }
#svgMapContainer svg { width: 100%; height: auto; display:block; }

/* Larger tap targets on small screens */
@media (max-width: 420px) {
  #svgMapContainer svg path { stroke-width: 1; }
  .ciro-bubble { padding: 8px 10px; font-size: 14px; }
  .ciro-popup-title { font-size: 15px; }
}

/* Slightly reduce legend size on small-but-not-tiny screens */
@media (max-width: 640px) and (min-width: 421px) {
  .ciro-legend-gradient .grad-bar { width: 140px; height: 11px; }
  .ciro-legend-label { font-size: 12px; }
}

/* Labels drawn on SVG paths */
/* SVG on-map labels removed; city names are shown only in popups. */
