:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #667181;
  --line: #d8dee8;
  --panel: #ffffff;
  --soft: #f5f7fa;
  --accent: #1b6e86;
  --accent-strong: #0e4557;
  --point: #d44f3e;
  --point-stroke: #7f261e;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--soft);
}

body.intro-active {
  overflow: hidden;
}

body.zoom-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

.intro {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(rgba(7, 14, 20, 0.42), rgba(7, 14, 20, 0.56)),
    url("welcome_background_generated.png") center / cover;
  color: #fff;
}

.intro.hidden,
.intro[hidden] {
  display: none !important;
}

.intro-inner {
  width: min(880px, 100%);
}

.intro-menu {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
}

.menu-button {
  min-width: 86px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  background: rgba(7, 14, 20, 0.46);
  color: #fff;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.menu-button:hover,
.menu-button[aria-expanded="true"] {
  background: rgba(7, 14, 20, 0.72);
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  width: 220px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

.menu-panel[hidden] {
  display: none;
}

.menu-panel a {
  padding: 13px 15px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.menu-panel a + a {
  border-top: 1px solid var(--line);
}

.menu-panel a:hover {
  background: #eef4f7;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #b7e4ee;
}

.intro h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro-copy {
  max-width: 640px;
  margin: 22px 0 0;
  font-size: 19px;
  line-height: 1.5;
  color: #e8eef2;
}

.lab-line {
  margin: 18px 0 30px;
  color: #d7edf3;
  font-weight: 700;
}

.visit-card {
  position: absolute;
  right: 28px;
  bottom: 28px;
  display: grid;
  gap: 10px;
  width: min(410px, calc(100vw - 56px));
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(7, 14, 20, 0.42);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}

.visit-card p {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  font-size: 14px;
}

.visit-card span {
  color: #d5e4eb;
  font-weight: 700;
}

.visit-card strong {
  color: #fff;
  font-weight: 800;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  margin-top: 28px;
  border: 0;
  padding: 12px 18px;
  border-radius: 6px;
  background: #f3c14e;
  color: #1e252f;
  font-weight: 800;
  cursor: pointer;
}

.primary-action:hover {
  background: #ffd56e;
}

.secondary-action {
  justify-self: start;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  padding: 9px 13px;
  font-weight: 800;
  cursor: pointer;
}

.secondary-action:hover {
  background: rgba(255, 255, 255, 0.23);
}

.app-shell {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.welcome-action {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-strong);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.welcome-action:hover {
  border-color: #a7bac7;
  background: #f8fbfc;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(640px, 1.9fr);
  gap: 18px;
  align-items: end;
  padding: 14px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.08);
  z-index: 10;
}

.brand h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) repeat(3, minmax(112px, 1fr));
  gap: 10px;
  align-items: start;
}

.controls label,
.search-control label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.controls select,
.search-row input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 9px;
}

.search-control {
  min-width: 0;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.search-row button {
  min-height: 38px;
  border: 1px solid #165d72;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 7px 12px;
  font-weight: 800;
  cursor: pointer;
}

.search-row button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.search-status {
  min-height: 16px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.search-status[data-tone="ok"] {
  color: #0f766e;
}

.search-status[data-tone="error"] {
  color: #b42318;
}

.map-stage {
  position: relative;
  min-height: calc(100vh - 74px);
}

#map {
  position: absolute;
  inset: 0;
  background: #dfe8ef;
}

.summary-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1001;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 130px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.16);
}

.summary-panel h3 {
  margin: 0 0 8px;
  font-size: 17px;
  letter-spacing: 0;
}

.summary-panel p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.summary-panel dl,
.tooltip-block dl {
  display: grid;
  grid-template-columns: minmax(116px, 1fr) minmax(90px, auto);
  gap: 6px 12px;
  margin: 10px 0 0;
  font-size: 13px;
}

.summary-panel dt,
.tooltip-block dt {
  color: var(--muted);
}

.summary-panel dd,
.tooltip-block dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.map-color-panel {
  position: absolute;
  left: 16px;
  bottom: 20px;
  z-index: 1001;
  display: grid;
  gap: 8px;
  width: min(300px, calc(100vw - 32px));
}

.color-control {
  font-size: 12px;
}

.color-control summary {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--accent-strong);
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}

.color-control summary::-webkit-details-marker {
  display: none;
}

.color-control[open] summary {
  border-color: #a7bac7;
  background: #f8fbfc;
}

.color-control label {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
  color: var(--muted);
  font-weight: 800;
}

.color-control select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 9px;
  font-weight: 700;
}

.legend {
  min-width: 230px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
  font-size: 12px;
}

.legend-title {
  margin-bottom: 7px;
  color: var(--muted);
  font-weight: 800;
}

.legend-scale {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e9eef5, var(--accent));
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--muted);
}

.leaflet-tooltip.dc-tooltip {
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  white-space: normal;
}

.tooltip-block {
  max-width: 340px;
}

.tooltip-block h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.tooltip-block p {
  margin: 0;
  color: var(--muted);
}

.tooltip-rule {
  height: 1px;
  margin: 9px 0;
  background: var(--line);
}

.subpage-body {
  min-height: 100%;
  background: #f2f5f8;
}

.subpage-shell {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 54px;
}

.subpage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.subpage-menu {
  position: fixed;
  top: 26px;
  right: 26px;
  z-index: 50;
}

