:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #6b7385; --line: #e3e6eb;
  --accent: #1f5fd6; --accent-weak: #e8effc; --ok: #1d8a4e; --warn: #b7791f; --bad: #c53030;
  --radius: 8px; font-size: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12151b; --card: #1a1e26; --text: #e6e8ec; --muted: #9aa2b1; --line: #2a303b; --accent: #5b8cff; --accent-weak: #1e2a44; }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
a { color: var(--accent); text-decoration: none; }
header { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; }
nav { display: flex; gap: 4px; flex: 1; }
nav a { padding: 8px 12px; border-radius: 6px; color: var(--muted); }
nav a.active { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
main { max-width: 1200px; margin: 0 auto; padding: 24px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.err { color: var(--bad); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--accent-weak); }
button { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 7px 14px; border-radius: 6px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--bad); }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.sm { padding: 4px 10px; font-size: 12.5px; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); width: 100%; }
label { display: block; margin-bottom: 12px; }
label > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: var(--accent-weak); color: var(--accent); }
.badge.ok { background: #e3f4ea; color: var(--ok); }
.badge.bad { background: #fbe6e6; color: var(--bad); }
.badge.warn { background: #fbf0dc; color: var(--warn); }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; min-width: 120px; }
.bar > div { height: 100%; background: var(--accent); }
.bar.warn > div { background: var(--warn); }
.bar.bad > div { background: var(--bad); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login .card { width: 380px; }
.login input { margin: 12px 0; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; z-index: 10; }
.modal-body { width: min(640px, 94vw); max-height: 84vh; overflow: auto; }
.secret { background: var(--bg); border: 1px dashed var(--line); padding: 10px; border-radius: 6px; word-break: break-all; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 6px; z-index: 20; }
.crumbs a { margin-right: 4px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
