:root {
  --bg: #0e1014;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a2f3a;
  --text: #e9ecf1;
  --muted: #8b93a3;
  --accent: #f5c518;
  --accent-text: #1a1400;
  --red: #ff5d5d;
  --green: #3ddc84;
  --amber: #ffb547;
  --discord: #5865f2;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
code { font: 14px ui-monospace, "Cascadia Code", Consolas, monospace; }
.muted { color: var(--muted); }
.center-text { text-align: center; }

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: #0b0d10;
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.who img { border-radius: 50%; background: var(--panel-2); }

main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.hero { max-width: 520px; margin: 48px auto; text-align: center; padding: 32px 28px; }
.hero p { color: #c3c9d4; }
.section-title { margin: 32px 0 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 9px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: #3a4150; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.discord { background: var(--discord); border-color: var(--discord); color: #fff; margin-top: 8px; padding: 12px 22px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.link:hover { color: var(--text); }
.link.danger:hover { color: var(--red); }

.idbox { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 12px 0 16px; }
.idbox code { background: var(--panel-2); border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; font-size: 16px; }

/* Upload */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(245, 197, 24, .05); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop span { color: var(--muted); font-size: 14px; }

.queue { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.row {
  display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto; gap: 12px; align-items: start;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
}
.row .name { font-weight: 600; overflow-wrap: anywhere; }
.row .size { color: var(--muted); font-size: 13px; }
.row textarea, #notes-list {
  width: 100%; min-height: 44px; resize: vertical; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px;
}
.row textarea:focus, #notes-list:focus { outline: 2px solid rgba(245, 197, 24, .5); outline-offset: 0; border-color: transparent; }
.row .x { align-self: center; }
.progress { height: 4px; background: var(--bg); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.row .err { color: var(--red); font-size: 13px; margin-top: 4px; }

details { margin-top: 14px; }
summary { cursor: pointer; color: var(--muted); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }

/* Jobs */
.jobs { display: flex; flex-direction: column; gap: 14px; }
.job { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.job-head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.job-file { font-weight: 600; overflow-wrap: anywhere; }
.job-meta { color: var(--muted); font-size: 13px; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.job.running .badge, .job.queued .badge, .job.uploading .badge { color: var(--amber); border-color: rgba(255, 181, 71, .4); }
.job.done .badge { color: var(--green); border-color: rgba(61, 220, 132, .4); }
.job.failed .badge { color: var(--red); border-color: rgba(255, 93, 93, .4); }
.note { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--line); color: #c3c9d4; font-size: 14px; white-space: pre-wrap; }

.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 14px 0 4px; flex-wrap: wrap; }
.steps li { font-size: 12px; padding: 4px 10px; border-radius: 6px; background: var(--panel-2); color: var(--muted); }
.steps li.done { color: var(--text); }
.steps li.done::before { content: "✓ "; color: var(--green); }
.steps li.now { color: var(--accent-text); background: var(--accent); font-weight: 700; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .7; } }
.elapsed { color: var(--muted); font-size: 13px; }

.job-title { font-size: 20px; margin: 14px 0 10px; }
.videos { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.videos figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.videos video { background: #000; border-radius: 8px; border: 1px solid var(--line); display: block; }
.v-portrait video { height: 400px; width: 225px; }
.v-landscape video { width: 480px; height: 270px; }
.videos figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.caption { margin-top: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.caption pre { margin: 0 0 10px; white-space: pre-wrap; font: inherit; font-size: 14px; color: #d6dbe3; }
.job-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.error { color: var(--red); margin: 12px 0 0; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .bar { padding: 10px 16px; }
  .who span { display: none; }
  .row { grid-template-columns: 1fr auto; }
  .row .note-cell { grid-column: 1 / -1; grid-row: 2; }
  .v-landscape video { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .videos figure.v-landscape { width: 100%; }
  .v-portrait video { width: 180px; height: 320px; }
}
