:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: rgba(17, 24, 39, 0.92);
  --text: #eef3ff;
  --muted: #9fb0d0;
  --line: rgba(255,255,255,0.08);
  --accent: #5ab0ff;
  --accent-2: #7cf0d0;
  --danger: #ff758f;
  --focus: #ffe082;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top, #12213d, var(--bg) 55%);
  color: var(--text);
}
.wrap { max-width: 980px; margin: 0 auto; padding: 32px 18px 56px; }
.hero h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.25rem); }
.eyebrow { margin: 0 0 8px; color: var(--accent-2); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sub { color: var(--muted); max-width: 720px; }
.hidden { display: none !important; }
.tv-welcome { margin-top: 16px; }
.tv-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: .85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: rgba(90,176,255,.14);
  color: #bfe0ff;
}
.tv-copy { margin: 10px 0 0; color: var(--muted); }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
}
.mt { margin-top: 14px; }
.mt-lg { margin-top: 28px; }
.mt-xs { margin-top: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.label { font-weight: 600; }
.input, .textarea {
  width: 100%;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
}
.textarea { min-height: 96px; resize: vertical; }
.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent), #7488ff);
  color: white;
  font-weight: 700;
  cursor: pointer;
}
.btn-secondary { background: rgba(255,255,255,.08); }
.btn-big {
  min-height: 60px;
  padding: 16px 22px;
  font-size: 1.05rem;
}
.status, .hint, .small, .job-meta { color: var(--muted); }
.jobs { display: grid; gap: 16px; }
.tv-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.job {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,.02);
}
.job-title { margin: 0; font-size: 1.05rem; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: .85rem;
  font-weight: 700;
  background: rgba(124,240,208,.12);
  color: var(--accent-2);
}
.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions a, .actions button {
  text-decoration: none;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: white;
  cursor: pointer;
}
.files { padding-left: 18px; margin: 0; }
.error { color: var(--danger); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

body.tv-mode .wrap {
  max-width: 1320px;
  padding: 28px 28px 72px;
}
body.tv-mode .hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
}
body.tv-mode .sub,
body.tv-mode .tv-copy,
body.tv-mode .small,
body.tv-mode .job-meta,
body.tv-mode .hint,
body.tv-mode .status {
  font-size: 1.08rem;
}
body.tv-mode .panel {
  border-radius: 24px;
  padding: 26px;
}
body.tv-mode .label,
body.tv-mode h2,
body.tv-mode .job-title {
  font-size: 1.35rem;
}
body.tv-mode .input,
body.tv-mode .textarea {
  border-radius: 16px;
  padding: 18px 20px;
  font-size: 1.1rem;
}
body.tv-mode .textarea {
  min-height: 140px;
}
body.tv-mode .btn {
  border-radius: 16px;
  min-height: 64px;
  padding: 16px 22px;
  font-size: 1.08rem;
}
body.tv-mode .btn-big {
  min-height: 84px;
  font-size: 1.2rem;
}
body.tv-mode .job {
  border-radius: 22px;
  padding: 22px;
}
body.tv-mode .progress-bar {
  height: 16px;
}
body.tv-mode .actions a,
body.tv-mode .actions button,
body.tv-mode .pill {
  min-height: 54px;
  padding: 14px 16px;
  font-size: 1rem;
}
body.tv-mode .grid {
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 14px;
}

@media (max-width: 640px) {
  .wrap { padding: 20px 14px 42px; }
  .panel { padding: 16px; }
}
