/* permit-sonar app: small, local stylesheet; no framework, no CDN. */
:root {
  --ink: #1b1f23;
  --muted: #5c6670;
  --line: #d9dee3;
  --paper: #ffffff;
  --accent: #0b5cad;
  --soft: #f3f5f7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

main { max-width: 1400px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }

h1 { font-size: 1.5rem; margin: 0.5rem 0 1rem; }

a { color: var(--accent); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  padding: 0.75rem 1rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 1rem;
}

.filters label { display: grid; gap: 0.2rem; font-size: 0.85rem; color: var(--muted); }

.filters select, .filters input {
  font: inherit;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  min-width: 10rem;
}

.filters button {
  font: inherit;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--paper);
  cursor: pointer;
}

/* top bar: brand + navigation */
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: 0.55rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--soft); }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em; margin-right: auto; }
.brand-mark { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 6px; background: var(--accent); color: var(--paper); font-size: 0.75rem; font-weight: 700; }
.topnav { display: flex; gap: 0.25rem; }
.topnav a { text-decoration: none; font-weight: 600; color: var(--muted); padding: 0.3rem 0.7rem; border-radius: 4px; }
.topnav a:hover { color: var(--ink); background: var(--paper); }
.topnav a[aria-current="page"] { color: var(--accent); background: var(--paper); box-shadow: inset 0 -2px 0 var(--accent); }
/* Narrow phones: the bar wraps instead of overflowing (an overflowing page
   makes mobile browsers zoom out, and nothing is full screen any more). */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; gap: 0.4rem 0.75rem; padding: 0.5rem 0.75rem; }
  .topnav { gap: 0; }
  .topnav a { padding: 0.3rem 0.5rem; }
}

/* footer */
.foot { max-width: 1400px; margin: 0 auto; padding: 1rem 1.25rem 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }

