/* Editor no toque (editor-toque.js): alças do lado de fora do trecho, ajuste
   fino, zoom e o seletor Resultado | Vídeo original. Carregado depois de
   style.css e mobile.css; valores de tokens.css. */

/* ---------------------------------------------------------------- alças */
/* Só o trecho escolhido tem alças, e elas ficam FORA dele: o corpo do trecho
   é sempre "mover", as alças verdes são sempre "mudar a duração". Antes as
   alças ficavam dentro e, num trecho curto, cobriam quase tudo. */
.tl-block .grip { display: none; }
.tl-block.sel { overflow: visible; border-color: var(--acao); background: rgba(214, 255, 63, .12); }
.tl-block.sel .n { color: var(--acao); }
.tl-block.sel .grip {
  display: block; top: -5px; bottom: -5px; width: 12px;
  background: var(--acao); border-radius: 5px; touch-action: none;
}
.tl-block.sel .grip.l { left: -14px; }
.tl-block.sel .grip.r { right: -14px; }
.tl-block.sel .grip:hover { background: var(--acao-hover); }
/* área de toque maior que o desenho, para fora (nunca por cima do trecho) */
.tl-block.sel .grip::after { content: ""; position: absolute; top: -8px; bottom: -8px; }
.tl-block.sel .grip.l::after { left: -16px; right: 0; }
.tl-block.sel .grip.r::after { right: -16px; left: 0; }
@media (pointer: coarse) {
  .tl-block.sel .grip { width: 16px; top: -7px; bottom: -7px; border-radius: 6px; }
  .tl-block.sel .grip.l { left: -19px; }
  .tl-block.sel .grip.r { right: -19px; }
  .tl-block.sel .grip.l::after { left: -22px; }
  .tl-block.sel .grip.r::after { right: -22px; }
}
/* as alças saem um pouco da trilha */
.tl-source { overflow: visible; }
.tl-blocks { z-index: 2; }

/* ----------------------------------------------------------- ajuste fino */
.e-timeline { grid-template-rows: auto minmax(0, 1fr); }
.e-tlbar { flex-wrap: wrap; min-height: var(--h-tl-bar); row-gap: 0; }
.e-fino {
  flex: 1 0 100%; order: -1;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.e-fino[hidden] { display: none; }
.e-fino-nome { flex: 1; min-width: 0; font: 600 13px/1.2 var(--font-ui); color: var(--ink); }
.e-fino-grupo {
  display: inline-flex; align-items: center; height: 34px;
  background: var(--e2); border-radius: var(--r-pill);
}
.e-fino-grupo button {
  width: 36px; height: 34px; padding: 0; border: 0; border-radius: var(--r-pill);
  background: none; color: var(--ink); cursor: pointer;
  font: 500 17px/1 var(--font-ui);
}
.e-fino-grupo button:hover { background: var(--e3); }
.e-fino-grupo button:active { background: var(--accent); }
.e-fino-grupo output { min-width: 52px; text-align: center; font-size: 12px; color: var(--ink); }

/* -------------------------------------------- Resultado | Vídeo original */
.e-ver { width: 230px; flex: none; margin-left: var(--s-3); }
.e-ver button { height: 30px; font-size: 12.5px; }
/* os dois plays pequenos das trilhas saem: o seletor faz o papel deles */
.e-tplay { display: none; }

@media (max-width: 767px) {
  .e-timeline { grid-template-rows: auto auto; }
  .e-tlbar { padding: 0 12px 6px; }
  /* o controle de zoom volta a aparecer no celular */
  #tlZoom { display: block; flex: 1; min-width: 60px; }
  .e-zoom { flex: 1 1 100%; order: 5; padding-top: 4px; }
  #editorRoot .e-zoom input[type="range"] { width: auto; flex: 1; }
  .e-fino-grupo, .e-fino-grupo button { height: 40px; }
  .e-fino-grupo button { width: 40px; }
  /* no celular o seletor fica na linha do play; o relógio já aparece na timeline */
  .e-transport { justify-content: flex-start; gap: 8px; padding: 0 12px; box-sizing: border-box; }
  .e-transport #btnPrevClip, .e-transport #btnNextClip, .e-transport #previewLabel { display: none; }
  .e-ver { flex: 1; width: auto; margin: 0; }
  .e-ver button { height: 40px; font-size: 13.5px; }
  .tl-block { height: 50px; margin-top: -25px; }
}
