:root {
  color-scheme: light dark;
  --fg: #1a1a1a;
  --bg: #ffffff;
  --border: #ddd;
  --accent: #2563eb;
  --muted: #666;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e5e5e5;
    --bg: #121212;
    --border: #333;
    --accent: #60a5fa;
    --muted: #999;
  }
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--fg);
  background: var(--bg);
  margin: 0;
  padding: 1rem;
  max-width: 720px;
  margin-inline: auto;
}

h1 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.site-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: bold;
}

#status {
  color: var(--muted);
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-bottom: 0.75rem;
}

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

select, input {
  font-size: 1rem;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--muted);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hidden { display: none; }

.muted { color: var(--muted); font-size: 0.85rem; }

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

button {
  font-size: 1rem;
  padding: 0.4rem 0.9rem;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

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

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

footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}
