/* ── PERMITS & PROJECTS ─────────────────────────────────────────────── */
#tabPm .pm-coverage-tag { display: block; white-space: normal; font-size: 10px; line-height: 1.4; }
#pmCoverageResults { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; color: var(--text2); font-size: 13px; line-height: 1.6; }
#pmCoverageResults[hidden] { display: none; }
#pmCoverageResults.pm-coverage-answer { display: block; padding: 12px; border: 1px solid #fb923c; border-radius: 8px; background: #332315; color: #fdba74; font-size: 14px; font-weight: 600; }
#pmCoverageResults.pm-coverage-unavailable { border-color: #f87171; color: #fca5a5; background: #351b23; }
#pmCoverageResults .pm-coverage-choice { display: block; margin-top: 10px; }
.pm-coverage-field { grid-column: span 2; }
.pm-coverage-choice { background: #152944; color: var(--text); border: 1px solid var(--border2); border-radius: 8px; padding: 10px 12px; text-align: left; cursor: pointer; font: inherit; }
.pm-coverage-choice span { display: block; font-size: 11px; color: var(--text2); }
.pm-coverage-choice:hover, .pm-coverage-choice:focus-visible { border-color: #5b9cf6; }
.pm-area { position: relative; z-index: 2; max-width: 1180px; margin: 28px auto 0; padding: 0 24px 48px; }
.pm-filters {
  background: rgba(19,34,56,0.92); border: 1px solid var(--border2); border-radius: var(--radius);
  padding: 16px; box-shadow: 0 4px 24px rgba(0,0,0,0.3); backdrop-filter: blur(10px);
}
.pm-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; }
.pm-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pm-field label { font-size: 10.5px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .07em; }
.pm-field select, .pm-field input {
  width: 100%; background: var(--card2); border: 1px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--text); font: inherit; font-size: 13px; padding: 9px 10px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.pm-field select:focus, .pm-field input:focus { border-color: rgba(91,156,246,.55); box-shadow: 0 0 0 3px rgba(91,156,246,.1); }
.pm-field select:disabled { opacity: .5; cursor: not-allowed; }
.pm-hint { font-size: 11.5px; color: var(--text3); margin-top: 10px; line-height: 1.5; }
.pm-hint strong { color: var(--text2); font-weight: 600; }
.pm-type-note { font-size: 11px; color: var(--yellow-text); margin-top: 6px; display: none; }
.pm-go { white-space: nowrap; height: 38px; }
.pm-coverage-field input[type=search] { font-size: 16px; }
.pm-coverage-out { margin-top: 2px; }
.pm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 10px; }
.pm-summary { font-size: 13px; color: var(--text2); flex: 1; min-width: 200px; }
.pm-summary b { color: var(--text); }
.pm-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pm-src { font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--green-border); background: var(--green-dim); color: var(--green-text); }
.pm-src.bad { border-color: var(--red-border); background: var(--red-dim); color: var(--red-text); }
.pm-banner { font-size: 12.5px; padding: 9px 12px; border-radius: var(--radius-sm); margin-bottom: 10px; border: 1px solid var(--yellow-border); background: var(--yellow-dim); color: var(--yellow-text); }
.pm-list { display: flex; flex-direction: column; gap: 8px; }
.pm-card {
  background: rgba(19,34,56,0.9); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 15px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px;
  animation: pmIn .25s ease both;
}
@keyframes pmIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pm-card:hover { border-color: var(--border2); }
.pm-addr { font-weight: 600; font-size: 14px; color: var(--text); }
.pm-meta { font-size: 11.5px; color: var(--text3); display: flex; gap: 10px; flex-wrap: wrap; }
.pm-tag { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 5px; background: var(--primary-dim); border: 1px solid var(--primary-border); color: #a8c4f0; }
.pm-desc { grid-column: 1 / -1; font-size: 12.5px; color: var(--text2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pm-parties { grid-column: 1 / -1; font-size: 11.5px; color: var(--text2); }
.pm-parties span { color: var(--text3); }
.pm-right { text-align: right; font-size: 11.5px; color: var(--text3); display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.pm-right a { color: var(--primary); text-decoration: none; font-weight: 600; }
.pm-right a:hover { text-decoration: underline; }
.pm-nocoord { font-size: 10.5px; color: var(--yellow-text); }
.pm-more { display: block; margin: 14px auto 0; }
.pm-state { text-align: center; padding: 44px 20px; background: rgba(19,34,56,0.7); border: 1px dashed var(--border2); border-radius: var(--radius); }
.pm-state h3 { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: 16px; color: var(--text); margin-bottom: 6px; }
.pm-state p { font-size: 13px; color: var(--text2); max-width: 520px; margin: 0 auto 14px; line-height: 1.55; }
.pm-skel { height: 86px; border-radius: var(--radius-sm); background: linear-gradient(90deg, rgba(23,41,68,.7) 25%, rgba(31,51,82,.9) 50%, rgba(23,41,68,.7) 75%); background-size: 200% 100%; animation: pmShimmer 1.3s linear infinite; }
@keyframes pmShimmer { to { background-position: -200% 0; } }
#pmMapWrap { position: relative; height: calc(100vh - 300px); min-height: 460px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border2); }
#pmMapEl { width: 100%; height: 100%; }
.pm-map-note { position: absolute; left: 12px; bottom: 12px; z-index: 1000; font-size: 12px; color: var(--text2); background: rgba(14,24,42,.92); border: 1px solid var(--border2); border-radius: 18px; padding: 6px 13px; }
.pm-map-err { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--text2); font-size: 13px; background: rgba(11,22,41,.9); z-index: 1001; }
.pm-pin { width: 13px; height: 13px; border-radius: 50%; background: #5b9cf6; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 2px 6px rgba(0,0,0,.5); }
@media (max-width: 960px) { .pm-filter-grid { grid-template-columns: 1fr 1fr; } .pm-go { grid-column: 1 / -1; } }
@media (max-width: 768px) {
  .pm-coverage-field { grid-column: auto; }
  .pm-area { padding: 0 14px 40px; }
  .pm-filter-grid { grid-template-columns: 1fr; }
  .pm-card { grid-template-columns: 1fr; }
  .pm-right { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; gap: 10px; }
  #pmMapWrap { height: 60vh; min-height: 320px; }
}

/* ── Results destination + mobile overflow containment (shared) ───── */
.result-anchor, #pmResultsTop { scroll-margin-top: 16px; }
.pm-searching { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text); }
.pm-searching::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #5b9cf6; animation: pmPulse 1s ease-in-out infinite alternate; }
@keyframes pmPulse { from { opacity: .35; transform: scale(.8); } to { opacity: 1; transform: scale(1.15); } }
html, body { max-width: 100%; overflow-x: clip; }
.search-area::before { max-width: 100vw; }
.cards-grid > *, .gs-cards > *, .pm-list > *, .pm-card > * { min-width: 0; }
.pm-addr, .pm-desc, .pm-parties, .pm-meta span { overflow-wrap: anywhere; }
table { max-width: 100%; }
.table-scroll, .results-area table, .gs-results-area table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
  .cards-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .results-area, .gs-results-area, .pm-area { max-width: 100vw; overflow-x: clip; }
  .results-area *, .gs-results-area * { max-width: 100%; }
  .results-area .leaflet-container *, .gs-results-area .leaflet-container * { max-width: none; }
  .card, .gs-card { min-width: 0; overflow-wrap: anywhere; }
}
