:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --card: #1a1d24;
  --border: #2a2f3a;
  --fg: #e6e8ec;
  --muted: #9aa2b1;
  --accent: #4f8cff;
  --accent-fg: #ffffff;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

header h1 {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.35rem 0 1.75rem;
  color: var(--muted);
}

form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

input[type="text"] {
  flex: 1;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
}

input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}

button, .panel-actions a {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  padding: 0.55rem 0.9rem;
  text-decoration: none;
}

form button {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
  font-weight: 600;
}

button:hover, .panel-actions a:hover { filter: brightness(1.1); }

.error {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--error);
  border-radius: 8px;
  color: var(--error);
  background: rgba(255, 107, 107, 0.08);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem 1rem;
}

.meta-grid div { display: flex; flex-direction: column; }
.meta-grid dt { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.meta-grid dd { margin: 0.1rem 0 0; font-variant-numeric: tabular-nums; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.tab[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

pre {
  margin: 0;
  max-height: 420px;
  overflow: auto;
  padding: 0.9rem;
  background: #0b0d11;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  color: #cbd3e1;
}

#allowlists { margin-top: 1.5rem; }
#allowlists .tagline { margin: 0.35rem 0 1rem; font-size: 0.9rem; }
#allowlists a { color: var(--accent); }

.allowlist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.allowlist-table th,
.allowlist-table td {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.allowlist-table thead th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.allowlist-table tbody th { font-weight: 600; white-space: nowrap; }

/* Each format cell offers three IP-version cuts: both / v4 / v6. */
.allowlist-table td.ver { white-space: nowrap; }
.allowlist-table td.ver a { margin-right: 0.6rem; }
.allowlist-table td.ver a:last-child { margin-right: 0; }

.site-footer {
  max-width: 760px;
  margin: 34px auto 0;
  padding: 26px 1.25rem 44px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

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

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --card: #ffffff;
    --border: #d9dde5;
    --fg: #1a1d24;
    --muted: #5c6470;
    --accent-fg: #ffffff;
  }
  pre { background: #f0f2f5; color: #1a1d24; }
}
