.map-shell {
  width: min(100%, var(--heop-page-max));
  margin-inline: auto;
  padding: 0.8rem var(--heop-gutter) 2.4rem;
}

.map-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, auto);
  gap: 0.85rem;
  align-items: center;
  padding: 0.45rem 0 0.75rem;
}

.map-hero-copy {
  min-width: 0;
}

.map-hero-copy p,
.map-hero-copy h1,
.map-hero-copy span {
  margin: 0;
}

.map-hero-copy p,
.map-results-heading p {
  color: var(--heop-orange);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.map-hero-copy h1 {
  margin-top: 0.12rem;
  color: var(--heop-forest);
  font-family: var(--heop-font);
  font-size: clamp(1.55rem, 3.7vw, 2.15rem);
  font-weight: 900;
  line-height: 1.05;
}

.map-hero-copy span {
  display: block;
  max-width: 32rem;
  margin-top: 0.22rem;
  color: rgba(27, 29, 24, 0.72);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.32;
}

.map-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: end;
  gap: 0.46rem;
  min-width: min(100%, 24rem);
}

.map-action-button,
.map-radius-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.38rem;
  border-radius: 10px;
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.map-action-button {
  gap: 0.34rem;
  min-width: 7.9rem;
  padding: 0 0.72rem;
  color: #fff;
  background: var(--heop-forest);
  border: 1px solid rgba(24, 57, 35, 0.16);
  box-shadow: 0 8px 18px rgba(36, 90, 59, 0.16);
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.map-action-button-secondary {
  color: var(--heop-forest);
  background: rgba(255, 253, 247, 0.86);
  border-color: rgba(223, 212, 195, 0.94);
  box-shadow: none;
}

.map-action-button:hover {
  background: var(--heop-forest-2);
  box-shadow: 0 10px 22px rgba(36, 90, 59, 0.2);
}

.map-action-button-secondary:hover {
  color: #fff;
}

.map-action-button:active {
  transform: scale(0.97);
}

.map-action-button svg {
  width: 0.98rem;
  height: 0.98rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.map-radius-control {
  gap: 0.42rem;
  padding: 0 0.58rem 0 0.68rem;
  color: var(--heop-ink);
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(223, 212, 195, 0.94);
}

.map-radius-control span {
  color: var(--heop-muted);
  white-space: nowrap;
}

.map-radius-control select {
  min-height: 1.8rem;
  color: var(--heop-forest);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 900;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 22.5rem);
  gap: 0.75rem;
  align-items: stretch;
}

.map-panel,
.map-results-panel {
  min-width: 0;
}

.map-panel {
  position: relative;
  display: block;
}

.local-map {
  width: 100%;
  height: clamp(25rem, 64vh, 40rem);
  min-height: 25rem;
  overflow: hidden;
  background: #dfe8dc;
  border: 1px solid rgba(223, 212, 195, 0.86);
  border-radius: 10px;
  box-shadow: none;
  isolation: isolate;
}

.leaflet-container {
  color: var(--heop-ink);
  font-family: var(--heop-font);
  letter-spacing: 0;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(255, 253, 247, 0.98);
  color: var(--heop-ink);
}

.leaflet-popup-content-wrapper {
  border: 1px solid rgba(223, 212, 195, 0.86);
  border-radius: var(--heop-radius);
  box-shadow: 0 16px 36px rgba(27, 29, 24, 0.16);
}

.leaflet-popup-content {
  width: 14rem;
  margin: 0.78rem;
}

.map-popup strong,
.map-popup span,
.map-popup small {
  display: block;
}

.map-popup strong {
  color: var(--heop-forest);
  font-size: 0.92rem;
  font-weight: 950;
}

.map-popup span {
  margin-top: 0.16rem;
  color: var(--heop-ink);
  font-size: 0.78rem;
  font-weight: 780;
}

.map-popup small {
  margin-top: 0.2rem;
  color: var(--heop-muted);
  font-size: 0.7rem;
  font-weight: 680;
  line-height: 1.32;
}

.map-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
  margin-top: 0.58rem;
}

.map-popup-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.72rem;
  padding: 0 0.58rem;
  color: #fff;
  background: var(--heop-forest);
  border-radius: 8px;
  font-size: 0.66rem;
  font-weight: 900;
  text-decoration: none;
}

.map-popup-actions a + a {
  color: var(--heop-forest);
  background: rgba(255, 253, 247, 0.96);
  border: 1px solid rgba(223, 212, 195, 0.86);
}

.map-popup-actions a:hover {
  color: #fff;
  background: var(--heop-orange);
}

.heop-pro-marker,
.heop-user-marker {
  background: transparent;
  border: 0;
}

.heop-pro-marker span,
.heop-user-marker span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(27, 29, 24, 0.18);
}

.heop-pro-marker span {
  background: var(--heop-orange);
  border: 3px solid #fffdf7;
}

.heop-user-marker span {
  background: var(--heop-forest);
  border: 4px solid #fffdf7;
  outline: 4px solid rgba(36, 90, 59, 0.22);
}

