/* Scoped preview widget; the active homepage and original map stay untouched. */
.map-interactive { margin-top: 28px; }
.map-workspace { min-width: 0; }
.map-stage { position: relative; width: 100%; aspect-ratio: 1400 / 860; overflow: hidden; border-radius: 8px; }
.dtd-target-map { display: block; width: 100%; height: 100%; overflow: hidden; }
/* Treat map labels as controls during dragging; surrounding page text stays selectable. */
.map-stage, .map-stage * { -webkit-user-select: none; user-select: none; }
#Page .dtd-target-map a { font-family: inherit; font-size: inherit; font-weight: inherit; fill: inherit; text-decoration: none; cursor: pointer; }
.dtd-target-map .target-location > path { pointer-events: none; }
.dtd-target-map .target-location > rect { stroke: transparent; stroke-width: 2; }
.dtd-target-map .target-location:hover > rect, .dtd-target-map .target-location:focus > rect { stroke: #f7941d; fill: #293640; }
.dtd-target-map .target-location:focus { outline: none; }
.dtd-target-map .map-pin-link:hover { stroke: #fff; }
.map-ready .map-stage { cursor: grab; touch-action: none; }
.map-ready .map-stage.is-dragging { cursor: grabbing; }
.map-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px; border: 1px solid #52616d; border-radius: 8px; background: #152129; }
.map-toolbar[hidden], .map-help[hidden] { display: none; }
.map-zoom-controls { display: flex; gap: 8px; }
#Page .map-toolbar button, .map-dialog button { min-width: 48px; min-height: 48px; margin: 0; padding: 10px 15px; border: 1px solid #748590; border-radius: 5px; background: #23333e; color: #fff; font: 600 16px/1.4 system-ui,sans-serif; cursor: pointer; }
#Page .map-toolbar button:hover, .map-dialog button:hover { border-color: #f7941d; background: #354651; }
#Page .map-toolbar button:focus-visible, .map-dialog button:focus-visible, .map-dialog a:focus-visible { outline: 3px solid #f7941d; outline-offset: 3px; }
#Page .map-toolbar button:disabled, .map-dialog button:disabled { opacity: .5; cursor: default; }
#Page .map-toolbar .map-expand { margin-left: auto; background: #f7941d; border-color: #f7941d; color: #111; }
#Page .map-toolbar .map-expand:hover { background: #ffad46; color: #111; }
.map-zoom-level { color: #d7e1e8; font: 500 14px/1.5 system-ui,sans-serif; min-width: 40px; }
#Page .map-help, .map-dialog .map-help { margin: 12px 0 8px; color: #bdc8d1; font: 400 14px/1.6 system-ui,sans-serif; text-align: center; }
.map-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; padding: 0; margin: 0; border: 0; background: #141d24; color: #f4f6f7; overscroll-behavior: contain; }
.map-dialog:not([open]) { display: none; }
.map-dialog[open] { display: flex; flex-direction: column; }
.map-dialog::backdrop { background: #10161c; }
.map-dialog-heading { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left)); border-bottom: 1px solid #52616d; }
#Page .map-dialog-heading h2 { margin: 0; color: #f4f6f7; font: 600 22px/1.3 system-ui,sans-serif; }
.map-dialog-slot { flex: 1; min-height: 0; display: flex; padding: 12px 18px 0; }
.map-dialog .map-workspace { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; }
.map-dialog .map-stage { flex: 1; min-height: 0; aspect-ratio: auto; }
.map-dialog .map-expand { display: none; }
.map-dialog .map-toolbar { flex: 0 0 auto; justify-content: center; }
.map-dialog-legend { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px 24px; padding: 12px 18px max(16px, env(safe-area-inset-bottom)); color: #d7dee4; font: 400 14px/1.6 system-ui,sans-serif; }
.map-dialog-legend > span { display: inline-flex; align-items: center; gap: 10px; }
.map-dialog-legend a { color: #f9b15b; font: inherit; text-decoration: underline; text-underline-offset: .18em; }
body.map-view-open { overflow: hidden; }
@media (max-width: 768px), (pointer: coarse) {
  .map-interactive { margin-top: 22px; }
  #Page .map-interactive:not(.is-expanded) .map-expand { width: 100%; margin: 0; }
  .map-interactive:not(.is-expanded) .map-stage { touch-action: pan-y; }
  .map-interactive:not(.is-expanded) .map-stage.is-zoomed { touch-action: none; }
  .map-zoom-controls, .map-zoom-level { display: none; }
  .map-interactive:not(.is-expanded) .map-toolbar { border: 0; background: transparent; padding: 0; }
  .map-dialog .map-toolbar { display: none; }
  #Page .map-dialog-heading h2 { font-size: 20px; }
  .map-dialog-slot { padding: 10px 12px 0; }
  .map-toolbar { gap: 10px; padding: 10px; }
}
@media (max-height: 500px) {
  .map-dialog .map-help { display: none; }
  .map-dialog-heading { padding-top: 8px; padding-bottom: 8px; }
  .map-dialog-legend { padding-top: 8px; padding-bottom: 8px; }
}
