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

body {
  position: relative;
  font-family: Arial, sans-serif;
  color: #111;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.panel {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 320px;
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 36px);
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  z-index: 20;
}

.control-bar {
  position: absolute;
  top: 18px;
  left: 370px;
  right: 214px;
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  padding: 3px;
  z-index: 18;
  pointer-events: none;
}

.bar-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  padding: 7px 10px;
  color: #1d1d1d;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}

.bar-button:hover {
  background: #fff;
}

.bar-button.active {
  border-color: #8f1d2c;
  background: #fff1e8;
  color: #7a1724;
}

.bar-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.bar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
}

.panel-toggle {
  display: none;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 35;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.panel-backdrop {
  display: none;
}

h1 {
  margin: 0 0 8px;
  font-size: 18px;
}

.what-is-this {
  margin: 0 0 10px;
  padding: 7px 8px;
  border-left: 3px solid #666;
  background: rgba(246, 247, 248, 0.9);
  font-size: 12px;
  line-height: 1.35;
}

.title {
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 700;
}

.control {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
}

.control select,
.control input {
  width: 100%;
  box-sizing: border-box;
}

.checkbox-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scale-control,
.projection-control {
  border: 0;
  padding: 0;
}

.scale-control legend,
.projection-control legend {
  padding: 0;
}

.scale-control label,
.projection-control label {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.25;
}

.checkbox-control input {
  width: auto;
}

.scale-control input,
.projection-control input {
  width: auto;
}

.legend {
  margin: 14px 0;
}

.ramp {
  height: 14px;
  border: 1px solid #999;
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 4px;
  font-size: 10px;
}

.legend-note {
  margin-top: 5px;
  font-size: 10px;
  color: #555;
  line-height: 1.25;
}

.gap-legend {
  display: grid;
  gap: 5px;
  margin: -4px 0 12px;
  font-size: 11px;
  color: #333;
}

.gap-swatch {
  display: inline-block;
  width: 22px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.hatch-swatch {
  background:
    repeating-linear-gradient(135deg, rgba(128, 128, 128, 0.6) 0 1px, transparent 1px 6px);
}

.dot-swatch {
  background:
    radial-gradient(circle, rgba(128, 128, 128, 0.55) 1px, transparent 1.5px) 0 0 / 6px 6px;
}

.meta {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 6px 10px;
  margin: 12px 0;
  font-size: 12px;
}

.meta dt {
  color: #555;
}

.meta dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.primary-meta {
  margin-bottom: 8px;
}

.layer-details {
  margin: 8px 0 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 7px 0;
  font-size: 12px;
}

.layer-details summary {
  cursor: pointer;
  font-weight: 700;
}

.layer-details .meta {
  margin-bottom: 2px;
}

.notice {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

.notice-block {
  max-width: 100%;
}

.info-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  border: 1px solid #777;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.info-text {
  max-width: 100%;
  box-sizing: border-box;
  margin: 7px 0 0;
  padding: 8px;
  border-left: 3px solid #777;
  background: rgba(246, 247, 248, 0.95);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

a {
  color: #0645ad;
}

.link-separator {
  color: #777;
  margin: 0 6px;
}

.footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 11px;
  line-height: 1.35;
  color: #444;
}

.level-ladder {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 176px;
  max-width: calc(100vw - 36px);
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  font-size: 11px;
  z-index: 10;
}

.level-toggle {
  display: none;
  width: 100%;
  border: 1px solid #999;
  background: #fff;
  border-radius: 4px;
  padding: 6px;
  font-size: 12px;
}

.level-ladder-body {
  display: grid;
  gap: 7px;
}

.ladder-note {
  text-align: center;
  color: #666;
  font-size: 10px;
}

.level-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  border: 1px solid rgba(90, 90, 90, 0.38);
  border-left: 4px solid #888;
  padding: 5px 5px 5px 6px;
  background: rgba(245, 245, 245, 0.95);
}

.level-step.disabled {
  color: #777;
  border-left-style: dashed;
  border-style: dashed;
  background: rgba(245, 245, 245, 0.7);
}

.level-step.active {
  border-left-color: #b2182b;
  background: rgba(246, 160, 77, 0.25);
}

.level-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}

.level-glyph {
  width: 30px;
  height: 30px;
  display: block;
}

.level-copy {
  min-width: 0;
}

.level-label {
  font-weight: 700;
  line-height: 1.2;
}

.level-height {
  margin-top: 2px;
  color: #666;
  line-height: 1.2;
}

.level-layer-list {
  display: grid;
  gap: 3px;
  margin-top: 5px;
}

.level-layer-button {
  display: grid;
  gap: 1px;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: #fff;
  padding: 3px 4px;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
  line-height: 1.2;
}

.level-layer-name,
.level-layer-altitude {
  min-width: 0;
}

.level-layer-name {
  overflow-wrap: anywhere;
}

.level-layer-altitude {
  color: #555;
}

.level-layer-button.active {
  border-color: #b2182b;
  background: #fff1e8;
}

.ladder-ground {
  height: 9px;
  border: 1px solid rgba(97, 77, 45, 0.45);
  background:
    linear-gradient(135deg, rgba(124, 96, 51, 0.35) 25%, transparent 25%) 0 0 / 10px 10px,
    linear-gradient(45deg, rgba(124, 96, 51, 0.28) 25%, transparent 25%) 0 0 / 10px 10px,
    #d2c4a3;
}

@media (max-width: 1023px) {
  .control-bar {
    left: 78px;
    right: 12px;
    top: 12px;
  }

  .level-ladder {
    top: auto;
    right: 12px;
    bottom: 14px;
    width: 226px;
  }

  .level-toggle {
    display: block;
  }

  .level-ladder:not(.expanded) .level-ladder-body {
    display: none;
  }
}

@media (max-width: 767px) {
  .panel-toggle {
    display: block;
  }

  .panel {
    position: absolute;
    top: 56px;
    bottom: 12px;
    left: 12px;
    box-sizing: border-box;
    width: min(336px, calc(100vw - 72px));
    max-width: none;
    padding: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(calc(-100% - 24px));
    transition: transform 160ms ease;
    z-index: 30;
  }

  .control-bar {
    left: 78px;
    right: 8px;
    top: 10px;
    gap: 5px;
    z-index: 34;
  }

  .bar-button {
    min-height: 35px;
    padding: 7px;
  }

  .bar-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .info-text {
    position: static;
  }

  body.panel-open .panel {
    transform: translateX(0);
  }

  body.panel-open .panel-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    z-index: 25;
  }

  body.panel-open .panel-toggle {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
  }

  .meta {
    grid-template-columns: 94px 1fr;
  }

  .level-ladder {
    right: 10px;
    bottom: 10px;
    width: min(226px, calc(100vw - 20px));
  }
}
