/* Site coordinates are selected visually; Leaflet owns the actual marker position. */
.swal2-popup.kkm-panel.bpay-location-panel { position: relative; display: flex !important; flex-direction: column; width: min(780px, calc(100vw - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))) !important; max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); padding: 18px; }
.swal2-popup.kkm-panel.bpay-location-panel > .swal2-html-container { width: 100%; min-height: 0; max-height: calc(100dvh - 72px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); margin: 0; padding: 0; overflow-y: auto; }
.bpay-location-panel > .swal2-close { position: absolute; inset: 8px 8px auto auto; width: 44px; height: 44px; min-width: 44px; min-height: 44px; margin: 0; padding: 0; z-index: 2; }
#map-dialog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; width: 100%; min-width: 0; }
#map-dialog > :not(#save-map):not(#cancel-map) { grid-column: 1 / -1; min-width: 0; }
#map-dialog > h2 { margin: 0 0 10px; padding-right: 34px; font-size: 23px; line-height: 1.4; }
#map-dialog > p:first-of-type { margin: 0 0 14px; font-size: 14px; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }
#map-dialog .map-basemap-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 9px; }
#map-dialog .map-basemap-toolbar .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 1 1 140px; min-width: 0; min-height: 48px; margin: 0; font-size: 14px; line-height: 1.5; white-space: normal; }
#map-dialog .map-basemap-toolbar .button[aria-pressed="true"] { background: var(--brand, #A7441E); border-color: var(--brand, #A7441E); color: #fff; }
#map-dialog #site-basemap-status { margin: 0 0 10px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
#map-dialog #site-map { width: 100%; min-width: 0; min-height: 240px; height: clamp(240px, 46dvh, 440px); margin: 0 0 13px; border: 1px solid var(--line); border-radius: 12px; }
#map-dialog #map-coordinate { padding: 11px 13px; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--brand-soft); color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.6; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#map-dialog #map-accuracy { margin: 6px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
#map-dialog #map-accuracy:empty { margin-top: 0; }
#map-dialog .site-location-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
#map-dialog .site-location-tools:has(#map-google[hidden]) { grid-template-columns: minmax(0, 1fr); }
#map-dialog .site-location-tools > .button { display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; min-height: 48px; margin: 0; padding: 9px 10px; font-size: 14px; line-height: 1.5; white-space: normal; text-align: center; }
#map-dialog #save-map, #map-dialog #cancel-map { display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; min-height: 48px; margin: 0; padding: 10px 12px; font-size: 15px; line-height: 1.6; white-space: normal; }
#map-dialog #save-map { grid-column: 1; } #map-dialog #cancel-map { grid-column: 2; }
#map-dialog #site-map .site-location-pin { width: 32px; height: 40px; border: 0; background: transparent; border-radius: 0; cursor: grab; }
#map-dialog #site-map .site-location-pin:active { cursor: grabbing; }
#map-dialog #site-map .site-location-pin svg { display: block; width: 32px; height: 40px; max-width: none; overflow: visible; filter: drop-shadow(0 3px 3px #2c201c44); }
#map-dialog #site-map .site-location-pin:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; border-radius: 12px; }
#map-dialog #site-map .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; }
@media (max-width: 600px) {
  .swal2-popup.kkm-panel.bpay-location-panel { padding: 16px 12px; }
  #map-dialog .site-location-tools > .button { min-height: 44px; padding-inline: 8px; font-size: 13px; }
  #map-dialog > h2 { font-size: 21px; margin-bottom: 8px; }
  #map-dialog > p:first-of-type { font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
  #map-dialog .map-basemap-toolbar .button { flex-basis: 110px; min-height: 44px; padding: 9px 10px; font-size: 13px; }
  #map-dialog #site-map { height: clamp(240px, 42dvh, 360px); }
  #map-dialog #map-coordinate { padding: 10px 11px; font-size: 15px; }
  #map-dialog #map-accuracy { font-size: 12px; }
  #map-dialog #save-map, #map-dialog #cancel-map { min-height: 46px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { #map-dialog #site-map .site-location-pin { transition: none; } }
@media (max-width: 600px) and (max-height: 750px) {
  #map-dialog #site-map { height: 240px; }
}
