:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --ok: #22c55e;
  --error: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 1.5rem 1rem 0.5rem;
  text-align: center;
}

header h1 { margin: 0; font-size: 1.6rem; }
.subtitle { color: var(--text-muted); margin: 0.3rem 0 0; font-size: 0.95rem; }

main {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1.2rem;
}

.panel.info p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; margin: 0.4rem 0 0; }
.panel.info h2 { margin: 0; font-size: 1rem; }

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  margin-top: 0.8rem;
}
label:first-child { margin-top: 0; }

textarea, select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.6rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

textarea:focus, select:focus { outline: 2px solid var(--accent); }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.char-count { text-align: right; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

button, .download-btn {
  display: inline-block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.7rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #0f172a;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

button:hover, .download-btn:hover { background: var(--accent-hover); }
button:disabled { background: var(--panel-border); color: var(--text-muted); cursor: not-allowed; }

.status {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.1);
}
.status.error { color: var(--error); background: rgba(248, 113, 113, 0.1); }
.status.ok { color: var(--ok); }

.progress-wrap {
  margin-top: 0.6rem;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

audio { width: 100%; margin-top: 0.5rem; }

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 1rem;
}
