:root {
  --map-bg: #071317;
  --map-card: rgba(7, 19, 23, 0.78);
  --map-line: rgba(4, 197, 191, 0.2);
  --map-accent: #04c5bf;
  --map-pink: #ee0c6f;
  --map-warn: #ff4f9a;
  --map-text: #efffff;
  --map-muted: #9bc0c4;
}

.maps-shell {
  min-height: 100vh;
  padding: 18px 22px 28px 292px;
  background:
    radial-gradient(circle at 18% 8%, rgba(238, 12, 111, 0.2), transparent 28%),
    radial-gradient(circle at 82% 0%, rgba(4, 197, 191, 0.18), transparent 30%),
    linear-gradient(135deg, #030b10, #071317 52%, #11121b);
  color: var(--map-text);
  font-family: Poppins, Arial, sans-serif;
}

.maps-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.maps-kicker {
  color: var(--map-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.maps-hero h1 {
  max-width: 720px;
  margin: 0 0 6px;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1;
}

.maps-hero p {
  max-width: 700px;
  margin: 0;
  color: var(--map-muted);
}

.maps-add-location,
.maps-filter-row button,
.maps-chip-row button,
.maps-dialog button[data-check-location] {
  border: 0;
  border-radius: 999px;
  background: var(--map-accent);
  color: #001316;
  font-weight: 800;
  padding: 11px 15px;
  cursor: pointer;
}

.maps-layout {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.maps-panel,
.maps-canvas,
.maps-dialog-card {
  border: 1px solid var(--map-line);
  background: var(--map-card);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.maps-panel {
  box-sizing: border-box;
  border-radius: 26px;
  max-height: calc(100vh - 116px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 18px 14px 14px;
  scrollbar-gutter: stable;
}

.maps-panel > * {
  max-width: 100%;
  min-width: 0;
}

.maps-search-card label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.maps-search-card input,
.maps-dialog input,
.maps-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: #071317;
  color: var(--map-text);
  margin-bottom: 10px;
  padding: 12px 14px;
  outline: none;
}

.maps-dialog textarea {
  min-height: 82px;
  resize: vertical;
}

.maps-filter-row,
.maps-chip-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.maps-filter-row button,
.maps-chip-row button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--map-text);
  padding: 8px 11px;
  font-size: 12px;
}

.maps-filter-row button.is-active,
.maps-chip-row button.is-active {
  background: linear-gradient(135deg, var(--map-pink), var(--map-accent));
  color: #fff;
}

.maps-chip-row button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.maps-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.maps-stats article {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px;
}

.maps-stats strong {
  display: block;
  font-size: 21px;
}

.maps-stats span,
.maps-chip-group p {
  color: var(--map-muted);
  font-size: 11px;
  line-height: 1.35;
}

.maps-filter-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  margin-bottom: 12px;
  padding: 10px;
}

.maps-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.maps-artist-card {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
}

.maps-card-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.maps-avatar {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border: 2px solid rgba(238, 12, 111, 0.72);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--map-pink), var(--map-accent));
  box-shadow: 0 0 0 4px rgba(238, 12, 111, 0.13), 0 10px 24px rgba(4, 197, 191, 0.18);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  overflow: hidden;
}

.maps-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}

.maps-card-title {
  flex: 1 1 auto;
  min-width: 0;
}

.maps-card-title h2 {
  font-size: 16px;
  margin: 0;
  overflow-wrap: anywhere;
}

