:root {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0d1a2c;
  --surface-2: #122238;
  --surface-3: #182b45;
  --text: #f4f7fb;
  --muted: #9cadc4;
  --line: rgba(163, 184, 213, 0.18);
  --accent: #f2ba4c;
  --accent-strong: #ffd675;
  --danger: #ff7676;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  --z1: #b85e30;
  --z2: #198467;
  --z3: #b28414;
  --z4: #7561bb;
  --z5: #287eb4;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  background:
    radial-gradient(circle at 15% -10%, rgba(40, 126, 180, 0.16), transparent 34%),
    var(--bg);
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 31, 0.93);
  backdrop-filter: blur(16px);
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 186, 76, 0.56);
  border-radius: 12px;
  color: var(--accent-strong);
  background: linear-gradient(145deg, rgba(242, 186, 76, 0.2), rgba(242, 186, 76, 0.04));
  font-weight: 900;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.update-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #cad6e6;
  background: rgba(18, 34, 56, 0.86);
  font-size: 0.72rem;
  font-weight: 700;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 26, 44, 0.96);
  z-index: 999;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-52%);
  color: var(--muted);
  font-size: 1.35rem;
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 42px 0 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(7, 17, 31, 0.74);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-wrap input:focus {
  border-color: rgba(242, 186, 76, 0.72);
  box-shadow: 0 0 0 3px rgba(242, 186, 76, 0.12);
}

.search-wrap input::placeholder { color: #7f91aa; }

.clear-search {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
}

.clear-search:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.view-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 17, 31, 0.62);
}

.view-button {
  height: 32px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.view-button.active {
  color: #1b1b18;
  background: var(--accent);
}

.zone-strip {
  display: flex;
  gap: 8px;
  padding: 9px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 31, 0.94);
  z-index: 998;
}
.zone-strip::-webkit-scrollbar { display: none; }

.zone-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b8c5d7;
  background: rgba(18, 34, 56, 0.62);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.zone-chip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--chip-color, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--chip-color, var(--accent)) 20%, transparent);
}

.zone-chip.active {
  color: var(--text);
  border-color: var(--chip-color, rgba(242, 186, 76, 0.78));
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 18%, var(--surface));
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
}

.directory-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(10, 22, 39, 0.97);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 10px;
}

.panel-heading h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.result-count {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(242, 186, 76, 0.12);
  font-size: 0.78rem;
  font-weight: 900;
}

.coverage-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 12px 10px;
  padding: 10px 11px;
  border: 1px solid rgba(25, 132, 103, 0.32);
  border-radius: 12px;
  background: rgba(25, 132, 103, 0.09);
}

.coverage-note > span {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #d9fff3;
  background: #198467;
  font-size: 0.72rem;
  font-weight: 900;
}

.coverage-note p {
  margin: 0;
  color: #abcabc;
  font-size: 0.74rem;
  line-height: 1.4;
}

.community-list {
  display: grid;
  gap: 9px;
  padding: 2px 12px 16px;
}

.community-card {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  text-align: left;
  background: rgba(18, 34, 56, 0.7);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.community-card:hover,
.community-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(242, 186, 76, 0.42);
  background: rgba(24, 43, 69, 0.88);
  outline: none;
}

