:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: #141b33;
  --panel-2: #0f1529;
  --border: #2a355f;
  --text: #edf2ff;
  --muted: #9eabd4;
  --accent: #7aa2ff;
  --accent-2: #9b7bff;
  --danger: #ff7b89;
  --success: #55d39a;
  --warning: #ffc76b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #162042 0%, var(--bg) 45%);
  color: var(--text);
}
.page { max-width: 1100px; margin: 0 auto; padding: 32px 20px 80px; }
.narrow-page { max-width: 560px; }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 18px; }
.compact-hero { margin-bottom: 12px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; }
h1, h2 { margin: 0; }
h1 { font-size: 42px; line-height: 1.05; margin-bottom: 10px; }
.login-title { font-size: 34px; }
h2 { font-size: 20px; margin-bottom: 8px; }
.sub, .helper, .muted { color: var(--muted); }
.sub { max-width: 720px; }
.meta-card, .card { background: rgba(20, 27, 51, 0.88); border: 1px solid var(--border); border-radius: 18px; backdrop-filter: blur(10px); }
.meta-card { min-width: 220px; padding: 18px; display: grid; gap: 14px; }
.meta-card span, .timeline span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.meta-card strong, .timeline strong { font-size: 15px; }
.card { padding: 22px; margin-bottom: 20px; }
.login-card { width: 100%; }
.top-nav { display: flex; gap: 10px; margin-bottom: 18px; }
.nav-link { padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,0.06); color: var(--text); text-decoration: none; border: 1px solid var(--border); }
.nav-link.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; }
.nav-link.subtle { opacity: 0.9; }
.auth-row, .actions, .download-row { display: flex; gap: 12px; flex-wrap: wrap; }
input, textarea, select, button, a { font: inherit; }
input, textarea, select {
  width: 100%; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 12px; padding: 12px 14px;
}
textarea { resize: vertical; min-height: 180px; }
button, a {
  border: 0; border-radius: 12px; padding: 12px 16px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; text-decoration: none; cursor: pointer; font-weight: 700;
}
button.secondary { background: #243051; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field span { font-size: 14px; color: var(--muted); }
.checkbox-field { flex-direction: row; align-items: center; gap: 10px; padding-top: 28px; }
.checkbox-field input { width: 18px; height: 18px; }
.result-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.badge { padding: 8px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.badge.idle { background: #243051; color: var(--muted); }
.badge.queued, .badge.running { background: rgba(255, 199, 107, 0.15); color: var(--warning); }
.badge.done { background: rgba(85, 211, 154, 0.15); color: var(--success); }
.badge.error { background: rgba(255, 123, 137, 0.15); color: var(--danger); }
.mini-badge { padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.mini-badge.queued, .mini-badge.running { background: rgba(255, 199, 107, 0.15); color: var(--warning); }
.mini-badge.done { background: rgba(85, 211, 154, 0.15); color: var(--success); }
.mini-badge.error { background: rgba(255, 123, 137, 0.15); color: var(--danger); }
.error-box { margin: 0 0 14px; padding: 14px; border-radius: 12px; white-space: pre-wrap; background: rgba(255, 123, 137, 0.08); border: 1px solid rgba(255, 123, 137, 0.32); color: #ffd7dd; }
.video-wrap { margin-top: 12px; }
video { width: 100%; max-height: 560px; border-radius: 16px; background: black; border: 1px solid var(--border); }
.timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.status-text { margin-top: 12px; }
.hidden { display: none !important; }
code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 6px; }
.history-list { display: grid; gap: 12px; }
.history-item {
  width: 100%; text-align: left; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: block;
}
.history-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.history-prompt { color: var(--text); margin-bottom: 8px; }
.history-meta { color: var(--muted); font-size: 13px; }
@media (max-width: 800px) {
  .hero { flex-direction: column; }
  .meta-card { width: 100%; }
  .form-grid, .timeline { grid-template-columns: 1fr; }
  h1 { font-size: 34px; }
}
