:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --ok: #3fb950;
  --fail: #f85149;
  --warn: #d29922;
  --primary: #6cb4d9;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fa;
    --surface: #ffffff;
    --border: #d0d7de;
    --text: #1f2328;
    --text-muted: #656d76;
    --primary: #3d7ea6;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

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

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.status-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-ok { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.badge-fail { background: color-mix(in srgb, var(--fail) 20%, transparent); color: var(--fail); }
.badge-unknown { background: color-mix(in srgb, var(--text-muted) 20%, transparent); color: var(--text-muted); }

.route {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.route-region {
  font-weight: 600;
}

.route-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.route-target {
  color: var(--text-muted);
  font-weight: 500;
}

.dc-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.dc-cell {
  text-align: center;
  padding: 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--mono);
  background: color-mix(in srgb, var(--border) 30%, transparent);
}

.dc-cell.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.dc-cell.fail { background: color-mix(in srgb, var(--fail) 15%, transparent); color: var(--fail); }

.proxy-status {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  background: color-mix(in srgb, var(--border) 30%, transparent);
}

.proxy-status.ok { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.proxy-status.fail { background: color-mix(in srgb, var(--fail) 10%, transparent); }

.meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.section {
  margin-top: 2rem;
}

.section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.section p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

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

.error {
  text-align: center;
  padding: 2rem;
  color: var(--fail);
}

footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }
