* {
  box-sizing: border-box;
}

html,
body,
#map {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Roboto", "Segoe UI", sans-serif;
}

body {
  color: #1f1f1f;
}

.panel {
  position: absolute;
  z-index: 2;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: 2px;
  font-size: 12px;
  line-height: 1.4;
}

.panel-heading {
  font-weight: 700;
  margin-bottom: 4px;
}

.panel-heading-gap {
  margin-top: 8px;
}

.panel-title {
  top: 12px;
  left: 12px;
  max-width: 420px;
}

.panel-title h1 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 400;
}

.panel-title p {
  margin: 0;
  color: #555;
  font-size: 11px;
}

.panel-layers {
  top: 12px;
  right: 12px;
  width: 252px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-layers label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.age-methods {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 4px 18px;
}

.age-methods label {
  font-size: 11px;
  color: #444;
}

.layer-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.layer-row > .panel-heading {
  flex: 1;
  margin-bottom: 0;
}

.layer-row > label {
  flex: 1 1 auto;
  min-width: 0;
}

.layer-row input[type="range"],
.panel-layers input[type="range"] {
  width: 70px;
  flex: 0 0 70px;
  margin: 0;
  cursor: pointer;
}

.opacity-value {
  flex: 0 0 34px;
  text-align: right;
  color: #555;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.popup-report {
  margin-top: 8px;
  width: 100%;
  padding: 5px 8px;
  cursor: pointer;
}

.popup-reported {
  margin-top: 6px;
  color: #c45c00;
  font-weight: 700;
}

.report-modal {
  position: absolute;
  z-index: 5;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-card {
  width: 280px;
  background: #fff;
  padding: 12px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.report-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.report-card textarea {
  width: 100%;
  margin: 8px 0;
  font: inherit;
  resize: vertical;
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.report-actions button {
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

#report-done {
  margin: 8px 0 0;
  font-weight: 700;
  color: #1b7a1b;
}

#report-done.report-error {
  color: #a33;
}

.panel-stats {
  bottom: 12px;
  left: 12px;
  width: 190px;
}

.panel-legend {
  bottom: 118px;
  right: 58px;
  width: 220px;
}

.legend-item {
  margin: 8px 0 4px;
}

.legend-label {
  margin-bottom: 4px;
}

.legend-bar {
  display: block;
  width: 100%;
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 1px;
}

.legend-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #555;
  margin-top: 2px;
}

.swatch-palm {
  background: linear-gradient(90deg, #f7fcb9, #c2e699, #78c679, #31a354, #006837);
}

.swatch-fdp {
  background: linear-gradient(90deg, #ffff32, #ffaa00, #ff0000);
}

.legend-class {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
  font-size: 11px;
}

.legend-swatch {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 1px;
}

.panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-heading-row .panel-heading {
  margin-bottom: 0;
}

.panel-close {
  border: 0;
  background: transparent;
  padding: 0 2px;
  font-size: 16px;
  line-height: 1;
  color: #666;
  cursor: pointer;
}

.muted {
  color: #666;
  font-size: 11px;
}

.stat-name {
  font-weight: 700;
  margin-top: 6px;
}

.panel-reports {
  top: 88px;
  left: 12px;
  width: 240px;
  max-height: 220px;
  overflow: auto;
}

.report-item {
  margin: 4px 0;
  color: #1f1f1f;
}

.banner {
  position: absolute;
  z-index: 3;
  top: 72px;
  left: 12px;
  right: 230px;
  max-width: 520px;
  background: #fff6d6;
  border: 1px solid #e0c36a;
  padding: 8px 10px;
  font-size: 12px;
}

.hidden {
  display: none;
}

.maplibregl-popup-content {
  font-size: 12px;
  max-width: 260px;
}

.maplibregl-popup-content h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.maplibregl-popup-content dt {
  color: #666;
  font-weight: 400;
}

.maplibregl-popup-content dd {
  margin: 0 0 4px;
  font-weight: 600;
}

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