:root {
  --bg: #0e0e10; --panel: #161618; --panel2: #1d1d20; --line: #2a2a2e; --text: #ececf0; --muted: #8c8c96;
  --accent: #6c5ce7; --accent2: #8b7cf6; --orange: #f0743e; --orange-bg: #3a2216; --green: #2ecc71; --green-bg: #133322;
  --yellow: #f5b544; --yellow-bg: #3a2e14; --red: #ff6b6b; --radius: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--accent2); }
.hidden { display: none !important; }
kbd { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 11px; color: var(--muted); }

/* topo */
.top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: -.3px; font-size: 17px; }
.brand span { color: var(--orange); font-style: italic; font-weight: 600; }
.crumb { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 160px; }
.crumb b { color: var(--text); font-weight: 600; }
.sel { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.btn:hover { border-color: #3d3d44; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.orange { background: var(--orange-bg); border-color: #5a3320; color: var(--orange); }
.btn.green { background: var(--green-bg); border-color: #1f5a3a; color: var(--green); }
.btn:disabled { opacity: .45; cursor: default; }
.count { background: var(--orange); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill.review { background: #24243a; color: #a9a4ff; }
.pill.changes, .pill.open { background: var(--yellow-bg); color: var(--yellow); }
.pill.approved, .pill.resolved { background: var(--green-bg); color: var(--green); }
.search { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 200px; }

/* layout */
.wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: calc(100vh - 57px); min-height: 0; }
.wrap > * { min-height: 0; }
.stage-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px 18px 10px; }
.stage { flex: 1 1 0; min-height: 200px; background: #000; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.stage .big-play { position: absolute; width: 68px; height: 68px; border-radius: 50%; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
.stage .tc-flag { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.7); padding: 8px 12px; border-radius: 8px; max-width: 70%; font-size: 13px; }

/* timeline */
.timeline { position: relative; margin-top: 12px; height: 46px; cursor: pointer; user-select: none; touch-action: none; }
.track { position: absolute; left: 0; right: 0; top: 6px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.buffered { position: absolute; top: 0; bottom: 0; left: 0; background: #3a3a40; }
.progress { position: absolute; top: 0; bottom: 0; left: 0; background: var(--orange); }
.head { position: absolute; top: 0; width: 3px; height: 18px; background: #fff; border-radius: 2px; transform: translateX(-1px); }
.marker { position: absolute; top: 20px; width: 22px; height: 22px; border-radius: 50%; transform: translateX(-11px); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; color: #fff; border: 2px solid var(--bg); }
.marker.resolved { opacity: .35; }
.marker:hover, .marker.active { transform: translateX(-11px) scale(1.18); z-index: 2; }
.hover-tc { position: absolute; top: -24px; background: #000; padding: 2px 6px; border-radius: 4px; font-size: 11px; transform: translateX(-50%); pointer-events: none; }

.controls { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.ic { width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.ic:hover { background: var(--panel2); }
.ic svg { width: 18px; height: 18px; }
.ic.on { color: var(--orange); }
.timecode { font-variant-numeric: tabular-nums; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin: 0 auto; font-size: 15px; letter-spacing: .5px; }
.dur { color: var(--muted); font-variant-numeric: tabular-nums; }
.hints { color: var(--muted); font-size: 12px; margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* lateral */
.side { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.side-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.side-head h3 { margin: 0; font-size: 15px; }
.side-head .muted { margin-left: auto; }
.muted { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 4px; padding: 10px 14px 0; }
.tab { padding: 6px 10px; border-radius: 7px; color: var(--muted); }
.tab.on { background: var(--panel2); color: var(--text); }
.list { flex: 1; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; cursor: pointer; }
.card.active { border-color: var(--orange); }
.card.is-resolved { opacity: .6; }
.card-h { display: flex; align-items: center; gap: 8px; }
.av { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.who { font-weight: 600; }
.card-h .num { color: var(--muted); font-size: 12px; margin-left: auto; }
.chk { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #4a4a52; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.chk.done { background: var(--green); border-color: var(--green); color: #052; }
.chk svg { width: 12px; height: 12px; }
.body { margin: 7px 0 0 32px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 12px; font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.chip.tc { background: var(--yellow-bg); color: var(--yellow); }
.chip.whole { background: #26244a; color: #a9a4ff; }
.card-f { margin: 8px 0 0 32px; display: flex; gap: 12px; align-items: center; }
.link { color: var(--muted); font-size: 12px; }
.link:hover { color: var(--text); }
.replies { margin: 8px 0 0 32px; border-left: 2px solid var(--line); padding-left: 10px; display: flex; flex-direction: column; gap: 8px; }
.reply .body { margin-left: 0; margin-top: 3px; }
.reply-box { margin: 8px 0 0 32px; display: flex; gap: 6px; }
.reply-box input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; }

.composer { border-top: 1px solid var(--line); padding: 10px 12px 12px; }
.composer textarea { width: 100%; min-height: 64px; max-height: 180px; resize: vertical; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; outline: none; }
.composer textarea:focus { border-color: var(--orange); }
.comp-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.comp-top .as { margin-left: auto; }
.comp-bot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.comp-bot .btn.send { margin-left: auto; background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }
.toggle-whole.on { background: #26244a; border-color: #3b3870; color: #a9a4ff; }

/* modal / toast */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: 100%; max-width: 380px; }
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 12px 0; outline: none; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #222226; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.banner { margin: 0 0 10px; padding: 9px 12px; border-radius: 8px; font-size: 13px; }
.banner.approved { background: var(--green-bg); color: var(--green); }
.banner.changes { background: var(--yellow-bg); color: var(--yellow); }
.banner.old { background: #26244a; color: #a9a4ff; }

/* celular */
@media (max-width: 900px) {
  .wrap { display: block; height: auto; }
  .stage-col { padding: 10px; }
  .stage { height: 62vh; flex: none; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .list { max-height: none; overflow: visible; }
  .hints { display: none; }
  .search { width: 100%; order: 10; }
  .top { gap: 8px; }
  .crumb { flex-basis: 100%; order: -1; }
  .composer { position: sticky; bottom: 0; background: var(--panel); z-index: 5; }
  .timecode { font-size: 13px; padding: 5px 8px; }
}

/* painel */
.admin { max-width: 1100px; margin: 0 auto; padding: 22px 18px 60px; }
.admin h1 { font-size: 22px; margin: 0 0 4px; }
.admin table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.admin th, .admin td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin th { color: var(--muted); font-weight: 500; font-size: 12px; }
.admin .proj { margin-top: 26px; font-size: 15px; color: var(--muted); }
.drop { margin-top: 16px; border: 2px dashed var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 10px; grid-template-columns: 1fr 1fr auto; align-items: end; }
.drop label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.drop input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px; color: var(--text); }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; grid-column: 1 / -1; }
.bar i { display: block; height: 100%; width: 0; background: var(--orange); }
@media (max-width: 700px) { .drop { grid-template-columns: 1fr; } .admin .hide-m { display: none; } }