.zone-badge-large {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--zone-color) 70%, white 8%);
  border-radius: 12px;
  color: white;
  background: color-mix(in srgb, var(--zone-color) 78%, #07111f);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--zone-color) 28%, transparent);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}

.community-copy { min-width: 0; }
.community-copy h3 {
  margin: 0 0 4px;
  overflow: hidden;
  color: #f7f9fc;
  font-size: 0.92rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-copy p {
  margin: 0 0 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mini-badge,
.detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid rgba(151, 174, 205, 0.16);
  border-radius: 999px;
  color: #b8c8dc;
  background: rgba(5, 14, 26, 0.44);
  font-size: 0.62rem;
  font-weight: 800;
}

.mini-badge.verified,
.detail-badge.verified {
  color: #b9f6df;
  border-color: rgba(25, 132, 103, 0.35);
  background: rgba(25, 132, 103, 0.11);
}

.mini-badge.needs,
.detail-badge.needs {
  color: #ffe2a5;
  border-color: rgba(178, 132, 20, 0.4);
  background: rgba(178, 132, 20, 0.12);
}

.card-arrow {
  color: #6f829b;
  font-size: 1.15rem;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
}

.sources-card {
  margin: auto 12px 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 17, 31, 0.65);
}

.sources-card h3 { margin-bottom: 7px; font-size: 0.84rem; }
.sources-card p { margin-bottom: 7px; color: var(--muted); font-size: 0.7rem; line-height: 1.45; }
.sources-card .fine-print { color: #d0b988; }
.sources-card summary { color: #c6d4e5; cursor: pointer; font-size: 0.72rem; font-weight: 800; }
.sources-card ul { margin: 9px 0 0; padding-left: 18px; }
.sources-card li { margin: 6px 0; }
.sources-card a { color: #8ac6f2; font-size: 0.7rem; }

.map-panel { position: relative; min-width: 0; min-height: 0; }
.map { width: 100%; height: 100%; background: #091425; }

.map-key {
  position: absolute;
  z-index: 500;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(151, 174, 205, 0.25);
  border-radius: 11px;
  color: #c5d2e3;
  background: rgba(7, 17, 31, 0.88);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  font-size: 0.66rem;
  font-weight: 750;
  pointer-events: none;
}

.map-key span { display: inline-flex; align-items: center; gap: 6px; }
.pin-sample { width: 10px; height: 10px; border-radius: 50% 50% 50% 0; background: var(--accent); transform: rotate(-45deg); }
.boundary-sample { width: 18px; height: 0; border-top: 3px solid #f1f5fa; opacity: 0.85; }

.leaflet-container { font-family: inherit; }
.leaflet-control-zoom a,
.leaflet-control-layers {
  border-color: var(--line) !important;
  color: var(--text) !important;
  background: rgba(7, 17, 31, 0.9) !important;
}
.leaflet-control-zoom a:hover { background: var(--surface-3) !important; }
.leaflet-control-layers-expanded { color: var(--text); }
.leaflet-control-layers label { color: #d4deeb; }
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  color: var(--text);
  background: #0e1b2e;
  box-shadow: var(--shadow);
}
.leaflet-popup-content { margin: 13px 14px; }
.leaflet-popup-close-button { color: #b8c6d8 !important; }

.popup-card { min-width: 210px; }
.popup-card .eyebrow { margin-bottom: 4px; }
.popup-card h3 { margin: 0 0 5px; font-size: 0.94rem; }
.popup-card p { margin: 0 0 10px; color: var(--muted); font-size: 0.72rem; line-height: 1.35; }
.popup-card button {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 9px;
  color: #171715;
  background: var(--accent);
  font-size: 0.73rem;
  font-weight: 900;
  cursor: pointer;
}

.community-pin-wrap {
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
}

.community-pin-name {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 170px;
  min-height: 28px;
  padding: 4px 8px 4px 4px;
  border: 1px solid color-mix(in srgb, var(--zone-color) 76%, white);
  border-radius: 999px;
  color: #f8fbff;
  background: color-mix(in srgb, var(--zone-color) 88%, #07111f);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.46);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.05;
}

.community-pin-name::after {
  content: '';
  position: absolute;
  left: 8px;
  bottom: -7px;
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-top-color: var(--zone-color);
}

.community-pin-dot {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: var(--zone-color);
}

.community-pin-text {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.zone-map-label-wrap { background: transparent; border: 0; }
.zone-map-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  color: white;
  background: color-mix(in srgb, var(--zone-color) 88%, #07111f);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.38);
  font-size: 0.66rem;
  font-weight: 900;
  white-space: nowrap;
}

.detail-dialog {
  width: min(1180px, calc(100vw - 28px));
  height: min(850px, calc(100dvh - 28px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(151, 174, 205, 0.3);
  border-radius: 20px;
  color: var(--text);
  background: #091526;
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.62);
}

.detail-dialog::backdrop {
  background: rgba(1, 7, 14, 0.78);
  backdrop-filter: blur(8px);
}

.detail-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.detail-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 26, 44, 0.98);
}

.close-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #d5dfec;
  background: #101f34;
  font-size: 1.3rem;
  cursor: pointer;
}
.close-button:hover { background: #192b45; }

.detail-title-block { min-width: 0; }
.detail-title-block h2 { margin: 4px 0 3px; font-size: clamp(1.05rem, 2.5vw, 1.45rem); }
.detail-title-block > p { margin: 0; overflow: hidden; color: var(--muted); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 5px; }

.directions-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  color: #181713;
  background: var(--accent);
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 900;
}

.detail-content {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
}

.detail-map-section {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
}

.detail-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(7, 17, 31, 0.88);
}
.detail-map-toolbar h3 { margin: 0; font-size: 0.98rem; }
.zoom-hint { color: var(--muted); font-size: 0.66rem; }
.layout-map { min-height: 320px; background: #0c1727; }

.layout-alert {
  position: absolute;
  z-index: 500;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(178, 132, 20, 0.42);
  border-radius: 11px;
  color: #f8d993;
  background: rgba(44, 34, 12, 0.92);
  box-shadow: 0 9px 28px rgba(0, 0, 0, 0.36);
  font-size: 0.72rem;
  line-height: 1.4;
}

.layout-label-wrap,
.unit-label-wrap { background: transparent; border: 0; }
.layout-label {
  position: relative;
  display: inline-flex;
  min-width: 40px;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border: 2px solid white;
  border-radius: 9px;
  color: white;
  background: var(--zone-color, #b28414);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.45);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.unit-label {
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 23px;
  padding: 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 7px;
  color: #0b1320;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  font-size: 0.58rem;
  font-weight: 900;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.unit-popup strong { display: block; margin-bottom: 4px; }
.unit-popup span { color: var(--muted); font-size: 0.72rem; }

.detail-info {
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background: #0b1729;
}

.summary-card,
.operations-card,
.contact-card,
.notes-card,
.directory-card,
.source-summary {
  margin-bottom: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 34, 56, 0.62);
}

.summary-card > p { margin-bottom: 12px; color: #cbd6e5; font-size: 0.78rem; line-height: 1.48; }

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.card-title-row h3 { margin: 0; font-size: 0.82rem; }

.access-badge {
  display: inline-flex;
  align-items: center;
  max-width: 58%;
  padding: 4px 7px;
  border: 1px solid rgba(151, 174, 205, 0.25);
  border-radius: 999px;
  color: #c8d4e4;
  background: rgba(7, 17, 31, 0.5);
  font-size: 0.58rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: right;
}

.access-badge.confirmed {
  color: #ffd6d6;
  border-color: rgba(255, 118, 118, 0.42);
  background: rgba(121, 30, 30, 0.22);
}

.access-badge.reported {
  color: #ffe1a0;
  border-color: rgba(242, 186, 76, 0.42);
  background: rgba(178, 132, 20, 0.15);
}

.access-badge.open {
  color: #b9f6df;
  border-color: rgba(25, 132, 103, 0.35);
  background: rgba(25, 132, 103, 0.11);
}

.access-copy {
  margin: 0 0 10px;
  color: #cad5e4;
  font-size: 0.72rem;
  line-height: 1.45;
}

.field-label {
  display: block;
  margin-bottom: 3px;
  color: #8ea0b8;
  font-size: 0.57rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.numbering-block {
  padding: 9px 10px;
  border: 1px solid rgba(151, 174, 205, 0.13);
  border-radius: 10px;
  background: rgba(7, 17, 31, 0.4);
}

.numbering-block p {
  margin: 0;
  color: #d7e0eb;
  font-size: 0.7rem;
  line-height: 1.42;
}

.gate-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(242, 186, 76, 0.34);
  border-radius: 10px;
  color: #d6c28f;
  background: rgba(242, 186, 76, 0.09);
  font-size: 0.68rem;
  font-weight: 800;
}

.gate-code-row code {
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  font-weight: 900;
}

.entrance-list { display: grid; gap: 7px; margin-top: 9px; }

.entrance-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid rgba(40, 126, 180, 0.32);
  border-radius: 10px;
  color: #e6f4ff;
  background: rgba(40, 126, 180, 0.11);
  text-decoration: none;
}

.entrance-button:hover { border-color: rgba(138, 198, 242, 0.62); background: rgba(40, 126, 180, 0.18); }
.entrance-icon { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px; color: #07111f; background: #8ac6f2; font-weight: 900; }
.entrance-button strong { display: block; font-size: 0.69rem; }
.entrance-button small { display: block; margin-top: 2px; color: #9cb7ce; font-size: 0.58rem; }

.verified-date { color: #8ea0b8; font-size: 0.57rem; line-height: 1.3; text-align: right; }
.contact-row { padding: 7px 0; border-top: 1px solid rgba(151, 174, 205, 0.11); }
.contact-row:first-of-type { border-top: 0; }
.contact-row > span:not(.field-label),
.contact-row > a { color: #d7e0eb; font-size: 0.7rem; line-height: 1.42; }
.contact-row > a { display: inline-flex; align-items: center; min-height: 28px; color: #9bd5ff; font-size: 0.78rem; font-weight: 900; text-decoration: none; }
.contact-row.urgent > a { color: #ffd38a; }
.contact-website { display: inline-flex; margin-top: 8px; color: #8ac6f2; font-size: 0.67rem; font-weight: 850; text-decoration: none; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.metric {
  min-width: 0;
  padding: 9px 7px;
  border: 1px solid rgba(151, 174, 205, 0.12);
  border-radius: 10px;
  background: rgba(7, 17, 31, 0.45);
  text-align: center;
}
.metric strong { display: block; margin-bottom: 2px; color: var(--accent-strong); font-size: 1rem; }
.metric span { color: var(--muted); font-size: 0.57rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

.notes-card h3,
.operations-card h3,
.contact-card h3,
.directory-card h3,
.source-summary h3 { margin-bottom: 8px; font-size: 0.82rem; }
.notes-card ul { margin: 0; padding-left: 18px; }
.notes-card li { margin: 5px 0; color: #d4bf94; font-size: 0.72rem; line-height: 1.42; }

.directory-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.directory-card-heading span { color: var(--muted); font-size: 0.66rem; }

.building-row {
  display: grid;
  grid-template-columns: minmax(78px, auto) minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(151, 174, 205, 0.12);
}
.building-row:first-child { border-top: 0; }
.building-name { color: #f3f6fa; font-size: 0.7rem; font-weight: 900; line-height: 1.35; }
.unit-list { display: flex; flex-wrap: wrap; gap: 4px; }
.unit-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 6px;
  color: #c9d7e8;
  background: rgba(7, 17, 31, 0.64);
  font-size: 0.58rem;
  font-weight: 800;
}
.no-unit-copy { color: var(--muted); font-size: 0.66rem; line-height: 1.35; }

.source-summary { margin-bottom: 0; }
.source-summary p { margin: 0; color: var(--muted); font-size: 0.68rem; line-height: 1.45; }

.toast {
  position: fixed;
  z-index: 3000;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  max-width: min(420px, calc(100vw - 30px));
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(7, 17, 31, 0.95);
  box-shadow: var(--shadow);
  font-size: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .topbar { min-height: 64px; padding: 9px 12px; }
  .brand-mark { width: 38px; height: 38px; }
  .update-pill { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .toolbar { grid-template-columns: 1fr; gap: 8px; padding: 8px 10px; }
  .view-switch { width: 100%; }
  .view-button { flex: 1; }
  .zone-strip { padding: 8px 10px; }
  .workspace { display: block; position: relative; }
  .directory-panel,
  .map-panel { position: absolute; inset: 0; }
  .directory-panel { border-right: 0; }
  .app[data-mobile-view="map"] .directory-panel { display: none; }
  .app[data-mobile-view="list"] .map-panel { display: none; }
  .panel-heading { padding-top: 15px; }
  .detail-dialog {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .detail-content { grid-template-columns: 1fr; grid-template-rows: minmax(400px, 54dvh) auto; overflow-y: auto; }
  .detail-map-section { min-height: 400px; border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-info { overflow: visible; }
}

@media (min-width: 861px) {
  .app[data-desktop-view="list"] .workspace { grid-template-columns: 1fr; }
  .app[data-desktop-view="list"] .map-panel { display: none; }
  .app[data-desktop-view="list"] .directory-panel { border-right: 0; }
  .app[data-desktop-view="list"] .community-list {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    padding: 4px 18px 18px;
  }
  .app[data-desktop-view="list"] .sources-card { margin-left: 18px; margin-right: 18px; }
}

@media (max-width: 520px) {
  .topbar .eyebrow { display: none; }
  .update-pill { font-size: 0.63rem; }
  .map-key { right: 10px; left: 10px; justify-content: center; }
  .detail-header { grid-template-columns: auto minmax(0, 1fr); padding: 10px; }
  .directions-button { grid-column: 2; width: fit-content; height: 32px; margin-top: -4px; }
  .detail-map-toolbar { align-items: flex-start; }
  .zoom-hint { max-width: 115px; text-align: right; }
  .metric-grid { gap: 5px; }
  .metric { padding: 8px 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
