:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #666;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --border: #e2e2e7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --card: #1e1e22;
    --text: #f0f0f0;
    --muted: #a0a0a8;
    --border: #333338;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.card {
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

h1 { margin: 0 0 4px; font-size: 1.4rem; }
.subtitle { margin: 0 0 20px; color: var(--muted); font-size: 0.9rem; }

label { display: block; font-size: 0.85rem; margin-bottom: 6px; color: var(--muted); }

textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

.charcount { text-align: right; font-size: 0.75rem; color: var(--muted); margin: 4px 0 16px; }

.row { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 20px; flex-wrap: wrap; }
.row > div:first-child { flex: 1; min-width: 160px; }
.checkbox-row { display: flex; align-items: center; padding-bottom: 10px; }
.checkbox-row label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: 0.9rem; }

button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.status { min-height: 1.2em; font-size: 0.85rem; color: var(--muted); margin: 12px 0 0; }

audio { width: 100%; margin-top: 12px; }
#download {
  display: block;
  text-align: center;
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
}
