body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  background: #f5f5f0;
  color: #1a1a1a;
  overflow: hidden
}

#map {
  background-color: #d1e3f0;
  position: absolute;
  width: 100%;
  height: 100%
}

.header-right {
  visibility: hidden
}

.back-link {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1001;
  font-size: .75rem;
  color: rgba(0, 0, 0, .5);
  text-decoration: none;
  transition: color .2s ease
}

.back-link:hover {
  color: #2563eb
}

.header {
  position: absolute;
  top: 50px;
  left: 20px;
  right: 20px;
  z-index: 600;
  pointer-events: none
}

.title-card {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 12px;
  padding: 20px 24px;
  display: inline-block;
  pointer-events: auto
}

.title-card h1 {
  margin: 0 0 4px 0;
  font-family: 'Instrument Serif', serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: #1e40af
}

.subtitle {
  font-size: .85rem;
  color: #475569
}

.title-meta {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center
}

.attribution,
.methods-link {
  font-size: .65rem;
  color: rgba(0, 0, 0, .4);
  text-decoration: none
}

.methods-link:hover {
  color: #1e40af
}

.settings-panel {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  pointer-events: none
}

.settings-card {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 16px;
  padding: 16px;
  width: 280px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .05);
  pointer-events: auto;
  transition: transform .6s cubic-bezier(.4, 0, .2, 1);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .65rem;
  text-transform: uppercase;
  color: rgba(0, 0, 0, .4);
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  cursor: pointer
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px
}

.header-right {
  display: none;
  visibility: hidden
}

#settingsContent {
  transition: opacity .3s ease
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center
}

.control-label>* {
  font-size: 1rem
}

.mono-value {
  color: #1e40af
}

.slider-controls {
  display: flex;
  align-items: center;
  gap: 12px
}

.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, .1);
  border-radius: 2px;
  outline: 0
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #1e40af;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1)
}

.play-btn {
  background: rgba(30, 64, 175, .1);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0
}

.mode-dropdown {
  width: 100%;
  padding: 8px;
  font-family: inherit;
  font-size: .75rem;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 6px;
  color: #1e40af;
  background: #fff
}

.meta-hint {
  font-size: .65rem;
  color: #64748b;
  margin-top: 4px
}

.legend-container {
  border-top: 1px solid rgba(0, 0, 0, .05);
  padding-top: 12px;
  margin-top: 12px
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px
}

.discrete-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, .05)
}

.ol-zoom {
  bottom: 10px;
  right: 10px;
  top: auto;
  left: auto;
}

.ol-popup {
  position: absolute;
  background-color: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .15);
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .1);
  bottom: 12px;
  left: -50px;
  min-width: 240px
}

.ol-popup:after {
  top: 100%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none;
  border-top-color: #fff;
  border-width: 10px;
  left: 48px
}

.ol-popup-closer {
  text-decoration: none;
  position: absolute;
  right: 12px;
  top: 8px;
  color: #94a3b8
}

.ol-popup-closer:after {
  content: "✖"
}

.popup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px
}

.stat-box {
  display: flex;
  flex-direction: column
}

.stat-label {
  font-size: .6rem;
  text-transform: uppercase;
  color: #64748b
}

.stat-value {
  font-size: .9rem;
  font-weight: 700;
  color: #1e293b
}

.unit {
  font-size: .7rem;
  font-weight: 400;
  color: #94a3b8
}

.hidden {
  display: none
}

.settings-card.collapsed {
  transform: translateY(calc(100% - 100px));
  opacity: 1;
  pointer-events: auto;
}

.settings-card.collapsed #settingsContent {
  opacity: 0;
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  transition: opacity .3s cubic-bezier(.4, 0, .2, 1) .3s, max-height .3s cubic-bezier(.4, 0, .2, 1) .3s;
}

#settingsContent {
  transition: opacity .6s cubic-bezier(.4, 0, .2, 1);
}

#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: white;
  font-family: sans-serif;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3ccca3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@media (orientation:portrait) {
  .control-label>* {
    font-size: 2rem
  }

  .back-link {
    visibility: hidden
  }

  .header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1002
  }

  .header-left {
    display: none;
    visibility: none
  }

  .header-right {
    visibility: visible;
    display: block
  }

  .title-card {
    border-radius: 0;
    width: 100%;
    text-align: center
  }

  .title-card>h1 {
    font-size: 4rem
  }

  .subtitle {
    font-size: 2rem
  }

  .title-meta {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 12px;
    width: 100%
  }

  .title-meta>* {
    font-size: 1.2rem
  }

  .settings-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1002
  }

  .settings-card {
    width: 100%;
    border-radius: 0;
    border: none;
    border-top: 2px solid rgba(0, 0, 0, .2);
    box-sizing: border-box;
    padding: 12px 20px 50px 20px;
    transition: transform .6s cubic-bezier(.4, 0, .2, 1);
  }

  #settingsContent {
    transition: opacity .6s cubic-bezier(.4, 0, .2, 1);
  }

  .legend-label {
    font-size: 1.5rem
  }

  .mode-dropdown {
    font-size: 2rem;
    padding: 8px;
    margin-top: 5px
  }

  .mode-dropdown>* {
    font-size: 1rem
  }

  .stat-label {
    font-size: 2rem
  }

  .stat-value {
    font-size: 2rem
  }

  .slider {
    height: 12px;
    border-radius: 6px
  }

  .slider::-webkit-slider-thumb {
    width: 44px;
    height: 44px;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .2)
  }

  .slider::-moz-range-thumb {
    width: 44px;
    height: 44px;
    background: #1e40af;
    border-radius: 50%;
    border: 4px solid #fff
  }

  .play-btn {
    width: 80px;
    height: 80px
  }

  .play-btn svg {
    width: 35px;
    height: 35px
  }

  .meta-hint {
    font-size: 1rem
  }

  #hideSettingsBtn {
    background: rgb(255, 255, 255);
    border: none;
    border-radius: 20px;
    padding: 4px 24px;
    color: #1e40af;
    cursor: pointer;
    z-index: 1010;
    width: 100vw;
  }

  #hideSettingsBtn.collapsed {
    transform: rotate(180deg);
  }

  .settings-header {
    visibility: visible;
    height: 60px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 15px
  }

  #settingsContent {
    transition: opacity .3s ease
  }

  .title-card {
    width: 100%;
    border-radius: 0;
    text-align: center
  }
}