:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #151b24;
  --panel-2: #10161f;
  --text: #f3f6fb;
  --muted: #94a3b8;
  --accent: #f59e0b;
  --accent-2: #fb7185;
  --border: rgba(255,255,255,.12);
  --good: #34d399;
  --bad: #fb7185;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(245, 158, 11, .18), transparent 34rem),
    radial-gradient(circle at 90% 0%, rgba(251, 113, 133, .16), transparent 34rem),
    var(--bg);
  color: var(--text);
}
.shell { width: min(1380px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 56px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: min(460px, 100%); }
.hero { margin-bottom: 28px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 68px); line-height: .95; }
.sub { color: var(--muted); font-size: 18px; max-width: 760px; }
.grid { display: grid; grid-template-columns: 0.8fr 1.1fr 1.1fr; gap: 18px; align-items: start; }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,.24);
}
.history-card { margin-top: 18px; }
.card-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.step {
  width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #111827; font-weight: 900;
}
h2 { margin: 0; font-size: 20px; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
label { display: block; color: #dbeafe; font-weight: 700; font-size: 13px; margin: 10px 0 8px; }
textarea, input, select {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, .58);
  color: var(--text);
  border-radius: 16px;
  padding: 14px;
  font: 15px/1.48 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  outline: none;
}
.login-card input { font-family: inherit; }
textarea:focus, input:focus, select:focus { border-color: rgba(245, 158, 11, .75); box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.row, .meta-row, .settings { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.meta-row input { flex: 1; font-family: inherit; }
.settings { justify-content: space-between; color: var(--muted); font-size: 13px; }
.settings label { width: 190px; margin: 0; }
button, a[download], .download-small {
  border: 0;
  border-radius: 14px;
  padding: 12px 15px;
  font-weight: 800;
  color: #111827;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
button:hover, a[download]:hover, .download-small:hover { filter: brightness(1.05); }
button:disabled { opacity: .55; cursor: wait; }
button.ghost { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid var(--border); }
button.primary { width: 100%; margin-top: 14px; font-size: 16px; }
.small { padding: 8px 10px; border-radius: 10px; font-size: 12px; }
.status { min-height: 22px; color: var(--muted); font-size: 14px; }
.status.ok { color: var(--good); }
.status.err { color: var(--bad); white-space: pre-wrap; }
.player { margin-top: 16px; background: rgba(2,6,23,.42); border: 1px solid var(--border); border-radius: 18px; padding: 14px; }
.hidden { display: none; }
audio { width: 100%; margin-bottom: 12px; }
pre { color: var(--muted); white-space: pre-wrap; overflow: auto; font-size: 12px; }
.history-list { display: grid; gap: 10px; margin-top: 14px; }
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, .34);
  border-radius: 16px;
}
.history-main { display: grid; gap: 4px; min-width: 0; }
.history-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-main span { color: var(--muted); font-size: 12px; }
.history-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 1100px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .history-item, .hero-top { align-items: stretch; flex-direction: column; } .history-actions { justify-content: flex-start; } }
