:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --ink: #1e2430;
  --muted: #5b6472;
  --accent: #2f6f5e;
  --accent-soft: #e1ede8;
  --accent-ink: #ffffff;
  --warn: #b5651d;
  --warn-soft: #f5e7d6;
  --line: #dde2e7;
}

body.dark {
  --bg: #14181c;
  --surface: #1e2429;
  --surface-2: #20262b;
  --ink: #edeef0;
  --muted: #9aa2ab;
  --accent: #5bb79b;
  --accent-soft: #1e322c;
  --accent-ink: #0e1210;
  --warn: #e0a458;
  --warn-soft: #332619;
  --line: #2c3339;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  transition: background 0.2s ease, color 0.2s ease;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding-inline: 16px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  padding-block: 32px 24px;
  background: var(--surface);
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}

.site-header h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4vw, 38px);
}

.lead {
  margin: 0 0 20px;
  color: var(--muted);
  max-width: 60ch;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  white-space: nowrap;
}

button:hover {
  opacity: 0.9;
}

main {
  padding-block: 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat .num {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.stat .label {
  font-size: 12px;
  color: var(--muted);
}

.stat.ok .num {
  color: var(--accent);
}

.section-title {
  font-size: 20px;
  margin: 0 0 12px;
}

.drawer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  margin: 0;
  font-size: 17px;
}

.drawer-head .count {
  font-size: 12px;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  padding: 16px 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
  text-decoration: none;
  color: inherit;
}

a.card:hover {
  border-color: var(--accent);
}

.card.is-hidden {
  display: none;
}

.card-name {
  font-weight: 600;
  font-size: 14.5px;
}

.card-title {
  font-size: 13px;
  color: var(--muted);
}

.chip {
  align-self: flex-start;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 99px;
}

.chip-empty {
  background: var(--warn-soft);
  color: var(--warn);
}

.chip-filled {
  background: var(--accent-soft);
  color: var(--accent);
}

#empty-search {
  text-align: center;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 18px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: var(--accent);
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .drawer-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
