:root {
  --bg: #ffffff;
  --text: #0b0b0b;
  --muted: rgba(0, 0, 0, .5);
  --line: rgba(0, 0, 0, 0.5);
  --line2: rgba(0, 0, 0, .5);
  --shadow: 0 14px 40px rgba(0, 0, 0, .12);

  /* colori accesi */
  --artist: #00d1ff;
  --cluster: #ff2e63;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 14px 16px;
}

.brandTitle {
  font-family: "Archivo Black", system-ui;
  font-size: 24px;
  letter-spacing: .2px;
}

.brandSub {
  margin-top: 3px;
  font-size: 16px;
  color: var(--muted);
}

.brandSub a {
  color: var(--text);
  text-decoration: underline;
}

.brandCorsica {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: calc(100vh - 72px);
}

.stage {
  position: relative;
  border-right: 1px solid var(--line);
  min-height: 420px;
  background: #fff;
}

.map {
  position: absolute;
  inset: 0;
}

.hud {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.hudRow {
  font-size: 12.5px;
  color: rgba(0, 0, 0, .75);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  color: rgba(0, 0, 0, .28);
}

.side {
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 0;
}

.sheetHandle {
  display: none;
}

.sideHead {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.statsRow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.statVal {
  font-family: "Archivo Black", system-ui;
  font-size: 16px;
  line-height: 1;
}

.statLbl {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.sideTop {
  display: flex;
  gap: 8px;
}

.sideFilters {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line2);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  flex: 1;
}

.btn:active {
  transform: translateY(1px);
}

.select {
  width: 100%;
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  font-size: 13px;
}

.panel {
  padding: 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.panelTitle {
  font-family: "Archivo Black", system-ui;
  font-size: 14px;
  margin-bottom: 10px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
}

.cardTitle {
  font-family: "Archivo Black", system-ui;
  font-size: 14px;
  margin-bottom: 8px;
}

.kv {
  font-size: 12.5px;
  color: rgba(0, 0, 0, .78);
  margin: 6px 0;
}

.kv b {
  color: rgba(0, 0, 0, .88);
}

.btnRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pillBtn {
  border: 1px solid var(--line2);
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pillBtn.disabled {
  opacity: .35;
  pointer-events: none;
  text-decoration: none;
}

.muted {
  color: var(--muted);
  font-size: 12.5px;
}

/* Leaflet minimal */
.leaflet-control-zoom a {
  border-radius: 12px !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow);
}

.leaflet-container {
  background: #ffffff;
}

.leaflet-control-attribution {
  display: none;
}

/* Mobile: mappa full + sheet overlay draggabile */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 72px);
  }

  .stage {
    border-right: none;
  }

  .side {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48vh;
    /* viene modificato via JS durante il drag */
    border-top: 1px solid var(--line);
    border-left: none;
    box-shadow: var(--shadow);
    z-index: 1000;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    overflow: hidden;
  }

  .sheetHandle {
    display: flex;
    justify-content: center;
    padding: 10px 0 6px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    touch-action: none;
    /* fondamentale per drag fluido */
  }

  .sheetPill {
    width: 46px;
    height: 5px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .25);
  }

  .sideHead {
    padding: 10px 12px;
  }

  .brandTitle {
    font-family: "Archivo Black", system-ui;
    font-size: 18px;
    letter-spacing: .2px;
  }

  .brandSub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 3px;
  }

  .brandCorsica {
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
  }
}

.checkRow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12.5px;
  color: rgba(0, 0, 0, .70);
}

.checkRow input {
  width: 16px;
  height: 16px;
}

/* tooltip cluster count già gestito in JS; qui lo rendiamo più “pulito” */
.leaflet-tooltip.clusterCount {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Basemap più “soft” */
.leaflet-tile {
  filter: grayscale(0.2) contrast(1.02);
}

/* Mobile: sidebar overlay già presente, nessun cambiamento extra necessario */

.searchWrap {
  margin-top: 10px;
  position: relative;
}

.search {
  width: 100%;
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  font-size: 13px;
}

.searchResults {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 2000;
}

.searchItem {
  width: 100%;
  text-align: left;
  border: none;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
}

.searchItem:hover {
  background: rgba(0, 0, 0, 0.04);
}

.searchMeta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

/* label permanente sotto ai pallini (Leaflet tooltip) */
.leaflet-tooltip.artistLabel {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.18);
  color: #000;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
  pointer-events: auto;
  cursor: pointer;
}