/* home */
.hero .lede { font-size: 1.15rem; max-width: 46rem; margin: 0 0 0.5rem; }
.intro { color: var(--muted); max-width: 52rem; margin: -0.5rem 0 1rem; }
.stat { display: grid; gap: 0.15rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); }
.stat-value { font-size: 1.7rem; line-height: 1.1; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card { display: grid; gap: 0.35rem; align-content: start; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; }
.card:hover { border-color: var(--accent); box-shadow: 0 1px 4px rgba(11, 92, 173, 0.15); }
.card-audience { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.card-title { font-size: 1.15rem; color: var(--accent); }
.card-text { color: var(--muted); font-size: 0.9rem; }

/* market: heat map */
.map-section { margin: 0 0 1rem; }
#map { height: 60vh; min-height: 320px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); }
#map-note { margin: 0.4rem 0 0; font-size: 0.85rem; }

/* market: totals, ranking bars, ZIP x trade grid */
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.totals { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.totals li { padding: 0.25rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); font-size: 0.85rem; }
.total-label { color: var(--muted); }
.ranking td.zip a { font-weight: 600; }
.bar-col { min-width: 12rem; width: 24%; }
.bar { position: relative; height: 1.3rem; background: var(--soft); border-radius: 3px; overflow: hidden; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); opacity: 0.75; border-radius: 3px; }
.bar-value { position: absolute; inset: 0 0.4rem; display: flex; align-items: center; font-size: 0.8rem; font-weight: 600; }
.grid-wrap { overflow-x: auto; }
.grid { border-collapse: collapse; font-size: 0.85rem; }
.grid caption { text-align: left; color: var(--muted); padding-bottom: 0.4rem; }
.grid th, .grid td { border: 1px solid var(--line); padding: 0.3rem 0.45rem; text-align: center; vertical-align: bottom; }
.grid th[scope="row"] { text-align: left; white-space: nowrap; background: var(--soft); }
.grid th.rot { height: 7rem; white-space: nowrap; vertical-align: bottom; padding-bottom: 0.4rem; }
.grid th.rot span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; font-weight: 600; }
.grid td.num { text-align: right; }
.heat-0 { color: var(--muted); }
.heat-1 { background: #e3eefb; }
.heat-2 { background: #b9d3f3; }
.heat-3 { background: #7fb0e6; }
.heat-4 { background: #3f85cf; color: var(--paper); font-weight: 600; }
.chip { align-self: end; padding: 0.35rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 0.85rem; }

.count { margin: 0 0 0.5rem; color: var(--muted); }

/* coverage status */
.status { font-weight: 600; }
.status.active { color: #1d7a3a; }
.status.lagging { color: #a35f00; }
.status.stopped, .status.failing { color: #a81d1d; }
.status.no-data { color: var(--muted); }

.leads { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

.leads caption { text-align: left; color: var(--muted); padding-bottom: 0.4rem; }

.leads th, .leads td {
  text-align: left;
  vertical-align: top;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

.leads th { background: var(--soft); position: sticky; top: 0; }

.leads td.num { text-align: right; white-space: nowrap; }

.leads td.day { white-space: nowrap; }

.leads tr.stale td { color: var(--muted); }

.muted { color: var(--muted); }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  margin-left: 0.3rem;
  vertical-align: middle;
}

.approx { cursor: help; border-bottom: 1px dotted var(--muted); }

tr.more td { text-align: center; padding: 0.75rem; }

tr.more button {
  font: inherit;
  padding: 0.4rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--paper);
  color: var(--accent);
  cursor: pointer;
}

.alert {
  margin: 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid #c9a227;
  background: #fff8e1;
  border-radius: 4px;
}

.htmx-request .leads { opacity: 0.6; }

/* market: tabs, map legend, ZIP popup, contractors */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin: 0 0 1rem; }
.tabs a { padding: 0.45rem 0.9rem; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
#contractor-map { height: 50vh; min-height: 300px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); }
.map-caption { margin: 0.4rem 0 0; font-size: 0.85rem; }
.map-legend { background: rgba(255, 255, 255, 0.92); padding: 0.5rem 0.7rem; border-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); font-size: 0.8rem; color: var(--ink); max-width: 18rem; }
.legend-scale { display: flex; align-items: center; gap: 0.4rem; }
.legend-scale i { display: inline-block; width: 6rem; height: 0.6rem; border-radius: 3px; background: linear-gradient(to right, #0000ff, #00ffff, #00ff00, #ffff00, #ff0000); }
.legend-line { margin-top: 0.3rem; font-weight: 600; }
.legend-hint { margin-top: 0.2rem; color: var(--muted); }
.legend-list { list-style: none; margin: 0; padding: 0; }
.legend-list li { display: flex; align-items: center; gap: 0.4rem; line-height: 1.5; }
.legend-list i { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; }
.zip-popup { font-size: 0.85rem; line-height: 1.4; }
.ranking tbody tr[data-zip] { cursor: pointer; }
.ranking tbody tr[data-zip]:hover td { background: var(--soft); }
.honesty { margin: 0 0 0.75rem; padding: 0.5rem 0.8rem; border-left: 3px solid #c9a227; background: #fffbea; font-size: 0.9rem; }
.badge.new { color: #1d7a3a; border-color: #1d7a3a; }
.crumbs { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.9rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0 0 1rem; padding: 0.75rem 1rem; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.weeks { list-style: none; margin: 0 0 1rem; padding: 0; max-width: 40rem; }
.weeks li { display: grid; grid-template-columns: 11rem 1fr; gap: 0.5rem; align-items: center; margin-bottom: 0.25rem; }
.weeks .bar { display: block; position: relative; height: 1.2rem; background: var(--soft); border-radius: 3px; overflow: hidden; }
.week-label { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.legend-pick { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
.legend-list li.dim { opacity: 0.45; }
.contractors tbody tr[data-contractor] { cursor: pointer; }
.contractors tbody tr[data-contractor]:hover td { background: var(--soft); }
.contractors tbody tr.picked td { background: #e3eefb; }

/* Leaflet 1.9.4 blends tiles with "plus-lighter" (seam fix); in Chrome over RDP (no GPU) it tints the map: off. */
.leaflet-container img.leaflet-tile { mix-blend-mode: normal; }
#map, #contractor-map { background: #fff; }
/* legend names are buttons: left-aligned like a list of links */
.legend-pick { text-align: left; }

/* leads: search form extras, actions, radar setup */
.filters .inline { display: inline-flex; align-items: center; gap: 0.3rem; }
.filters .inline input[type="number"] { min-width: 4.5rem; width: 4.5rem; }
.filters .inline input[type="text"] { min-width: 6rem; width: 6rem; }
.filters label.check { display: flex; flex-direction: row; align-items: center; gap: 0.4rem; color: var(--ink); align-self: end; padding-bottom: 0.4rem; }
.button-link { align-self: end; padding: 0.35rem 0.9rem; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; align-items: baseline; }
.actions .links { margin: 0 0 0.5rem; font-size: 0.9rem; }
.radar-setup select[multiple] { min-width: 14rem; }
.small { font-size: 0.85rem; }

/* home: landing page */
.landing { max-width: none; padding: 0 0 3rem; }
.landing > section { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem; }
.hero-band { background: linear-gradient(135deg, #0b5cad 0%, #08498a 60%, #0a3f74 100%); color: #fff; }
.hero-band .hero-inner { max-width: 1100px; margin: 0 auto; padding: 3.5rem 1.25rem 3rem; }
.hero-band h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.15; margin: 0 0 0.75rem; max-width: 40rem; }
.hero-band .subhead { font-size: 1.15rem; max-width: 40rem; margin: 0 0 1.5rem; opacity: 0.92; }
.hero-band .eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; opacity: 0.85; margin: 0 0 0.75rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn { display: inline-block; padding: 0.7rem 1.3rem; border-radius: 6px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.btn-primary { background: #fff; color: var(--accent); }
.btn-primary:hover { background: #e9f1fb; }
.btn-secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #08498a; }
.proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; padding: 1.25rem 1.25rem !important; border-bottom: 1px solid var(--line); }
.proof .stat { background: var(--paper); border: 0; padding: 0.5rem 0.75rem; text-align: center; }
.proof .stat-value { font-size: 1.6rem; }
.landing h2 { font-size: 1.5rem; margin: 0 0 0.35rem; }
.landing .section-lede { color: var(--muted); margin: 0 0 1.25rem; max-width: 46rem; }
.audience { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.25rem; }
.audience .card { padding: 1.4rem 1.5rem; gap: 0.5rem; }
.audience .card ul { margin: 0.25rem 0 0; padding-left: 1.1rem; color: var(--ink); font-size: 0.95rem; }
.audience .card li { margin-bottom: 0.2rem; }
.audience .soon { color: var(--muted); font-size: 0.85rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem; counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li { position: relative; padding: 1.1rem 1.2rem 1.1rem 3.6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 1.1rem; top: 1rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.steps strong { display: block; margin-bottom: 0.25rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.samples { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.sample { border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; display: grid; gap: 0.3rem; background: var(--paper); }
.sample .sample-trade { font-weight: 700; color: var(--accent); }
.sample .sample-where { font-size: 0.95rem; }
.sample .sample-meta { color: var(--muted); font-size: 0.85rem; }
.section-foot { margin: 1.25rem 0 0; }
.county-list { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0 0 1rem; padding: 0; }
.county-list li { padding: 0.25rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); font-size: 0.9rem; }
.final-cta { text-align: center; background: var(--soft); border-top: 1px solid var(--line); }
.final-cta h2 { margin-bottom: 0.5rem; }
.final-cta p { color: var(--muted); margin: 0 0 1rem; }
@media (max-width: 600px) { .hero-band .hero-inner { padding: 2.5rem 1rem 2rem; } .landing > section { padding: 1.5rem 1rem; } }

/* leads: job sites (Spike 2) */
.sites-headline { margin: 0 0 1rem; font-size: 1.05rem; }
.sites-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 38%); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .sites-layout { grid-template-columns: 1fr; } .sites-map-pane { order: -1; } }
.sites-map-pane { position: sticky; top: 0.75rem; }
#sites-map { height: 70vh; min-height: 320px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
@media (max-width: 900px) { #sites-map { height: 40vh; } .sites-map-pane { position: static; } }
.legend-inline { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; list-style: none; margin: 0.4rem 0 0; padding: 0; font-size: 0.85rem; color: var(--muted); }
.pin-sample { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; vertical-align: -1px; }
.pin-sample.today, .block-dot.today { background: #d1495b; }
.pin-sample.week, .block-dot.week { background: #0b5cad; }
.pin-sample.multi { background: #fff; border: 3px solid #1b1f23; box-sizing: border-box; }
.site-block { margin: 0 0 1.5rem; }
.site-block h2 { display: flex; align-items: center; gap: 0.5rem; font-size: 1.2rem; margin: 0 0 0.6rem; }
.block-dot { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; }
.site-cards { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.site-card { padding: 22px 20px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.site-card:last-of-type { border-bottom: 0; }
.site-card:hover, .site-card:focus { background: #f7f9fc; outline: none; }
.site-card p { margin: 0; }
.site-what { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; font-size: 1.02rem; line-height: 1.3; }
.site-what strong { font-weight: 600; }
.site-what .badge { margin-left: 0.4rem; vertical-align: middle; }
.trade-tag { display: inline-block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 2px; }
.site-value { font-weight: 700; white-space: nowrap; }
.site-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 0.9rem; }
.site-meta .grow { flex: 1; }
.site-where { color: var(--muted); }
.site-contractor { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid #c9d6e8; border-radius: 999px; padding: 0 10px; font-size: 0.85rem; font-weight: 600; background: #eef3fa; color: #1f3b5c; }
.chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 0 9px; font-size: 0.82rem; background: #f3f5f8; color: var(--ink); }
.chip.open { background: #e7f4ea; border-color: #b9dcc2; color: #1d7a3a; font-weight: 600; }
.show-more { display: block; margin: 10px auto; font: inherit; padding: 0.45rem 1.2rem; border: 1px solid var(--accent); border-radius: 4px; background: var(--paper); color: var(--accent); cursor: pointer; }
.site-pin span { display: block; border-radius: 50%; color: #fff; font-weight: 700; font-size: 0.8rem; text-align: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); opacity: 0.92; }
.site-pin.active span { transform: scale(1.3); opacity: 1; box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.35); }
.site-pin.multi span { border: 3px solid #1b1f23; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.35); }

/* Radar rows open the details overlay */
.site-row { cursor: pointer; }
.site-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.detail-toggle { font: inherit; font-size: 0.85rem; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.detail-toggle::after { content: " \25B8"; }

/* Map pin mini-card (Leaflet popup) */
.pin-card { display: grid; gap: 6px; font: 0.9rem/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); }
.pin-card strong { font-weight: 600; }
.pin-where { color: var(--muted); }
.pin-value { font-weight: 700; }
.pin-card .site-contractor, .pin-card .chip { justify-self: start; }
.pin-details { font-weight: 600; margin-top: 2px; }
.leaflet-popup-content { margin: 12px 14px; }

/* The details overlay: one native <dialog>, modal, over the list and the map */
.site-dialog { padding: 0; border: 0; border-radius: 12px; width: min(960px, calc(100vw - 2rem)); max-width: none; max-height: calc(100vh - 3rem); background: var(--paper); color: var(--ink); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); }
.site-dialog::backdrop { background: rgba(27, 31, 35, 0.55); }
body.dialog-open { overflow: hidden; }
.sd-panel { position: relative; display: flex; flex-direction: column; max-height: calc(100vh - 3rem); }
.sd-bar { position: absolute; top: 12px; right: 12px; z-index: 1; display: flex; align-items: center; gap: 0.5rem; }
.sd-back { display: none; }
.sd-close { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 26px/1 system-ui, sans-serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.sd-close:hover, .sd-close:focus-visible { background: var(--soft); outline: 2px solid var(--accent); outline-offset: 1px; }
.sd-body { overflow: auto; padding: 22px 26px 28px; }
.sd-loading { margin: 1rem 0; }
.sd-head { padding-right: 56px; }
.sd-head h2 { margin: 0; font-size: 1.35rem; line-height: 1.25; }
.sd-where { margin: 4px 0 0; color: var(--muted); }
.sd-permits { display: grid; gap: 16px; margin-top: 18px; }
.permit-detail { display: grid; gap: 8px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); font-size: 0.95rem; }
.pd-head { display: flex; justify-content: space-between; gap: 0.75rem; margin: 0; }
.pd-head strong { font-size: 1.05rem; }
.pd-status { color: var(--muted); white-space: nowrap; }
.pd-desc { margin: 0; color: var(--ink); }
.pd-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); gap: 6px 14px; margin: 4px 0 0; }
.pd-facts dt { color: var(--muted); }
.pd-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .site-dialog { width: 100vw; height: 100vh; height: 100dvh; max-height: none; margin: 0; border-radius: 0; box-shadow: none; }
  .sd-panel { height: 100%; max-height: none; }
  .sd-bar { position: sticky; top: 0; right: auto; justify-content: space-between; padding: 8px 10px 8px 6px; border-bottom: 1px solid var(--line); background: var(--paper); }
  .sd-back { display: inline-flex; align-items: center; font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 8px 10px; cursor: pointer; }
  .sd-close { width: 36px; height: 36px; box-shadow: none; }
  .sd-body { padding: 16px 16px 28px; flex: 1; }
  .sd-head { padding-right: 0; }
  .permit-detail { padding: 14px; }
  .pd-facts { grid-template-columns: max-content minmax(0, 1fr); }
}

/* founder module (admin) */
.admin-bar { background: #1b2433; }
.admin-bar .brand, .admin-bar .topnav a { color: #fff; }
.admin main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.admin-card { border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1rem; background: var(--paper); display: grid; gap: 0.2rem; }
.admin-card span { color: var(--muted); font-size: 0.85rem; }
.admin-card strong { font-size: 1.6rem; }
.admin-card small { color: var(--muted); }
.admin-card.nota-a { border-left: 5px solid #1d7a3a; }
.admin-card.nota-b { border-left: 5px solid #d39e00; }
.admin-card.nota-c { border-left: 5px solid #c0392b; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 800px) { .admin-cols { grid-template-columns: 1fr; } }
.admin-table { border-collapse: collapse; width: 100%; }
.admin-table td, .admin-table th { border-bottom: 1px solid var(--line); padding: 0.35rem 0.5rem; text-align: left; }
.admin-table .num { text-align: right; }
.admin-group { border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1rem; margin: 0 0 0.8rem; background: var(--paper); }
.admin-group-head { margin: 0 0 0.4rem; }
.admin-decided { color: #1d7a3a; margin: 0.3rem 0; }
.admin-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.admin-form input[type=text] { min-width: 18rem; padding: 0.35rem 0.5rem; }
.admin-form button { padding: 0.35rem 0.8rem; cursor: pointer; }
.admin-form button.secondary { background: #f3f5f8; }
.admin-bar .topnav a[aria-current="page"] { background: transparent; color: #fff; border-bottom: 2px solid #ff8c28; }
.admin-links a { margin-right: 0.6rem; }
