#map[ihb-map-canvas] {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--map-bg)
}

#map[ihb-map-canvas]  .leaflet-control-attribution {
  font-size: 9px !important
}

#map[ihb-map-canvas]  .leaflet-bottom.leaflet-left {
  bottom: 15px !important;
  left: 8px !important
}

@media(max-width:600px) {
  #map[ihb-map-canvas]  .leaflet-bottom.leaflet-left {
    bottom: calc(var(--journal-card-height, 80px) + 32px + env(safe-area-inset-bottom)) !important
  }
}

:root[data-theme="dark"] #map[ihb-map-canvas]  .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) saturate(.72) brightness(.82) contrast(1.08);
}

:root[data-theme="dark"] #map[ihb-map-canvas]  .leaflet-control-zoom a,
:root[data-theme="dark"] #map[ihb-map-canvas]  .leaflet-control-attribution,
:root[data-theme="dark"] #map[ihb-map-canvas]  .leaflet-tooltip,
:root[data-theme="dark"] #map[ihb-map-canvas]  .leaflet-popup-content-wrapper,
:root[data-theme="dark"] #map[ihb-map-canvas]  .leaflet-popup-tip {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme="dark"] #map[ihb-map-canvas]  .leaflet-tooltip-top:before {
  border-top-color: var(--panel);
}

:root[data-theme="dark"] #map[ihb-map-canvas]  .leaflet-tooltip-bottom:before {
  border-bottom-color: var(--panel);
}

:root[data-theme="dark"] #map[ihb-map-canvas]  .leaflet-tooltip-left:before {
  border-left-color: var(--panel);
}

:root[data-theme="dark"] #map[ihb-map-canvas]  .leaflet-tooltip-right:before {
  border-right-color: var(--panel);
}

#map[ihb-map-canvas]  .country-shape:focus {
  outline: none;
}

#map[ihb-map-canvas]  .country-shape:focus-visible {
  stroke: var(--focus);
  stroke-width: 3px;
}

.map-status[ihb-map-canvas] {
  position: fixed;
  bottom: 18px;
  left: 66px;
  max-width: min(600px, calc(100vw - 90px));
  z-index: 600;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.map-status:empty[ihb-map-canvas] {
  display: none;
}

@media(max-width:600px) {
  .map-status[ihb-map-canvas] {
    bottom: calc(var(--journal-card-height, 80px) + 38px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 85px);
    font-size: 11px;
  }
}
