:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --soft: #f4f4f5;
  --line: #e4e4e7;
  --ink: #0a0a0a;
  --muted: #62626b;
  --acc: #ff5a1f;
  --acc-ink: #ffffff;
  --ok: #0f9d58;
  --err: #d92d20;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.4 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.top { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 5; flex-wrap: wrap; }
.brand { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.brand .dot { background: var(--acc); color: #fff; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; }
.presets { display: flex; align-items: center; gap: 6px; margin-left: 12px; }
.presets label { font-weight: 600; font-size: 12px; color: var(--muted); }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

select, input[type=text], input[type=password], input[type=number], textarea { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: #fff; width: 100%; }
.presets select { width: 170px; }
textarea { resize: vertical; min-height: 60px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acc); outline-offset: -1px; border-color: transparent; }

.ghost { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; color: var(--ink); }
.ghost:hover:not(:disabled) { border-color: var(--ink); }
.ghost.danger:hover { border-color: var(--err); color: var(--err); }
.ghost.icon { padding: 5px 10px; font-size: 16px; line-height: 1; }
.ghost.wide { flex: 1; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 0; }
.primary { background: var(--acc); color: var(--acc-ink); border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 700; font-size: 15px; flex: 1; }
.primary:hover:not(:disabled) { filter: brightness(.95); }
.primary-sm { background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: 7px 14px; font-weight: 600; }

.grid { display: grid; grid-template-columns: 300px minmax(320px, 1fr) 380px; gap: 0; height: calc(100vh - 53px); }
.col { padding: 16px; overflow: auto; }
.left { border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.right-col { border-left: 1px solid var(--line); display: flex; flex-direction: column; padding: 0; }
.center { display: flex; flex-direction: column; align-items: center; gap: 12px; background: var(--soft); }

.drop { border: 2px dashed #c9c9cf; border-radius: var(--r); padding: 22px 12px; text-align: center; cursor: pointer; background: #fff; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--acc); background: #fff6f2; }
.drop-ico { font-size: 22px; color: var(--acc); }
.list-head { display: flex; justify-content: space-between; font-weight: 600; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; align-items: start; }
.item.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.item img { width: 48px; height: 85px; object-fit: cover; border-radius: 6px; background: #ddd; }
.item .nm { font-weight: 600; font-size: 12.5px; word-break: break-all; }
.item .meta { font-size: 11.5px; color: var(--muted); }
.item input { margin-top: 6px; font-size: 12px; padding: 5px 7px; }
.item .side { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.item .side button { padding: 3px 8px; font-size: 12px; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--soft); white-space: nowrap; }
.badge.concluido { background: #e7f6ee; color: var(--ok); }
.badge.erro { background: #fdecea; color: var(--err); }
.badge.processando, .badge.transcrevendo { background: #fff0e9; color: var(--acc); }
.bar { height: 4px; background: var(--soft); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; background: var(--acc); width: 0; transition: width .2s; }

.stage-wrap { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 0; }
.stage { position: relative; height: min(76vh, 900px); aspect-ratio: 9/16; background: #000; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.stage video { position: absolute; object-fit: fill; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #bbb; text-align: center; padding: 20px; }
.player { display: flex; gap: 8px; align-items: center; width: min(100%, 520px); }
.player input[type=range] { flex: 1; }
.legal { margin: 0; font-size: 11.5px; color: var(--muted); }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 12px 0; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; padding: 8px 10px; border-bottom: 2px solid transparent; font-weight: 600; color: var(--muted); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--acc); }
.panel { padding: 16px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.panel .help { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: #333; }
.ctl { display: flex; flex-direction: column; gap: 6px; }
.ctl > label, .ctl .lbl { font-weight: 600; font-size: 12.5px; display: flex; justify-content: space-between; }
.ctl .val { color: var(--muted); font-weight: 500; }
.ctl input[type=range] { width: 100%; accent-color: var(--acc); }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: #fff; padding: 7px 6px; font-size: 12.5px; }
.seg button.on { background: var(--ink); color: #fff; }
.color { display: flex; gap: 8px; align-items: center; }
.color input[type=color] { width: 40px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.color input[type=text] { font-family: ui-monospace, monospace; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--acc); width: 16px; height: 16px; }
.sep { border-top: 1px solid var(--line); margin: 2px 0; }
.posgrid { display: grid; grid-template-columns: repeat(3, 34px); gap: 4px; }
.posgrid button { height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 6px; }
.posgrid button.on { background: var(--ink); }
.caps { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.cap { display: grid; grid-template-columns: 74px 1fr; gap: 6px; align-items: center; }
.cap span { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }
.cap input { padding: 5px 7px; font-size: 12.5px; }
.logo-prev { max-width: 120px; max-height: 60px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/12px 12px; border-radius: 6px; padding: 4px; border: 1px solid var(--line); }

.actions { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.overall { height: 6px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.overall > div { height: 100%; width: 0; background: var(--acc); transition: width .2s; }

dialog { border: 0; border-radius: 14px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.25); width: min(420px, 92vw); }
.dlg { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dlg h3 { margin: 0; }
.dlg label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }

#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 90vw; }
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }

@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; height: auto; }
  .left, .right-col { border: 0; border-bottom: 1px solid var(--line); }
  .stage { height: 70vh; }
}
[hidden] { display: none !important; }