:root {
  color-scheme: dark light;
  --bg: #0f1216;
  --surface: #171b22;
  --border: #2a3140;
  --text: #e8ecf3;
  --muted: #9aa3b2;
  --accent: #6ea8fe;
  --legacy: #c9a227;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --border: #d9dee8;
    --text: #141820;
    --muted: #5c6675;
    --accent: #1a5fb4;
    --legacy: #9a6b00;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.title {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.root-path {
  font-size: 0.88em;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  word-break: break-all;
}

.header-meta {
  font-size: 0.85rem;
}

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

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.count-line {
  margin: 0;
  flex: 1 1 100%;
  font-size: 0.9rem;
}

.search-wrap {
  flex: 1 1 220px;
}

#filter {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

#filter:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.toggles {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chk {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
  user-select: none;
}

.empty {
  color: var(--muted);
  margin: 0 0 1rem;
}

.hidden {
  display: none !important;
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.5rem;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2em 0.55em;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.badge-legacy {
  border-color: color-mix(in srgb, var(--legacy) 55%, var(--border));
  color: var(--legacy);
}

.path-line {
  font-size: 0.82rem;
  color: var(--muted);
  word-break: break-all;
}

.desc {
  margin: 0;
  font-size: 0.92rem;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
}

.meta-row {
  font-size: 0.8rem;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
