:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --ink: #16352e;
  --paper: rgba(247, 246, 239, 0.92);
  --line: rgba(25, 61, 51, 0.14);
  --active: #275b4b;
  --shadow: 0 10px 34px rgba(24, 42, 36, 0.15);
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background: #8b9385;
  color: var(--ink);
}

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

.topbar {
  position: fixed;
  z-index: 10;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.brand,
.style-switcher {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px) saturate(120%);
  -webkit-backdrop-filter: blur(15px) saturate(120%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.brand-mark {
  width: 18px;
  height: 16px;
  background: var(--active);
  clip-path: polygon(0 100%, 37% 15%, 56% 55%, 73% 0, 100% 100%);
}

.style-switcher {
  display: flex;
  padding: 4px;
  border-radius: 15px;
}

.style-switcher button {
  min-height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #48625b;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 620;
  white-space: nowrap;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.style-switcher button:hover {
  color: var(--ink);
  background: rgba(39, 91, 75, 0.08);
}

.style-switcher button[aria-pressed="true"] {
  color: #fff;
  background: var(--active);
  box-shadow: 0 3px 10px rgba(28, 65, 54, 0.2);
}

.style-switcher button:focus-visible,
.brand:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 2px;
}

.style-switcher.is-loading {
  cursor: progress;
}

.style-switcher.is-loading button {
  cursor: progress;
}

.status {
  position: fixed;
  z-index: 10;
  right: 12px;
  bottom: 12px;
  max-width: min(420px, calc(100vw - 24px));
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  background: rgba(247, 246, 239, 0.86);
  box-shadow: 0 5px 20px rgba(24, 42, 36, 0.12);
  color: #48625b;
  font-size: 12px;
  backdrop-filter: blur(12px);
  transition: opacity 220ms ease;
}

.status[data-state="ready"] {
  opacity: 0;
  pointer-events: none;
}

.status[data-state="error"] {
  color: #8d2e28;
  opacity: 1;
}

.maplibregl-ctrl-top-right {
  top: 78px;
  right: 8px;
}

.maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.maplibregl-ctrl-group button {
  width: 34px;
  height: 34px;
}

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

@media (max-width: 760px) {
  .topbar {
    top: 10px;
    left: 10px;
    right: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .brand {
    align-self: flex-start;
    min-height: 38px;
    padding: 0 13px;
  }

  .style-switcher {
    width: 100%;
  }

  .style-switcher button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 7px;
    font-size: 11px;
  }

  .maplibregl-ctrl-top-right {
    top: 104px;
  }
}

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