/* ==========================================================================
   Linha do tempo estilo editor de vídeo (CapCut-like)
   Variáveis no escuro (padrão) e no tema claro (html.theme-light)
   ========================================================================== */
.tl-editor {
    --tl-bg: #101014;
    --tl-panel: #17171c;
    --tl-head: #141418;
    --tl-border: #26262e;
    --tl-text: #e4e4e7;
    --tl-muted: #8b8b96;
    --tl-ruler: #5f5f6a;
    --tl-track: #1b1b21;
    --tl-accent: #22d3ee;
    --tl-playhead: #ffffff;
    --tl-video-a: #3b3b8f;
    --tl-audio-bg: #0f3d3a;
    --tl-audio-border: #14b8a6;
    --tl-audio-wave: rgba(94, 234, 212, 0.75);
    --tl-text-bg: #4a2c0b;
    --tl-text-border: #f59e0b;
    --tl-btn: #232329;
    --tl-btn-hover: #2e2e36;
    border-radius: 14px;
    border: 1px solid var(--tl-border);
    background: var(--tl-bg);
    color: var(--tl-text);
    overflow: hidden;
    outline: none;
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
}
.tl-editor:focus-visible { box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.45); }

html.theme-light .tl-editor {
    --tl-bg: #f4f5f8;
    --tl-panel: #ffffff;
    --tl-head: #eceef3;
    --tl-border: #dcdfe6;
    --tl-text: #1f2430;
    --tl-muted: #6b7280;
    --tl-ruler: #9aa1ad;
    --tl-track: #e7e9ef;
    --tl-accent: #0891b2;
    --tl-playhead: #111827;
    --tl-audio-bg: #ccfbf1;
    --tl-audio-border: #0d9488;
    --tl-audio-wave: rgba(13, 148, 136, 0.7);
    --tl-text-bg: #fef3c7;
    --tl-text-border: #d97706;
    --tl-btn: #ffffff;
    --tl-btn-hover: #eef0f4;
    box-shadow: 0 8px 24px -14px rgba(15, 23, 42, 0.25);
}

/* ---------- Barra de ferramentas ---------- */
.tl-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--tl-panel);
    border-bottom: 1px solid var(--tl-border);
}
.tl-toolbar-left, .tl-toolbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-toolbar-right { justify-content: flex-end; }
.tl-toolbar-center { display: flex; align-items: center; gap: 6px; }
.tl-title { font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.tl-chip {
    font-size: 10px; padding: 2px 7px; border-radius: 999px;
    background: var(--tl-btn); border: 1px solid var(--tl-border); color: var(--tl-muted);
    white-space: nowrap;
}
.tl-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    height: 28px; min-width: 28px; padding: 0 7px; border-radius: 8px;
    background: transparent; color: var(--tl-text); border: 1px solid transparent;
    font-size: 11px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.tl-btn:hover { background: var(--tl-btn-hover); }
.tl-btn svg { width: 15px; height: 15px; }
.tl-btn.is-on { color: var(--tl-accent); background: var(--tl-btn); border-color: var(--tl-border); }
.tl-play {
    width: 34px; height: 34px; border-radius: 999px;
    background: var(--tl-text); color: var(--tl-bg);
}
.tl-play:hover { background: var(--tl-accent); color: #fff; }
.tl-play svg { width: 16px; height: 16px; }
.tl-timecode { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; margin-left: 6px; white-space: nowrap; }
.tl-timecode b { color: var(--tl-accent); font-weight: 700; }
.tl-timecode span { color: var(--tl-muted); }
.tl-zoom { display: flex; align-items: center; gap: 4px; }
.tl-zoom input[type=range] {
    -webkit-appearance: none; appearance: none; width: 96px; height: 4px; border-radius: 99px;
    background: var(--tl-border); outline: none; cursor: pointer;
}
.tl-zoom input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 99px;
    background: var(--tl-text); border: 2px solid var(--tl-panel); box-shadow: 0 0 0 1px var(--tl-border);
}
.tl-zoom input[type=range]::-moz-range-thumb {
    width: 10px; height: 10px; border-radius: 99px; background: var(--tl-text); border: 2px solid var(--tl-panel);
}
.tl-zoom-label { font-family: ui-monospace, monospace; font-size: 10px; color: var(--tl-muted); min-width: 30px; text-align: right; }

/* ---------- Corpo: cabeçalhos das faixas + área rolável ---------- */
.tl-body { display: flex; position: relative; }
.tl-heads {
    flex: 0 0 104px; background: var(--tl-head); border-right: 1px solid var(--tl-border);
    display: flex; flex-direction: column; padding-bottom: 10px;
}
.tl-head-spacer { height: 26px; border-bottom: 1px solid var(--tl-border); }
.tl-head {
    display: flex; flex-direction: column; justify-content: center; gap: 1px;
    padding: 0 10px; margin-top: 8px; border-radius: 0;
}
.tl-head-name { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--tl-text); }
.tl-head-name svg { width: 13px; height: 13px; color: var(--tl-muted); }
.tl-head-meta { font-size: 10px; color: var(--tl-muted); font-family: ui-monospace, monospace; padding-left: 19px; }
.tl-h-video { height: 56px; }
.tl-h-audio { height: 46px; }
.tl-h-text { height: 30px; }