.maps-card-title p,
.maps-location,
.maps-kind {
  margin: 2px 0 0;
  color: var(--map-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.maps-status {
  flex: 0 1 auto;
  margin-left: auto;
  max-width: 46%;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
}

.maps-status-verified {
  background: rgba(4, 197, 191, 0.16);
  color: #79fff9;
}

.maps-status-unclaimed {
  background: rgba(238, 12, 111, 0.18);
  color: #ff9fc8;
}

.maps-tags,
.maps-card-metrics,
.maps-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.maps-tags span,
.maps-card-metrics span {
  max-width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--map-muted);
  font-size: 11px;
  overflow-wrap: anywhere;
  padding: 6px 8px;
}

.maps-card-metrics strong {
  color: var(--map-text);
}

.maps-actions a,
.maps-actions button {
  box-sizing: border-box;
  flex: 1;
  max-width: 100%;
  min-width: 118px;
  border: 0;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--map-text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 9px;
  text-align: center;
  text-decoration: none;
}

.maps-actions a:last-child {
  background: var(--map-accent);
  color: #001316;
}

.maps-actions button {
  background: linear-gradient(135deg, var(--map-pink), #ff6aa9);
  color: #fff;
}

.maps-canvas {
  position: relative;
  min-height: calc(100vh - 116px);
  border-radius: 30px;
  overflow: hidden;
  background: linear-gradient(140deg, rgba(238, 12, 111, 0.12), transparent 35%), #071317;
}

.maps-grid,
.maps-district,
.maps-road {
  position: absolute;
  pointer-events: none;
}

.maps-grid {
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle, #000 58%, transparent 100%);
}

.maps-district {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 44px;
  background: rgba(255, 255, 255, 0.035);
}

.district-a { inset: 10% 52% 54% 8%; transform: rotate(-8deg); }
.district-b { inset: 18% 10% 34% 48%; transform: rotate(7deg); }
.district-c { inset: 58% 28% 10% 14%; transform: rotate(4deg); }

.maps-road {
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(4, 197, 191, 0.22), rgba(238, 12, 111, 0.2));
  box-shadow: 0 0 30px rgba(4, 197, 191, 0.14);
}

.road-main { left: -8%; right: -8%; top: 42%; transform: rotate(-14deg); }
.road-cross { left: 18%; right: 8%; top: 64%; transform: rotate(18deg); }
.road-curve { left: 44%; right: 16%; top: 24%; transform: rotate(51deg); }

.maps-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border: 4px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px 18px 18px 4px;
  rotate: -45deg;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.maps-pin span {
  rotate: 45deg;
  font-size: 11px;
  font-weight: 900;
}

.maps-pin-verified { background: var(--map-accent); color: #001316; }
.maps-pin-unclaimed { background: var(--map-pink); color: #fff; }
.maps-pin.is-hidden,
.maps-artist-card.is-hidden { display: none; }

.maps-legend {
  position: absolute;
  left: 20px;
  bottom: 20px;
  display: flex;
  gap: 11px;
  flex-wrap: wrap;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.42);
  padding: 11px 13px;
  z-index: 3;
}

.maps-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--map-muted);
  font-size: 12px;
}

.maps-legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
}

.maps-legend .verified { background: var(--map-accent); }
.maps-legend .unclaimed { background: var(--map-pink); }

.maps-dialog {
  border: 0;
  background: transparent;
}

.maps-dialog::backdrop {
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(4px);
}

.maps-dialog-card {
  position: relative;
  width: min(92vw, 460px);
  border-radius: 26px;
  padding: 22px;
  color: var(--map-text);
}

.maps-dialog-close {
  position: absolute;
  right: 16px;
  top: 12px;
  background: transparent !important;
  color: var(--map-text) !important;
  border: 0;
  font-size: 28px;
}

.maps-dialog output {
  display: block;
  margin: 10px 0;
  color: var(--map-muted);
}

@media (max-width: 980px) {
  .maps-shell { padding: 16px 14px 94px; }
  .maps-hero { display: block; }
  .maps-layout { grid-template-columns: 1fr; }
  .maps-panel { max-height: none; }
  .maps-canvas { min-height: 520px; }
}

@media (max-width: 560px) {
  .maps-stats { grid-template-columns: 1fr; }
  .maps-hero h1 { font-size: 32px; }
  .maps-panel, .maps-canvas { border-radius: 22px; }
}

.maps-panel {
  scrollbar-color: rgba(4, 197, 191, 0.72) transparent;
  scrollbar-width: thin;
}

.maps-panel::-webkit-scrollbar {
  width: 8px;
}

.maps-panel::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
  margin-block: 18px;
}

.maps-panel::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--map-accent), var(--map-pink));
  background-clip: padding-box;
}

.maps-panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #42fff6, #ff4f9a);
  background-clip: padding-box;
}

.maps-actions a,
.maps-actions button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 38px;
  min-width: 0;
  padding: 8px 10px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  white-space: normal;
}

.maps-disabled-submit,
.maps-disabled-submit:disabled {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(239, 255, 255, 0.52);
  cursor: not-allowed;
  font-weight: 800;
  padding: 11px 14px;
  text-align: center;
}

.tatzo-leaflet-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #071317;
}

.maps-canvas .leaflet-container {
  background: #071317;
  font-family: Poppins, Arial, sans-serif;
}

.maps-canvas .leaflet-control-zoom a {
  background: rgba(7, 19, 23, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--map-text);
}

.maps-canvas .leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.55);
  color: rgba(239, 255, 255, 0.62);
}