.map-legend {
  position: absolute;
  left: 0.58rem;
  bottom: 0.58rem;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
  color: var(--heop-muted);
  font-size: 0.68rem;
  font-weight: 760;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 1.42rem;
  padding: 0 0.48rem;
  background: rgba(255, 253, 247, 0.88);
  border: 1px solid rgba(223, 212, 195, 0.7);
  border-radius: 999px;
}

.legend-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
}

.legend-dot-user {
  background: var(--heop-forest);
}

.legend-dot-pro {
  background: var(--heop-orange);
}

.map-results-panel {
  display: flex;
  flex-direction: column;
  max-height: clamp(25rem, 64vh, 40rem);
  padding: 0.74rem;
  overflow: hidden;
  background: rgba(255, 253, 247, 0.88);
  border: 1px solid rgba(223, 212, 195, 0.86);
  border-radius: 10px;
  box-shadow: none;
}

.map-results-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.62rem;
  padding-bottom: 0.58rem;
  border-bottom: 1px solid rgba(95, 102, 93, 0.13);
}

.map-results-heading p,
.map-results-heading h2 {
  margin: 0;
}

.map-results-heading h2 {
  margin-top: 0.1rem;
  color: var(--heop-forest);
  font-family: var(--heop-font);
  font-size: 1.05rem;
  line-height: 1.05;
}

.map-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.86rem;
  height: 1.86rem;
  padding: 0 0.42rem;
  color: #fff;
  background: var(--heop-forest);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 950;
}

.map-heading-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.36rem;
}

.map-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 1.86rem;
  padding: 0 0.54rem;
  color: var(--heop-forest);
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid rgba(223, 212, 195, 0.88);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 920;
  box-shadow: 0 8px 18px rgba(27, 29, 24, 0.05);
}

.map-filter-toggle[aria-expanded="true"],
.map-filter-toggle.is-active {
  color: #fff;
  background: var(--heop-forest);
  border-color: var(--heop-forest);
}

.map-filter-toggle svg {
  width: 0.86rem;
  height: 0.86rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.map-filter-toggle strong {
  display: inline-grid;
  place-items: center;
  min-width: 1rem;
  height: 1rem;
  padding-inline: 0.24rem;
  color: var(--heop-forest);
  background: #fffdf7;
  border-radius: 999px;
  font-size: 0.58rem;
  line-height: 1;
}

.map-filter-panel[hidden] {
  display: none;
}

.map-filter-panel {
  display: grid;
  gap: 0.58rem;
  margin-top: 0.64rem;
  padding: 0.62rem;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(255, 248, 236, 0.92));
  border: 1px solid rgba(223, 212, 195, 0.84);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.map-filter-section {
  display: grid;
  gap: 0.34rem;
}

.map-filter-section > span {
  color: var(--heop-muted);
  font-size: 0.62rem;
  font-weight: 940;
  text-transform: uppercase;
}

.map-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.map-filter-chips:empty::before {
  content: "Aucune option";
  color: rgba(95, 102, 93, 0.66);
  font-size: 0.66rem;
  font-weight: 720;
}

.map-filter-chips button,
.map-filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.62rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 850;
}

.map-filter-chips button {
  padding: 0 0.48rem;
  color: var(--heop-forest);
  background: rgba(255, 253, 247, 0.84);
  border: 1px solid rgba(223, 212, 195, 0.78);
}

.map-filter-chips button.is-active {
  color: #fff;
  background: var(--heop-orange);
  border-color: var(--heop-orange);
}

.map-filter-chips button small {
  margin-left: 0.22rem;
  opacity: 0.78;
  font: inherit;
  font-size: 0.58rem;
}

.map-filter-clear {
  justify-self: start;
  padding: 0 0.58rem;
  color: var(--heop-muted);
  background: transparent;
  border: 1px dashed rgba(95, 102, 93, 0.28);
}

.map-filter-clear:hover {
  color: var(--heop-forest);
  border-color: rgba(36, 90, 59, 0.34);
}

.map-status {
  margin: 0.58rem 0;
  color: var(--heop-muted);
  font-size: 0.74rem;
  font-weight: 720;
  line-height: 1.36;
}

.map-results-list {
  display: grid;
  gap: 0.46rem;
  min-height: 0;
  overflow: auto;
  padding-right: 0.12rem;
}

.map-result-card {
  display: grid;
  gap: 0.34rem;
  padding: 0.64rem;
  background: rgba(255, 253, 247, 0.76);
  border: 1px solid rgba(223, 212, 195, 0.76);
  border-radius: 10px;
}

.map-result-card:focus-within,
.map-result-card:hover {
  border-color: rgba(200, 97, 56, 0.52);
  box-shadow: 0 8px 18px rgba(27, 29, 24, 0.06);
}

.map-result-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.6rem;
}

.map-result-card h3,
.map-result-card p,
.map-result-card small {
  margin: 0;
}

.map-result-card h3 {
  color: var(--heop-forest);
  font-size: 0.86rem;
  font-weight: 950;
  line-height: 1.16;
}

.map-result-distance {
  flex: 0 0 auto;
  color: var(--heop-orange);
  font-size: 0.74rem;
  font-weight: 950;
  white-space: nowrap;
}

