:root {
  --bg: #ffffff;
  --fg: #17181c;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --panel: #f9fafb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --fg: #e8eaed;
    --muted: #9aa1ab;
    --line: #262b33;
    --accent: #6ea8fe;
    --panel: #171a20;
  }
}

* { box-sizing: border-box; }

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

header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 600; color: var(--fg); text-decoration: none; }
.hub { color: var(--muted); font-size: 0.85rem; }

main { max-width: 68rem; margin: 0 auto; padding: 1.5rem; }

h1 { font-size: 1.35rem; margin: 0 0 0.75rem; }
h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.04em;
     color: var(--muted); margin: 2rem 0 0.6rem; }

.stats { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.stat {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.75rem 1.1rem; min-width: 6rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
}
.stat .n { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 0.8rem; }

table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 0.8rem;
     text-transform: uppercase; letter-spacing: 0.03em; }
td.desc { color: var(--muted); }
a { color: var(--accent); }

code, pre {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
}
pre {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem; overflow-x: auto; white-space: pre-wrap;
}

.lock {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.1rem 0.4rem; border: 1px solid var(--line); border-radius: 4px;
  color: var(--muted);
}

.empty { color: var(--muted); }

.error, .warn {
  padding: 0.7rem 0.9rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel);
}
.error { border-color: #b4232a; }
.warn { color: var(--muted); }

label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem;
        color: var(--muted); }
input {
  font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.35rem 0.5rem;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

form.inline { display: inline-flex; margin: 0; gap: 0.4rem; }
form.signout { margin-left: auto; }
form.signout button { font-size: 0.8rem; padding: 0.2rem 0.6rem; }

dl.meta { display: grid; grid-template-columns: max-content 1fr;
          gap: 0.2rem 1rem; margin: 0 0 1rem; }
dl.meta dt { color: var(--muted); font-size: 0.85rem; }
dl.meta dd { margin: 0; }

form { margin: 1rem 0; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
button {
  font: inherit; padding: 0.35rem 0.9rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--fg);
  cursor: pointer;
}
button:hover { border-color: var(--accent); }
