:root {
  --bg: #0f172a;
  --panel: rgba(15, 23, 42, 0.9);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --border: rgba(148, 163, 184, 0.2);
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

#topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

#title {
  font-size: 16px;
  font-weight: 700;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-nav {
  display: flex;
  gap: 12px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a.active {
  color: var(--accent);
  font-weight: 700;
}

#about-toggle {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

#about-toggle:hover {
  border-color: var(--accent);
}

#app {
  position: relative;
  flex: 1;
  min-height: 0;
}

.summary {
  position: absolute;
  top: 16px;
  right: 16px;
  left: 272px;
  max-width: 560px;
  margin-left: auto;
  z-index: 20;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 14px;
  line-height: 1.6;
}

.summary.hidden {
  display: none;
}

.summary p {
  margin: 0 0 12px;
}

.summary p:last-child {
  margin-bottom: 0;
}

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

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

#panel {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  width: 240px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 13px;
}

#panel h2 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.layer-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
}

.layer-option input {
  accent-color: var(--accent);
}

#opacity-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

#opacity-row label {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

#opacity-row input[type="range"] {
  width: 100%;
}

#legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 10;
  width: 240px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 12px;
}

.legend-title {
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 700;
}

.legend-gradient {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(to right, #333, #ccc);
}

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

.hover-tooltip {
  position: absolute;
  z-index: 20;
  display: none;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
