:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --orange: #d29922;
  --red: #f85149;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 1rem;
  line-height: 1.5;
  min-height: 100vh;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.5rem 0;
}

.api-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.api-hint code {
  background: var(--surface);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

main {
  max-width: 900px;
  margin: 0 auto;
}

#loading {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

#error {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

#error.hidden,
#content.hidden {
  display: none;
}

.summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary-item .label {
  font-size: 0.8rem;
  color: var(--muted);
}

.summary-item .value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
}

.sites {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.site-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.site-card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  padding: 0.75rem 1rem;
  background: rgba(88, 166, 255, 0.08);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-card h2 .domain {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-card .error-msg {
  padding: 1rem;
  color: var(--red);
  font-size: 0.9rem;
}

.site-card .stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.site-card .stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.site-card .stat .label {
  font-size: 0.8rem;
  color: var(--muted);
}

.site-card .stat .value {
  font-size: 1.1rem;
  font-weight: 600;
}

.site-card .countries {
  padding: 0 1rem 1rem;
}

.site-card .countries h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.5rem 0;
}

.country-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.country-list li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.country-list .code {
  font-weight: 600;
  color: var(--accent);
}

.country-list .count {
  color: var(--muted);
  font-size: 0.8rem;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

footer p {
  margin: 0;
}