.subpage-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-strong);
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.subpage-menu summary::-webkit-details-marker {
  display: none;
}

.subpage-menu[open] summary {
  border-color: #a7bac7;
  background: #f8fbfc;
}

.subpage-menu nav {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  width: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
}

.subpage-menu a {
  padding: 13px 15px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.subpage-menu a + a {
  border-top: 1px solid var(--line);
}

.subpage-menu a:hover {
  background: #eef4f7;
}

.return-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-strong);
  padding: 8px 12px;
  font-weight: 800;
  text-decoration: none;
}

.return-link:hover {
  border-color: #a7bac7;
  background: #f8fbfc;
}

.enter-map-link {
  border-color: #165d72;
  background: var(--accent);
  color: #fff;
}

.enter-map-link:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.subpage-header {
  max-width: 790px;
  margin-bottom: 26px;
}

.subpage-header p {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.subpage-header h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.content-section,
.cluster-card,
.figure-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.content-section,
.cluster-card {
  padding: 20px;
}

.content-section h2,
.cluster-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: 0;
}

.content-section p,
.cluster-card p {
  margin: 0;
  color: #485365;
  font-size: 15px;
  line-height: 1.6;
}

.content-section p + p,
.cluster-card p + p {
  margin-top: 12px;
}

.source-note {
  max-width: 820px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.figure-panel {
  margin-bottom: 16px;
  padding: 12px;
}

.figure-panel img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.cluster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.analysis-intro {
  max-width: 920px;
  margin-bottom: 16px;
}

.analysis-cluster-grid .cluster-card {
  display: grid;
  align-content: start;
}

.map-zoom-trigger {
  position: relative;
  display: grid;
  width: 100%;
  margin: -8px 0 16px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.map-zoom-trigger img,
.cluster-card img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.map-zoom-trigger img {
  margin: 0;
}

.cluster-card > img {
  margin: -8px 0 16px;
}

.map-zoom-trigger span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-radius: 999px;
  background: rgba(14, 69, 87, 0.92);
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.map-zoom-trigger:hover span,
.map-zoom-trigger:focus-visible span {
  background: #0b3442;
}

.map-zoom-trigger:focus-visible {
  outline: 3px solid rgba(27, 110, 134, 0.36);
  outline-offset: 3px;
}

.map-zoom-modal[hidden] {
  display: none;
}

.map-zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.map-zoom-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(12, 18, 26, 0.78);
  cursor: zoom-out;
}

.map-zoom-frame {
  position: relative;
  z-index: 1;
  width: min(1280px, 96vw);
  max-height: 92vh;
  margin: 0;
  padding: 46px 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
}

.map-zoom-frame img {
  display: block;
  width: 100%;
  max-height: calc(92vh - 104px);
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef3f6;
}

.map-zoom-close {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-strong);
  padding: 6px 10px;
  font-weight: 800;
  cursor: pointer;
}

.map-zoom-close:hover,
.map-zoom-close:focus-visible {
  border-color: #a7bac7;
  background: #f8fbfc;
}

#mapZoomCaption {
  margin-top: 10px;
  color: #485365;
  font-size: 14px;
  font-weight: 800;
}

.cluster-facts {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: #344052;
  font-size: 14px;
  line-height: 1.45;
}

.cluster-facts b {
  color: var(--ink);
}

.contact-section {
  max-width: 780px;
}

.contact-list {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px 18px;
  margin: 0;
}

.contact-list dt {
  color: var(--muted);
  font-weight: 800;
}

.contact-list dd {
  margin: 0;
  font-weight: 700;
}

.contact-list a {
  color: var(--accent-strong);
}

.traffic-section {
  margin-top: 16px;
  max-width: 600px;
}

.visitor-widget {
  display: grid;
  place-items: center;
  margin-top: 16px;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.visitor-widget iframe,
.visitor-widget img,
.visitor-widget canvas {
  max-width: 100%;
}

.visitor-widget a {
  max-width: 100%;
}

.visitor-widget #mapmyvisitors-widget {
  max-width: 100% !important;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 860px) {
  .intro {
    align-items: end;
    justify-items: start;
    padding: 78px 18px 32px;
  }

  .intro-menu {
    top: 18px;
    right: 18px;
  }

  .intro h1 {
    font-size: clamp(34px, 12vw, 52px);
  }

  .visit-card p {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .visit-card {
    right: 18px;
    bottom: 18px;
    width: min(420px, calc(100vw - 36px));
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .map-stage {
    min-height: calc(100vh - 278px);
  }

  .summary-panel {
    top: auto;
    right: 10px;
    bottom: 250px;
    left: 10px;
    width: auto;
    max-height: 24vh;
  }

  .map-color-panel {
    right: 10px;
    bottom: 16px;
    left: 10px;
    width: auto;
  }

  .content-grid,
  .cluster-grid {
    grid-template-columns: 1fr;
  }

  .map-zoom-modal {
    padding: 10px;
  }

  .map-zoom-frame {
    width: min(100%, 96vw);
    padding: 44px 10px 10px;
  }

  .subpage-shell {
    width: min(100% - 28px, 1120px);
    padding-top: 76px;
  }

  .subpage-menu {
    top: 18px;
    right: 14px;
  }

  .contact-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .contact-list dd + dt {
    margin-top: 10px;
  }
}
