:root {
  color-scheme: light dark;
  --bg: #f6f7f9; --panel: #ffffff; --text: #16181d; --muted: #667085; --line: #e3e6eb;
  --accent: #2f5bea; --good: #17803d; --good-bg: #e3f5e9; --bad: #b42318; --bad-bg: #fde8e6; --warn: #9a6700;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --panel: #171a21; --text: #e6e8ec; --muted: #98a2b3; --line: #262b36;
    --accent: #7b9bff; --good: #5fd08a; --good-bg: #12301f; --bad: #ff8a80; --bad-bg: #3a1614; --warn: #e3b341;
  }
}
* { 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); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, textarea { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.bar { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.bar nav { display: flex; gap: 18px; flex: 1; }
.bar nav a { color: var(--muted); }
.bar nav a[aria-current] { color: var(--text); font-weight: 600; }
.brand { font-weight: 700; color: var(--text); }
main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head .actions, .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { color: var(--muted); margin: 0 0 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.card > header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card > header h2 { margin: 0; }
.narrow { max-width: 420px; margin: 12vh auto 0; }
.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.on { background: var(--good); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.tag.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.tag.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.count { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }
.notice { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.notice.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; }
th, td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.fail td:first-child { color: var(--bad); font-weight: 600; }
tr.warn td:first-child { color: var(--warn); font-weight: 600; }
tr.ok td:first-child { color: var(--good); }
button, .button { font: inherit; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
button:hover, .button:hover { border-color: var(--accent); text-decoration: none; }
button:disabled { opacity: .55; cursor: progress; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; color: var(--muted); padding: 0; }
label { display: block; margin-bottom: 10px; }
label > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
input, select, textarea { width: 100%; font: inherit; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
textarea { min-height: 76px; resize: vertical; }
textarea.tall { min-height: 420px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 14px; padding: 12px 14px 4px; }
legend { font-weight: 600; padding: 0 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
form.inline { display: flex; gap: 8px; }
form.inline input, form.inline select { width: auto; flex: 1; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button[aria-selected=true] { border-color: var(--accent); color: var(--accent); }
.request { border-bottom: 1px solid var(--line); padding: 10px 0; }
.request:last-child { border-bottom: 0; }
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); padding: 20px; width: min(760px, calc(100vw - 32px)); max-height: 86vh; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog form { margin-top: 14px; text-align: right; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 999px; max-width: calc(100vw - 32px); }
#toast.bad { background: var(--bad); color: #fff; }
[hidden] { display: none !important; }
