:root {
  --bg: #0a0a0f;
  --bg-2: #15151c;
  --bg-3: #1f1f2a;
  --line: #2a2a36;
  --text: #e7e7ee;
  --muted: #a4a4b8;
  --dim: #6a6a80;
  --accent: #7c5cff;
  --accent-2: #9c7cff;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(10,10,15,0.95), rgba(10,10,15,0.85));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.brand-title { font-weight: 700; font-size: 18px; }
.brand-sub { color: var(--muted); font-size: 13px; }

nav { display: flex; gap: 6px; }
nav a {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--muted);
  border: 1px solid transparent;
}
nav a.active {
  background: var(--bg-3);
  color: var(--text);
  border-color: var(--line);
}

main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px 60px;
}

footer {
  display: flex; justify-content: space-between;
  padding: 24px 28px;
  color: var(--dim);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.empty {
  padding: 36px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* ----- Filters ----- */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px;
}
.chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.chip.active { color: var(--text); border-color: var(--accent); background: rgba(124, 92, 255, 0.12); }
.search input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  width: 260px;
}
.search input:focus { outline: none; border-color: var(--accent); }

/* ----- Table ----- */
table.lb {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
table.lb th, table.lb td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
table.lb th {
  background: var(--bg-3);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
table.lb tbody tr:hover { background: rgba(124, 92, 255, 0.06); cursor: pointer; }
table.lb td.repo { font-family: ui-monospace, Menlo, Consolas, monospace; }
table.lb td.score { font-variant-numeric: tabular-nums; font-weight: 700; }
.kind {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11px;
  border-radius: 4px;
  background: var(--bg-3);
  color: var(--muted);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.kind.claude { color: #c4b5fd; }
.kind.agents { color: #93c5fd; }
.kind.skill  { color: #fcd34d; }

.score-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-pill.s5 { background: rgba(74, 222, 128, 0.18); color: #4ade80; }
.score-pill.s4 { background: rgba(124, 92, 255, 0.18); color: #c4b5fd; }
.score-pill.s3 { background: rgba(92, 184, 255, 0.18); color: #93c5fd; }
.score-pill.s2 { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.score-pill.s1 { background: rgba(248, 113, 113, 0.18); color: #f87171; }

.bucket-label { color: var(--dim); font-size: 12px; margin-left: 6px; }

/* ----- Pagination ----- */
.pager {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.pager button {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.pager button:disabled { color: var(--dim); cursor: not-allowed; }

/* ----- Detail / Lint ----- */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 10px 0; }
.card .meta { color: var(--muted); font-size: 13px; }

.hero {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: center;
}
.hero .ring {
  width: 220px; height: 220px;
}
.hero .total {
  font-size: 64px; font-weight: 800; line-height: 1; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.hero .bucket { color: var(--accent); font-weight: 600; }

.breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.rule-row {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.rule-row .name { font-weight: 600; font-size: 13px; }
.rule-row .bar {
  position: relative;
  height: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.05);
  margin-top: 6px;
}
.rule-row .bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.rule-row .sub { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rule-row .hits { color: var(--dim); font-size: 12px; margin-top: 6px; }
.rule-row .hits code { background: rgba(255,255,255,0.05); padding: 1px 5px; border-radius: 4px; color: var(--muted); }

.lint-form {
  display: flex; gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.lint-form input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  font: inherit;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.lint-form input:focus { outline: none; border-color: var(--accent); }
.lint-form button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.lint-form button:disabled { background: var(--dim); cursor: not-allowed; }

.share { color: var(--muted); font-size: 13px; }
.share input { width: 100%; background: var(--bg-3); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 10px; font-family: ui-monospace, Menlo, Consolas, monospace; }

.histo {
  display: flex; align-items: flex-end; gap: 6px;
  height: 200px;
  padding: 12px;
  background: var(--bg-3);
  border-radius: 8px;
}
.histo .col {
  flex: 1;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-radius: 4px 4px 0 0;
  position: relative;
}
.histo .col span {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--muted);
}

.muted { color: var(--muted); }
.dim   { color: var(--dim); }

@media (max-width: 800px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hero { grid-template-columns: 1fr; }
  .search input { width: 100%; }
  table.lb th:nth-child(3), table.lb td:nth-child(3),
  table.lb th:nth-child(5), table.lb td:nth-child(5) { display: none; }
}
