:root {
  --bg: #0b0f14;
  --card: #121922;
  --line: #233041;
  --text: #e6edf3;
  --muted: #8b9bb0;
  --accent: #4f8cff;
  --good: #3ecf8e;
  --warn: #f5b74f;
  --bad: #ff6b6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 0 auto 16px; max-width: 460px; }
.card.wide { max-width: none; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); margin: 0 0 16px; }
label { display: block; margin: 0 0 12px; color: var(--muted); font-size: 13px; }
input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #0e141b; color: var(--text); font-size: 15px; }
button, .btn { display: inline-block; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; text-decoration: none; }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button.link { background: none; border: none; color: var(--muted); padding: 0; font-size: 13px; text-decoration: underline; cursor: pointer; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.hidden { display: none !important; }
.head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.logo { font-weight: 700; letter-spacing: 0.14em; color: var(--accent); }
.pill { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
canvas#cv { display: block; width: min(100%, 360px); aspect-ratio: 1; margin: 0 auto; border-radius: 10px; background: #0b0f14; border: 1px solid var(--line); touch-action: none; user-select: none; -webkit-user-select: none; }
.status { min-height: 22px; text-align: center; color: var(--muted); margin: 12px 0 4px; }
.verdict { font-size: 20px; font-weight: 700; margin: 8px 0 12px; }
.verdict.pass { color: var(--good); }
.verdict.grey { color: var(--warn); }
.verdict.fail, .verdict.bot { color: var(--bad); }
.bars { display: grid; gap: 8px; margin-bottom: 12px; }
.bar { display: grid; grid-template-columns: 110px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.bar .track { height: 8px; background: #0e141b; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar .track i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.4s; }
.bar b { color: var(--text); text-align: right; }
ul.explain { margin: 0 0 12px; padding-left: 18px; }
ul.explain li { margin-bottom: 4px; }
details { margin: 6px 0 10px; color: var(--muted); font-size: 13px; }
pre, code { font: 12px/1.5 ui-monospace, Consolas, monospace; background: #0e141b; border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow: auto; }
code { display: block; word-break: break-all; }
.hint { font-size: 13px; color: var(--muted); margin-top: 14px; }
.trap { position: absolute; left: -10000px; top: 0; }

@media (max-width: 520px) {
  .wrap { padding: 10px 6px 32px; }
  .card { padding: 12px; border-radius: 12px; }
  canvas#cv { width: 100%; }
  .status { font-size: 14px; }
}

/* дашборд */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.tile .n { font-size: 30px; font-weight: 700; line-height: 1.1; }
.tile .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.pass { background: rgba(62, 207, 142, 0.15); color: var(--good); }
.badge.grey { background: rgba(245, 183, 79, 0.15); color: var(--warn); }
.badge.fail, .badge.bot { background: rgba(255, 107, 107, 0.15); color: var(--bad); }
canvas.thumb { width: 72px; height: 72px; border-radius: 8px; background: #0b0f14; border: 1px solid var(--line); display: block; }
.small { font-size: 12px; color: var(--muted); }
