:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #171a1f;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #1f6feb;
  --accent-soft: #e7f0ff;
  --good: #177245;
  --warn: #8a5a00;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

p {
  margin: 0;
}

#subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.stats {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px 48px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px;
  gap: 14px;
  margin-bottom: 12px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
}

input:focus,
select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.tag-panel {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.tag-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tag-panel-header button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 4px 8px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfe;
  color: #384150;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 4px 8px;
}

.tag-filter small {
  color: var(--muted);
  font-size: 11px;
}

.tag-filter.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #174ea6;
  font-weight: 700;
}

.active-filters {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.repo-list {
  display: grid;
  gap: 12px;
}

.repo-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.repo-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.repo-title h2 {
  margin: 0;
  font-size: 18px;
}

.status {
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef8f2;
  color: var(--good);
  font-size: 12px;
  font-weight: 700;
}

.status.paused,
.status.archived,
.status.private {
  background: #fff6df;
  color: var(--warn);
}

.summary {
  margin-top: 8px;
  color: #313741;
  line-height: 1.5;
}

.meta {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.meta code {
  color: #384150;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: #174ea6;
  font-size: 12px;
}

.commands {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 300px;
}

.commands h3 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.command {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fbfcfe;
}

.command span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

code {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

a:hover {
  text-decoration: underline;
}

.empty,
.error {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.error {
  color: #b42318;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar,
  .repo-card {
    grid-template-columns: 1fr;
  }

  .commands {
    min-width: 0;
  }
}
