:root {
  --bg: #0b1220; --panel: #141c2b; --panel2: #1b2536; --line: #26324a;
  --text: #e8edf5; --muted: #9aa3ad; --accent: #ffd166; --accent2: #5ec8ff; --danger: #ff6b6b;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, "Helvetica Neue", Segoe UI, sans-serif; }
a { color: var(--accent2); }
h2 { margin: 0 0 6px; font-size: 20px; }
h3 { margin: 0 0 8px; }
p { margin: 6px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
kbd { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: 12px; }

.top { display: flex; align-items: center; gap: 18px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 17px; }
.steps { display: flex; gap: 6px; }
.step { background: transparent; color: var(--muted); border: 1px solid transparent; padding: 6px 12px; border-radius: 999px; cursor: pointer; font: inherit; }
.step.active { color: var(--text); border-color: var(--line); background: var(--panel2); }
.step.done { color: var(--accent); }
.jobbar { margin-left: auto; display: flex; gap: 6px; }

main { max-width: 1200px; margin: 0 auto; padding: 20px; }
.panel { display: none; }
.panel.active { display: block; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card.sticky { position: sticky; top: 62px; z-index: 5; }
.grid2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

label { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 13px; color: var(--muted); flex: 1; }
label.inline { flex-direction: row; align-items: center; gap: 8px; flex: 0 0 auto; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=url], input[type=search], input[type=number], select, textarea {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%;
}
input[type=color] { width: 44px; height: 32px; border: 1px solid var(--line); background: var(--panel2); border-radius: 8px; padding: 2px; }
textarea { resize: vertical; font-size: 16px; line-height: 1.7; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

button, .button { border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .button.primary { background: var(--accent); color: #1a1400; border-color: transparent; font-weight: 600; }
button.ghost { background: transparent; }
button.big { padding: 12px 20px; font-size: 16px; }
.primary kbd { background: rgba(0,0,0,.12); border-color: rgba(0,0,0,.25); color: inherit; margin-left: 4px; }
button:disabled { opacity: .5; cursor: default; }

.tabs { display: flex; gap: 6px; margin: 10px 0; }
.tab { border-radius: 999px; }
.tab.active { background: var(--accent2); color: #00121c; border-color: transparent; }
.tabpane { display: none; }
.tabpane.active { display: block; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 30px; text-align: center; cursor: pointer; color: var(--muted); }
.drop.over { border-color: var(--accent2); color: var(--text); }
.drop input { display: none; }

.progress { height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: var(--accent2); width: 0; transition: width .4s; }
.progress .indeterminate { width: 30%; animation: slide 1.2s infinite linear; }
@keyframes slide { from { margin-left: -30%; } to { margin-left: 100%; } }
.log { background: #060a12; border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 220px; overflow: auto; font-size: 12px; color: #b8c2cc; white-space: pre-wrap; }

.list { list-style: none; padding: 0; margin: 8px 0; max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.list li { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; gap: 8px; align-items: center; }
.list li:hover { background: var(--panel2); }
.list li .t { font-weight: 600; }
.list li .m { color: var(--muted); font-size: 12px; }
.list li .x { margin-left: auto; color: var(--danger); background: none; border: none; }

audio { width: 100%; margin: 10px 0; }
.preview { background: #000; border-radius: var(--radius); padding: 22px 16px; text-align: center; min-height: 130px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.preview-title { color: var(--muted); font-size: 13px; }
.preview-current { font-size: 30px; font-weight: 700; color: var(--accent); line-height: 1.4; }
.preview-next { color: var(--muted); font-size: 18px; }

table.lines { width: 100%; border-collapse: collapse; }
table.lines th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 4px 8px; }
table.lines td { padding: 4px 8px; border-top: 1px solid var(--line); }
table.lines tr.sel td { background: rgba(94, 200, 255, .12); }
table.lines tr.playing td { background: rgba(255, 209, 102, .14); }
table.lines tr.gap td { color: var(--muted); font-style: italic; }
table.lines input.time { width: 92px; font-variant-numeric: tabular-nums; }
table.lines input.txt { width: 100%; font-size: 16px; }
table.lines td.n { color: var(--muted); width: 32px; }
table.lines button { padding: 4px 8px; }

video { width: 100%; border-radius: var(--radius); background: #000; margin: 10px 0; }
.bgpreview { max-width: 100%; border-radius: 8px; margin: 6px 0; }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--accent2); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 8px; z-index: 50; }
.toast.err { border-color: var(--danger); }

.stages { display: flex; gap: 6px; list-style: none; padding: 0; margin: 6px 0 10px; flex-wrap: wrap; }
.stages li { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.stages li.active { border-color: var(--accent2); color: var(--text); background: rgba(94,200,255,.12); }
.stages li.done { border-color: transparent; color: var(--accent); background: rgba(255,209,102,.12); }
.stages li.done::before { content: "✓ "; }
.preview-text { background: #060a12; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 260px; overflow: auto; font: 16px/1.7 inherit; font-family: inherit; white-space: pre-wrap; margin: 10px 0 0; }
table.lines td.shown { color: var(--muted); font-size: 14px; max-width: 320px; }
table.lines td.w { width: 14px; color: var(--accent2); font-size: 11px; }
code { background: var(--panel2); padding: 0 4px; border-radius: 4px; }
