:root {
  color-scheme: light dark;
  --border: #d8dde3;
  --bg-alt: #f4f6f8;
  --accent: #1a5fb4;
  --text-muted: #5c6773;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0 1.5rem 2rem;
  color: #1c1f24;
  background: #fff;
}

@media (prefers-color-scheme: dark) {
  body {
    background: #16181c;
    color: #e7e9ec;
  }
  :root {
    --border: #33383f;
    --bg-alt: #202327;
    --text-muted: #9aa3ad;
  }
}

header {
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

h1 {
  font-size: 1.4rem;
  margin: 0;
}

#filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

#filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--text-muted);
  gap: 0.25rem;
}

#filters input {
  font: inherit;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: inherit;
}

#titleQuery {
  min-width: 16rem;
}

#filters button {
  font: inherit;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg-alt);
  color: inherit;
}

#filters button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

#resultCount {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:hover {
  background: var(--bg-alt);
}

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

td a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  table, thead, tbody, tr, th, td {
    display: block;
  }
  thead {
    display: none;
  }
  tr {
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
  }
  td {
    border: none;
    padding: 0.2rem 0;
  }
  td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
  }
}
