:root {
  --bg: #000;
  --ink: #f4f4f0;
  --muted: #8a8a94;
  --line: #1a1a22;
  --panel: rgba(0, 0, 0, 0.78);
  --lime: #c8ff00;
  --pink: #ff2d6a;
  --blue: #3d7eff;
  --blue-2: #7eb0ff;
  --orange: #ff8c00;
  --violet: #c45cff;
  --teal: #00ffd0;
  --glow-lime: 0 0 18px rgba(200, 255, 0, .55);
  --glow-pink: 0 0 18px rgba(255, 45, 106, .55);
  --glow-blue: 0 0 18px rgba(61, 126, 255, .55);
  --glow-teal: 0 0 18px rgba(0, 255, 208, .55);
  --serif: "Fraunces", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 12px;
  --hdr: 60px;
  --ftr: 36px;
  --A: #c8ff00;
  --B: #7eb0ff;
  --C: #ff2d6a;
  --open: #00ffd0;
  --closed: #8a8a94;
  --crit: #ff2d6a;
  --critbg: rgba(255, 45, 106, 0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  background: #000;
}
a { color: var(--blue-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--lime); }
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 0.95;
}
h1 { font-size: clamp(42px, 7vw, 88px); color: var(--lime); text-shadow: var(--glow-lime); }
h2 { font-size: clamp(28px, 4vw, 44px); color: var(--pink); text-shadow: var(--glow-pink); margin: 28px 0 12px; }
h3 { font-size: clamp(20px, 3vw, 28px); color: var(--teal); text-shadow: var(--glow-teal); }
.sr { position: absolute; left: -9999px; }
.muted { color: var(--muted); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--hdr);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: rgba(0, 0, 0, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex: none;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wordmark {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lime);
  text-decoration: none;
  text-shadow: var(--glow-lime);
  white-space: nowrap;
}
.wordmark:hover { color: #fff; text-shadow: var(--glow-lime); }
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: var(--glow-pink);
  flex-shrink: 0;
}
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lime);
  text-shadow: var(--glow-lime);
  margin: 0 0 14px;
}
nav { display: flex; flex-wrap: wrap; gap: 4px 4px; justify-content: flex-end; }
nav a {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
nav a:hover { color: var(--lime); }
nav a.active {
  color: var(--lime);
  border-color: var(--lime);
  box-shadow: var(--glow-lime);
  text-shadow: var(--glow-lime);
}

/* Views / map shell */
.view { flex: 1; min-height: 0; }
#view-map { display: flex; height: calc(100vh - var(--hdr) - var(--ftr)); background: #000; }
#view-map[hidden], .page[hidden] { display: none; }
#sidebar {
  width: 420px;
  max-width: 100%;
  background: var(--panel);
  border-right: 1px solid #1f1f28;
  box-shadow: 0 0 0 1px rgba(200, 255, 0, 0.06);
  overflow-y: auto;
  flex: none;
}
#map { flex: 1; min-height: 300px; background: #000; }

/* Filters / list */
#filters {
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2;
  border-bottom: 1px solid var(--line);
}
#filters input[type=search],
#filters select {
  font-family: var(--sans);
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #2a2a34;
  border-radius: 8px;
  background: #000;
  color: var(--ink);
  width: 100%;
  min-width: 0;
  min-height: 44px;
}
#filters input[type=search]::placeholder { color: #6a6a74; }
#filters input[type=search]:focus,
#filters select:focus {
  outline: 1px solid var(--lime);
  border-color: var(--lime);
  box-shadow: var(--glow-lime);
}
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.check {
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  min-height: 40px;
  flex: 1 1 100%;
  line-height: 1.3;
}
.check input { width: 18px; height: 18px; accent-color: var(--pink); flex: none; }
#result-count {
  padding: 8px 16px;
  font-size: 13px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}
#results { list-style: none; margin: 0; padding: 0; }
#results li a {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
#results li a:hover,
#results li a:focus { background: #0a0a10; color: inherit; }
.r-name { font-weight: 700; font-size: 15px; }
.r-latest { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--ink); margin: 3px 0 2px; }
.r-meta { font-size: 13px; color: var(--muted); }

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  vertical-align: 2px;
  margin-left: 6px;
  white-space: nowrap;
}
.b-open { color: var(--teal); box-shadow: 0 0 10px rgba(0, 255, 208, .28); }
.b-closed { color: var(--muted); }
.b-A { color: var(--lime); box-shadow: 0 0 10px rgba(200, 255, 0, .35); }
.b-B { color: var(--blue-2); box-shadow: 0 0 10px rgba(61, 126, 255, .4); }
.b-C { color: var(--pink); box-shadow: 0 0 10px rgba(255, 45, 106, .45); }
.b-crit { color: var(--pink); font-weight: 700; }
.b-clean { color: var(--lime); box-shadow: 0 0 10px rgba(200, 255, 0, .35); }

