.featured-body {
  margin-bottom: 1.35rem;
}

.map-preview {
  position: relative;
  min-width: 0;
}

.featured-body > .map-preview {
  height: 100%;
  min-height: 14rem;
}

.map-frame {
  position: relative;
  height: 100%;
  min-height: 0;
}

.map-canvas {
  width: 100%;
  height: 14rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--map-placeholder);
}

.featured-body > .map-preview .map-canvas {
  height: 100%;
}

.map-canvas--unavailable {
  display: grid;
  color: var(--muted);
  padding: 1rem;
  font-size: 0.78rem;
  text-align: center;
  place-items: center;
}

:root[data-theme="dark"] .map-canvas .leaflet-tile-pane {
  filter: invert(0.9) hue-rotate(180deg) brightness(0.82) contrast(0.9);
}

.map-canvas .leaflet-bar {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  box-shadow: 0 0.15rem 0.55rem rgba(20, 36, 29, 0.18);
}

.map-canvas .leaflet-bar a,
.map-canvas .leaflet-bar a:hover {
  width: 2rem;
  height: 2rem;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.9rem;
}

.map-canvas .leaflet-bar a:hover,
.map-canvas .leaflet-bar a:focus-visible {
  background: var(--detail);
  color: var(--accent-dark);
}

.map-canvas .leaflet-bar a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.map-canvas .leaflet-control-attribution {
  max-width: calc(100% - 3.5rem);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.25;
}

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

.catalog-map-marker {
  border: 0;
  background: transparent;
  color: var(--accent);
  filter: drop-shadow(0 0.18rem 0.2rem rgba(20, 36, 29, 0.35));
}

.catalog-map-marker--business {
  color: var(--company-icon);
}

.catalog-map-marker--place {
  color: var(--place-icon);
}

.catalog-map-marker svg {
  display: block;
  width: 30px;
  height: 42px;
  overflow: visible;
}

.catalog-map-marker path {
  fill: currentColor;
  stroke: var(--surface);
  stroke-width: 1.8;
}

.catalog-map-marker circle {
  fill: var(--surface);
  stroke: currentColor;
  stroke-width: 1.4;
}

.map-canvas .leaflet-popup-content-wrapper,
.map-canvas .leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
}

.map-canvas .leaflet-popup-content-wrapper {
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  box-shadow: 0 0.5rem 1.4rem var(--shadow);
}

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

.business-map-popup strong,
.place-map-popup strong {
  font-size: 0.82rem;
}

.business-map-popup span,
.place-map-popup span {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.map-expand-toggle {
  position: absolute;
  z-index: 1000;
  right: 0.65rem;
  bottom: 1.45rem;
  display: grid;
  width: 2.35rem;
  min-height: 2.35rem;
  border: 1px solid var(--accent-border);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: 0 0.2rem 0.7rem rgba(20, 36, 29, 0.18);
  color: var(--accent-dark);
  padding: 0;
  place-items: center;
}

.map-expand-toggle:hover,
.map-expand-toggle:focus-visible {
  border-color: var(--accent);
  background: var(--detail);
}

.map-expand-toggle:focus-visible {
  outline: 3px solid var(--accent-outline);
  outline-offset: 2px;
}

.map-expand-toggle .ui-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.featured-body--map-expanded {
  grid-template-columns: minmax(0, 1fr);
}

.featured-body--map-expanded > .map-preview {
  grid-column: 1 / -1;
  height: clamp(22rem, 52vh, 32rem);
}

.map-preview-link {
  position: absolute;
  top: calc(100% + 0.38rem);
  left: 0;
  display: inline-block;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
}

.result a.map-preview-link,
.result a.company-address-link {
  color: var(--map-link);
}

.company-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.map-item-toggle {
  display: inline-flex;
  width: auto;
  min-height: 1.9rem;
  gap: 0.3rem;
  align-items: center;
  border: 1px solid var(--map-link-border);
  border-radius: 0.42rem;
  background: var(--map-link-background);
  color: var(--map-link);
  padding: 0.3rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.15;
}

.map-item-toggle:hover,
.map-item-toggle:focus-visible,
.map-item-toggle--active {
  border-color: var(--map-link);
  background: color-mix(in srgb, var(--map-link-background) 65%, var(--detail));
  color: var(--map-link);
}

.map-item-toggle:focus-visible {
  outline: 3px solid var(--map-link-border);
  outline-offset: 2px;
}

.map-item-toggle .ui-icon {
  width: 0.85rem;
  height: 0.85rem;
}

.map-item-toggle:disabled {
  cursor: default;
  opacity: 1;
}

.side-result--mapped {
  border-color: var(--map-link-border);
  box-shadow: inset 0.2rem 0 0 var(--map-link);
}

@media (max-width: 40rem) {
  .featured-body {
    row-gap: 2rem;
    margin-bottom: 0;
  }

  .map-canvas {
    height: 13rem;
  }

  .featured-body > .map-preview {
    display: block;
    height: auto;
  }

  .featured-body > .map-preview .map-canvas {
    height: 13rem;
  }

  .map-expand-toggle {
    width: 2.35rem;
  }

  .featured-body--map-expanded > .map-preview {
    height: clamp(22rem, 65vh, 30rem);
  }

  .featured-body--map-expanded > .map-preview .map-canvas {
    height: 100%;
  }
}
