/* Texas SWD Wells map - self-contained, neutral styles */
.swd-app, .swd-app * { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #222; background: #f6f6f4;
}
.swd-app {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  max-width: 1400px; margin: 0 auto; padding: 12px 16px;
}
.swd-header h1 { font-size: 1.45rem; margin: 0 0 2px; font-weight: 650; line-height: 1.2; }
.swd-sub { margin: 0 0 10px; color: #555; font-size: 0.92rem; }

.swd-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px;
  background: #fff; border: 1px solid #ddd; border-radius: 6px;
  padding: 10px 12px; margin-bottom: 10px;
}
.swd-field { display: flex; flex-direction: column; gap: 3px; font-size: 0.8rem; color: #555; min-width: 0; }
.swd-field span { font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: 0.72rem; }
.swd-field select {
  font: inherit; font-size: 0.92rem; color: #222;
  padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; background: #fff;
  width: 16rem; max-width: 100%;
}
#f-operator { width: 22rem; }
.swd-check { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; padding-bottom: 6px; cursor: pointer; }
.swd-check input { width: 16px; height: 16px; margin: 0; }
.swd-status { display: flex; align-items: center; gap: 10px; margin-left: auto; padding-bottom: 3px; }
#swd-count { font-size: 0.9rem; font-weight: 600; color: #333; white-space: nowrap; }
.swd-btn {
  font: inherit; font-size: 0.85rem; padding: 5px 12px; cursor: pointer;
  border: 1px solid #bbb; border-radius: 4px; background: #f3f3f3; color: #222;
}
.swd-btn:hover { background: #e8e8e8; }

.swd-map-wrap { flex: 1 1 auto; min-height: 360px; position: relative; }
#swd-map { position: absolute; inset: 0; border: 1px solid #ccc; border-radius: 6px; background: #e8e8e4; }

.swd-footer { font-size: 0.78rem; color: #555; padding-top: 8px; line-height: 1.4; }
.swd-footer p { margin: 0 0 2px; }
.swd-footer a { color: #1f4e9c; }
.swd-attr { color: #777; }

/* Legend */
.swd-legend {
  background: rgba(255,255,255,.93); padding: 8px 10px; border-radius: 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,.3); font-size: 12px; line-height: 1.5; color: #222;
}
.swd-legend h4 { margin: 0 0 4px; font-size: 12px; font-weight: 650; }
.swd-legend .row { display: flex; align-items: center; gap: 7px; }
.swd-legend svg { flex: none; }

/* Tooltip / popup content */
.swd-info { font-size: 12.5px; line-height: 1.45; min-width: 190px; }
.swd-info .nm { font-weight: 650; font-size: 13px; margin-bottom: 2px; }
.swd-info a { color: #1f4e9c; word-break: break-all; }
.swd-info .ll { color: #666; }
.leaflet-tooltip.swd-tip { padding: 6px 8px; }

@media (max-width: 720px) {
  .swd-app { padding: 8px; }
  .swd-header h1 { font-size: 1.15rem; }
  .swd-sub { display: none; }
  .swd-controls { gap: 8px; padding: 8px; }
  .swd-field { flex: 1 1 100%; }
  .swd-field select, #f-operator { width: 100%; }
  .swd-status { margin-left: 0; width: 100%; justify-content: space-between; }
  .swd-map-wrap { min-height: 55vh; }
  .swd-legend { font-size: 11px; padding: 6px 8px; }
}
