/* HGS Maps interactive map card. Layout: wrap container + panel in one parent (auto-gets .hgsmap-layout). */
.hgsmap-layout { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; align-items: start; }
.hgsmap-container { height: min(72vh, 680px); min-height: 360px; border: 1px solid #aab3be; border-radius: 4px; background: #e8edf2; z-index: 0; }
.hgsmap-container.hgsmap-measuring, .hgsmap-container.hgsmap-measuring .leaflet-interactive { cursor: crosshair; }
.hgsmap-panel { font-size: 14px; min-width: 0; }
.hgsmap-panel .hidden { display: none !important; }
.hgsmap-panel h3 { margin: 10px 0 6px; font-size: 15px; color: #1f5fa8; }
.hgsmap-panel h4 { margin: 8px 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: #5b6673; }
.hgsmap-toggle { display: none; width: 100%; min-height: 44px; text-align: left; }

.hgsmap-field { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; font-weight: 600; }
.hgsmap-field select { min-height: 44px; min-width: 0; width: 100%; font-weight: 400; }
.hgsmap-btn { min-width: 44px; min-height: 44px; padding: 4px 8px; font: inherit; font-size: 13px; border: 1px solid #1f5fa8; background: #fff; color: #1f5fa8; border-radius: 4px; cursor: pointer; }
.hgsmap-btn:hover { background: #e8f0fa; }
.hgsmap-btn:focus-visible, .hgsmap-toggle:focus-visible, .hgsmap-check input:focus-visible { outline: 3px solid #7fb0e8; outline-offset: 1px; }
.hgsmap-btn[aria-pressed="true"] { background: #1f5fa8; color: #fff; }
.hgsmap-btn-wide { width: 100%; }

.hgsmap-layer { padding: 0 0 2px; }
.hgsmap-check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 400; cursor: pointer; }
.hgsmap-check input { width: 20px; height: 20px; flex: none; }
.hgsmap-count, .hgsmap-note, .hgsmap-status { color: #5b6673; font-size: 12px; }
.hgsmap-note:empty { display: none; }
.hgsmap-opacity { width: 100%; min-height: 32px; }
.hgsmap-status { min-height: 18px; margin-top: 8px; }

.hgsmap-drawer { background: #fff; border: 2px solid #1f5fa8; border-radius: 6px; padding: 8px 10px; margin: 0 0 10px; max-height: 50vh; overflow: auto; }
.hgsmap-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.hgsmap-props { width: 100%; border-collapse: collapse; }
.hgsmap-props th { text-align: left; font-weight: 600; padding: 3px 8px 3px 0; vertical-align: top; white-space: nowrap; color: #5b6673; }
.hgsmap-props td { padding: 3px 0; overflow-wrap: anywhere; }
.hgsmap-props tr + tr { border-top: 1px solid #e3e7ec; }

/* map controls */
.hgsmap-ctl { background: rgba(255,255,255,.92); border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.hgsmap-tools { display: flex; flex-direction: column; gap: 2px; padding: 2px; }
.hgsmap-tools .hgsmap-btn { border-color: #cfd6de; }
.hgsmap-info { padding: 4px 8px; font: 12px/1.35 ui-monospace, Consolas, monospace; max-width: 70vw; }
.hgsmap-measure-out:not(:empty) { margin-top: 3px; padding-top: 3px; border-top: 1px solid #ccd; font-family: system-ui, sans-serif; font-weight: 600; color: #ad1457; }
.hgsmap-legend { max-width: 260px; max-height: calc(min(72vh, 680px) * .45); overflow: auto; padding: 4px 8px; font-size: 12px; }
.hgsmap-legend-btn { display: block; width: 100%; text-align: left; border: 0; background: transparent; font-weight: 700; }
.hgsmap-legend-collapsed .hgsmap-legend-body { display: none; }
.hgsmap-ltitle { font-weight: 700; margin: 6px 0 2px; }
.hgsmap-lnote { color: #5b6673; margin: 2px 0; }
.hgsmap-lrow { display: flex; align-items: center; gap: 6px; min-height: 18px; }
.hgsmap-sw { display: inline-block; flex: none; }
.hgsmap-sw-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #333; box-sizing: border-box; }
.hgsmap-sw-box { width: 16px; height: 12px; border: 1px solid #333; box-sizing: border-box; }
.hgsmap-sw-line { width: 20px; height: 0; border-top: 3px solid #1f5fa8; }
.hgsmap-sw-cluster { width: 16px; height: 16px; border-radius: 50%; }
.hgsmap-grad { height: 10px; border: 1px solid #888; }
.hgsmap-grad-lab { display: flex; justify-content: space-between; }

/* well markers */
.hgsmap-cluster { background: transparent; }
.hgsmap-cluster > div { width: 100%; height: 100%; border-radius: 50%; background: rgba(31,95,168,.85); border: 3px solid rgba(255,255,255,.8); box-sizing: border-box; color: #fff; font: 700 12px/1 system-ui, sans-serif; display: flex; align-items: center; justify-content: center; }
.hgsmap-tri-wrap { background: transparent; border: 0; }
.hgsmap-tri { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid #7570b3; filter: drop-shadow(0 0 1px #000); }

@media (max-width: 800px) {
  .hgsmap-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .hgsmap-container { height: 60vh; min-height: 300px; }
  .hgsmap-legend { max-height: 22vh; max-width: 50vw; font-size: 11px; overflow: auto; }
  .hgsmap-toggle { display: block; margin-top: 8px; }
  .hgsmap-body.hgsmap-collapsed { display: none; }
  .hgsmap-container .leaflet-bar a, .hgsmap-container .leaflet-control-layers-toggle { width: 44px; height: 44px; line-height: 44px; }
  .hgsmap-container .leaflet-bar a { font-size: 22px; }
}
@media (pointer: coarse) {
  .hgsmap-container .leaflet-bar a, .hgsmap-container .leaflet-control-layers-toggle { width: 44px; height: 44px; line-height: 44px; }
}
