html,
body {
  height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
}

#map {
  height: 100%;
  width: 100%;
}

.sidebar {
  position: fixed;
  top: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 1;
  box-sizing: border-box;
  width: 320px;
  overflow-y: auto;
  padding: 18px;
  color: #202020;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d7d7d7;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
  font-size: 13px;
}

.sidebar-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.subtitle {
  margin: 5px 0 0;
  color: #555;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.description {
  margin: 14px 0 0;
  color: #444;
  font-size: 13px;
  line-height: 1.45;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 18px 0 0;
  padding: 14px 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.stat {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: baseline;
  gap: 10px;
}

.stat strong {
  color: #111;
  font-size: 18px;
  line-height: 1.2;
}

.stat span {
  color: #444;
  line-height: 1.35;
}

.panel-section {
  margin-top: 18px;
}

.panel-section h2 {
  margin: 0 0 10px;
  color: #222;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.search-field {
  margin-top: 10px;
}

.search-field label {
  display: block;
  margin-bottom: 5px;
  color: #444;
  font-size: 12px;
  font-weight: 700;
}

.search-field select {
  box-sizing: border-box;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  color: #222;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 4px;
  font: inherit;
}

.search-field select:disabled {
  color: #777;
  background: #f3f3f3;
}

.map-controls {
  position: fixed;
  right: 16px;
  bottom: 28px;
  z-index: 1;
  box-sizing: border-box;
  width: 230px;
  padding: 12px;
  color: #222;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  font-size: 12px;
}

.about-button {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2;
  min-height: 34px;
  padding: 7px 12px;
  color: #222;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #cfcfcb;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.about-button:hover {
  background: #fff;
  border-color: #b7b7b2;
}

.about-modal {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 24px;
  background: rgba(32, 32, 32, 0.42);
}

.about-modal[hidden] {
  display: none;
}

.about-card {
  position: relative;
  box-sizing: border-box;
  width: min(680px, 100%);
  max-height: min(82vh, 720px);
  overflow-y: auto;
  padding: 24px;
  color: #202020;
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.about-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  color: #444;
  background: #f7f7f5;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.about-close:hover {
  color: #111;
  background: #fff;
}

.about-card h2 {
  margin: 0;
  padding-right: 36px;
  color: #111;
  font-size: 22px;
  line-height: 1.15;
}

.paper-section {
  margin-top: 20px;
}

.paper-section h3 {
  margin: 0 0 12px;
  color: #222;
  font-size: 14px;
  line-height: 1.2;
}

.paper-details {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 9px 14px;
  margin: 0;
}

.paper-details dt {
  color: #555;
  font-weight: 700;
}

.paper-details dd {
  margin: 0;
  color: #222;
  line-height: 1.45;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e0e0dc;
}

.logo-row img {
  display: block;
  max-width: 170px;
  max-height: 58px;
  object-fit: contain;
}

.control-group + .control-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
}

.control-group h2 {
  margin: 0 0 7px;
  color: #222;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.control-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.control-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 7px;
  color: #333;
  background: #fff;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.control-options input {
  margin: 0;
}

.satellite-attribution {
  margin: 8px 0 0;
  color: #666;
  font-size: 11px;
  line-height: 1.35;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
}

.summary-grid span {
  color: #555;
  line-height: 1.25;
}

.summary-grid strong {
  color: #111;
  font-size: 13px;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}

.summary-link {
  box-sizing: border-box;
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 9px 12px;
  color: #333;
  background: #f7f7f5;
  border: 1px solid #cfcfcb;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.summary-link:hover {
  color: #111;
  background: #fff;
  border-color: #b7b7b2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.swatch {
  width: 18px;
  height: 14px;
  border: 1px solid #777;
}

.swatch-csmd {
  background: rgba(178, 72, 70, 0.58);
}

.swatch-other {
  background: rgba(212, 212, 212, 0.32);
}

.note {
  margin: 0;
  color: #555;
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-footer {
  margin: 18px 0 0;
  color: #777;
  font-size: 11px;
  line-height: 1.35;
}

.sidebar-footer a {
  color: #555;
  text-decoration: none;
  transition: color 160ms ease, text-shadow 160ms ease;
}

.sidebar-footer a:hover {
  color: #222;
  text-shadow: 0 0 8px rgba(178, 72, 70, 0.32);
}

.visitor-counter {
  display: block;
  max-width: 100%;
  height: 20px;
  margin-top: 8px;
  opacity: 0.78;
}

.maplibregl-ctrl-bottom-left {
  left: 352px;
  bottom: 28px;
}

.popup-table {
  border-collapse: collapse;
  font-size: 12px;
}

@media (max-width: 720px) {
  .sidebar {
    right: 16px;
    bottom: auto;
    width: auto;
    max-height: 48vh;
  }

  .maplibregl-ctrl-bottom-left {
    left: 16px;
    bottom: 16px;
  }

  .map-controls {
    right: 16px;
    bottom: 16px;
    width: min(230px, calc(100vw - 32px));
  }

  .about-button {
    top: calc(48vh + 36px);
    right: 16px;
  }

  .paper-details {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .paper-details dd {
    margin-bottom: 8px;
  }

  .logo-row {
    justify-content: center;
  }
}

.popup-table th,
.popup-table td {
  padding: 3px 6px 3px 0;
  text-align: left;
  vertical-align: top;
}

.popup-table th {
  color: #555;
  font-weight: 700;
}
