/* Berg Copper map: control panel in the style of the Telkwa map
   panel (telkwa-coal.ca/map/panel.css), adapted for phone widths. */
html, body { margin: 0; padding: 0; height: 100%; background: #e9eef0;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a; }
#map { position: absolute; inset: 0; }

#controls { position: absolute; top: 10px; right: 10px; z-index: 10;
  background: #fff; padding: 10px 12px; border-radius: 4px;
  box-shadow: 0 1px 4px #0006; font-size: 12px; width: 290px;
  max-height: calc(100% - 50px); overflow-y: auto; box-sizing: border-box; }
#controls b { font-size: 13px; }
#controls > summary { display: flex; align-items: center; gap: 8px;
  cursor: pointer; list-style: none; user-select: none; }
#controls > summary::-webkit-details-marker { display: none; }
#controls .burger { padding: 1px 7px; border: 1px solid #aaa;
  border-radius: 4px; background: #fff; font-size: 14px; line-height: 1.3; }
#controls:not([open]) { width: auto; }
.lede { margin: 8px 0 0; color: #333; }
.hd { font-size: 11px; color: #666; margin: 10px 0 4px; }
#basemap-btns { display: flex; gap: 4px; }
#basemap-btns .legend-btn { flex: 1; text-align: center; }
#layersec { margin: 8px 0 0; border-top: 1px solid #ddd; padding-top: 2px; }
#layer-buttons { display: flex; flex-direction: column; gap: 4px; }
.legend-btn { padding: 6px 9px; border: 1px solid #aaa; border-radius: 4px;
  background: #fff; color: #222; cursor: pointer; font: inherit;
  font-size: 12px; text-align: left; touch-action: manipulation; }
.legend-btn:hover { background: #f4f4f4; }
.legend-btn.active { background: #006893; color: #fff; border-color: #004f70; }
.legend-btn .tag { float: right; font-size: 10px; opacity: .8; }
.swatches { display: none; margin: 2px 0 4px 6px; font-size: 11px; color: #333; }
.legend-btn.active + .swatches { display: block; }
.swatches .row { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.sw { width: 12px; height: 12px; border: 2px solid; border-radius: 2px;
  flex: 0 0 12px; box-sizing: border-box; }
.sw.line { height: 0; border-width: 2px 0 0 0; border-radius: 0; width: 16px; flex-basis: 16px; }
.prov-legend .row { display: flex; gap: 6px; align-items: flex-start; margin: 3px 0; font-size: 11px; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px;
  margin-top: 2px; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #0004; }
.dot.measured { background: #b3261e; }
.dot.figure { background: #006893; }
.dot.reference { background: #56636e; }
.note { margin-top: 10px; font-size: 11px; color: #555; line-height: 1.45;
  border-top: 1px solid #ddd; }
.note p { margin: 6px 0; }
.note a, .maplibregl-popup-content a, dialog a { color: #006893; }

.pin { cursor: pointer; width: 26px; height: 36px; }
.pin svg { display: block; filter: drop-shadow(0 1px 1px #0005); }
.maplibregl-popup-content { font-size: 13px; line-height: 1.45;
  padding: 10px 12px; max-height: 50vh; overflow-y: auto; }
.maplibregl-popup-content h3 { margin: 0 22px 4px 0; font-size: 14px; }
.maplibregl-popup-content .prov { font-size: 11px; color: #555;
  margin: 0 0 6px; display: flex; gap: 6px; align-items: center; }
.maplibregl-popup-content p { margin: 4px 0; }
.maplibregl-popup-content .cite { font-size: 12px; margin-top: 6px; }
.maplibregl-popup-content .cite a { display: block; }
.maplibregl-popup-close-button { font-size: 18px; width: 26px; height: 26px; }

dialog { max-width: 560px; width: calc(100vw - 32px); box-sizing: border-box;
  border: 0; border-radius: 6px; box-shadow: 0 4px 20px #0006;
  padding: 16px 18px; font-size: 14px; line-height: 1.5; }
dialog h2 { margin: 0 0 8px; font-size: 17px; }
dialog .close { float: right; border: 0; background: none; font-size: 22px;
  cursor: pointer; line-height: 1; }
dialog::backdrop { background: #0005; }

@media (max-width: 600px) {
  #controls { top: 8px; right: 8px; left: 8px; width: auto;
    max-height: calc(100% - 60px); }
  #controls:not([open]) { left: auto; }
}
