.map-canvas { position: absolute; inset: 0; isolation: isolate; background: var(--fill); }
.leaflet-container { background: var(--fill); font: inherit; }

:root[data-scheme="dark"] .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(1.45) contrast(.8) saturate(.5);
}

.leaflet-container .leaflet-control-attribution {
  padding: 2px 7px;
  border-radius: 7px 0 0 0;
  background: rgba(255, 255, 255, .85);
  color: #333;
  font-size: 11px;
}

.leaflet-container .leaflet-control-attribution a { color: #1a5fb4; }

:root[data-scheme="dark"] .leaflet-container .leaflet-control-attribution {
  background: rgba(20, 22, 26, .85);
  color: #ccc;
}

:root[data-scheme="dark"] .leaflet-container .leaflet-control-attribution a { color: #8bbcff; }

/* Markers are zero-sized icons with the content centred on the point. */
.marker { width: 0; height: 0; }

.price-pin,
.cluster,
.flat-pin,
.place-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.price-pin {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 14px;
  background: #fff;
  color: #14161a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
}

.price-pin .icon { width: 11px; height: 11px; fill: #f0435c; stroke: none; }
.price-pin.fresh { border-color: #1976d9; background: #1976d9; color: #fff; }
.price-pin.matched { border-color: #f0435c; background: #f0435c; color: #fff; }
.price-pin.matched .icon { fill: #fff; }

.cluster {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 7px;
  border: 3px solid rgba(255, 255, 255, .92);
  border-radius: 20px;
  background: #27313f;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  font-size: 14px;
  font-weight: 750;
}

.price-pin.selected,
.cluster.selected { border-color: #fff; background: #e6393f; color: #fff; }

.flat-pin {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #1976d9;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.flat-pin .icon { width: 22px; height: 22px; }

.place-pin { width: 26px; height: 26px; }

.place-dot {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
}

.place-pin .place-dot { border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.place-dot .icon { width: 14px; height: 14px; }
.metro > .place-dot, .place-dot.metro { background: #d8343f; }
.grocery > .place-dot, .place-dot.grocery { background: #22915a; }
.mall > .place-dot, .place-dot.mall { background: #8650c7; }
.pharmacy > .place-dot, .place-dot.pharmacy { background: #168f99; }

.place-name {
  position: absolute;
  top: 50%;
  left: 29px;
  max-width: 120px;
  padding: 2px 6px;
  overflow: hidden;
  transform: translateY(-50%);
  border-radius: 6px;
  background: rgba(255, 255, 255, .92);
  color: #14161a;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
}

.place-name.leftwards { right: 29px; left: auto; }

/* Detail map */

.mini-map {
  position: relative;
  height: 230px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 13px;
  background: var(--fill);
}

.map-cover { position: absolute; z-index: 600; inset: 0; width: 100%; }

.map-expand {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.map-expand .icon { width: 18px; height: 18px; }
.places { margin-top: 6px; }

.place {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 50px;
  padding: 6px 0;
  text-align: left;
}

.place + .place { border-top: 1px solid var(--line); }
.place-text { flex: 1; min-width: 0; }

.place-text b {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-text small { color: var(--muted); font-size: 12px; }
.place-distance { flex: none; color: var(--muted); font-size: 14px; }

.full-map { background: var(--bg); }

.full-map-top,
.map-top {
  position: absolute;
  z-index: 2;
  top: calc(var(--safe-top) + 10px);
  left: calc(var(--safe-left) + 10px);
  right: calc(var(--safe-right) + 10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.full-map-top > *,
.map-top > * { pointer-events: auto; }

.map-caption,
.map-count {
  min-width: 0;
  padding: 9px 13px;
  overflow: hidden;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-count .more { min-height: 0; font-size: 13px; }
.map-top .pill { box-shadow: var(--shadow); }
.map-view .leaflet-top.leaflet-right { top: calc(var(--safe-top) + 56px); }

.map-preview {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 22px;
  display: none;
  gap: 8px;
  padding: 8px 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 10px;
  scrollbar-width: none;
}

.map-preview::-webkit-scrollbar { display: none; }
.map-preview.show { display: flex; }

.mini-card {
  position: relative;
  flex: 0 0 100%;
  overflow: hidden;
  scroll-snap-align: start;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mini-card:not(:only-child) { flex-basis: 90%; }
.mini-card.bone { position: relative; height: 162px; }
.mini-open { display: flex; width: 100%; height: 118px; text-align: left; }

.mini-photo {
  display: grid;
  flex: none;
  position: relative;
  place-items: center;
  width: 118px;
  height: 100%;
  background: var(--fill);
  color: var(--muted);
}

.mini-photo img { width: 118px; height: 118px; object-fit: cover; }

.mini-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  height: 100%;
  padding: 8px 10px;
  font-size: 13px;
}

.mini-text > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-text strong { padding-right: 36px; font-size: 19px; }

.mini-text .mini-wishes { display: flex; gap: 4px; margin-top: 3px; }

.mini-wishes > span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 5px;
  border-radius: 7px;
  background: var(--state-bg);
  color: var(--state);
  font-size: 11px;
  font-weight: 650;
}

.mini-wishes .icon { width: 11px; height: 11px; stroke-width: 3; }
.mini-like { position: absolute; top: 2px; right: 2px; }
