:root {
  --ink: #0d0d0d;
  --teal: #00c8a0;
  --linen: #f7f7f5;
  --slate: #9a9a96;
  --border: #e2e2df;
  --panel: rgba(247, 247, 245, 0.94);
  --font-display: "Space Grotesk", sans-serif;
  --font-sans: Inter, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--linen);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

.chrome {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.chrome > * {
  pointer-events: auto;
}

.topbar {
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  border: 0.5px solid var(--border);
  padding: 8px 12px;
}

.brand svg {
  display: block;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: 0.14em;
  font-size: 13px;
  text-transform: uppercase;
}

.panel {
  background: var(--panel);
  border: 0.5px solid var(--border);
  padding: 12px 14px;
  min-width: 220px;
  max-width: 280px;
}

.panel h2,
.legend h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
}

.layers + h2,
.modes + h2 {
  margin-top: 14px;
}

.modes + h2 + label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
  margin-bottom: 8px;
}

.layers label,
.modes label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
}

.modes {
  display: flex;
  gap: 12px;
  margin: 8px 0 12px;
}

.key-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 0.5px solid var(--border);
}

.key-row input {
  width: 100%;
  margin-top: 6px;
  border: 0.5px solid var(--border);
  background: var(--linen);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  padding: 8px;
}

.key-row a {
  display: inline-block;
  margin-top: 8px;
  color: var(--teal);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.key-row a:hover {
  color: var(--ink);
}

.key-row a + a {
  margin-left: 12px;
}

.legend {
  margin-top: 12px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.7;
}

.swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}

.footer {
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: flex-end;
  justify-content: space-between;
}

.attr,
.status {
  background: var(--panel);
  border: 0.5px solid var(--border);
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--slate);
  max-width: min(720px, 100%);
}

.status strong {
  color: var(--ink);
  font-weight: 500;
}

.banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  background: var(--panel);
  border: 0.5px solid var(--border);
  padding: 16px 20px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 300;
  display: none;
}

.banner.visible {
  display: block;
}

.maplibregl-popup-content {
  background: var(--linen);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 0;
  box-shadow: none;
  border: 0.5px solid var(--border);
}

.maplibregl-popup-tip {
  border-top-color: var(--border);
}

.maplibregl-ctrl-group {
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 0.5px solid var(--border);
}

.maplibregl-ctrl-attrib {
  font-size: 10px;
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .panel {
    max-width: none;
  }
}
