html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20242a;
}

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

.panel {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  width: min(280px, calc(100vw - 32px));
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.panel.is-collapsed {
  width: 44px;
  height: 44px;
  padding: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel h1 {
  margin: 0 40px 12px 0;
  font-size: 18px;
  line-height: 1.2;
}

.panel-header h1 {
  margin: 0 40px 12px 0;
}

.panel.is-collapsed .panel-header h1,
.panel.is-collapsed .panel-body {
  display: none;
}

.icon-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-color: #c5ccd5;
  background: #f6f8fa;
  color: #20242a;
  font-size: 20px;
  line-height: 1;
}

.icon-button:hover {
  background: #e9edf2;
}

.toggles {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.toggles label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

button {
  width: 100%;
  min-height: 36px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  background: #1f2937;
  color: white;
  font-size: 14px;
  cursor: pointer;
}

button:hover {
  background: #374151;
}

.view-info {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #d7dce2;
  font-size: 13px;
  line-height: 1.45;
  color: #3f4854;
}

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

.downloads a {
  color: #0f5f8f;
  text-decoration: none;
}

.downloads a:hover {
  text-decoration: underline;
}

.maplibregl-popup-content {
  max-width: 260px;
  font: 13px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mode-switcher {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.mode-button {
  min-height: 34px;
  padding: 0 10px;
  border-color: #c5ccd5;
  background: #f6f8fa;
  color: #20242a;
}

.mode-button.is-active {
  border-color: #1f2937;
  background: #1f2937;
  color: white;
}

.stats-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  width: min(520px, calc(100vw - 32px));
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stats-panel.is-hidden {
  display: none;
}

.stats-panel h2,
.stats-panel h3 {
  margin: 0 0 10px;
}

.stats-panel h3 {
  margin-top: 18px;
  font-size: 15px;
}

.stats-summary {
  font-size: 13px;
  line-height: 1.5;
  color: #3f4854;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #d7dce2;
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 8px;
  border-bottom: 1px solid #e5e9ef;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f1f4f7;
  font-weight: 650;
}

.correlation-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  margin: 0;
  font-size: 13px;
}

.correlation-list dt {
  font-weight: 650;
}

.correlation-list dd {
  margin: 0;
}
