:root {
  --fg: #1a1a2e;
  --muted: #666;
  --accent: #2f6fed;
  --danger: #c0392b;
  --line: #ddd;
  --bg: #fafafa;
}

* { box-sizing: border-box; }

body {
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--fg);
  background: var(--bg);
  margin: 0;
}

#topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

#brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--fg);
}

#quota {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.meter {
  width: 8rem;
  height: 0.5rem;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.meter .fill {
  height: 100%;
  background: var(--accent);
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem;
}

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

form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
  margin: 1rem 0;
}

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

input, select {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}

button {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

button:hover { background: #f0f0f0; }

button.danger { color: var(--danger); }

.rows { list-style: none; padding: 0; }

.rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

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

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

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

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

.status {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  background: #eee;
}

.status.transcribing { background: #fff3cd; }
.status.done { background: #d4edda; }
.status.failed { background: #f8d7da; }

.transcript {
  white-space: pre-wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
}

.empty { color: var(--muted); font-style: italic; }
.error { color: var(--danger); }