.tl-scroll {
    flex: 1 1 auto; overflow-x: auto; overflow-y: hidden; position: relative;
    scrollbar-width: thin; scrollbar-color: var(--tl-border) transparent;
}
.tl-scroll::-webkit-scrollbar { height: 8px; }
.tl-scroll::-webkit-scrollbar-thumb { background: var(--tl-border); border-radius: 8px; }
.tl-board { position: relative; min-width: 100%; padding: 0 0 10px; cursor: text; user-select: none; }

/* Régua */
.tl-ruler {
    position: relative; height: 26px; border-bottom: 1px solid var(--tl-border);
    background: var(--tl-panel); cursor: ew-resize;
}
.tl-tick { position: absolute; bottom: 0; width: 1px; background: var(--tl-ruler); opacity: .55; height: 5px; }
.tl-tick.major { height: 10px; opacity: 1; }
.tl-tick-label {
    position: absolute; top: 3px; transform: translateX(4px);
    font-size: 9.5px; font-family: ui-monospace, monospace; color: var(--tl-muted); white-space: nowrap;
}

/* Faixas */
.tl-track { position: relative; margin-top: 8px; border-radius: 8px; background: var(--tl-track); }
.tl-t-video { height: 56px; }
.tl-t-audio { height: 46px; }
.tl-t-text { height: 30px; }
.tl-empty { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 12px; font-size: 11px; font-style: italic; color: var(--tl-muted); }

/* Clipes */
.tl-clip {
    position: absolute; top: 0; bottom: 0; border-radius: 7px; overflow: hidden;
    display: flex; align-items: center; cursor: pointer;
    transition: filter .12s, box-shadow .12s;
}
.tl-clip:hover { filter: brightness(1.12); }
.tl-clip.is-active { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); }
.tl-clip.is-selected { box-shadow: 0 0 0 2px var(--tl-playhead), 0 0 0 4px rgba(34, 211, 238, .35); z-index: 3; }
.tl-clip-label {
    position: relative; z-index: 2; padding: 0 7px; font-size: 10.5px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

.tl-clip-video {
    left: 0; width: 100%;
    background-color: #0b0b0f; background-repeat: no-repeat; background-size: 100% 100%; background-origin: border-box;
    border: 1px solid rgba(255, 255, 255, .12); cursor: text; align-items: flex-start;
}
.tl-clip-video .tl-clip-label {
    margin: 4px; padding: 1px 6px; border-radius: 5px; font-size: 10px; color: #fff;
    background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px);
}

