:root {
  --bg: #111214; --panel: #1b1d21; --line: #2c2f36; --text: #e9e9ea; --muted: #9a9ca3;
  --accent: #e8b04b; --danger: #e5675a; --warn-bg: #3a2c12; --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 1100px; margin: 0 auto; padding: 12px 16px 48px; }
h1 { font-size: 1.3rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.warn { color: #f3c77a; }
.banner { background: var(--warn-bg); padding: 10px 12px; border-radius: var(--radius); }
.spacer, .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.bar { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.narrow { max-width: 420px; margin: 12vh auto 0; }
button, .button, select, input {
  font: inherit; color: var(--text); background: #262930; border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 14px; text-decoration: none; min-height: 42px;
}
button, .button { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--accent); color: #1b1407; border-color: var(--accent); font-weight: 600; }
.danger { color: var(--danger); }
input { width: 100%; }
label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
pre.params { white-space: pre-wrap; word-break: break-all; background: #0c0d0f; padding: 10px; border-radius: 8px; font-size: .85rem; user-select: all; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.video { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: visible; }
.cover { display: block; position: relative; aspect-ratio: 16 / 9; background: #0c0d0f; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.thumb { position: absolute; inset: 0; background: center / cover no-repeat; }
.thumb:not(.has-image)::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; color: #3b3e46; font-size: 2rem; }
.progress { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--accent); }
.video .row { padding: 8px 10px 10px; align-items: flex-start; }
.title { color: var(--text); text-decoration: none; display: block; overflow-wrap: anywhere; font-weight: 500; }
.meta { font-size: .85rem; }
.badge { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 1px 7px; margin-top: 3px; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 2px 10px; font-size: 1.2rem; border-radius: 6px; }
.menu summary::-webkit-details-marker { display: none; }
.menu-items { position: absolute; right: 0; top: 100%; z-index: 5; background: #22252b; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; min-width: 190px; padding: 4px; }
.menu-items button { background: none; border: 0; justify-content: flex-start; }
video { width: 100%; max-height: 78vh; background: #000; border-radius: var(--radius); }
.actions { margin-top: 10px; flex-wrap: wrap; }
.net { background: var(--warn-bg); color: #f3c77a; padding: 8px 12px; border-radius: 8px; }
.jobs { display: flex; flex-direction: column; gap: 10px; }
.job { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.job button { min-height: 34px; padding: 4px 10px; }
.track { height: 6px; background: #2a2d33; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.job.failed .bar-fill { background: var(--danger); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2b2e35; border: 1px solid var(--line); padding: 10px 16px; border-radius: 8px; max-width: calc(100% - 32px); z-index: 10; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } main { padding: 8px 12px 40px; } }
