:root {
  --bg: #f6f7f9; --card: #fff; --text: #1b1f24; --muted: #646d78; --line: #dfe3e8;
  --accent: #2f6fed; --star: #e3a008; --chip: #eef1f5; --danger: #c0392b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --card: #171b21; --text: #e6e9ed; --muted: #8b95a1; --line: #2a3038;
    --accent: #6b9bff; --star: #f2c14e; --chip: #222831; --danger: #ff7b6b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; gap: 10px; height: 56px; }
.top h1 { font-size: 18px; margin: 0; }
.spacer { flex: 1; }
.btn { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.controls input, .controls select, .settings input {
  font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; }
.controls input { flex: 1 1 260px; min-width: 0; }
.controls select { flex: 0 1 auto; }
.status { color: var(--muted); min-height: 1.4em; margin: 6px 0; }
.status.error { color: var(--danger); }
.section { margin: 18px 0 28px; }
.section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--chip); border-radius: 999px; padding: 4px 12px; color: var(--text); font-size: 14px; }
.chip:hover { text-decoration: none; outline: 1px solid var(--line); }
.chip small { color: var(--muted); margin-left: 6px; }

.repo { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  display: flex; gap: 10px; align-items: flex-start; }
.repo .body { flex: 1; min-width: 0; }
.repo .name { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.repo .desc { color: var(--muted); margin: 2px 0 6px; overflow-wrap: anywhere; }
.repo .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); align-items: center; }
.repo .meta a { color: var(--muted); }
.repo .meta a:hover { color: var(--accent); }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: 12px; margin-left: 6px; color: var(--muted); font-weight: 400; vertical-align: 2px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.star { background: none; border: none; cursor: pointer; font-size: 20px; line-height: 1; padding: 2px;
  color: var(--line); }
.star.on { color: var(--star); }
.star:hover { color: var(--star); }
.topics { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.topic { background: var(--chip); color: var(--accent); border-radius: 999px; padding: 0 8px; font-size: 12px; cursor: pointer; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }

dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text);
  padding: 0; width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.4); }
.settings { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.settings h2 { margin: 0; font-size: 18px; }
.settings label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.settings label .muted { font-weight: 400; }
.settings .hint { margin: -4px 0 0; color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.top h1, .btn { white-space: nowrap; }
@media (max-width: 520px) {
  #who { display: none; }
  .controls select { flex: 1 1 40%; }
}
