:root {
  --bg: #0b0b0c;
  --fg: #ededef;
  --muted: #8a8a92;
  --faint: #56565d;
  --line: #1e1e21;
  --line-strong: #2a2a2e;
  --accent: #ededef;
  --field-bg: #131316;
  --danger: #f87171;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 52px;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.topbar nav {
  display: flex;
  gap: 1.25rem;
  flex: 1;
}
.topbar nav a {
  font-size: 13px;
  color: var(--muted);
  padding: 2px 0;
  transition: color 0.15s;
}
.topbar nav a:hover { color: var(--fg); }
.logout { margin: 0; }
.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s;
}
.linkbtn:hover { color: var(--fg); }

/* content */
.content {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.page-title {
  margin: 0 0 2rem;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* stat rows (no boxes; hairline separated) */
.stats { border-top: 1px solid var(--line); }
.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value {
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.stat-value.empty { color: var(--faint); font-weight: 400; }

/* login */
.login {
  max-width: 300px;
  margin: 18vh auto 0;
  padding: 0 1.5rem;
}
.login h1 {
  margin: 0 0 1.5rem;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.field { display: block; margin-bottom: 1rem; }
.field span {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 12px;
  color: var(--muted);
}
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  background: var(--field-bg);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus { border-color: var(--fg); }

button.primary {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}
button.primary:hover { opacity: 0.85; }
button.primary:active { transform: translateY(1px); }

.error {
  margin: 0 0 1rem;
  font-size: 13px;
  color: var(--danger);
}
.warn {
  margin: 0 0 1rem;
  font-size: 13px;
  color: var(--fg);
  border-left: 2px solid var(--muted);
  padding-left: 0.6rem;
}
.dl-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
}

/* domains */
.inline-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  max-width: 420px;
}
.inline-form input { flex: 1; }
button.primary.compact { width: auto; padding: 0.5rem 1rem; }

input[type="file"] {
  width: 100%;
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  background: var(--field-bg);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}
input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.25rem 0.7rem;
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  background: var(--line-strong);
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.rows { border-top: 1px solid var(--line); }
.row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.host { font-size: 14px; font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.status-active { color: #4ade80; border-color: #1f5133; }
.status-dead { color: var(--faint); }
.linkbtn.accent { color: var(--fg); font-weight: 500; }
.linkbtn.danger { color: var(--muted); }
.linkbtn.danger:hover { color: var(--danger); }
.muted-note { font-size: 12px; color: var(--muted); }
.empty-note { color: var(--faint); font-size: 13px; }

/* analytics */
.range {
  display: flex;
  gap: 1.25rem;
  margin: -1rem 0 2rem;
}
.range a {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s;
}
.range a:hover { color: var(--fg); }
.range a.on { color: var(--fg); font-weight: 500; }

.section-title {
  margin: 2.5rem 0 0.5rem;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.bars { border-top: 1px solid var(--line); }
.bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.bar-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 38%;
  min-width: 0;
  font-size: 13px;
}
.bar-track {
  flex: 1;
  height: 6px;
  background: var(--field-bg);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  background: var(--fg);
  border-radius: 3px;
}
.bar-value {
  flex: 0 0 3.5rem;
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.bar.zero .bar-name,
.bar.zero .bar-value { color: var(--faint); }

.trend {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 88px;
  padding-top: 0.5rem;
  border-bottom: 1px solid var(--line-strong);
}
.trend-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}
.trend-bar {
  min-height: 2px;
  background: var(--fg);
  border-radius: 2px 2px 0 0;
}
.trend-col.zero .trend-bar { background: var(--line-strong); }
.trend-axis {
  display: flex;
  gap: 4px;
  margin-top: 0.4rem;
}
.trend-axis span {
  flex: 1;
  font-size: 10px;
  color: var(--faint);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
