* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: system-ui, sans-serif;
}
#map {
  width: 100vw;
  height: 100vh;
}

#panel {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 14px 16px;
  min-width: 200px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
#panel h1 {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
}
#panel-toggle {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #444;
  padding: 0 2px;
  line-height: 1;
}
#panel-content.collapsed {
  display: none;
}

.legend {
  margin-bottom: 12px;
}
.legend-bar {
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(to right, #d73027, #f46d43, #fee08b, #a6d96a, #1a9850);
  margin-bottom: 3px;
}
.legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #666;
}

.symbol-legend {
  margin-bottom: 10px;
  font-size: 11px;
  color: #444;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.symbol-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.symbol-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  outline: 1px solid #aaa;
  flex-shrink: 0;
}
.symbol-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#filter-label {
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
}
#score-filter {
  width: 100%;
  accent-color: #2ecc71;
}
#filter-value {
  font-size: 12px;
  color: #333;
  margin-top: 3px;
}

#info {
  position: absolute;
  bottom: 28px;
  left: 12px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 200px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: none;
}
#info h2 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #444;
  margin-bottom: 4px;
}
.info-row span:last-child {
  font-weight: 600;
  color: #1a1a1a;
}
.score-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
  color: white;
}
#share-btn {
  margin-top: 8px;
  width: 100%;
  padding: 5px 0;
  font-size: 11px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  color: #333;
}
#share-btn:hover {
  background: #e0e0e0;
}

#presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.preset-btn {
  padding: 3px 8px;
  font-size: 11px;
  border: 1px solid #ccc;
  border-radius: 12px;
  background: #f5f5f5;
  cursor: pointer;
  color: #222;
  white-space: nowrap;
}
.preset-btn:hover {
  background: #e8e8e8;
}
.preset-btn.active {
  background: #1a9850;
  border-color: #1a9850;
  color: #fff;
}

#component-toggles {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#component-toggles label,
.ortho-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #444;
  cursor: pointer;
}
.ortho-label {
  margin-top: 6px;
}

#kunta-filter {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
#kunta-filter label {
  font-size: 11px;
  color: #555;
  white-space: nowrap;
}
#kunta-select {
  flex: 1;
  font-size: 11px;
  padding: 3px 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #222;
}

#top-list {
  margin-top: 10px;
  border-top: 1px solid #e0e0e0;
  padding-top: 8px;
}
#top-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  user-select: none;
  margin-bottom: 5px;
}
#top-list-toggle {
  font-size: 9px;
  color: #999;
}
#top-list-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
}
#top-list-items.collapsed {
  display: none;
}
.top-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  color: #333;
}
.top-list-item:hover {
  background: #f0f0f0;
}
.top-list-item.active {
  background: #e8f4e8;
}
.top-rank {
  width: 14px;
  color: #999;
  font-size: 10px;
  flex-shrink: 0;
}
.top-score {
  font-weight: 700;
  font-size: 12px;
}
.top-cell-id {
  color: #aaa;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
