:root {
  --bg: #0f1115;
  --panel: #181b22;
  --border: #272b35;
  --text: #e6e8ee;
  --muted: #8a90a0;
  --accent: #5865f2;
  --danger: #e5534b;
}

* { box-sizing: border-box; }

/* Elements below set their own display, which would otherwise override the hidden attribute. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

main {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  padding: 16px;
  min-height: 100vh;
  align-items: start;
}

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
}

.video-wrap {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

video { width: 100%; height: 100%; display: block; }

.empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  color: var(--muted);
}

.details { display: flex; flex-direction: column; gap: 10px; padding: 12px 2px; }
.title-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.title { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; min-width: 0; }

aside { display: flex; flex-direction: column; gap: 12px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

h2 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

ul { list-style: none; margin: 0; padding: 0; }

.files li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}
.files li:hover { background: rgba(255, 255, 255, 0.04); }
.files li.active { background: rgba(88, 101, 242, 0.2); }
.files li.job, .files li.muted { cursor: default; }
.files .name { flex: 1 1 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .size { flex: 1; color: var(--muted); font-size: 12px; white-space: nowrap; }
.files li.job progress { flex-basis: 100%; height: 6px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); }

input, select, button {
  font: inherit;
  color: var(--text);
  background: #0f1115;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
}

button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.6; cursor: default; }
button.small-btn { padding: 3px 8px; font-size: 12px; }
button.ghost { background: transparent; border-color: var(--border); color: var(--muted); }

#upload-form { display: flex; flex-direction: column; gap: 8px; }
#upload-form input[type='file'] { padding: 6px; }
progress { width: 100%; }

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card h1 { margin: 0; font-size: 22px; }
