/* Kenzy Reels Studio — segue o Manual de Marca Kenzy v1.0 */
:root {
  --ink: #000000;
  --paper: #ffffff;
  --paper-warm: #faf9f5;
  --g050: #f5f5f5;
  --g200: #e5e5e5;
  --g400: #a3a3a3;
  --g500: #737373;
  --alert: #e5484d;
  --disp: 'Space Grotesk', system-ui, sans-serif;
  --text: 'Outfit', system-ui, sans-serif;
  --r: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.45 var(--text); -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { opacity: .4; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); }
[hidden] { display: none !important; }
::selection { background: var(--ink); color: #fff; }

.ey { font-family: var(--disp); font-size: 11px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--g500); }
.num { font-family: var(--disp); font-variant-numeric: tabular-nums; }
.muted { color: var(--g500); }
.small { font-size: 12px; }

/* ---------- topo ---------- */
.top { display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 56px; border-bottom: 1px solid var(--g200); background: #fff; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .wm { font-family: var(--disp); font-weight: 700; font-size: 17px; letter-spacing: .24em; }
.brand .sep { width: 1px; height: 18px; background: var(--g200); }
.presets { display: flex; align-items: center; gap: 8px; margin-left: 20px; }
.presets select { width: 180px; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--ink); color: #fff; border: 1px solid var(--ink); border-radius: var(--r); padding: 9px 16px; font-family: var(--disp); font-weight: 600; font-size: 13px; letter-spacing: .02em; transition: background .15s, color .15s, border-color .15s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: #1f1f1f; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--g200); }
.btn.ghost:hover:not(:disabled) { border-color: var(--ink); background: #fff; }
.btn.danger:hover:not(:disabled) { border-color: var(--alert); color: var(--alert); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.icon { padding: 5px 9px; font-size: 15px; line-height: 1; }
.btn.primary { flex: 1; padding: 14px 18px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.btn.wide { flex: 1; }
.link { background: none; border: 0; padding: 0; color: var(--g500); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }

select, input[type=text], input[type=password], textarea { border: 1px solid var(--g200); border-radius: var(--r); padding: 8px 10px; background: #fff; width: 100%; }
textarea { resize: vertical; min-height: 58px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
input[type=range] { accent-color: var(--ink); width: 100%; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { accent-color: var(--ink); width: 15px; height: 15px; margin: 0; }

.seg { display: inline-flex; border: 1px solid var(--g200); border-radius: var(--r); overflow: hidden; background: #fff; }
.seg.full { display: flex; }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px 12px; font-family: var(--disp); font-size: 12px; font-weight: 500; color: var(--g500); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--g200); }
.seg button.on { background: var(--ink); color: #fff; }
.seg button:disabled { opacity: .35; }

/* ---------- layout ---------- */
.grid { display: grid; grid-template-columns: 290px minmax(360px, 1fr) 360px; height: calc(100vh - 56px); }
.col { min-height: 0; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.left { border-right: 1px solid var(--g200); padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.right-col { border-left: 1px solid var(--g200); display: flex; flex-direction: column; overflow: hidden; }

/* ---------- lote ---------- */
.drop { border: 1px dashed var(--g400); border-radius: var(--r); padding: 18px 12px; text-align: center; cursor: pointer; background: #fff; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--ink); background: var(--g050); }
.drop-t { font-family: var(--disp); font-weight: 600; font-size: 14px; }
.list-tools { display: flex; justify-content: space-between; align-items: center; }
.list { display: flex; flex-direction: column; gap: 6px; overflow: auto; padding-right: 2px; flex: 1; }
.item { display: grid; grid-template-columns: 16px 40px 1fr auto; gap: 10px; align-items: center; padding: 7px 8px; border: 1px solid var(--g200); border-radius: var(--r); background: #fff; cursor: pointer; transition: border-color .12s; }
.item:hover { border-color: var(--g400); }
.item.focus { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--ink); }
.item.checked { background: var(--g050); }
.item img, .item .ph { width: 40px; height: 71px; object-fit: cover; border-radius: 3px; background: var(--g200); display: block; }
.item .nm { font-weight: 500; font-size: 12.5px; word-break: break-all; line-height: 1.3; }
.item .meta { font-family: var(--disp); font-size: 11px; color: var(--g500); margin-top: 2px; }
.item .side { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.item .side button { padding: 3px 7px; font-size: 11px; }
.tag { font-family: var(--disp); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; border: 1px solid var(--g200); color: var(--g500); white-space: nowrap; }
.tag.concluido { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag.erro { color: var(--alert); border-color: var(--alert); }
.tag.processando, .tag.transcrevendo { color: var(--ink); border-color: var(--ink); }
.tag.custom { border-style: dashed; color: var(--ink); }
.bar { height: 2px; background: var(--g200); margin-top: 6px; }
.bar > div { height: 100%; background: var(--ink); transition: width .2s; }

/* ---------- centro ---------- */
.center { position: relative; display: flex; flex-direction: column; background-color: var(--g050); background-image: linear-gradient(var(--g200) 1px, transparent 1px), linear-gradient(90deg, var(--g200) 1px, transparent 1px); background-size: 28px 28px; overflow: hidden; }
.center-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--g200); flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.gridview { flex: 1; min-height: 0; display: grid; gap: 14px; padding: 18px; justify-content: center; align-content: center; }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer; width: var(--stage-w, auto); }
.stage { position: relative; height: var(--stage-h, 70vh); width: var(--stage-w, auto); aspect-ratio: 9/16; background: #000; overflow: hidden; border-radius: 2px; }
.stage video { position: absolute; object-fit: fill; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage .novid { position: absolute; inset: 0; display: grid; place-items: center; color: var(--g500); font-size: 11px; text-align: center; padding: 10px; }
/* moldura de canto (grafismo Kenzy) no vídeo em foco */
.tile.focus::before, .tile.focus::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--ink); pointer-events: none; z-index: 2; }
.tile.focus::before { top: -7px; left: -7px; border-right: 0; border-bottom: 0; }
.tile.focus::after { bottom: 22px; right: -7px; border-left: 0; border-top: 0; }
.tile-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; min-width: 0; }
.tile-foot .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-weight: 500; }
.scrub { display: flex; align-items: center; gap: 10px; padding: 8px 18px 14px; }
.empty { position: absolute; inset: 56px 0 0 0; display: grid; place-items: center; pointer-events: none; }
.empty-frame { position: relative; padding: 38px 46px; text-align: center; background: #fff; border: 1px solid var(--g200); }
.empty-frame::before, .empty-frame::after { content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid var(--ink); }
.empty-frame::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.empty-frame::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.empty-t { font-family: var(--disp); font-weight: 700; font-size: 24px; letter-spacing: -.01em; margin: 10px 0 6px; }

/* tabela */
.tableview { flex: 1; overflow: auto; padding: 18px; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--g200); }
.tbl th { font-family: var(--disp); font-size: 10.5px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--g500); text-align: left; padding: 10px; border-bottom: 1px solid var(--ink); background: #fff; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--g200); vertical-align: middle; font-size: 13px; }
.tbl tr.focus td { background: var(--g050); }
.tbl tr { cursor: pointer; }
.tbl img, .tbl .ph { width: 34px; height: 60px; object-fit: cover; border-radius: 3px; display: block; background: var(--g200); }
.tbl input[type=text] { padding: 6px 8px; font-size: 12.5px; min-width: 200px; }
.tbl .caps-prev { font-size: 12px; color: var(--g500); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- edição ---------- */
.scope { padding: 16px 16px 12px; border-bottom: 1px solid var(--g200); display: flex; flex-direction: column; gap: 8px; }
.scope-note { font-size: 12px; color: var(--g500); min-height: 16px; }
.scope-note b { color: var(--ink); font-weight: 600; }
.tabs { display: flex; flex-wrap: wrap; padding: 0 12px; border-bottom: 1px solid var(--g200); }
.tabs button { background: none; border: 0; padding: 11px 8px; margin-bottom: -1px; border-bottom: 2px solid transparent; font-family: var(--disp); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--g500); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs button .dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); margin-left: 4px; vertical-align: middle; }
.panel { padding: 16px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.help { border-left: 2px solid var(--ink); background: var(--g050); padding: 10px 12px; font-size: 12.5px; color: #222; }
.ctl { display: flex; flex-direction: column; gap: 6px; }
.ctl > label, .ctl .lbl { font-family: var(--disp); font-weight: 500; font-size: 12px; display: flex; justify-content: space-between; align-items: center; }
.ctl .val { color: var(--g500); font-variant-numeric: tabular-nums; }
.ctl .val.mod { color: var(--ink); font-weight: 700; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.panel > *, .ctl, .color { min-width: 0; }
.color input[type=text] { min-width: 0; }
.color { display: flex; gap: 8px; align-items: center; }
.color input[type=color] { width: 38px; height: 34px; border: 1px solid var(--g200); border-radius: var(--r); padding: 2px; background: #fff; flex: none; }
.color input[type=text] { font-family: var(--disp); font-size: 12.5px; }
.divider { border-top: 1px solid var(--g200); margin: 2px 0; }
.posgrid { display: grid; grid-template-columns: repeat(3, 30px); gap: 4px; }
.posgrid button { height: 30px; border: 1px solid var(--g200); background: #fff; border-radius: 3px; }
.posgrid button.on { background: var(--ink); border-color: var(--ink); }
.caps { display: flex; flex-direction: column; gap: 5px; max-height: 300px; overflow: auto; }
.cap { display: grid; grid-template-columns: 70px 1fr; gap: 6px; align-items: center; }
.cap span { font-family: var(--disp); font-size: 11px; color: var(--g500); cursor: pointer; }
.cap input { padding: 5px 7px; font-size: 12.5px; }
.logo-prev { max-width: 110px; max-height: 50px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/10px 10px; border: 1px solid var(--g200); border-radius: 3px; padding: 3px; }

.actions { border-top: 1px solid var(--ink); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
/* barra de progresso em forma de régua (grafismo Kenzy) */
.ruler { position: relative; height: 10px; background: linear-gradient(90deg, var(--g400) 1px, transparent 1px) 0 0/10% 100%; border-bottom: 1px solid var(--g200); }
.ruler > div { position: absolute; left: 0; bottom: -1px; height: 3px; width: 0; background: var(--ink); transition: width .2s; }

dialog { border: 1px solid var(--ink); border-radius: 0; padding: 0; width: min(420px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.35); }
.dlg { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.dlg h3 { margin: 0; font-family: var(--disp); font-weight: 700; font-size: 22px; }
.dlg label { display: flex; flex-direction: column; gap: 6px; font-family: var(--disp); font-weight: 500; font-size: 12px; }

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

@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; height: auto; }
  .left, .right-col { border: 0; border-bottom: 1px solid var(--g200); overflow: visible; }
  .list { max-height: 320px; }
  .presets { margin-left: 0; }
  .top { height: auto; padding: 10px 16px; flex-wrap: wrap; }
}

/* estilos de legenda (cartões) */
.styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.style-card { min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: stretch; padding: 6px; border: 1px solid var(--g200); border-radius: var(--r); background: #fff; }
.style-card:hover { border-color: var(--g400); }
.style-card.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.style-card .sample { background: #3a3a3a; background-image: linear-gradient(135deg, #555, #222); border-radius: 3px; padding: 10px 3px; font-size: 10.5px; font-weight: 700; line-height: 1.1; text-align: center; white-space: nowrap; overflow: hidden; }
.style-card .lbl { font-family: var(--disp); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
details.more { border: 1px solid var(--g200); border-radius: var(--r); padding: 8px 10px; }
details.more summary { cursor: pointer; font-family: var(--disp); font-size: 12px; font-weight: 500; color: var(--g500); }
details.more[open] { display: flex; flex-direction: column; gap: 12px; }
details.more[open] summary { margin-bottom: 4px; color: var(--ink); }
.post-cell { min-width: 220px; }
.post-cell textarea { min-height: 44px; font-size: 12px; padding: 6px 8px; }
.stage { touch-action: none; }
.btn.ghost.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.ghost.on:hover:not(:disabled) { background: #1f1f1f; }