.map-result-card p {
  color: rgba(27, 29, 24, 0.72);
  font-size: 0.7rem;
  font-weight: 690;
  line-height: 1.3;
}

.map-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.map-result-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 1.32rem;
  padding: 0 0.38rem;
  color: var(--heop-muted);
  background: rgba(255, 253, 247, 0.82);
  border: 1px solid rgba(223, 212, 195, 0.72);
  border-radius: 999px;
  font-size: 0.61rem;
  font-weight: 820;
}

.map-result-map-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  width: fit-content;
  min-height: 1.76rem;
  padding: 0 0.52rem;
  color: var(--heop-forest);
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(223, 212, 195, 0.86);
  border-radius: 8px;
  font-size: 0.64rem;
  font-weight: 900;
}

.map-result-map-button:hover {
  color: #fff;
  background: var(--heop-forest);
  border-color: var(--heop-forest);
}

.map-result-map-button svg {
  width: 0.86rem;
  height: 0.86rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.map-empty-state {
  display: grid;
  place-items: center;
  min-height: 8rem;
  padding: 1rem;
  color: var(--heop-muted);
  border: 1px dashed rgba(95, 102, 93, 0.26);
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 860px) {
  .map-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .map-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    min-width: 0;
  }

  .map-action-button,
  .map-radius-control {
    min-width: 0;
    width: 100%;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .local-map {
    height: clamp(24rem, 60vh, 34rem);
  }

  .map-results-panel {
    max-height: none;
  }

  .map-results-list {
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .map-page .app-header {
    padding-top: 0.42rem;
    padding-bottom: 0.42rem;
  }

  .map-page .topbar {
    grid-template-columns: 3.25rem minmax(0, 1fr) auto;
    gap: 0.42rem;
  }

  .map-page .brand-mark {
    min-height: 2.08rem;
    width: auto;
    justify-self: center;
    justify-items: center;
    justify-content: center;
  }

  .map-page .brand-mark img {
    width: 5.5rem;
  }

  .map-page .header-punchline,
  .map-page .header-search {
    display: none;
  }

  .map-page .top-actions {
    gap: 0.34rem;
  }

  .map-page .profile-button {
    width: 2.28rem;
    height: 2.28rem;
    border-width: 0.16rem;
    font-size: 0.74rem;
  }

  .map-page .icon-button {
    width: 2.08rem;
    height: 2.08rem;
  }

  .map-shell {
    padding-top: 0.3rem;
    padding-bottom: 2rem;
  }

  .map-hero {
    gap: 0.4rem;
    padding: 0.12rem 0 0.42rem;
  }

  .map-hero-copy {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.72rem;
  }

  .map-hero-copy p,
  .map-hero-copy span {
    display: none;
  }

  .map-hero-copy h1 {
    font-size: 1.36rem;
    line-height: 1.08;
  }

  .map-controls {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr) minmax(0, 1fr);
    gap: 0.3rem;
  }

  .map-action-button,
  .map-radius-control {
    min-width: 0;
    min-height: 2.02rem;
    padding-inline: 0.34rem;
    font-size: 0.66rem;
  }

  .map-radius-control {
    justify-content: space-between;
    gap: 0.18rem;
  }

  .map-action-button svg {
    width: 0.86rem;
    height: 0.86rem;
  }

  .map-radius-control select {
    min-width: 0;
    font-size: 0.66rem;
  }

  .local-map {
    height: clamp(18rem, 42svh, 22rem);
    min-height: 18rem;
  }

  .map-legend {
    left: 0.46rem;
    bottom: 0.46rem;
    max-width: calc(100% - 0.92rem);
  }

  .map-legend span {
    min-height: 1.32rem;
    padding-inline: 0.4rem;
  }

  .map-layout {
    gap: 0.58rem;
  }

  .map-results-panel {
    padding: 0.62rem;
  }

  .map-results-heading {
    align-items: center;
    padding-bottom: 0.46rem;
  }

  .map-results-heading p {
    display: none;
  }

  .map-heading-actions {
    gap: 0.28rem;
  }

  .map-filter-toggle {
    min-height: 1.74rem;
    padding-inline: 0.44rem;
    font-size: 0.62rem;
  }

  .map-filter-panel {
    gap: 0.48rem;
    margin-top: 0.5rem;
    padding: 0.52rem;
  }

  .map-filter-chips {
    gap: 0.26rem;
  }

  .map-filter-chips button,
  .map-filter-clear {
    min-height: 1.52rem;
    font-size: 0.6rem;
  }

  .map-status {
    margin: 0.42rem 0;
  }

  .map-result-card {
    padding: 0.58rem;
  }

  .map-result-card > p {
    display: none;
  }

  .map-result-meta span:nth-child(n + 3) {
    display: none;
  }
}

@media (max-width: 360px) {
  .map-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr) minmax(0, 0.92fr);
    gap: 0.22rem;
  }

  .map-action-button,
  .map-radius-control,
  .map-radius-control select {
    font-size: 0.6rem;
  }
}
