/**
 * SynTekton Platform — Foundation Spatial Map Measure modal (Spike 6M)
 * Modal open/close uses is-open (preserved Measure on Map behavior).
 * Separate from legacy DIY .tkcc-map-* styles — Foundation adapter entry only.
 */

body.st-fnd-modal-open {
  overflow: hidden;
}

.st-fnd-map-control {
  margin: 12px 0;
}

.st-fnd-map-open {
  margin-right: 8px;
}

.st-fnd-map-status {
  margin: 8px 0;
  font-size: 13px;
}

.st-fnd-map-preview {
  margin: 8px 0;
  font-size: 13px;
  font-weight: 600;
}

.st-fnd-map-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100100;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.st-fnd-map-modal.is-open {
  display: grid;
}

.st-fnd-map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.st-fnd-map-panel {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  padding: 16px;
  box-sizing: border-box;
}

.st-fnd-map-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.st-fnd-map-header h3 {
  margin: 0 0 4px;
}

.st-fnd-map-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
}

.st-fnd-map-canvas {
  width: 100%;
  min-height: 460px;
  border: 1px solid #c3c4c7;
  background: #f7f9fb;
}

.st-fnd-map-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.st-fnd-map-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.st-fnd-map-canvas .mapboxgl-ctrl-group button {
  min-width: 29px;
}

@media (max-width: 700px) {
  .st-fnd-map-search,
  .st-fnd-map-summary {
    display: grid;
    grid-template-columns: 1fr;
  }
  .st-fnd-map-canvas {
    min-height: 360px;
  }
  .st-fnd-map-actions .button {
    width: 100%;
  }
}