.tl-clip-audio { background: var(--tl-audio-bg); border: 1px solid var(--tl-audio-border); align-items: flex-start; }
.tl-clip-audio .tl-clip-label { padding-top: 3px; font-size: 10px; color: var(--tl-text); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
html.theme-light .tl-clip-audio .tl-clip-label { text-shadow: none; }
.tl-wave { position: absolute; left: 0; right: 0; bottom: 2px; height: 70%; width: 100%; z-index: 1; }
.tl-wave path { fill: var(--tl-audio-wave); }

.tl-clip-text { background: var(--tl-text-bg); border: 1px solid var(--tl-text-border); color: var(--tl-text); }
.tl-clip-text .tl-t-icon {
    flex: 0 0 auto; margin-left: 5px; width: 15px; height: 15px; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 800; background: var(--tl-text-border); color: #1c1003;
}

/* Cursor de reprodução */
.tl-playhead {
    position: absolute; top: 0; bottom: 0; width: 0; z-index: 10; pointer-events: none;
    border-left: 1.5px solid var(--tl-playhead);
}
.tl-playhead-knob {
    position: absolute; top: 2px; left: -7px; width: 13px; height: 18px; pointer-events: auto; cursor: ew-resize;
    background: var(--tl-playhead); border-radius: 3px 3px 7px 7px;
    clip-path: polygon(0 0, 100% 0, 100% 65%, 50% 100%, 0 65%);
}
.tl-hover {
    position: absolute; top: 0; bottom: 0; width: 0; z-index: 9; pointer-events: none;
    border-left: 1px dashed var(--tl-muted); opacity: 0; transition: opacity .1s;
}
.tl-hover span {
    position: absolute; top: 4px; left: 4px; padding: 1px 5px; border-radius: 4px;
    font-size: 9.5px; font-family: ui-monospace, monospace; white-space: nowrap;
    background: var(--tl-text); color: var(--tl-bg);
}
.tl-board:hover .tl-hover.show { opacity: .8; }
.tl-board.is-scrubbing, .tl-board.is-scrubbing * { cursor: ew-resize !important; }

/* Rodapé de atalhos */
.tl-footer {
    display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 12px;
    border-top: 1px solid var(--tl-border); background: var(--tl-panel);
    font-size: 10px; color: var(--tl-muted);
}
.tl-footer kbd {
    font-family: ui-monospace, monospace; font-size: 9.5px; padding: 0 4px; border-radius: 4px;
    border: 1px solid var(--tl-border); background: var(--tl-btn); color: var(--tl-text);
}

@media (max-width: 760px) {
    .tl-toolbar { grid-template-columns: 1fr; }
    .tl-toolbar-left, .tl-toolbar-right, .tl-toolbar-center { justify-content: center; }
    .tl-heads { flex-basis: 74px; }
    .tl-head-meta { display: none; }
}

/* ---------- Card de consumo das APIs ---------- */
.usage-bar { height: 6px; border-radius: 99px; overflow: hidden; display: flex; background: rgba(148, 163, 184, .2); }
.usage-bar > div { height: 100%; }

/* ---------- Tela cheia: vídeo em cima, linha do tempo embaixo ---------- */
.tl-fs-exit { display: none; }
#timelineFsBtn.is-on .tl-fs-enter { display: none; }
#timelineFsBtn.is-on .tl-fs-exit { display: block; }

#step4VideoPane.tl-fs-mode {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; gap: 12px 0;
    width: 100vw; height: 100vh; padding: 12px 16px;
    overflow: hidden; background: #0b0d12;
}
html.theme-light #step4VideoPane.tl-fs-mode { background: #eef1f6; }
#step4VideoPane.tl-fs-fallback { position: fixed; inset: 0; z-index: 9999; margin: 0 !important; }
#step4VideoPane.tl-fs-mode > * { margin: 0 !important; }

/* Painel do vídeo: só o player, ocupando o espaço que sobra */
#step4VideoPane.tl-fs-mode > #finalVideoPanel {
    grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; display: flex;
    padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none;
}
#step4VideoPane.tl-fs-mode > #finalVideoPanel:not(:has(video)) { display: none; }
#step4VideoPane.tl-fs-mode #finalVideoPanel > :not(#finalVideoContainer) { display: none !important; }
#step4VideoPane.tl-fs-mode #finalVideoContainer { flex: 1 1 auto; min-height: 0; display: flex; align-items: stretch; justify-content: stretch; }
#step4VideoPane.tl-fs-mode #finalVideoContainer > div {
    flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px;
}
#step4VideoPane.tl-fs-mode #finalVideoContainer > div > * { margin: 0 !important; }
#step4VideoPane.tl-fs-mode #finalVideoContainer > div > :not(#annotStage):not(#annotToolbar):not(#annotInspector) { display: none !important; }
/* O palco ocupa só a altura que sobra; o vídeo fica contido nele (sem invadir a linha do tempo) */
#step4VideoPane.tl-fs-mode #annotStage { flex: 1 1 0; min-height: 0; }

