:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-2: #101d32;
  --card: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.14);
  --text: #eef5ff;
  --muted: #9db0ca;
  --accent: #5eead4;
  --accent-2: #60a5fa;
  --danger: #fb7185;
  --ok: #86efac;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Be Vietnam Pro", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  letter-spacing: -0.015em;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(circle at 15% 15%, rgba(96, 165, 250, 0.28), transparent 30%),
    radial-gradient(circle at 85% 0%, rgba(94, 234, 212, 0.18), transparent 28%),
    linear-gradient(135deg, var(--bg), #020617 70%);
  color: var(--text);
}

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  line-height: 0.95;
  margin: 0;
  letter-spacing: -0.08em;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: -0.025em;
  max-width: 680px;
}

.status {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  white-space: nowrap;
}
.status.ok { color: var(--ok); }
.status.error { color: var(--danger); }

.card {
  border: 1px solid var(--card-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.11), rgba(255,255,255,0.06));
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  padding: clamp(20px, 4vw, 36px);
}

label {
  display: block;
  font-weight: 600;
  margin: 0 0 10px;
}

textarea, select, input[type="search"] {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 18px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.64);
  padding: 16px 18px;
  font: inherit;
  font-weight: 400;
  letter-spacing: -0.02em;
  outline: none;
}

textarea:focus, select:focus, input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(94,234,212,0.12);
}

textarea { resize: vertical; }
select option { background: #0f172a; }

.meta {
  text-align: right;
  color: var(--muted);
  margin: 8px 2px 20px;
  font-size: 0.9rem;
}

.filters, .voice-row, .grid {
  display: grid;
  gap: 18px;
  align-items: end;
}

.filters {
  grid-template-columns: minmax(190px, 0.75fr) minmax(180px, 0.65fr) 1.2fr;
  margin-bottom: 18px;
}

.voice-row {
  grid-template-columns: 1.2fr 0.8fr;
  margin-bottom: 20px;
}

.voice-info {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(2, 6, 23, 0.42);
  min-height: 74px;
}

.voice-info strong {
  display: block;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}

.voice-info span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.grid {
  grid-template-columns: 1fr 1fr;
}

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

.quick-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.quick-langs button {
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 10px 13px;
  font-size: 0.9rem;
}

.actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 26px;
}

button, .download {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

button.primary {
  color: #04111d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
button:hover, .download:hover { transform: translateY(-1px); }
button:disabled { opacity: 0.55; cursor: wait; }

.download {
  color: var(--text);
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.09);
}
.download.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.player {
  margin-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.11);
  padding-top: 24px;
}

audio {
  width: 100%;
}

.message {
  min-height: 24px;
  color: var(--muted);
}
.message.error { color: var(--danger); }
.message.ok { color: var(--ok); }

@media (max-width: 820px) {
  .hero { align-items: start; flex-direction: column; }
  .filters, .voice-row, .grid { grid-template-columns: 1fr; }
  .status { white-space: normal; }
}
