* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, Segoe UI, Roboto, sans-serif; color: #1a1a1a; }
#map { position: absolute; inset: 0; }

.panel {
  position: absolute;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  padding: 14px 16px;
  z-index: 500;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.panel h2 { margin: 0 0 10px; font-size: 15px; }
.panel h3 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #555; }
.hidden { display: none !important; }

#app-title {
  position: absolute;
  top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 500;
  background: rgba(255,255,255,0.94);
  padding: 10px 22px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  text-align: center;
  max-width: 520px;
}
#app-title h1 { font-size: 16px; margin: 0; }
#app-title p { font-size: 11px; margin: 6px 0 0; color: #555; }

.floating-toggle {
  position: absolute;
  bottom: 16px; left: 16px;
  z-index: 500;
  background: #1a1a1a; color: #fff; border: none;
  padding: 8px 16px; border-radius: 20px;
  font-size: 12px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.floating-toggle:hover { background: #333; }

#layer-panel { top: 16px; left: 16px; width: 280px; }
.layer-group { margin-bottom: 10px; }
.layer-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; cursor: pointer; }
.source-note-inline { font-size: 10px; color: #777; margin: 0 0 6px 24px; font-style: italic; }
.source-note-inline a { color: #4a7c9e; }

#legend-panel { bottom: 16px; left: 16px; width: 280px; }
#legend-close { position: absolute; top: 10px; right: 12px; border: none; background: none; font-size: 18px; cursor: pointer; color: #888; }
.legend-item { margin-bottom: 14px; }
.legend-title { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.legend-row { display: flex; align-items: center; gap: 6px; font-size: 11px; margin: 2px 0; }
.swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.legend-gradient { height: 10px; border-radius: 3px; }
.legend-labels { display: flex; justify-content: space-between; font-size: 10px; color: #555; margin-top: 2px; }
.source-note { font-size: 10px; color: #555; margin-top: 5px; padding: 5px 7px; background: #f4f4f0; border-left: 3px solid #999; border-radius: 3px; line-height: 1.4; }
.source-note a { color: #4a7c9e; word-break: break-all; }

#info-panel { top: 90px; right: 16px; width: 300px; } /* clears the +/- zoom control */
#info-close { position: absolute; top: 10px; right: 12px; border: none; background: none; font-size: 18px; cursor: pointer; color: #888; }
#info-coords { font-size: 12px; color: #555; margin-bottom: 8px; }
.stat-row { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 0; border-bottom: 1px solid #eee; gap: 8px; }

#loading {
  position: absolute; top: 70px; left: 50%; transform: translateX(-50%);
  background: #1a1a1a; color: #fff; padding: 6px 14px; border-radius: 6px;
  font-size: 12px; z-index: 600;
}

#citation-footer {
  position: absolute;
  bottom: 8px; right: 8px;
  z-index: 500;
  background: rgba(255,255,255,0.92);
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  font-size: 10px;
  color: #444;
  max-width: 440px;
  line-height: 1.5;
}
#citation-footer a { color: #4a7c9e; }
#citation-footer .citation-sep { margin: 0 4px; color: #bbb; }
