:root {
  --fresh: #37b24d;
  --lagging: #f59f00;
  --stale: #e03131;
  --nodata: #6c757d;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

#panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  padding: 14px 16px;
  width: 300px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-sizing: border-box;
  font-size: 13px;
  color: #222;
}

#panel h1 {
  font-size: 15px;
  margin: 0 0 6px;
}

#panel h1 .subtitle {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: #666;
}

#status-line {
  margin-bottom: 10px;
  color: #555;
}

.section-title,
.legend-title {
  font-weight: 600;
  margin: 10px 0 4px;
}

#dno-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#dno-list li {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 2px 8px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
}

#dno-list li:hover {
  background: #f1f3f5;
}

#dno-list .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 2px;
}

#dno-list .name {
  font-weight: 600;
}

#dno-list .name .count {
  font-weight: 400;
  color: #555;
}

#dno-list .detail {
  grid-column: 2;
  color: #555;
  font-size: 12px;
  line-height: 1.35;
}

#dno-list .detail.error {
  color: var(--stale);
}

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

.legend summary {
  cursor: pointer;
  font-weight: 600;
  margin-top: 10px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.swatch-dashed {
  width: 16px;
  height: 0;
  border-top: 2px dashed #333;
  display: inline-block;
}

.toggle-row {
  display: block;
  margin: 4px 0;
  cursor: pointer;
}

#attribution {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #ddd;
  font-size: 10.5px;
  color: #777;
  line-height: 1.4;
}

#attribution a {
  color: #777;
}

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

.outage-popup table td {
  padding: 1px 6px 1px 0;
  vertical-align: top;
  font-size: 12px;
}

.outage-popup td.label {
  color: #666;
  white-space: nowrap;
}

@media (max-width: 600px) {
  #panel {
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: 45vh;
  }
}
