:root{
  --bg:#0b0b0b;
  --panel:#111;
  --panel2:#151515;
  --text:#eaeaea;
  --muted:#a9a9a9;
  --border:#242424;
  --accent:#ffffff;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0));
}

.brand{display:flex;align-items:baseline;gap:10px}
.dot{width:10px;height:10px;border-radius:999px;background:#fff;margin-right:2px}
.title{font-weight:800;letter-spacing:.2px}
.subtitle{font-size:12px;color:var(--muted)}

.actions{display:flex;gap:10px;align-items:center}

.layout{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap:16px;
  padding:16px;
}

.panel{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  overflow:auto;
  max-height: calc(100vh - 88px);
}

.stage{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  min-height: 620px;
}

.stageHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}
.stageTitle{font-weight:700}
.stageMeta{color:var(--muted); font-size:12px}

.canvasWrap{
  background:#000;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:10px;
}

canvas{
  width:min(100%, 1100px);
  height:auto;
  image-rendering:auto;
  background:#000;
}

h2{margin:10px 0 8px 0;font-size:14px;color:#fff}
hr{border:0;border-top:1px solid var(--border);margin:14px 0}

.row{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}

label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted)}
input,select,textarea{
  background:var(--panel2);
  border:1px solid var(--border);
  color:var(--text);
  padding:10px 10px;
  border-radius:10px;
  outline:none;
}
textarea{min-height:64px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:#3a3a3a}

.check{flex-direction:row;align-items:center;gap:10px}
.check input{width:18px;height:18px}

.btn{
  border:1px solid var(--border);
  background:var(--panel2);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
}
.btn:hover{filter:brightness(1.07)}
.btn:disabled{opacity:.45;cursor:not-allowed}

.btn.primary{
  background:#fff;
  color:#000;
  border-color:#fff;
}
.btn.secondary{
  background:transparent;
}
.btn.small{
  padding:8px 10px;
  border-radius:10px;
  font-weight:650;
  font-size:12px;
}

.hint{
  font-size:12px;
  color:var(--muted);
  margin-top:8px;
  line-height:1.35;
}

.cardItem{
  border:1px solid var(--border);
  background:var(--panel2);
  border-radius:14px;
  padding:10px;
  margin:10px 0;
}
.cardTop{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  margin-bottom:8px;
}
.cardIdx{font-size:12px;color:var(--muted)}
.cardBtns{display:flex;gap:6px;flex-wrap:wrap}
.cardBtns button{padding:7px 9px;border-radius:10px;font-size:12px}

.split{
  display:grid;
  grid-template-columns: 1fr 120px;
  gap:10px;
  align-items:start;
}
.split label{margin:0}

.status{
  border:1px solid var(--border);
  background:rgba(0,0,0,.25);
  border-radius:14px;
  padding:10px;
}
#statusLine{font-size:12px;color:var(--muted);margin-bottom:8px}
.progressWrap{
  width:100%;
  height:10px;
  background:rgba(255,255,255,.06);
  border-radius:999px;
  overflow:hidden;
}
#progressBar{
  height:100%;
  width:0%;
  background:#fff;
}
.log{
  margin:10px 0 0 0;
  max-height:160px;
  overflow:auto;
  background:rgba(0,0,0,.25);
  padding:10px;
  border-radius:12px;
  border:1px solid var(--border);
  font-size:11px;
  color:#cfcfcf;
}

.downloadRow{
  margin-top:12px;
  display:flex;
  gap:10px;
  align-items:flex-start;
  flex-wrap:wrap;
}
#resultVideo{
  max-width: min(100%, 1100px);
  width:100%;
  border-radius:12px;
  border:1px solid var(--border);
}