.btn-link, .back, .btn {
  background: #000;
  color: var(--lime);
  border: 1px solid var(--lime);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--glow-lime);
}
.btn-link { margin: 12px 16px 20px; }
.btn-link:hover, .back:hover, .btn:hover {
  background: var(--lime);
  color: #000;
  text-shadow: none;
}

/* Detail */
#detail-pane { padding: 16px 18px 30px; }
.back { margin-bottom: 16px; }
.d-name {
  scroll-margin-top: 96px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(28px, 4.4vw, 44px);
  color: var(--lime);
  text-shadow: var(--glow-lime);
  margin: 0 0 8px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.d-addr { margin: 0 0 8px; color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0; }
.fact {
  background: var(--panel);
  border: 1px solid #1f1f28;
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: 0 0 0 1px rgba(200, 255, 0, 0.08);
}
.fact b {
  display: block;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 26px;
  line-height: 1.1;
  color: var(--lime);
  text-shadow: var(--glow-lime);
}
.fact-pink { box-shadow: 0 0 0 1px rgba(255, 45, 106, 0.16); }
.fact-pink b { color: var(--pink); text-shadow: var(--glow-pink); }
.fact-teal { box-shadow: 0 0 0 1px rgba(0, 255, 208, 0.14); }
.fact-teal b { color: var(--teal); text-shadow: var(--glow-teal); }
.fact-blue { box-shadow: 0 0 0 1px rgba(61, 126, 255, 0.16); }
.fact-blue b { color: var(--blue-2); text-shadow: var(--glow-blue); }
.fact span {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; margin: 12px 0; }
dl.kv dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
dl.kv dd { margin: 0; }
.note {
  background: var(--panel);
  border: 1px solid #1f1f28;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  margin: 16px 0;
  box-shadow: 0 0 0 1px rgba(61, 126, 255, 0.1);
}
.note ul { margin: 8px 0 0; padding-left: 18px; }
h3.sec {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  text-shadow: var(--glow-teal);
  margin: 26px 0 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.insp {
  border: 1px solid #1f1f28;
  border-radius: var(--radius);
  margin: 10px 0;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(200, 255, 0, 0.05);
}
.insp-h {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #050506;
  border-bottom: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  flex-wrap: wrap;
}
.insp-h .date { font-weight: 700; color: var(--ink); }
.insp-h .cnt { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.vlist { list-style: none; margin: 0; padding: 4px 0; }
.vlist li { padding: 6px 12px; font-size: 14px; border-left: 3px solid transparent; }
.vlist li.crit { border-left-color: var(--pink); background: var(--critbg); }
.vlist .code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-right: 6px;
}
.vlist .ct {
  color: var(--pink);
  font-weight: 700;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 6px;
  text-shadow: 0 0 10px rgba(255, 45, 106, .45);
}
.none { padding: 10px 12px; font-size: 14px; color: var(--muted); }
.cmt {
  margin: 0;
  padding: 10px 12px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.cmt-l {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

/* Browse / about */
.page { overflow-y: auto; background: #000; }
.page-inner { max-width: 920px; margin: 0 auto; padding: 36px 20px 60px; }
.lede { font-size: 18px; color: var(--ink); max-width: 46rem; margin: 18px 0 28px; }
.prose { max-width: 760px; }
.prose li { margin: 8px 0; }
.prose code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--teal);
}
.disclaimer {
  background: var(--panel);
  border: 1px solid #1f1f28;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 0 0 1px rgba(255, 140, 0, 0.18);
}
.lists { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lcard {
  background: var(--panel);
  border: 1px solid #1f1f28;
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 0 0 1px rgba(200, 255, 0, 0.08);
}
.lcard h2 {
  font-size: clamp(22px, 3vw, 30px);
  margin: 0 0 6px;
  color: var(--lime);
  text-shadow: var(--glow-lime);
}
.lcard:nth-child(2) h2 { color: var(--pink); text-shadow: var(--glow-pink); }
.lcard:nth-child(3) h2 { color: var(--blue-2); text-shadow: var(--glow-blue); }
.lcard:nth-child(4) h2 { color: var(--teal); text-shadow: var(--glow-teal); }
.lcard p.desc { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.lcard ol { margin: 0; padding: 0; list-style: none; max-height: 520px; overflow-y: auto; }
.lcard li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.lcard li a { font-weight: 700; text-decoration: none; }
.lcard li .m { display: block; font-size: 12.5px; color: var(--muted); }

.site-footer {
  height: var(--ftr);
  flex: none;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 20px;
  border-top: 1px solid var(--line);
  background: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Latest inspection panel */
.latest-panel {
  background: var(--panel);
  border: 1px solid #1f1f28;
  border-radius: var(--radius);
  padding: 16px 16px 8px;
  margin: 16px 0 20px;
  box-shadow: 0 0 0 1px rgba(200, 255, 0, 0.14), var(--glow-lime);
}
.latest-panel.latest-crit {
  box-shadow: 0 0 0 1px rgba(255, 45, 106, 0.22), var(--glow-pink);
}
.latest-panel .eyebrow { margin-bottom: 8px; }
.latest-date {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--lime);
  text-shadow: var(--glow-lime);
  margin: 0 0 6px;
}
.latest-crit .latest-date { color: var(--pink); text-shadow: var(--glow-pink); }
.latest-type {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 12px;
}
.unofficial-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
}
.foot-note { font-size: 12.5px; margin-top: 18px; }

details.history {
  margin: 18px 0 8px;
  border: 1px solid #1f1f28;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(61, 126, 255, 0.1);
  padding: 0 12px 8px;
}
details.history summary {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-2);
  cursor: pointer;
  list-style: none;
  padding: 14px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
details.history summary::-webkit-details-marker { display: none; }
details.history summary::after {
  content: "+";
  color: var(--lime);
  font-size: 18px;
  line-height: 1;
  text-shadow: var(--glow-lime);
}
details.history[open] summary::after { content: "–"; }
details.history summary:hover { color: var(--lime); }
.hist-n {
  font-family: var(--mono);
  color: var(--lime);
  text-shadow: var(--glow-lime);
}
.leaflet-popup-content .r-latest { display: block; margin-top: 4px; color: var(--ink); }

/* Map pins, clusters, leaflet chrome */
.pin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #000; }
.leaflet-container { background: #000; font-family: var(--sans); }
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #000;
  color: var(--ink);
  border: 1px solid #1f1f28;
  box-shadow: 0 0 0 1px rgba(200, 255, 0, 0.12), 0 10px 40px rgba(0, 0, 0, 0.6);
  border-radius: 12px;
}
.leaflet-popup-content { font-size: 14px; margin: 10px 12px; }
.leaflet-popup-content a { font-weight: 700; }
.leaflet-popup-tip-container .leaflet-popup-tip { box-shadow: none; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--lime); }
.leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.72) !important;
  color: #6a6a74;
  font-size: 10px;
}
.leaflet-control-attribution a { color: #8a8a94; }
.leaflet-control-zoom a,
.leaflet-bar a {
  background: #000 !important;
  color: var(--lime) !important;
  border-color: #1f1f28 !important;
}
.leaflet-bar { border: 1px solid #1f1f28 !important; box-shadow: var(--glow-lime); }
.leaflet-bar a:hover { background: #111 !important; color: #fff !important; }
.leaflet-touch .leaflet-bar a { width: 36px; height: 36px; line-height: 36px; }

.nri-cluster {
  background: #000;
  border: 1.5px solid var(--lime);
  border-radius: 50%;
  color: var(--lime);
  font-family: var(--mono);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-lime);
}
.nri-cluster span { line-height: 1; }
.nri-cluster-small { width: 36px; height: 36px; font-size: 12px; }
.nri-cluster-medium {
  width: 44px;
  height: 44px;
  font-size: 13px;
  border-color: var(--blue);
  color: var(--blue-2);
  box-shadow: var(--glow-blue);
}
.nri-cluster-large {
  width: 54px;
  height: 54px;
  font-size: 14px;
  border-color: var(--pink);
  color: var(--pink);
  box-shadow: var(--glow-pink);
}
.marker-cluster { background: none !important; }
.marker-cluster div { background: none !important; }

@media (max-width: 820px) {
  :root { --hdr: auto; }
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 14px;
    gap: 8px;
    height: auto;
  }
  .kicker { display: none; }
  nav { width: 100%; justify-content: flex-start; }
  nav a { padding: 8px 10px; }
  html, body { height: auto; }
  body { display: block; }
  #view-map { display: flex; flex-direction: column; height: auto; min-height: 0; }
  #map { order: -1; height: 46vh; min-height: 240px; flex: none; }
  #sidebar { width: 100%; border-right: 0; border-top: 1px solid #1f1f28; overflow: visible; }
  #filters { position: static; }
  .row { flex-wrap: wrap; }
  .check { flex: 1 1 100%; }
  .lists { grid-template-columns: 1fr; }
  .site-footer { height: auto; white-space: normal; }
  .facts { grid-template-columns: 1fr 1fr; }
  h1 { font-size: clamp(36px, 11vw, 56px); }
}
@media (max-width: 420px) {
  .facts { grid-template-columns: 1fr; }
}
