:root {
  --bg: #f6f7f9; --surface: #fff; --text: #14171c; --muted: #5d6573; --border: #e1e4ea;
  --accent: #2f5bea; --accent-weak: #e8eefe; --ok: #127a46; --warn: #a15c00; --err: #b42318;
  --bar: #2f5bea;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --surface: #171a21; --text: #e7e9ee; --muted: #9aa3b2; --border: #2a2f3a;
          --accent: #7c9bff; --accent-weak: #1d2640; --ok: #4cc38a; --warn: #f0a742; --err: #ff6b5e;
          --bar: #7c9bff; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
header.top { background: var(--surface); border-bottom: 1px solid var(--border); }
header.top .in { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center;
                 gap: 20px; height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.brand span { color: var(--muted); font-weight: 500; }
nav a { color: var(--muted); padding: 6px 2px; margin-right: 14px; }
nav a.on { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--accent); }
.spacer { flex: 1; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 28px 0 10px; }
.sub { color: var(--muted); margin-bottom: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.tile .v { font-size: 26px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .s { color: var(--muted); font-size: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px;
     border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll { overflow-x: auto; }
.bar { height: 6px; background: var(--accent-weak); border-radius: 3px; margin-top: 4px; }
.bar > i { display: block; height: 100%; background: var(--bar); border-radius: 3px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px;
        border: 1px solid var(--border); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: currentColor; }
.pill.warn { color: var(--warn); border-color: currentColor; }
.pill.err { color: var(--err); border-color: currentColor; }
.note { padding: 10px 12px; border-radius: 8px; background: var(--accent-weak); margin: 12px 0; }
.note.warn { background: transparent; border: 1px solid var(--warn); }
.note.err { background: transparent; border: 1px solid var(--err); }
.note.secret { font-family: ui-monospace, monospace; word-break: break-all; border: 1px dashed var(--accent); }
form.inline { display: inline; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
label { display: block; font-size: 12px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; }
textarea { width: 100%; min-height: 70px; }
button, .btn { font: inherit; cursor: pointer; border-radius: 7px; padding: 7px 14px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button.link { border: none; background: none; color: var(--accent); padding: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid input, .form-grid select { width: 100%; }
.login { max-width: 360px; margin: 10vh auto; }
.login input { width: 100%; margin: 4px 0 12px; }
.weeknav { display: flex; gap: 10px; align-items: center; }
.muted { color: var(--muted); }
code { font-family: ui-monospace, monospace; font-size: 12.5px; }
