:root {
  color-scheme: light dark;
  --fg: #1b1f24;
  --bg: #ffffff;
  --muted: #6b7280;
  --border: #d9dee3;
  --accent: #0b5fff;
  --row-alt: #f5f7fa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6e9ee;
    --bg: #14161a;
    --muted: #9aa4b2;
    --border: #2b2f36;
    --accent: #5b9dff;
    --row-alt: #1c1f24;
  }
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--bg);
  margin: 0;
  padding: 1.5rem 2rem 3rem;
}

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

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

section {
  margin-bottom: 2.5rem;
}

#search-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

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

input, button {
  font: inherit;
}

input[type="date"], input[type="text"] {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
}

button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button:hover { opacity: 0.9; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

tbody tr:nth-child(even) { background: var(--row-alt); }
tbody tr.muted { color: var(--muted); }

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 60ch;
}

.result-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-top: 0.6rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}

.result-item:hover { border-color: var(--accent); }

.error {
  color: #c0392b;
  margin-top: 0.75rem;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--row-alt);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  margin-left: 0.4rem;
}
