:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1b1f24; --dim: #5f6b7a; --line: #dfe3e8;
  --accent: #2f6fde; --accent-text: #fff; --good: #1a7f37; --bad: #cf222e; --warn: #9a6700;
  --row: #f9fafb; --code: #f0f2f5;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --panel: #171b21; --text: #e3e7ec; --dim: #8b96a5; --line: #2a313a;
    --accent: #4c8dff; --accent-text: #fff; --good: #3fb950; --bad: #f85149; --warn: #d29922;
    --row: #1b2027; --code: #1f252d;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 15px; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
.dim { color: var(--dim); }
.sub { color: var(--dim); margin: -6px 0 14px; }
main { padding: 20px 24px 60px; max-width: 1600px; margin: 0 auto; }

.top { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: var(--panel);
       border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; color: var(--text); }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { padding: 6px 12px; border-radius: 6px; color: var(--dim); }
.top nav a.on, .top nav a:hover { background: var(--code); color: var(--text); text-decoration: none; }
.who { display: flex; gap: 10px; align-items: center; color: var(--dim); margin: 0; }

button, .btn { font: inherit; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-text); cursor: pointer; display: inline-block; }
button.secondary, .btn.secondary { background: transparent; color: var(--accent); }
button.link { background: none; border: 0; color: var(--accent); padding: 0; }
.btn:hover { text-decoration: none; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
textarea { width: 100%; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; resize: vertical; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 14px; }
.bar label { display: flex; gap: 6px; align-items: center; color: var(--dim); }

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.more { font-size: 12px; font-weight: 400; }

.scroll { overflow: auto; max-height: 75vh; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.panel .scroll { max-height: 360px; }
table.grid { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 5px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.grid th { position: sticky; top: 0; background: var(--code); font-weight: 600; font-size: 12px; }
.grid tbody tr:nth-child(even) { background: var(--row); }
.grid .num { text-align: right; }
.grid .null { color: var(--dim); font-style: italic; font-size: 12px; }
.grid .empty { color: var(--dim); text-align: center; padding: 16px; }
.good { color: var(--good); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.warnc { color: var(--warn); font-weight: 600; }
.meta { color: var(--dim); font-size: 12px; margin: 6px 2px 0; }
.warn { color: var(--warn); }

pre.error { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad);
  border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); padding: 10px 12px; border-radius: 8px; white-space: pre-wrap; }
p.error { color: var(--bad); margin: 0; }
details { margin: 12px 0; }
summary { cursor: pointer; color: var(--dim); }
details pre, code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
details pre { background: var(--code); padding: 10px; border-radius: 8px; overflow: auto; }
.history ul { list-style: none; padding: 0; margin: 8px 0; }
.history li { margin: 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; }

.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cards a { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; color: var(--text); height: 100%; }
.cards a:hover { border-color: var(--accent); text-decoration: none; }
.cards span { color: var(--dim); font-size: 13px; }

.login { max-width: 340px; margin: 12vh auto 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 28px; }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login label { display: flex; flex-direction: column; gap: 4px; color: var(--dim); font-size: 13px; }
.login button { margin-top: 6px; padding: 8px; }

@media (max-width: 700px) {
  main { padding: 16px; }
  .top { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .panels { grid-template-columns: 1fr; }
}

.login .ipnote { margin: 16px 0 0; text-align: center; color: var(--dim); font-size: 12px; }
.login .ipnote code { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--text); }

.login .banner { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 11px; line-height: 1.5;
  text-align: left; color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.login .banner strong { color: var(--warn); }

.login .lannote { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 12px; text-align: center;
  color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--good) 40%, transparent); }

.grid th { cursor: pointer; user-select: none; }
.grid th:hover { background: color-mix(in srgb, var(--accent) 14%, var(--code)); }
.grid th[data-sort] { color: var(--accent); }
.sort-ind { font-size: 10px; opacity: .85; }

.roleform { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 0; }
.rolechk { display: inline-flex; gap: 5px; align-items: center; color: var(--text); font-size: 13px; white-space: nowrap; }
.roleform button { padding: 4px 12px; }
button.danger, .link.danger { color: var(--bad); border-color: var(--bad); }
button.link.danger { background: none; border: 0; }

.invitebox { background: color-mix(in srgb, var(--good) 10%, transparent); border: 1px solid color-mix(in srgb, var(--good) 40%, transparent);
  border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: 13px; }
.invitelink { width: 100%; margin-top: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
