:root {
  --bg: #ffffff;
  --card: #f5f6f8;
  --text: #16181d;
  --muted: #6b7280;
  --line: #e4e6eb;
  --accent: #4f46e5;
  --good: #16a34a;
  --mid: #d97706;
  --bad: #dc2626;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b;
    --card: #1e2128;
    --text: #eef0f4;
    --muted: #9aa1ad;
    --line: #2c3039;
    --accent: #818cf8;
    --good: #22c55e;
    --mid: #f59e0b;
    --bad: #f87171;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
}
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); width: 100%; }

/* Score ring */
.ring {
  width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  background: conic-gradient(var(--col) calc(var(--pct) * 1%), var(--line) 0);
  display: grid; place-items: center;
}
.ring-inner {
  width: calc(var(--size) - 16px); height: calc(var(--size) - 16px); border-radius: 50%;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
}
.ring-num { font-size: calc(var(--size) * 0.3); font-weight: 800; line-height: 1; }
.ring-max { font-size: 11px; color: var(--muted); margin-left: 2px; }

/* Category bars */
.cat { margin-bottom: 8px; }
.cat-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.cat-top span:last-child { color: var(--muted); }
.bar { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; }

/* Checks */
.checks { list-style: none; padding: 0; margin: 0; }
.check { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.icon {
  width: 20px; height: 20px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff;
}
.check.pass .icon { background: var(--good); }
.check.warn .icon { background: var(--mid); }
.check.fail .icon { background: var(--bad); }
.check-body { flex: 1; min-width: 0; }
.check-top { display: flex; justify-content: space-between; gap: 8px; }
.pts { color: var(--muted); font-size: 11px; white-space: nowrap; }
.detail { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.fix { font-size: 12px; margin-top: 4px; padding: 6px 8px; border-radius: 6px; background: var(--card); }

/* Extra statuses (page audit engine) */
.check.info .icon { background: #2563eb; }
.check.manual .icon { background: #7c3aed; }
.check.unknown .icon { background: #6b7280; }
.check.na .icon { background: #9ca3af; }
.cid { font: 600 11px ui-monospace, Menlo, Consolas, monospace; color: var(--muted); }
.chip-st { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .03em; padding: 2px 7px; border-radius: 99px; color: #fff; white-space: nowrap; }
.st-pass { background: var(--good); }
.st-fail { background: var(--bad); }
.st-warn { background: var(--mid); }
.st-info { background: #2563eb; }
.st-manual { background: #7c3aed; }
.st-unknown { background: #6b7280; }
.st-na { background: #9ca3af; }

/* The hidden attribute must always win over display rules */
[hidden] { display: none !important; }
