:root {
  color-scheme: dark;
  --bg: #111318;
  --panel: #1b1f27;
  --panel-2: #222834;
  --text: #f1f3f7;
  --muted: #9aa3b2;
  --line: #303746;
  --ok: #55d187;
  --warn: #f2c14e;
  --bad: #ee6b6e;
  --accent: #8ab4ff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
h1 { margin: 0 0 4px; font-size: 24px; }
h2 { margin: 0 0 4px; font-size: 18px; }
h2 a { color: var(--text); text-decoration: none; }
h2 a:hover { text-decoration: underline; }
p { margin: 0 0 8px; }
code { font-size: 13px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { color: var(--text); font-weight: 700; text-decoration: none; }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.who form { margin: 0; }

main { width: min(1180px, calc(100vw - 24px)); margin: 20px auto 40px; }
.page-head { margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.panel { margin-top: 16px; }
.panel.narrow { max-width: 520px; margin: 40px auto; }
.card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.card dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 12px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; overflow-wrap: anywhere; }

.pill, .badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 13px; background: #2a3140; color: var(--text); white-space: nowrap; }
.pill.ok { background: var(--ok); color: #07120c; }
.pill.warn { background: var(--warn); color: #1d1503; }
.pill.bad { background: var(--bad); color: #180708; }
.pill.muted { background: #2a3140; color: var(--muted); }

button, a.button { border: 0; border-radius: 6px; padding: 8px 14px; min-height: 38px; color: #071120; background: var(--accent); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; display: inline-block; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.danger { background: var(--bad); color: #180708; }
button.secondary { background: #2a3140; color: var(--text); }
button.link { background: none; color: var(--accent); padding: 0; min-height: 0; font-weight: 400; }
form.restart { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

.notice { margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 6px; background: var(--panel-2); }
.notice.ok { border-left-color: var(--ok); }
.notice.warn { border-left-color: var(--warn); }
.notice.error { border-left-color: var(--bad); }

input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px 8px; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
legend { color: var(--muted); font-size: 13px; padding: 0 4px; }
.user-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; }
.user-form fieldset { grid-column: 1 / -1; }
.user { border-top: 1px solid var(--line); padding: 14px 0; display: grid; gap: 8px; }
.user.disabled .user-id { opacity: .6; }
.user > form:last-child { justify-self: end; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

@media (max-width: 560px) {
  .topbar { padding: 10px 12px; }
  .grid { grid-template-columns: 1fr; }
  .card dl { grid-template-columns: 1fr; }
  .card dt { margin-top: 4px; }
}