.maps-canvas .leaflet-control-attribution a {
  color: var(--map-accent);
}

.tatzo-map-marker {
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36), 0 0 0 6px rgba(4, 197, 191, 0.12);
  display: grid;
  place-items: center;
}

.tatzo-map-marker span {
  color: #001316;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.tatzo-map-marker-verified {
  background: var(--map-accent);
}

.tatzo-map-marker-unclaimed {
  background: var(--map-pink);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36), 0 0 0 6px rgba(238, 12, 111, 0.16);
}

.tatzo-map-marker-unclaimed span {
  color: #fff;
}

.maps-canvas .leaflet-popup-content-wrapper,
.maps-canvas .leaflet-popup-tip {
  background: rgba(7, 19, 23, 0.96);
  color: var(--map-text);
  border: 1px solid rgba(4, 197, 191, 0.2);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.tatzo-map-popup {
  max-width: min(280px, 72vw);
  min-width: 230px;
  overflow: hidden;
}

.tatzo-map-popup-head {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.tatzo-map-popup-icon {
  align-items: center;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 34px;
  font-size: 17px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
}

.tatzo-map-popup-verified .tatzo-map-popup-icon {
  background: var(--map-accent);
  box-shadow: 0 0 0 5px rgba(4, 197, 191, 0.14);
  color: #001316;
}

.tatzo-map-popup-unclaimed .tatzo-map-popup-icon {
  background: radial-gradient(circle at 34% 24%, #ff9bc5, var(--map-pink));
  box-shadow: 0 0 0 5px rgba(238, 12, 111, 0.16);
}

.tatzo-map-popup strong {
  color: var(--map-text);
  display: block;
  font-size: 15px;
  line-height: 1.2;
  margin: 0 0 4px;
}

.tatzo-map-popup-status,
.tatzo-map-popup-address {
  color: var(--map-muted);
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
}

.tatzo-map-popup-meta,
.tatzo-map-popup-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.tatzo-map-popup-meta span,
.tatzo-map-popup-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  padding: 6px 8px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tatzo-map-popup-verified .tatzo-map-popup-meta span,
.tatzo-map-popup-verified .tatzo-map-popup-pill {
  background: rgba(4, 197, 191, 0.12);
  border: 1px solid rgba(4, 197, 191, 0.18);
  color: #9ffdfa;
}

.tatzo-map-popup-unclaimed .tatzo-map-popup-meta span,
.tatzo-map-popup-unclaimed .tatzo-map-popup-pill {
  background: rgba(238, 12, 111, 0.12);
  border: 1px solid rgba(238, 12, 111, 0.18);
  color: #ffc4dc;
}

.tatzo-map-popup-address {
  margin-top: 9px;
}

.tatzo-map-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tatzo-map-popup-action {
  align-items: center;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--map-text);
  cursor: pointer;
  display: inline-flex;
  flex: 1 1 95px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  min-height: 34px;
  padding: 8px 10px;
  text-align: center;
  text-decoration: none;
}

.tatzo-map-popup-book {
  background: var(--map-accent);
  color: #001316;
}

.tatzo-map-popup-claim {
  background: linear-gradient(135deg, var(--map-pink), #ff6aa9);
  color: #fff;
}

.maps-empty-map {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 3;
  width: min(68%, 260px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.42);
  color: var(--map-text);
  padding: 10px 12px;
  pointer-events: none;
  text-align: left;
}

.maps-empty-map strong,
.maps-empty-map span {
  display: block;
}

.maps-empty-map strong {
  font-size: 12px;
  line-height: 1.2;
}

.maps-empty-map span {
  color: var(--map-muted);
  font-size: 11px;
  line-height: 1.3;
  margin-top: 2px;
}

/* Critical scoped Leaflet layout fallback in case CDN CSS is delayed/blocked or global CSS interferes. */
.maps-canvas .leaflet-container {
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
  touch-action: pan-x pan-y;
}

.maps-canvas .leaflet-pane,
.maps-canvas .leaflet-map-pane,
.maps-canvas .leaflet-tile-pane,
.maps-canvas .leaflet-overlay-pane,
.maps-canvas .leaflet-shadow-pane,
.maps-canvas .leaflet-marker-pane,
.maps-canvas .leaflet-tooltip-pane,
.maps-canvas .leaflet-popup-pane {
  left: 0;
  position: absolute;
  top: 0;
}

.maps-canvas .leaflet-map-pane {
  z-index: 1;
}

.maps-canvas .leaflet-tile-pane {
  z-index: 200;
}

.maps-canvas .leaflet-overlay-pane {
  z-index: 400;
}

.maps-canvas .leaflet-shadow-pane {
  z-index: 500;
}

.maps-canvas .leaflet-marker-pane {
  z-index: 600;
}

.maps-canvas .leaflet-tooltip-pane {
  z-index: 650;
}

.maps-canvas .leaflet-popup-pane {
  z-index: 700;
}

.maps-canvas .leaflet-tile,
.maps-canvas .leaflet-marker-icon,
.maps-canvas .leaflet-marker-shadow {
  left: 0;
  position: absolute;
  top: 0;
}

.maps-canvas .leaflet-container img,
.maps-canvas .leaflet-container .leaflet-tile {
  max-height: none !important;
  max-width: none !important;
}

.maps-canvas .leaflet-tile-container {
  left: 0;
  position: absolute;
  top: 0;
}

.maps-canvas .leaflet-control-container {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 800;
}

.maps-canvas .leaflet-top,
.maps-canvas .leaflet-bottom {
  pointer-events: none;
  position: absolute;
  z-index: 1000;
}

.maps-canvas .leaflet-top {
  top: 12px;
}

.maps-canvas .leaflet-bottom {
  bottom: 12px;
}

.maps-canvas .leaflet-left {
  left: 12px;
}

.maps-canvas .leaflet-right {
  right: 12px;
}

.maps-canvas .leaflet-control {
  clear: both;
  float: left;
  pointer-events: auto;
}

.maps-canvas .leaflet-right .leaflet-control {
  float: right;
}

.maps-canvas .leaflet-control-zoom {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.maps-canvas .leaflet-control-zoom a {
  display: block;
  height: 32px;
  line-height: 32px;
  text-align: center;
  text-decoration: none;
  width: 32px;
}

.maps-canvas .leaflet-control-zoom-in,
.maps-canvas .leaflet-control-zoom-out {
  font-size: 20px;
  font-weight: 800;
}

.maps-canvas .leaflet-control-attribution {
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.4;
  max-width: min(80vw, 460px);
  padding: 4px 9px;
}

.maps-canvas .leaflet-control-attribution {
  opacity: 0.56;
  transform: scale(0.86);
  transform-origin: bottom right;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.maps-canvas .leaflet-control-attribution:hover,
.maps-canvas .leaflet-control-attribution:focus-within {
  opacity: 0.96;
  transform: scale(0.96);
}

.tatzo-cluster {
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38), 0 0 0 7px rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
}

.tatzo-cluster span {
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.tatzo-cluster-verified {
  background: radial-gradient(circle at 35% 28%, #8ffefa, var(--map-accent));
}

.tatzo-cluster-unclaimed {
  background: radial-gradient(circle at 35% 28%, #ff9bc5, var(--map-pink));
}

.tatzo-cluster-mixed {
  background: linear-gradient(135deg, var(--map-accent), var(--map-pink));
}

.tatzo-map-marker-unclaimed span {
  font-size: 20px;
  line-height: 0.8;
}

.maps-artist-card-imported {
  border-color: rgba(238, 12, 111, 0.26);
  background: linear-gradient(145deg, rgba(238, 12, 111, 0.11), rgba(255, 255, 255, 0.045));
}

.maps-artist-card-imported .maps-avatar {
  border-color: rgba(238, 12, 111, 0.85);
  background: radial-gradient(circle at 34% 25%, #ff9bc5, var(--map-pink));
  box-shadow: 0 0 0 4px rgba(238, 12, 111, 0.16), 0 14px 28px rgba(238, 12, 111, 0.18);
}

.maps-artist-card-imported .maps-card-title h2::after {
  content: "Imported location";
  display: inline-flex;
  margin-left: 8px;
  border-radius: 999px;
  background: rgba(238, 12, 111, 0.18);
  color: #ffb4d2;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 7px;
  vertical-align: middle;
}

.maps-contact-tags span {
  border: 1px solid rgba(238, 12, 111, 0.16);
  background: rgba(238, 12, 111, 0.1);
  color: #ffc4dc;
}

.maps-claim-submit:not(:disabled) {
  background: linear-gradient(135deg, var(--map-pink), #ff6aa9);
  color: #fff;
  cursor: pointer;
}

.maps-mobile-actions,
.maps-mobile-sheet-close,
.maps-mobile-sheet-handle,
.maps-mobile-sheet-backdrop {
  display: none;
}

@media (max-width: 760px) {
  body.maps-mobile-sheet-active {
    overflow: hidden;
  }

  .maps-shell {
    min-height: 100svh;
    padding: 10px 10px 88px;
  }

  .maps-hero {
    display: none;
  }

  .maps-layout {
    display: flex;
    min-height: calc(100svh - 98px);
  }

  .maps-canvas {
    order: 1;
    width: 100%;
    min-height: calc(100svh - 108px);
    border-radius: 24px;
  }

  .maps-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    max-height: min(76svh, 680px);
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 28px 28px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 12px 12px calc(18px + env(safe-area-inset-bottom));
    transform: translateY(calc(100% + 18px));
    transition: transform 0.24s ease;
  }

  .maps-shell.is-mobile-sheet-open .maps-panel {
    transform: translateY(0);
  }

  .maps-mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;
    display: block;
    background: rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(2px);
  }

  .maps-mobile-sheet-backdrop[hidden] {
    display: none;
  }

  .maps-mobile-sheet-close {
    position: sticky;
    top: 0;
    z-index: 2;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--map-text);
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
  }

  .maps-mobile-sheet-handle {
    position: sticky;
    top: 8px;
    z-index: 2;
    display: block;
    width: 42px;
    height: 4px;
    margin: -34px auto 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
  }

  .maps-mobile-actions {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 820;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: rgba(3, 11, 16, 0.78);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(14px);
    padding: 8px;
  }

  .maps-mobile-actions button {
    min-height: 42px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--map-text);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    padding: 8px 6px;
  }

  .maps-mobile-actions button:nth-child(2) {
    color: #9ffdfa;
  }

  .maps-mobile-actions button:nth-child(4) {
    background: linear-gradient(135deg, var(--map-pink), #ff6aa9);
    color: #fff;
  }

  .maps-panel .maps-search-card,
  .maps-panel .maps-stats,
  .maps-panel .maps-filter-panel,
  .maps-panel .maps-results {
    display: none;
  }

  .maps-shell[data-mobile-sheet-mode="search"] .maps-search-card,
  .maps-shell[data-mobile-sheet-mode="search"] .maps-stats {
    display: block;
  }

  .maps-shell[data-mobile-sheet-mode="search"] .maps-stats {
    display: grid;
  }

  .maps-shell[data-mobile-sheet-mode="filters"] .maps-search-card,
  .maps-shell[data-mobile-sheet-mode="filters"] .maps-filter-panel {
    display: block;
  }

  .maps-shell[data-mobile-sheet-mode="list"] .maps-search-card,
  .maps-shell[data-mobile-sheet-mode="list"] .maps-stats,
  .maps-shell[data-mobile-sheet-mode="list"] .maps-results,
  .maps-shell[data-mobile-sheet-mode="selected"] .maps-results {
    display: grid;
  }

  .maps-shell[data-mobile-sheet-mode="selected"] .maps-artist-card {
    display: none;
  }

  .maps-shell[data-mobile-sheet-mode="selected"] .maps-artist-card.is-mobile-selected {
    display: block;
  }

  .maps-shell[data-mobile-sheet-mode="selected"] .maps-artist-card.is-hidden.is-mobile-selected {
    display: block;
    opacity: 0.72;
  }

  .maps-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .maps-stats article {
    padding: 9px;
  }

  .maps-stats strong {
    font-size: 18px;
  }

  .maps-results {
    padding-bottom: 8px;
  }

  .maps-artist-card {
    border-radius: 20px;
  }

  .maps-canvas .leaflet-top {
    top: 10px;
  }

  .maps-canvas .leaflet-left {
    left: 10px;
  }

  .maps-canvas .leaflet-bottom {
    bottom: 82px;
  }

  .maps-legend {
    left: 12px;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    max-width: calc(100% - 24px);
    padding: 8px 10px;
  }

  .maps-legend span {
    font-size: 11px;
  }

  .maps-empty-map {
    top: 12px;
    right: 12px;
    width: min(56vw, 210px);
  }

  .maps-canvas .leaflet-popup-pane {
    display: none;
  }
}

@media (max-width: 420px) {
  .maps-shell {
    padding-left: 8px;
    padding-right: 8px;
  }

  .maps-canvas {
    min-height: calc(100svh - 104px);
    border-radius: 20px;
  }

  .maps-mobile-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .maps-canvas .leaflet-bottom {
    bottom: 126px;
  }

  .maps-legend {
    bottom: calc(120px + env(safe-area-inset-bottom));
  }

  .maps-stats {
    grid-template-columns: 1fr;
  }
}

.maps-mobile-explore,
.maps-mobile-tabs {
  display: none;
}

@media (max-width: 760px) {
  .maps-shell {
    --maps-mobile-nav-offset: 78px;
    min-height: 100dvh;
    padding-bottom: calc(var(--maps-mobile-nav-offset) + 12px + env(safe-area-inset-bottom));
  }

  .maps-layout {
    min-height: calc(100dvh - var(--maps-mobile-nav-offset) - 18px);
  }

  .maps-canvas {
    min-height: calc(100dvh - var(--maps-mobile-nav-offset) - 24px);
  }

  .maps-panel {
    bottom: calc(var(--maps-mobile-nav-offset) + env(safe-area-inset-bottom));
    max-height: min(72dvh, 640px);
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }

  .maps-mobile-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin: 0 0 12px;
  }

  .maps-mobile-tabs button {
    min-height: 42px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--map-text);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    padding: 8px 6px;
  }

  .maps-mobile-tabs button:nth-child(2) {
    color: #9ffdfa;
  }

  .maps-mobile-tabs button:nth-child(4) {
    background: linear-gradient(135deg, var(--map-pink), #ff6aa9);
    color: #fff;
  }

  .maps-mobile-actions {
    display: none;
  }

  .maps-mobile-explore {
    position: absolute;
    left: 50%;
    bottom: calc(var(--maps-mobile-nav-offset) + 12px + env(safe-area-inset-bottom));
    z-index: 820;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(3, 11, 16, 0.78);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34), 0 0 0 5px rgba(4, 197, 191, 0.08);
    backdrop-filter: blur(14px);
    color: var(--map-text);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    min-height: 46px;
    padding: 8px 14px 8px 12px;
  }

  .maps-mobile-explore span:first-child {
    position: relative;
    width: 18px;
    height: 18px;
  }

  .maps-mobile-explore span:first-child::before,
  .maps-mobile-explore span:first-child::after {
    content: "";
    position: absolute;
    left: 3px;
    width: 12px;
    height: 12px;
    border-left: 3px solid var(--map-accent);
    border-top: 3px solid var(--map-pink);
    transform: rotate(45deg);
  }

  .maps-mobile-explore span:first-child::before {
    top: 1px;
  }

  .maps-mobile-explore span:first-child::after {
    top: 8px;
    opacity: 0.78;
  }

  .maps-shell.is-mobile-sheet-open .maps-mobile-explore {
    display: none;
  }

  .maps-shell[data-mobile-sheet-mode="search"] .maps-search-card,
  .maps-shell[data-mobile-sheet-mode="filters"] .maps-search-card,
  .maps-shell[data-mobile-sheet-mode="list"] .maps-search-card {
    scroll-margin-top: 18px;
  }

  .maps-results,
  .maps-filter-panel {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .maps-legend {
    top: 12px;
    right: 12px;
    bottom: auto;
    left: auto;
    max-width: min(58vw, 230px);
    justify-content: flex-end;
  }

  .maps-empty-map {
    top: 86px;
  }

  .maps-canvas .leaflet-bottom {
    bottom: 14px;
  }
}

@media (max-width: 420px) {
  .maps-mobile-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .maps-mobile-explore {
    bottom: calc(var(--maps-mobile-nav-offset) + 10px + env(safe-area-inset-bottom));
  }

  .maps-canvas .leaflet-bottom {
    bottom: 10px;
  }
}

.maps-location-request-card h2,
.maps-claim-card h2 {
  margin-top: 0;
}

.maps-location-request-card p,
.maps-claim-card p {
  color: var(--map-muted);
  line-height: 1.45;
}

.maps-location-request-submit,
.maps-claim-submit:not(:disabled) {
  width: 100%;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--map-pink), #ff6aa9);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  padding: 12px 14px;
}

.maps-location-request-submit:disabled,
.maps-claim-submit:disabled {
  opacity: 0.68;
  cursor: wait;
}

.maps-location-request-card,
.maps-claim-card {
  border-color: rgba(238, 12, 111, 0.2);
  background:
    radial-gradient(circle at 12% 0%, rgba(238, 12, 111, 0.18), transparent 34%),
    rgba(7, 19, 23, 0.94);
}

@media (max-width: 760px) {
  .maps-dialog[open] {
    align-items: center;
    justify-items: center;
    padding: 14px 10px calc(var(--maps-mobile-nav-offset, 78px) + 16px + env(safe-area-inset-bottom));
  }

  .maps-dialog-card {
    width: min(94vw, 460px);
    max-height: calc(100dvh - var(--maps-mobile-nav-offset, 78px) - 34px - env(safe-area-inset-bottom));
    overflow: auto;
    overscroll-behavior: contain;
    padding: 20px 16px calc(22px + env(safe-area-inset-bottom));
  }

  .maps-dialog input,
  .maps-dialog textarea {
    font-size: 16px;
  }
}

@media (max-width: 760px) {
  .maps-dialog[open] {
    display: grid;
  }
}

.maps-dialog-help {
  border: 1px solid rgba(4, 197, 191, 0.14);
  border-radius: 14px;
  background: rgba(4, 197, 191, 0.08);
  padding: 10px 12px;
}

.maps-pin-picker-button {
  width: 100%;
  border: 1px solid rgba(4, 197, 191, 0.24);
  border-radius: 15px;
  background: rgba(4, 197, 191, 0.11);
  color: #9ffdfa;
  cursor: pointer;
  font-weight: 900;
  padding: 12px 14px;
}

@media (max-width: 760px) {
  .maps-dialog {
    width: 100vw;
    max-width: 100vw;
    margin: auto;
    padding: 0;
    overflow: visible;
  }

  .maps-dialog[open] {
    padding: 12px 12px calc(var(--maps-mobile-nav-offset, 78px) + 18px + env(safe-area-inset-bottom));
  }

  .maps-dialog-card {
    box-sizing: border-box;
    width: calc(100vw - 24px);
    max-width: 520px;
    margin-inline: auto;
    overflow-x: hidden;
  }

  .maps-dialog-card,
  .maps-dialog-card * {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
  }

  .maps-dialog-card h2,
  .maps-dialog-card p,
  .maps-dialog-card output,
  .maps-dialog-card label,
  .maps-dialog-card button {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .maps-dialog input,
  .maps-dialog textarea,
  .maps-dialog button,
  .maps-dialog output {
    width: 100%;
  }
}

.maps-dialog-card h2 {
  padding-right: 54px;
  overflow-wrap: anywhere;
}

.maps-dialog-close {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  z-index: 4;
}

.maps-file-upload {
  display: block;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--map-text);
  margin-bottom: 10px;
  padding: 11px 13px;
}

.maps-file-upload span,
.maps-file-upload small {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.maps-file-upload span {
  font-weight: 800;
  margin-bottom: 7px;
}

.maps-file-upload small {
  color: var(--map-muted);
  font-size: 11px;
  margin-top: 6px;
}

.maps-file-upload input {
  width: 100%;
  margin: 0;
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .maps-dialog[open] {
    inset-inline: 0;
  }

  .maps-dialog-card {
    width: min(calc(100vw - 24px), 520px);
    max-width: calc(100vw - 24px);
    transform: none;
  }

  .maps-dialog-close {
    right: 12px;
    top: 12px;
  }

  .maps-dialog-card h2 {
    padding-right: 48px;
  }
}

/* Structural mobile-safe modal layout. Keep the native <dialog> as the overlay,
   but make the card/header/body layout explicit so the close button cannot overlap titles. */
.maps-dialog[open] {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px 12px calc(var(--maps-mobile-nav-offset, 92px) + env(safe-area-inset-bottom) + 16px);
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.maps-modal {
  position: relative;
  width: min(calc(100vw - 24px), 520px);
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - var(--maps-mobile-nav-offset, 92px) - env(safe-area-inset-bottom) - 32px);
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.maps-modal,
.maps-modal * {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.maps-modal-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: start;
  gap: 12px;
  padding: 22px 22px 8px;
}

.maps-modal-title {
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.maps-modal-close,
.maps-modal-close.maps-dialog-close {
  position: static !important;
  justify-self: end;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  line-height: 1;
}

.maps-modal-body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 22px 22px;
}

.maps-modal-body p,
.maps-modal-body output,
.maps-modal-body label,
.maps-modal-body button,
.maps-modal-body input,
.maps-modal-body textarea {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.maps-modal-body input,
.maps-modal-body textarea,
.maps-modal-body button,
.maps-modal-body output,
.maps-modal-body .maps-file-upload {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 760px) {
  .maps-shell,
  .maps-layout,
  .maps-canvas {
    overflow-x: hidden;
  }

  .maps-dialog[open] {
    align-items: flex-start;
    padding: 16px 12px calc(var(--maps-mobile-nav-offset, 92px) + env(safe-area-inset-bottom) + 16px);
  }

  .maps-modal {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - var(--maps-mobile-nav-offset, 92px) - env(safe-area-inset-bottom) - 32px);
  }

  .maps-modal-header {
    grid-template-columns: minmax(0, 1fr) 44px;
    padding: 20px 16px 8px;
  }

  .maps-modal-body {
    padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  }
}

/* Final mobile modal centering fix */
@media (max-width: 560px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .maps-dialog {
    width: calc(100dvw - 24px) !important;
    max-width: calc(100dvw - 24px) !important;
    min-width: 0 !important;
    margin: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-sizing: border-box !important;
    inset: 0 !important;
    overflow: visible !important;
  }

  .maps-dialog[open] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .maps-dialog-card,
  .maps-modal,
  .maps-modal-card {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    max-height: calc(100dvh - 120px) !important;
    overflow-y: auto !important;
    padding: 28px 22px 32px !important;
    border-radius: 28px !important;
  }

  .maps-dialog-card *,
  .maps-modal *,
  .maps-modal-card * {
    box-sizing: border-box !important;
    max-width: 100%;
  }

  .maps-dialog-card input,
  .maps-dialog-card textarea,
  .maps-dialog-card select,
  .maps-dialog-card button,
  .maps-modal input,
  .maps-modal textarea,
  .maps-modal select,
  .maps-modal button {
    max-width: 100% !important;
  }

  .maps-modal-header,
  .maps-dialog-header {
    position: relative !important;
    padding-right: 58px !important;
  }

  .maps-modal-title,
  .maps-dialog-title,
  .maps-dialog-card h2,
  .maps-modal h2 {
    padding-right: 58px !important;
    font-size: clamp(34px, 10vw, 46px) !important;
    line-height: 1.08 !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  .maps-dialog-close,
  .maps-modal-close {
    position: absolute !important;
    top: 22px !important;
    right: 22px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    z-index: 5 !important;
    margin: 0 !important;
  }
}

/* Real final fix: keep mobile modal close button in top-right */
@media (max-width: 560px) {
  .maps-dialog-card,
  .maps-modal,
  .maps-modal-card {
    position: relative !important;
  }

  .maps-dialog-card h2,
  .maps-modal h2,
  .maps-modal-title,
  .maps-dialog-title {
    padding-right: 74px !important;
  }

  .maps-dialog-card > button[aria-label*="Close"],
  .maps-dialog-card > button[aria-label*="close"],
  .maps-dialog-card > button[aria-label*="Fermer"],
  .maps-dialog-card > button[aria-label*="fermer"],
  .maps-dialog-card > .maps-dialog-close,
  .maps-dialog-card > .maps-modal-close,
  .maps-dialog-card > .modal-close,
  .maps-dialog-card > [data-dialog-close],
  .maps-dialog-card > [data-modal-close],
  .maps-modal > button[aria-label*="Close"],
  .maps-modal > button[aria-label*="close"],
  .maps-modal > button[aria-label*="Fermer"],
  .maps-modal > button[aria-label*="fermer"],
  .maps-modal > .maps-dialog-close,
  .maps-modal > .maps-modal-close,
  .maps-modal > .modal-close,
  .maps-modal > [data-dialog-close],
  .maps-modal > [data-modal-close] {
    position: absolute !important;
    top: 26px !important;
    right: 26px !important;
    left: auto !important;
    bottom: auto !important;

    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    z-index: 50 !important;

    border-radius: 999px !important;
  }
}

@media (max-width: 390px) {
  .maps-dialog-card h2,
  .maps-modal h2,
  .maps-modal-title,
  .maps-dialog-title {
    padding-right: 66px !important;
  }

  .maps-dialog-card > button[aria-label*="Close"],
  .maps-dialog-card > button[aria-label*="close"],
  .maps-dialog-card > button[aria-label*="Fermer"],
  .maps-dialog-card > button[aria-label*="fermer"],
  .maps-dialog-card > .maps-dialog-close,
  .maps-dialog-card > .maps-modal-close,
  .maps-dialog-card > .modal-close,
  .maps-dialog-card > [data-dialog-close],
  .maps-dialog-card > [data-modal-close],
  .maps-modal > button[aria-label*="Close"],
  .maps-modal > button[aria-label*="close"],
  .maps-modal > button[aria-label*="Fermer"],
  .maps-modal > button[aria-label*="fermer"],
  .maps-modal > .maps-dialog-close,
  .maps-modal > .maps-modal-close,
  .maps-modal > .modal-close,
  .maps-modal > [data-dialog-close],
  .maps-modal > [data-modal-close] {
    top: 22px !important;
    right: 22px !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
  }
}
