:root {
  --bg: #0e1014;
  --panel: #161a21;
  --panel-2: #1d222b;
  --line: #2a303b;
  --text: #e8eaee;
  --muted: #8b93a1;
  --accent: #f2b84b;
  --accent-ink: #1a1405;
  --ok: #5fd08a;
  --bad: #ff7a6b;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { width: 100%; max-width: 960px; margin: 0 auto; padding: 16px; flex: 1; }
h1 { font-size: 1.8rem; line-height: 1.2; margin: .4em 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 2rem 0 .3rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px;
       padding: 12px 16px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: .02em; }
.brand .mark { color: var(--accent); }
.top nav { display: flex; align-items: center; gap: 14px; font-size: .9rem; flex-wrap: wrap; }
.top nav form { margin: 0; }
.who { color: var(--muted); overflow: hidden; text-overflow: ellipsis; max-width: 40vw; white-space: nowrap; }
.foot { padding: 20px 16px; color: var(--muted); font-size: .8rem; text-align: center; border-top: 1px solid var(--line); }
button { font: inherit; cursor: pointer; }
a.button { display: inline-block; text-decoration: none; }
.actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 1.2rem; }
.signin { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 1.5rem; }
button.primary, a.button.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius);
                 padding: 10px 18px; font-weight: 700; }
button.primary:disabled { opacity: .6; cursor: default; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; }
input[type=text], input[type=password] {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; width: 100%; min-width: 0;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hero { max-width: 640px; margin: 8vh auto 0; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.hero p { color: #c6cad3; font-size: 1.08rem; }
.hero .invite { margin-top: 2rem; padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; }
.narrow { max-width: 440px; margin: 8vh auto 0; }
.stack { display: grid; gap: 10px; }
.addform { display: flex; gap: 8px; margin-top: 8px; }
.addform input[type=text] { flex: 1; }
.file { position: relative; display: inline-flex; align-items: center; padding: 0 14px; border: 1px dashed var(--line);
        border-radius: var(--radius); color: var(--muted); cursor: pointer; white-space: nowrap; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file.has { color: var(--text); border-style: solid; }
.msg { min-height: 1.5em; margin: 6px 0 0; font-size: .9rem; }
.msg.bad { color: var(--bad); }
.msg.ok { color: var(--ok); }
.items { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 160px 1fr; gap: 14px; background: var(--panel);
        border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; align-items: center; }
.item a.cover { display: block; aspect-ratio: 16/9; background: var(--panel-2); border-radius: 6px; overflow: hidden; position: relative; }
.item a.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item a.cover .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 1.6rem; }
.item .name { font-weight: 600; color: var(--text); word-break: break-word; }
.item .meta { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .6s; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
         padding: 2px 7px; border-radius: 999px; background: var(--panel-2); color: var(--muted); margin-right: 6px; }
.badge.ready { background: rgba(95,208,138,.15); color: var(--ok); }
.badge.failed { background: rgba(255,122,107,.15); color: var(--bad); }
.badge.downloading, .badge.converting, .badge.processing { background: rgba(242,184,75,.15); color: var(--accent); }
.title { word-break: break-word; }
.state { margin-bottom: 14px; }
.player { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; }
.player .video-js { width: 100%; }
.note { color: var(--muted); font-size: .9rem; }
.files { list-style: none; padding: 0; margin: 8px 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.files li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--line); font-size: .92rem; align-items: baseline; }
.files li:first-child { border-top: 0; }
.files .path { word-break: break-all; }
.files .right { display: flex; gap: 12px; color: var(--muted); white-space: nowrap; }
.danger { margin-top: 28px; }
.danger button { color: var(--bad); }
.stats { border-collapse: collapse; width: 100%; }
.stats th, .stats td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.stats th { color: var(--muted); font-weight: 500; width: 50%; }
@media (max-width: 600px) {
  .addform { flex-wrap: wrap; }
  .addform input[type=text] { flex-basis: 100%; }
  .file { padding: 10px 14px; }
  .item { grid-template-columns: 96px 1fr; }
  .who { display: none; }
}
