:root {
  --bg: #0e0e10; --card: #18181b; --line: #2f2f35; --text: #efeff1; --muted: #a0a0ab;
  --twitch: #9146ff; --youtube: #ff0033; --ok: #2ecc71; --warn: #f5a623; --err: #ff5c5c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: #bf94ff; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--card); }
.brand { font-weight: 700; font-size: 18px; }
.tw { color: var(--twitch); } .yt { color: var(--youtube); }
.me { display: flex; align-items: center; gap: 10px; }
.me img { width: 32px; height: 32px; border-radius: 50%; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.card.center { text-align: center; max-width: 560px; margin: 60px auto; padding: 36px; }
h1 { font-size: 24px; margin-top: 0; } h2 { font-size: 18px; margin: 0 0 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.alert { background: #3a1a1d; border: 1px solid var(--err); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.btn { display: inline-block; border: 0; border-radius: 6px; padding: 9px 16px; font-weight: 600; color: #fff; text-decoration: none; cursor: pointer; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.twitch { background: var(--twitch); } .btn.youtube { background: var(--youtube); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.small { padding: 4px 10px; font-size: 12px; }
form.inline { display: inline; }
.accounts { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.acc .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.ok { color: var(--ok); font-weight: 600; margin-bottom: 6px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar h2 { margin: 0; }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
select, input.title { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font: inherit; }
.vods { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.vod { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.vod.selected { border-color: var(--youtube); box-shadow: 0 0 0 1px var(--youtube); }
.pick { position: relative; display: block; cursor: pointer; aspect-ratio: 16/9; background: #000; }
.pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick input { position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; z-index: 1; accent-color: var(--youtube); }
.dur { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.8); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.info { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
input.title { width: 100%; }
.meta { font-size: 13px; color: var(--muted); }
.badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--line); color: var(--text); text-decoration: none; font-weight: 600; }
.badge.done { background: #1d3a28; color: var(--ok); }
.badge.downloading, .badge.uploading { background: #3a2f12; color: var(--warn); }
.badge.error { background: #3a1a1d; color: var(--err); }
.jobs { display: flex; flex-direction: column; gap: 10px; }
.job { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; gap: 12px; align-items: center; }
.jbody { flex: 1; min-width: 0; }
.jthumb { width: 128px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; display: block; }
.badge.thumbnail { background: #2a1f3d; color: #bf94ff; }
.job .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.bar div { height: 100%; background: var(--warn); transition: width .5s; }
.job.done .bar div { background: var(--ok); }
.job.uploading .bar div { background: var(--youtube); }
.more { text-align: center; margin-top: 14px; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
@media (max-width: 600px) { .top { padding: 10px 16px; } .vods { grid-template-columns: 1fr; } .jthumb { width: 80px; } }
.styles { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.style { position: relative; }
.style img { height: 90px; border-radius: 6px; border: 1px solid var(--line); display: block; }
.style button { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.75); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
label.upload { cursor: pointer; }
label.block { display: block; margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
textarea { width: 100%; margin-top: 6px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: inherit; resize: vertical; }
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; max-width: 700px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog pre { white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 6px; font: 13px/1.5 ui-monospace, monospace; max-height: 60vh; overflow: auto; }
.manual { margin-top: 10px; padding: 12px; border: 1px dashed var(--warn); border-radius: 8px; background: #221d10; }
.manual p { margin: 0 0 8px; font-size: 13px; }
.manual textarea { font-size: 12px; }
.manual ol { margin: 0 0 8px; padding-left: 20px; font-size: 13px; }
.manual-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.badge.waiting_thumbnail { background: #3a2f12; color: var(--warn); }
.job.waiting_thumbnail { border-color: var(--warn); }
.keybox { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.keybox .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.keybox input { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font: inherit; width: min(420px, 100%); }
.faces { margin: 6px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.manual details { margin-top: 10px; }
.manual summary { cursor: pointer; color: var(--muted); margin-bottom: 6px; }
.legal h2 { font-size: 16px; margin: 18px 0 6px; }
.legal li, .legal p { line-height: 1.55; }
.legal-links { text-align: center; }
.sys { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tablewrap { overflow-x: auto; }
table.admin { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.admin td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.admin .av { width: 24px; height: 24px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.okc { color: var(--ok); }
.errc { color: var(--err); }
pre.log { max-height: 360px; overflow: auto; font-size: 11px; background: #0d0d10; padding: 10px; border-radius: 6px; white-space: pre-wrap; }
.acting { background: #2a1f3d; border: 1px solid #9146ff; color: #e9dcff; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.steptxt { color: var(--text, inherit); font-weight: 600; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 18px; border-radius: 6px; overflow: hidden; background: #2a2a30; margin: 8px 0; }
.stack span { display: block; height: 100%; }
.s-vod { background: #9146ff; } .s-app { background: #ff4d6d; } .s-other { background: #6b6b76; } .s-free { background: #2a2a30; border: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
