:root {
  --bg: #0f1115; --panel: #171a21; --line: #262b36; --text: #e8eaf0; --muted: #8b93a7;
  --accent: #c8a2ff; --ok: #4ade80; --err: #f87171; --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.top { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center;
  padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { font-weight: 700; color: var(--text); letter-spacing: .04em; }
.brand span, .muted { color: var(--muted); }
nav { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
nav a { color: var(--text); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.card.highlight { border-color: var(--accent); }
.narrow { max-width: 460px; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.login { max-width: 380px; margin: 12vh auto 0; }
label { display: block; margin-bottom: .75rem; color: var(--muted); font-size: .9rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font: inherit; }
textarea { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .button { display: inline-block; padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--line);
  background: #222734; color: var(--text); font: inherit; cursor: pointer; }
button.primary { background: var(--accent); color: #1a1029; border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--err); }
button.small { padding: .3rem .6rem; font-size: .85rem; }
button.link { background: none; border: 0; color: var(--muted); padding: 0; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.row label { flex: 1 1 180px; margin: 0; }
form.inline { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
form.inline input, form.inline select { width: auto; margin: 0; padding: .3rem .5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.alert { padding: .6rem .8rem; border-radius: 8px; border: 1px solid; }
.alert.error { color: var(--err); border-color: #5b2626; background: #2a1414; }
.alert.ok, .ok { color: var(--ok); }
.alert.ok { border-color: #1f4d33; background: #102117; }
.small { font-size: .85rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--panel); color: var(--muted); font-weight: 600; font-size: .85rem; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .75rem; overflow-x: auto; font-size: .85rem; }
pre.token { color: var(--accent); word-break: break-all; white-space: pre-wrap; }
details summary { cursor: pointer; color: var(--muted); margin-bottom: .5rem; }
