:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1d2330; --muted: #667085; --line: #e3e6ec;
  --accent: #2f6fed; --ok: #1a8f4d; --warn: #b7791f; --bad: #c53030; --code: #f0f2f6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --panel: #1b1f27; --text: #e6e9ef; --muted: #98a2b3; --line: #2a303b;
    --accent: #6c9bff; --ok: #4cc38a; --warn: #e3b341; --bad: #ff7b72; --code: #232833;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", "PingFang SC", sans-serif; }
header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; flex-wrap: wrap; }
header h1 { font-size: 16px; margin: 0 8px 0 0; }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav button { background: none; border: 0; padding: 6px 12px; border-radius: 6px; color: var(--muted);
  cursor: pointer; font: inherit; }
nav button.active { background: var(--code); color: var(--text); }
main { max-width: 1000px; margin: 0 auto; padding: 16px; }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px; }
h2 { font-size: 15px; margin: 0 0 10px; }
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: 500; }
code, pre { background: var(--code); border-radius: 4px; font: 13px ui-monospace, Menlo, monospace; }
code { padding: 1px 5px; }
pre { padding: 8px 10px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px;
  background: var(--code); }
.badge.loaded, .badge.ok { color: var(--ok); }
.badge.stale, .badge.warn { color: var(--warn); }
.badge.failed, .badge.bad { color: var(--bad); }
.badge.disabled { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
button.primary, button.danger, button.plain { font: inherit; padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--line); cursor: pointer; background: var(--panel); color: var(--text); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 6px 8px; border-radius: 6px; color: var(--text);
  border: 1px solid var(--line); background: var(--bg); max-width: 100%; }
textarea { width: 100%; min-height: 110px; font: 13px ui-monospace, Menlo, monospace; }
.login { max-width: 360px; margin: 14vh auto 0; }
.login input { width: 100%; font-size: 24px; letter-spacing: .3em; text-align: center; }
.msg { margin: 8px 0; min-height: 1.4em; }
.msg.err { color: var(--bad); }
.msg.good { color: var(--ok); }
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text);
  max-width: 460px; }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
