:root {
  --bg: #f5f6f8; --panel: #fff; --ink: #1b1d22; --sub: #6a6f7a; --line: #e3e5ea;
  --accent: #03c75a; --accent-ink: #fff; --warn: #e5484d; --hl: #fff4c2; --chip: #eef1f5;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111317; --panel: #1a1d22; --ink: #e8eaee; --sub: #9aa0ab; --line: #2b2f36;
          --hl: #3a3420; --chip: #252a31; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 -apple-system, "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif; }
header { display: flex; gap: 16px; align-items: center; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-size: 17px; white-space: nowrap; }
.brand b { color: var(--accent); }
#addForm { display: flex; gap: 8px; flex: 1; min-width: 280px; }
#addForm input { flex: 1; min-width: 0; }
input, select, textarea { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
textarea { width: 100%; resize: vertical; }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 14px; }
button:disabled { opacity: .5; cursor: default; }
#addForm button, .primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.primary { width: 100%; padding: 12px; font-size: 16px; margin-top: 12px; }
.ghost { background: transparent; }
.msg { margin: 10px 20px 0; padding: 10px 14px; border-radius: 8px; background: var(--hl); }
main { display: grid; grid-template-columns: 280px 1fr; gap: 16px; padding: 16px 20px; }
aside { display: flex; flex-direction: column; gap: 8px; }
.card { display: flex; gap: 10px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card img { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--chip); flex: none; }
.card .t { font-weight: 600; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .s { font-size: 12px; color: var(--sub); }
.badge { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--chip); color: var(--sub); }
.badge.done { background: var(--accent); color: #fff; }
.badge.error { background: var(--warn); color: #fff; }
section#detail { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; }
.empty ol { color: var(--sub); line-height: 2; }
.dhead { display: flex; gap: 12px; align-items: center; }
.dthumb { width: 54px; height: 72px; object-fit: cover; border-radius: 8px; }
.dtitle { margin: 0; font-size: 18px; }
.dsub { color: var(--sub); font-size: 13px; }
.progress { margin: 14px 0; display: flex; align-items: center; gap: 10px; }
.bar, .tbar { flex: 1; height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.bar i, .tbar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .4s; }
.pstep { font-size: 13px; color: var(--sub); white-space: nowrap; }
.err { margin: 12px 0; padding: 10px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.note { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--hl); font-size: 13px; }
.cols { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 20px; margin-top: 16px; }
.player { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 9 / 16; }
.player video { width: 100%; height: 100%; display: block; object-fit: contain; }
.ov { position: absolute; top: 7%; left: 0; right: 0; text-align: center; pointer-events: none; font-weight: 900; font-size: clamp(14px, 4.8cqw, 26px); container-type: inline-size; }
.player { container-type: inline-size; }
.ov div { display: inline-block; padding: 2px 8px; margin: 2px 0; font-size: 7.5cqw; line-height: 1.25; }
.ov1 { background: #000; color: #fff; }
.ov2 { background: #ffe500; color: #000; }
.ov1:empty, .ov2:empty { display: none !important; }
.ov { display: flex; flex-direction: column; align-items: center; }
.pinfo { font-size: 12px; color: var(--sub); margin: 6px 0 12px; }
h3 { font-size: 15px; margin: 14px 0 8px; }
.renders { display: flex; flex-direction: column; gap: 10px; }
.rcard { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.rcard video { width: 100%; border-radius: 8px; background: #000; max-height: 420px; }
.rcard .rh { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; }
.rcard .ra { display: flex; gap: 6px; margin-top: 6px; }
.rcard .ra a, .rcard .ra button { font-size: 12px; padding: 5px 10px; text-decoration: none; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.rcard .ra a.dl { background: var(--accent); color: #fff; border-color: var(--accent); }
.plans-bar { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border-radius: 18px; padding: 6px 14px; }
.tabs button.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.lab { display: block; font-size: 12px; color: var(--sub); margin: 14px 0 4px; }
.hooks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.total { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; }
.tlabel { font-weight: 700; white-space: nowrap; }
.tlabel.over { color: var(--warn); }
.clips { display: flex; flex-direction: column; gap: 6px; }
.clip { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.clip.playing { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.clip .row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.clip .no { font-weight: 700; width: 22px; }
.clip input[type=number] { width: 84px; padding: 4px 6px; }
.clip .dur { font-size: 12px; color: var(--sub); width: 44px; }
.clip button { padding: 3px 8px; font-size: 12px; }
.clip .txt { font-size: 13px; color: var(--sub); margin-top: 4px; }
.clip .why { font-size: 11px; color: var(--sub); }
.role { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--chip); }
.addcur { margin-top: 8px; width: 100%; border-style: dashed; }
.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.opts input:not([type]) , .opts .endtext { width: 100%; margin-top: 4px; }
.trwrap { margin-top: 20px; border-top: 1px solid var(--line); }
.trhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.trhead input { flex: 1; max-width: 280px; }
.tr { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.tl { display: flex; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.tl:hover { background: var(--chip); }
.tl .tm { color: var(--accent); cursor: pointer; font-variant-numeric: tabular-nums; flex: none; width: 56px; }
.tl .tx { flex: 1; cursor: pointer; }
.tl .tx mark { background: var(--hl); color: inherit; }
.tl.in { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tl button { padding: 0 8px; font-size: 12px; flex: none; }
@media (max-width: 900px) {
  main { grid-template-columns: 1fr; padding: 12px 16px; }
  aside { flex-direction: row; overflow-x: auto; }
  .card { min-width: 240px; }
  .cols { grid-template-columns: 1fr; }
  .player { max-width: 320px; margin: 0 auto; }
}
