:root {
  --bg: #f5f6f8; --card: #ffffff; --text: #16181d; --muted: #5d6470; --line: #dfe2e7;
  --accent: #1f5fd6; --accent-text: #ffffff; --error-bg: #fdecec; --error: #a4161a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --card: #1a1d23; --text: #eceef2; --muted: #9aa1ad; --line: #2c3038;
    --accent: #5b8cff; --accent-text: #0b0d10; --error-bg: #3a1c1e; --error: #ffb3b5;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-block; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line);
        border-radius: 14px; padding: 28px 24px; display: flex; flex-direction: column; }
.card h1 { font-size: 22px; margin: 22px 0 16px; }
label { font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
input[type=text], input[type=password] {
  font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 12px; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
button { font: inherit; font-weight: 600; border: 0; border-radius: 9px; padding: 11px 14px; cursor: pointer;
         background: var(--accent); color: var(--accent-text); }
.card button { margin-top: 20px; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); padding: 7px 12px; font-weight: 500; }
.error { background: var(--error-bg); color: var(--error); border-radius: 9px; padding: 10px 12px; margin: 0 0 6px; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 16px 0 0; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
       padding: 14px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.who form { margin: 0; }
.page { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }
.page h1 { margin: 0 0 8px; font-size: 26px; }
.muted { color: var(--muted); }

.tabs { display: flex; gap: 4px; flex: 1; margin-left: 24px; }
.tabs a { color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-weight: 500; }
.tabs a:hover { color: var(--text); background: var(--bg); }
.tabs a[aria-current="page"] { color: var(--text); background: var(--bg); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 20px 0; }
.tile, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tile .k { color: var(--muted); font-size: 13px; }
.tile .v { font-size: 26px; font-weight: 600; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--muted); font-size: 13px; }
.panel h2 { font-size: 16px; margin: 0 0 10px; }
.list { width: 100%; border-collapse: collapse; }
.list td { padding: 8px 0; border-top: 1px solid var(--line); }
.list tr:first-child td { border-top: 0; }
.num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.placeholder { margin-top: 24px; }
@media (max-width: 640px) { .tabs { order: 3; flex-basis: 100%; margin-left: 0; } }

.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.pill.run { color: var(--accent); border-color: var(--accent); }
.subtabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 14px 0 18px; }
.subtabs a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a:hover { color: var(--text); }
.subtabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.panel { margin-bottom: 16px; }
.findings h2 { margin-top: 18px; }
.findings h2:first-child { margin-top: 0; }
.findings p { margin: 6px 0; }
a { color: var(--accent); }
.small { font-size: 13px; }
.note { background: var(--card); border: 1px solid var(--accent); border-radius: 9px; padding: 10px 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }
button:disabled { opacity: .5; cursor: default; }
.runs td { padding-right: 12px; }
.ok { color: #1f8a4c; }
.bad { color: var(--error); }
.t-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.t-head h2 { margin: 0; }
.filter { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 200px; }
.scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 8px; }
table.data { border-collapse: collapse; width: 100%; font-size: 13px; }
table.data th { position: sticky; top: 0; background: var(--card); text-align: left; font-weight: 600; padding: 8px 10px;
  border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; }
table.data th[aria-sort="ascending"]::after { content: " ▲"; }
table.data th[aria-sort="descending"]::after { content: " ▼"; }
table.data td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tbody tr:hover { background: var(--bg); }
.prose { line-height: 1.6; }
.prose table { border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.prose code { background: var(--bg); padding: 1px 4px; border-radius: 4px; }
pre.log { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; max-height: 75vh; font-size: 12px; white-space: pre-wrap; }
@media (prefers-color-scheme: dark) { .ok { color: #6fd39a; } }
table.data td.code { white-space: nowrap; }
