:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e3e3df;
  --no-data: #e6e6e1;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo { font-size: 22px; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-tag { font-size: 12px; color: var(--muted); }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.pill {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: var(--shadow);
}

.pill:hover { border-color: #cfcfc8; transform: translateY(-1px); }
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.map-wrap {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 20px 16px;
  box-shadow: var(--shadow);
}

.map-info h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.map-info p {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

#map {
  width: 100%;
  height: auto;
  display: block;
}

.country {
  stroke: #ffffff;
  stroke-width: 0.4px;
  transition: fill .25s ease, opacity .15s ease;
  cursor: pointer;
}

.country:hover { opacity: 0.85; }

.graticule {
  fill: none;
  stroke: #ececec;
  stroke-width: 0.4;
}

.sphere {
  fill: #f4f7fa;
  stroke: #cfd6dd;
  stroke-width: 0.6;
}

.tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translate(-50%, -110%);
  transition: opacity .12s ease;
  z-index: 100;
  white-space: nowrap;
}

.tooltip.show { opacity: 1; }
.tooltip .value { color: #ffd166; font-weight: 600; }

.legend {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.legend-gradient {
  flex: 1;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(to right, #f7fbff, #08306b);
}

.legend-note {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.loading.show { opacity: 1; }

.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 32px;
  font-size: 11px;
  color: var(--muted);
}