:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --error: #f87171;
  --radius: 12px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 640px;
  width: 100%;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.lang-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  background: var(--bg);
  border-radius: 8px;
  padding: 3px;
  border: 1px solid var(--border);
}

.lang-btn {
  flex: 1;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s;
}

textarea:focus {
  border-color: var(--accent);
}

textarea::placeholder {
  color: var(--text-muted);
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

button {
  flex-shrink: 0;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
}

button.secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

button.secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex: 1;
  text-align: right;
}

.status.error {
  color: var(--error);
}

.player {
  margin-top: 20px;
  display: none;
}

.player.show {
  display: block;
}

.player audio {
  width: 100%;
  border-radius: 8px;
  outline: none;
}

.footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

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

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  body {
    padding: 16px;
    align-items: flex-start;
    padding-top: 48px;
  }

  h1 {
    font-size: 1.4rem;
  }

  .card {
    padding: 16px;
  }

  .actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .status {
    text-align: center;
  }
}
