.map-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(16, 28, 39, .9);
  box-shadow: var(--shadow);
}

.map-heading { align-items: flex-end; margin-bottom: 14px; }
.map-heading > div:first-child { min-width: 0; }
.map-heading p { overflow: hidden; text-overflow: ellipsis; }

.map-actions { display: flex; align-items: center; gap: 7px; }

.center-map, .map-tool, .map-size {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 39px;
  padding: 9px 12px !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px;
  background: #0b1620 !important;
  color: var(--text) !important;
}
.map-tool { width: 39px; padding: 0 !important; font-size: 1.25rem !important; font-weight: 750 !important; }
.map-size { color: var(--accent) !important; white-space: nowrap; }
.map-size b { font-size: .78rem; }

.map-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid #304454;
  border-radius: 17px;
  background: #0b1620;
}

.map-frame #map {
  width: 100%;
  height: clamp(340px, 46vh, 520px);
  z-index: 1;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 17px;
  margin-top: 12px;
  color: var(--muted);
  font-size: .74rem;
}

.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-legend i { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 7px; font-style: normal; font-weight: 900; }
.legend-shell { background: #ffd400; color: #d71920; }
.legend-aral { background: #1265a8; color: #fff; }
.legend-ionity { background: #691cff; color: #fff; }
.legend-enbw { background: #ffd419; color: #111; }
.leaflet-container { font-family: inherit; }
.leaflet-control-zoom a { background: #10202d !important; color: #fff !important; border-color: #2e4657 !important; }
.leaflet-control-attribution { background: rgba(255, 255, 255, .9) !important; color: #22313b !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #0d1923; color: var(--text); }
.leaflet-popup-content { margin: 13px 15px; min-width: 190px; }
.map-popup strong, .map-popup span { display: block; }
.map-popup span { margin-top: 4px; color: #a9bac5; font-size: .77rem; }
.map-popup a { display: block; margin-top: 11px; padding: 8px 10px; border-radius: 9px; background: var(--accent); color: #062017; text-align: center; text-decoration: none; font-weight: 800; }
.provider-pin, .search-pin, .destination-pin { display: grid; place-items: center; border: 3px solid #fff; border-radius: 13px; box-shadow: 0 5px 15px rgba(0, 0, 0, .38); font-size: 14px; font-weight: 950; }
.search-pin { border-radius: 50%; background: #25a6ff; color: #fff; box-shadow: 0 0 0 7px rgba(37, 166, 255, .22), 0 5px 15px rgba(0, 0, 0, .35); font-size: 18px; }
.destination-pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 8px; transform: rotate(-45deg); background: #ffbb3e; color: #17200a; font-size: 17px; }
.destination-pin b { transform: rotate(45deg); }
.provider-pin.recommended-pin { box-shadow: 0 0 0 7px rgba(66, 231, 190, .28), 0 6px 17px rgba(0, 0, 0, .42); }
.map-popup .popup-live { margin-top: 8px; color: #82f4d6; font-weight: 800; }
.map-popup .popup-live.unavailable { color: #91a5b5; font-weight: 650; }
.charger-card { cursor: pointer; }
.charger-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 16px 34px rgba(0, 0, 0, .25); }

body.map-is-expanded { overflow: hidden; }
.map-panel.map-expanded {
  position: fixed;
  z-index: 1400;
  inset: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  background: #071019;
}
.map-panel.map-expanded .map-frame { flex: 1; min-height: 0; }
.map-panel.map-expanded .map-frame #map { height: 100%; }
.map-panel.map-expanded .map-legend { flex: 0 0 auto; }

@media (max-width: 720px) {
  .map-panel { padding: 13px; }
  .map-frame #map { height: 390px; }
  .center-map { font-size: .75rem !important; }
  .map-heading { align-items: stretch; flex-direction: column; }
  .map-actions { width: 100%; }
  .center-map { flex: 1; }
  .map-size { margin-left: auto; }
  .map-panel.map-expanded .map-heading { flex: 0 0 auto; }
  .map-panel.map-expanded .map-heading p { white-space: nowrap; }
}

@media (max-width: 430px) {
  .map-size b { display: none; }
  .map-size { width: 39px; padding: 0 !important; }
}