/* Ferramentas de anotação numa coluna à esquerda: o vídeo ganha a altura toda */
#step4VideoPane.tl-fs-mode #finalVideoContainer > div {
    display: grid; grid-template-columns: 196px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    column-gap: 12px; row-gap: 8px;
}
#step4VideoPane.tl-fs-mode #annotStage { grid-column: 2; grid-row: 1 / -1; min-height: 0; }
/* Fundo da coluna: um painel só, da altura do vídeo até a linha do tempo */
#step4VideoPane.tl-fs-mode #finalVideoContainer > div:has(#annotToolbar)::before {
    content: ''; grid-column: 1; grid-row: 1 / -1; border-radius: 12px;
    background: rgba(15, 23, 42, .7); border: 1px solid #1e293b;
}
html.theme-light #step4VideoPane.tl-fs-mode #finalVideoContainer > div:has(#annotToolbar)::before { background: #ffffff; border-color: #dfe4ec; }
#step4VideoPane.tl-fs-mode #annotToolbar,
#step4VideoPane.tl-fs-mode #annotInspector {
    position: relative; z-index: 1; background: transparent !important; border-color: transparent !important; padding: 10px;
}
#step4VideoPane.tl-fs-mode #annotToolbar { grid-column: 1; grid-row: 1; }
#step4VideoPane.tl-fs-mode #annotInspector {
    grid-column: 1; grid-row: 2; align-self: start; max-height: 100%; overflow-y: auto;
    border-top: 1px solid #1e293b !important; border-radius: 0;
}
html.theme-light #step4VideoPane.tl-fs-mode #annotInspector { border-top-color: #dfe4ec !important; }
/* Nada selecionado: dica no espaço do inspetor */
#step4VideoPane.tl-fs-mode #finalVideoContainer > div:has(#annotInspector.hidden):has(#annotTools:not(.hidden))::after {
    content: 'Clique numa anotação para editar o tempo, o texto ou excluir.';
    grid-column: 1; grid-row: 2; align-self: start; position: relative; z-index: 1;
    margin: 0 10px; padding-top: 10px; border-top: 1px solid #1e293b;
    font-size: 11px; line-height: 1.4; color: #64748b; text-align: center;
}
#step4VideoPane.tl-fs-mode #annotToolbar,
#step4VideoPane.tl-fs-mode #annotInspector,
#step4VideoPane.tl-fs-mode #annotTools {
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 8px;
}
#step4VideoPane.tl-fs-mode #annotToolbar > button,
#step4VideoPane.tl-fs-mode #annotInspector > button { justify-content: center; width: 100%; }
#step4VideoPane.tl-fs-mode #annotStatus { margin-left: 0; text-align: center; line-height: 1.35; }
#step4VideoPane.tl-fs-mode #annotTools .an-group { display: flex; flex-wrap: wrap; justify-content: center; }
#step4VideoPane.tl-fs-mode #annotDuration { width: 100%; }
#step4VideoPane.tl-fs-mode #annotInspector > label { justify-content: space-between; }
#step4VideoPane.tl-fs-mode #annotInspector > label input { flex: 1 1 auto; width: auto; min-width: 0; }
#step4VideoPane.tl-fs-mode #annotInspector #annotText { width: 100%; }
#step4VideoPane.tl-fs-mode #annotInspector > .flex-1 { display: none; }
/* Sem a barra (vídeo ainda sem anotação disponível) o palco usa a largura toda */
#step4VideoPane.tl-fs-mode #finalVideoContainer > div:not(:has(#annotToolbar)) { grid-template-columns: minmax(0, 1fr); }
#step4VideoPane.tl-fs-mode #finalVideoContainer > div:not(:has(#annotToolbar)) #annotStage { grid-column: 1; }
#step4VideoPane.tl-fs-mode #finalVideoPlayer {
    position: absolute; inset: 0; width: 100%; height: 100%; max-height: none;
    object-fit: contain; border: 0; box-shadow: none; background: transparent;
}

/* Linha do tempo + inspetor embaixo, rolando se faltar altura */
#step4VideoPane.tl-fs-mode > #multitrackTimelineContainer {
    grid-column: 1 / -1; grid-row: 2; min-width: 0; max-height: 46vh; overflow-y: auto; padding: 10px 12px;
}
#step4VideoPane.tl-fs-mode > #finalVideoPanel:not(:has(video)) ~ #multitrackTimelineContainer { grid-row: 1 / -1; max-height: none; }
#step4VideoPane.tl-fs-mode > #multitrackTimelineContainer > * + * { margin-top: 10px !important; }
#step4VideoPane.tl-fs-mode .tl-footer { display: none; }
/* O cartão "Trecho falado" repete o painel ao lado: aparece só quando o editor da fala está aberto */
#step4VideoPane.tl-fs-mode #timelineSegmentInspector:has(#segmentEditor.hidden) { display: none; }

/* ---------- Tela cheia: falas ao lado do vídeo (a que está tocando fica verde) ---------- */
.fs-script { display: none; }
#step4VideoPane.tl-fs-mode:has(#finalVideoPlayer) > #fsScriptPanel {
    --fs-bg: #0f172a; --fs-soft: #111c33; --fs-line: #1e293b; --fs-text: #e2e8f0; --fs-muted: #94a3b8; --fs-input: #020617;
    --fs-on-bg: #14532d; --fs-on-line: #22c55e; --fs-on-text: #ffffff; --fs-on-muted: #bbf7d0;
    display: flex; flex-direction: column; grid-column: 2; grid-row: 1; min-height: 0; margin-left: 12px !important;
    width: clamp(300px, 27vw, 480px); border-radius: 12px; overflow: hidden;
    background: var(--fs-bg); border: 1px solid var(--fs-line); color: var(--fs-text);
}
html.theme-light #step4VideoPane.tl-fs-mode:has(#finalVideoPlayer) > #fsScriptPanel {
    --fs-bg: #ffffff; --fs-soft: #f8fafc; --fs-line: #dfe4ec; --fs-text: #0f172a; --fs-muted: #64748b; --fs-input: #ffffff;
    --fs-on-bg: #dcfce7; --fs-on-line: #16a34a; --fs-on-text: #14532d; --fs-on-muted: #166534;
}
@media (max-width: 899px) { #step4VideoPane.tl-fs-mode:has(#finalVideoPlayer) > #fsScriptPanel { display: none; } }
.fs-head { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--fs-line); }
.fs-head b { font-size: 13px; }
.fs-head span { font-size: 11px; color: var(--fs-muted); }
.fs-list { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.fs-item { flex-shrink: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; padding: 6px 8px;
    border-radius: 10px; border: 1px solid var(--fs-line); background: var(--fs-soft); transition: background .15s, border-color .15s; }
.fs-item.is-changed { border-color: #f59e0b; box-shadow: inset 3px 0 0 #f59e0b; }
.fs-item.is-speaking { background: var(--fs-on-bg); border-color: var(--fs-on-line); box-shadow: 0 0 0 1px var(--fs-on-line); }
.fs-item.is-speaking.is-changed { box-shadow: inset 3px 0 0 #f59e0b, 0 0 0 1px var(--fs-on-line); }
.fs-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 3px; }
.fs-time { font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--fs-muted); cursor: pointer; }
.fs-time:hover { color: var(--fs-text); text-decoration: underline; }
.fs-one { font-size: 12px; line-height: 1; padding: 2px 4px; border-radius: 5px; color: var(--fs-muted); cursor: pointer; }
.fs-one:hover { background: var(--fs-line); color: var(--fs-text); }
.fs-text { display: block; width: 100%; resize: none; overflow: hidden; field-sizing: content; padding: 2px 6px; border-radius: 6px;
    font-size: 13px; line-height: 1.5; background: transparent; color: var(--fs-text); border: 1px solid transparent; outline: none; }
.fs-text:not([readonly]):hover { border-color: var(--fs-line); }
.fs-text:not([readonly]):focus { border-color: #0a8ae6; background: var(--fs-input); }
.fs-item.is-speaking .fs-text { color: var(--fs-on-text); font-weight: 600; }
.fs-item.is-speaking .fs-text:focus { color: var(--fs-text); }
.fs-item.is-speaking .fs-time, .fs-item.is-speaking .fs-one, .fs-item.is-speaking .fs-note { color: var(--fs-on-muted); }
.fs-note { padding: 2px 6px 0; font-size: 11px; line-height: 1.4; color: var(--fs-muted); }
.fs-note button { text-decoration: underline; text-underline-offset: 2px; font-weight: 600; cursor: pointer; }
.fs-wait { display: flex; align-items: center; gap: 6px; padding: 4px 6px 0; font-size: 11px; color: var(--fs-muted); }
.fs-wait select { height: 22px; padding: 0 4px; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer; outline: none;
    background: var(--fs-input); color: var(--fs-text); border: 1px solid var(--fs-line); }
.fs-wait select:focus { border-color: #0a8ae6; }
.fs-wait select:disabled { opacity: .5; cursor: wait; }
.fs-item.is-speaking .fs-wait { color: var(--fs-on-muted); }
/* Blocos de fala novos e o botão para adicionar entre os textos */
.fs-new { flex-shrink: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; padding: 6px 8px; border-radius: 10px;
    border: 1px dashed #0a8ae6; background: var(--fs-soft); }
.fs-new .fs-text { border-color: var(--fs-line); background: var(--fs-input); }
.fs-tag { font-size: 10px; font-weight: 700; color: #2ea4f5; }
.fs-add { flex-shrink: 0; display: flex; align-items: center; gap: 8px; height: 16px; font-size: 11px; font-weight: 600; color: var(--fs-muted); cursor: pointer; }
.fs-add::before, .fs-add::after { content: ''; flex: 1; border-top: 1px dashed var(--fs-line); }
.fs-add span { opacity: .65; }
.fs-add:hover, .fs-add:focus-visible { color: #2ea4f5; }
.fs-add:hover span, .fs-add:focus-visible span { opacity: 1; }
.fs-add:hover::before, .fs-add:hover::after { border-color: #0a8ae6; }
.fs-add:disabled { opacity: .4; cursor: wait; }
.fs-empty { padding: 16px; font-size: 12px; text-align: center; color: var(--fs-muted); }
.fs-foot { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--fs-line); background: var(--fs-soft); }
.fs-foot[hidden], .fs-busy[hidden], .fs-note[hidden] { display: none; }
.fs-changed { font-size: 11px; font-weight: 600; color: #f59e0b; }
.fs-actions { display: flex; gap: 8px; }
.fs-btn { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer;
    background: transparent; color: var(--fs-text); border: 1px solid var(--fs-line); }
.fs-btn.primary { flex: 1; background: #059669; border-color: #059669; color: #fff; }
.fs-btn.primary:hover { background: #047857; }
.fs-btn:disabled { opacity: .55; cursor: wait; }
.fs-busy { display: flex; align-items: center; gap: 8px; font-size: 11px; line-height: 1.4; }
.fs-busy i { width: 14px; height: 14px; flex-shrink: 0; border-radius: 99px; border: 2px solid #22c55e; border-top-color: transparent; animation: fs-spin .8s linear infinite; }
@keyframes fs-spin { to { transform: rotate(360deg); } }
/* A fala que está tocando também fica verde na linha do tempo */
#step4VideoPane.tl-fs-mode .tl-clip-audio.is-active,
#step4VideoPane.tl-fs-mode .tl-clip-text.is-active { background: #15803d; border-color: #4ade80; color: #fff; box-shadow: 0 0 0 2px #4ade80; }
#step4VideoPane.tl-fs-mode .tl-clip-audio.is-active .tl-clip-label { color: #fff; }
#step4VideoPane.tl-fs-mode .tl-clip-audio.is-active .tl-wave path { fill: rgba(220, 252, 231, .85); }

/* ---------- Faixa de anotações ---------- */
.tl-h-annot, .tl-t-annot { height: 30px; }
.tl-clip-annot {
    bottom: auto; cursor: grab; color: var(--tl-text);
    background: color-mix(in srgb, var(--c) 28%, var(--tl-track));
    border: 1px solid var(--c);
}
.tl-clip-annot:active { cursor: grabbing; }

/* Falas (narração + legenda) arrastáveis */
.tl-clip-audio, .tl-clip-text { cursor: grab; }
.tl-clip.is-dragging { cursor: grabbing; z-index: 5; opacity: .85; box-shadow: 0 0 0 2px var(--tl-playhead); transition: none; }
#timelineBoard.is-busy .tl-clip-audio, #timelineBoard.is-busy .tl-clip-text { cursor: progress; opacity: .6; }
.tl-drag-tip {
    position: fixed; z-index: 9999; pointer-events: none; padding: 3px 8px; border-radius: 6px;
    font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
    background: #0f172a; color: #e2e8f0; border: 1px solid #22d3ee; box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}
.tl-clip-annot .tl-a-icon { flex: 0 0 auto; margin-left: 8px; font-size: 11px; font-weight: 800; line-height: 1; }
.tl-clip-annot .tl-clip-label { font-size: 10px; padding-left: 5px; }
.tl-annot-edge { position: absolute; top: 0; bottom: 0; width: 7px; z-index: 3; cursor: ew-resize; }
.tl-annot-edge.l { left: 0; }
.tl-annot-edge.r { right: 0; }
.tl-clip-annot:hover .tl-annot-edge, .tl-clip-annot.is-selected .tl-annot-edge { background: rgba(255, 255, 255, .22); }

/* ---------- Editor de anotações sobre o vídeo ---------- */
.annot-stage { position: relative; }
.annot-overlay { position: absolute; display: none; pointer-events: none; overflow: hidden; touch-action: none; }
.annot-overlay.is-editing { pointer-events: auto; cursor: default; outline: 2px dashed rgba(10, 138, 230, .7); outline-offset: -2px; }
.annot-overlay.is-drawing { cursor: crosshair; }
.annot-overlay.is-editing .an-shape { cursor: move; }
.annot-overlay.is-drawing .an-shape { cursor: crosshair; }
.an-handle { fill: #ffffff; stroke: #0891b2; stroke-width: 2; vector-effect: non-scaling-stroke; cursor: grab; }

.an-group { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 9px; background: rgba(2, 6, 23, .55); border: 1px solid #1e293b; }
html.theme-light .an-group { background: #ffffff; border-color: #dfe4ec; }
.an-tool {
    width: 28px; height: 28px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
    color: #cbd5e1; transition: background .12s, color .12s;
}
.an-tool svg { width: 16px; height: 16px; }
.an-tool:hover { background: #1e293b; color: #fff; }
.an-tool.is-on { background: #0070d1; color: #fff; }
html.theme-light .an-tool { color: #475569; }
html.theme-light .an-tool:hover { background: #eef2f7; color: #0f172a; }
html.theme-light .an-tool.is-on { background: #0070d1; color: #fff; }
.an-colors { gap: 4px; padding: 4px 6px; }
.an-color {
    width: 18px; height: 18px; border-radius: 99px; background: var(--c);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); transition: transform .1s;
}
.an-color:hover { transform: scale(1.12); }
.an-color.is-on { box-shadow: 0 0 0 2px #0b0d12, 0 0 0 4px #2ea4f5; }
html.theme-light .an-color.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0070d1; }

/* ---------- Documentação ---------- */
.doc-mark { background: rgba(250, 204, 21, .28); color: inherit; border-radius: 3px; padding: 0 1px; }
.doc-seg.is-on { background: rgba(0, 112, 209, .22); }
.doc-seg.is-on span:last-child { color: #fff; }
.doc-chapter.is-on { background: rgba(0, 112, 209, .25); color: #fff; }
.doc-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; font-size: 11px; color: #94a3b8; }
.doc-icon:hover:not(:disabled) { background: #1e293b; color: #fff; }
.doc-icon:disabled { opacity: .3; cursor: default; }
.doc-card .line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html.theme-light .doc-mark { background: rgba(250, 204, 21, .45); }
html.theme-light .doc-seg.is-on, html.theme-light .doc-chapter.is-on { background: rgba(0, 112, 209, .12); color: #07264a; }
html.theme-light .doc-seg.is-on span:last-child { color: #07264a; }
html.theme-light .doc-icon:hover:not(:disabled) { background: #eef2f7; color: #0f172a; }
/* Sumário no tema claro: fundo branco e texto preto */
html.theme-light .doc-toc-item.is-on { background: #fff; border-color: #e2e8f0; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
html.theme-light .doc-toc-item button,
html.theme-light .doc-toc-item .doc-chapter,
html.theme-light .doc-toc-item .doc-chapter span:last-child { color: #0f172a; }
html.theme-light .doc-toc-item .text-slate-500 { color: #64748b; }
html.theme-light .doc-toc-item .doc-chapter:hover { background: #f1f5f9; color: #0f172a; }
html.theme-light .doc-toc-item .doc-chapter .text-indigo-300 { color: #0070d1; }
html.theme-light .doc-toc-item .doc-chapter.is-on { background: #eaf6ff; color: #0f172a; }

/* Reprocessar trecho: intervalo marcado na linha do tempo */
.tl-range-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px;
    border-bottom: 1px solid var(--tl-border); background: rgba(244, 63, 94, .08);
    font-size: 11px; color: var(--tl-text);
}
.tl-range-bar label { display: inline-flex; align-items: center; gap: 4px; }
.tl-range-bar input[type=number] {
    width: 76px; padding: 2px 6px; border-radius: 6px; font-family: ui-monospace, monospace; font-size: 11px;
    background: var(--tl-bg); color: var(--tl-text); border: 1px solid var(--tl-border);
}
.tl-range-hint { color: #fda4af; font-weight: 600; }
.tl-range-info { color: var(--tl-muted); }
.tl-range-check input { accent-color: #f43f5e; }
.tl-range-go { background: #e11d48 !important; color: #fff !important; border-color: #e11d48 !important; font-weight: 600; }
.tl-range-go:disabled { opacity: .5; cursor: wait; }
.tl-range {
    position: absolute; top: 0; bottom: 0; z-index: 8; pointer-events: none;
    background: rgba(244, 63, 94, .16); border-left: 2px solid #f43f5e; border-right: 2px solid #f43f5e;
}
.tl-range-edge {
    position: absolute; top: 0; bottom: 0; width: 10px; pointer-events: auto; cursor: ew-resize;
}
.tl-range-edge.l { left: -6px; }
.tl-range-edge.r { right: -6px; }
.tl-board.is-range-mode, .tl-board.is-range-mode .tl-clip { cursor: crosshair; }

/* Cortes: trechos que somem do vídeo final (hachurado) */
.tl-cuts { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.tl-cut {
    position: absolute; top: 0; bottom: 0; min-width: 3px;
    background: repeating-linear-gradient(135deg, rgba(15, 23, 42, .62) 0 6px, rgba(15, 23, 42, .38) 6px 12px);
    border-left: 2px solid #f59e0b; border-right: 2px solid #f59e0b;
}
.tl-cut-tag {
    position: absolute; top: 3px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px;
    padding: 1px 6px; border-radius: 999px; background: #f59e0b; color: #1c1917; font-size: 10px; font-weight: 700; white-space: nowrap;
    pointer-events: auto; cursor: pointer; border: 0;
}
.tl-cut-tag:hover { background: #fbbf24; }
.tl-cut.pending {
    background: repeating-linear-gradient(135deg, rgba(244, 63, 94, .30) 0 6px, rgba(244, 63, 94, .14) 6px 12px);
    border-left: 2px dashed #f43f5e; border-right: 2px dashed #f43f5e;
}
.tl-cut.pending .tl-cut-tag { background: #f43f5e; color: #fff; }
.tl-cuts-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; padding: 7px 10px; border-radius: 10px; font-size: 11px;
    background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .45); color: #fcd34d;
}
.tl-cuts-bar b { color: #fde68a; }
html.theme-light .tl-cuts-bar { color: #92400e; background: #fffbeb; border-color: #fcd34d; }
html.theme-light .tl-cuts-bar b { color: #78350f; }
.tl-cut-go { background: #d97706 !important; color: #fff !important; border-color: #d97706 !important; font-weight: 600; }
.tl-cut-go:disabled { opacity: .5; cursor: wait; }
.tl-clip.in-range { outline: 2px dashed #f43f5e; outline-offset: -2px; opacity: .65; }

/* Áudio original do vídeo + botões de mudo nas faixas de áudio */
.tl-head-row { display: flex; align-items: center; gap: 4px; }
.tl-head-row .tl-head-meta { padding-left: 0; }
.tl-mute { width: 24px; height: 20px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px;
    color: var(--tl-text); background: var(--tl-btn); border: 1px solid var(--tl-border); transition: background .12s, color .12s; }
.tl-mute:hover { background: var(--tl-btn-hover); }
.tl-mute svg { width: 14px; height: 14px; }
.tl-mute.is-muted { color: #f87171; border-color: rgba(248, 113, 113, .45); }
.tl-clip-orig { left: 0; background: #2a1f4d; border: 1px solid #55c91f; align-items: flex-start; pointer-events: none; }
.tl-clip-orig .tl-wave path { fill: rgba(125, 211, 252, .8); }
.tl-clip-orig .tl-clip-label { padding-top: 3px; font-size: 10px; color: var(--tl-text); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.tl-track.is-muted .tl-clip { opacity: .4; filter: grayscale(.6); }
html.theme-light .tl-clip-orig { background: #ddfacb; border-color: #55c91f; }
html.theme-light .tl-clip-orig .tl-wave path { fill: rgba(3, 105, 161, .55); }
html.theme-light .tl-clip-orig .tl-clip-label { text-shadow: none; }
