@font-face { font-family: "Poppins"; src: url("/fonts/Poppins-Regular.ttf"); font-weight: 400; }
@font-face { font-family: "Poppins"; src: url("/fonts/Poppins-Medium.ttf"); font-weight: 500; }
@font-face { font-family: "Poppins"; src: url("/fonts/Poppins-SemiBold.ttf"); font-weight: 600; }
@font-face { font-family: "Poppins"; src: url("/fonts/Poppins-Bold.ttf"); font-weight: 700; }
@font-face { font-family: "Poppins"; src: url("/fonts/Poppins-BoldItalic.ttf"); font-weight: 700; font-style: italic; }
@font-face { font-family: "DM Mono"; src: url("/fonts/ui/DMMono-Regular.ttf"); font-weight: 400; }
@font-face { font-family: "DM Mono"; src: url("/fonts/ui/DMMono-Medium.ttf"); font-weight: 500; }

:root {
  --bg: #0d0b0a;
  --bg-2: #120f0d;
  --panel: #161210;
  --panel-2: #1c1714;
  --panel-3: #241e1a;
  --line: #2b2420;
  --line-2: #3a312b;
  --text: #f2ece4;
  --text-2: #c9beb2;
  --muted: #a39789;
  --faint: #7e7369;
  --red: #e3241d;
  --red-deep: #a8070a;
  --green: #49dc7b;
  --cream: #fff1d2;
  --amber: #ffb547;
  --m-chunk: #e9e1d6;
  --m-stack: #e3241d;
  --m-solo: #49dc7b;
  --m-card: #f2c46b;
  --radius: 14px;
  --sans: "Poppins", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 50% -10%, #2a1a14 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 110%, #1a1410 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font: 400 13px/1.5 var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 100; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-3%)} 60%{transform:translate(-2%,-1%)} 80%{transform:translate(3%,3%)} 100%{transform:translate(0,0)} }

.eyebrow {
  margin: 0; font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}

/* ---------------------------------------------------------------- topo */
.topbar {
  height: 58px; display: flex; align-items: center; gap: 24px; padding: 0 22px;
  border-bottom: 1px solid var(--line); background: rgba(13, 11, 10, .7); backdrop-filter: blur(10px);
  position: relative; z-index: 5;
}
.brand { display: flex; align-items: baseline; gap: 2px; white-space: nowrap; }
.brand-sans { font: 600 21px/1 var(--sans); letter-spacing: -.04em; }
.brand-serif { font: 700 25px/1 var(--sans); color: var(--red); letter-spacing: -.05em; margin-left: 1px; }
.brand-tag { margin-left: 14px; font: 400 10.5px/1 var(--mono); color: var(--faint); letter-spacing: .14em; text-transform: uppercase; }
.project-title { flex: 1; display: flex; justify-content: center; }
.title-edit { position: relative; display: flex; align-items: center; max-width: min(460px, 100%); cursor: text; }
.project-title #projectTitle {
  background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 30px; text-align: center;
  font: 600 16px/1 var(--sans); letter-spacing: -.02em; color: var(--text); width: 100%;
  field-sizing: content; min-width: 140px; max-width: 460px;
}
.title-edit svg { position: absolute; right: 9px; width: 15px; height: 15px; fill: var(--muted); opacity: .55; pointer-events: none; transition: opacity .15s; }
.title-edit:hover svg { opacity: 1; }
.project-title #projectTitle:hover { border-color: var(--line); }
.project-title #projectTitle:focus { outline: none; border-color: var(--line-2); background: var(--panel); }
.project-title #projectTitle:focus + svg { opacity: 0; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.history { display: flex; gap: 6px; margin-right: 6px; }
.history .btn-ghost { display: grid; place-items: center; }
.history svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-ghost:disabled { opacity: .35; cursor: default; }
.btn-help { font: 600 14px/1 var(--sans); }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 99px;
  border: 1px solid var(--line); font: 500 10.5px/1 var(--mono); letter-spacing: .1em; color: var(--muted);
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.chip.on { color: var(--text-2); border-color: #2f4a37; }
.chip.on i { background: var(--green); box-shadow: 0 0 10px var(--green); }

/* ---------------------------------------------------------------- layout */
.studio {
  height: calc(100vh - 58px);
  display: grid; grid-template-columns: 260px minmax(0, 1fr) 400px;
}

/* ---------------------------------------------------------------- trilho */
.rail {
  border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(180deg, rgba(22,18,16,.6), rgba(13,11,10,.2));
}
.rail-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 12px; }
.project-list { flex: 1; overflow: auto; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.rail-search { padding: 0 10px 8px; }
.rail-search input { width: 100%; font-size: 12px; }
.hint.pad { padding: 8px; }
.project-list:empty::after {
  content: "Nenhum projeto ainda."; color: var(--faint); font-size: 12px; padding: 10px 8px;
}
.proj {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 7px;
  border-radius: 11px; border: 1px solid transparent; background: transparent; text-align: left; position: relative;
  transition: background .15s, border-color .15s;
}
.proj:hover { background: var(--panel); }
.proj.active { background: var(--panel-2); border-color: var(--line-2); }
.proj.active::before { content: ""; position: absolute; left: -10px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--red); }
.proj img { width: 44px; height: 60px; object-fit: cover; border-radius: 7px; background: var(--panel-3); }
.proj-name { font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-meta { font: 400 11px/1.45 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj > div { min-width: 0; }
.proj-del { opacity: 0; border: 0; background: none; color: var(--muted); font-size: 16px; padding: 4px 6px; border-radius: 6px; }
.proj:hover .proj-del, .proj:focus-within .proj-del { opacity: 1; }
.proj-del:hover { color: var(--red); background: rgba(227,36,29,.1); }
.m-chunk { background: var(--m-chunk); } .m-stack { background: var(--m-stack); }
.m-solo { background: var(--m-solo); } .m-card { background: var(--m-card); }
.m-flash { background: var(--cream); box-shadow: 0 0 6px var(--cream); width: 3px !important; }
.m-emph { background: var(--amber); width: 7px !important; height: 7px !important; border-radius: 50% !important; }

/* ---------------------------------------------------------------- botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2);
  font-weight: 500; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--panel-3); border-color: #4a3f37; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 8px 24px -10px rgba(227,36,29,.7); }
.btn-primary:hover { background: #f0302a; border-color: #f0302a; }
.btn-danger, .btn-danger:hover { background: var(--red-deep); border-color: var(--red); color: #fff; }
.btn-primary:disabled { background: var(--panel-3); border-color: var(--line-2); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn-sm span { font-size: 15px; line-height: 1; margin-top: -1px; }
.btn-lg { padding: 13px 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--muted); font: 500 11px/1 var(--mono); letter-spacing: .06em; padding: 4px; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--text); }
.btn-ghost { background: none; border: 1px solid var(--line); color: var(--text-2); width: 30px; height: 30px; border-radius: 8px; font-size: 17px; line-height: 1; }
.btn-ghost:hover { border-color: var(--line-2); color: var(--text); }
.btn-round {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg);
  display: grid; place-items: center; box-shadow: 0 6px 20px -6px rgba(255,241,210,.35); transition: transform .12s;
}
.btn-round:hover { transform: scale(1.05); }
.btn-round svg { width: 20px; height: 20px; fill: currentColor; }
.btn-round .i-pause { display: none; }
.btn-round.playing .i-play { display: none; }
.btn-round.playing .i-pause { display: block; }
.btn-round.loading { background: var(--panel-3); color: var(--muted); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

select, input[type=text], input:not([type]), textarea {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; outline: none;
}
select:focus, input:focus, textarea:focus { border-color: #57493f; }
select:disabled { opacity: .45; }
select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }

/* ---------------------------------------------------------------- palco */
.stage { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.drop {
  position: absolute; inset: 22px; border-radius: 22px; border: 1.5px dashed var(--line-2);
  display: grid; place-items: center; text-align: center; transition: border-color .2s, background .2s;
  background: radial-gradient(600px 400px at 50% 40%, rgba(227,36,29,.07), transparent 70%);
}
.drop.over { border-color: var(--red); background: radial-gradient(600px 400px at 50% 40%, rgba(227,36,29,.16), transparent 70%); }
.drop-inner { max-width: 520px; padding: 20px; animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }
.drop-kicker { font: 500 11.5px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--red); margin: 0 0 18px; }
.drop-title { margin: 0 0 16px; font: 600 44px/1.02 var(--sans); letter-spacing: -.045em; }
.drop-title em { display: block; font: 700 46px/1.05 var(--sans); font-style: normal; letter-spacing: -.045em; color: var(--cream); }
.drop-sub { color: var(--muted); max-width: 420px; margin: 0 auto 26px; font-size: 13.5px; }
.drop { overflow: auto; }
.drop-inner { max-width: 720px; }
.drop .drop-title { font-size: 38px; }
.drop .drop-title em { font-size: 40px; }
.drop .drop-sub { margin-bottom: 20px; }
.drop-label { margin: 22px 0 10px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.drop-label small { text-transform: none; letter-spacing: 0; font: 400 11.5px var(--sans); color: var(--faint); }
.drop-presets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; text-align: left; }
.preset.small .preset-media { aspect-ratio: 340 / 300; }
.preset.small .preset-tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1180px) { .drop-presets { grid-template-columns: repeat(4, 1fr); } }
.adv-opts { margin-top: 16px; text-align: left; }
.adv-opts > summary { cursor: pointer; color: var(--muted); font-size: 12px; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.adv-opts > summary::before { content: "›"; display: inline-block; transition: transform .15s; }
.adv-opts[open] > summary::before { transform: rotate(90deg); }
.adv-opts > summary:hover { color: var(--text-2); }
.adv-opts label { display: grid; gap: 6px; margin-top: 10px; max-width: 280px; font-size: 12px; color: var(--muted); }
.drop .adv-opts { display: flex; flex-direction: column; align-items: center; }
.drop .adv-opts label { text-align: left; width: 280px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.viewer { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 22px 12px; gap: 10px; }
.phone-wrap { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; }
.glow {
  position: absolute; width: 46%; aspect-ratio: 1; border-radius: 50%; filter: blur(80px); opacity: .55;
  background: radial-gradient(circle, rgba(227,36,29,.5), rgba(255,181,71,.15) 50%, transparent 70%);
  animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.12); opacity: .4; } }
.phone {
  position: relative; height: 100%; max-height: 100%; aspect-ratio: 9 / 16; border-radius: 26px; overflow: hidden;
  background: #000; box-shadow: 0 0 0 1px #2e2723, 0 0 0 7px #0a0807, 0 0 0 8px #2b2420, 0 40px 80px -30px #000;
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.phone { isolation: isolate; }   /* a mistura das camadas da legenda acontece só com o vídeo */
.phone video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.live, .live canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.live canvas[data-l="screen"], .live canvas[data-l="back_screen"] { mix-blend-mode: screen; }
.frame-loading { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--red), transparent); opacity: 0; transition: opacity .2s; }
.frame-loading.on { opacity: 1; animation: scan 1s linear infinite; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.busy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding: 24px; background: rgba(10,8,7,.82); backdrop-filter: blur(8px); }
.ring { position: relative; width: 108px; height: 108px; margin-bottom: 18px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring-bg { stroke: var(--line-2); }
.ring-fg { stroke: var(--green); stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset .4s; filter: drop-shadow(0 0 6px rgba(73,220,123,.6)); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font: 500 18px var(--mono); }
.busy-title { margin: 0; font: 600 20px/1.2 var(--sans); letter-spacing: -.02em; }
.busy-sub { margin: 6px 0 0; color: var(--muted); font: 400 11px/1.4 var(--mono); }

.transport { display: flex; align-items: center; gap: 14px; }
.tc { font: 500 13px/1 var(--mono); color: var(--text-2); letter-spacing: .03em; }
.tc-sep { color: var(--faint); margin: 0 6px; }
.pv-box { display: flex; align-items: center; gap: 10px; min-width: 0; }
.preview-state { font: 400 11px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.preview-state.stale { color: var(--amber); }
.preview-state.busy { color: var(--green); }

/* palavras clicáveis sobre o quadro parado */
.hits { position: absolute; inset: 0; }
.hits[hidden] { display: none; }
.hit { position: absolute; border-radius: 6px; cursor: pointer; transition: box-shadow .12s, background .12s; }
.hit:hover { box-shadow: 0 0 0 1.5px rgba(255,241,210,.75); background: rgba(255,241,210,.06); }
.hits.dragging .hit { box-shadow: 0 0 0 1.5px var(--amber); background: rgba(255,181,71,.12); cursor: grabbing; }
.drag-tip { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 6px 10px; border-radius: 8px;
  background: rgba(13,11,10,.85); border: 1px solid var(--line-2); font: 500 11px/1 var(--mono); color: var(--amber); pointer-events: none; z-index: 4; }
.drag-tip[hidden] { display: none; }
.phone-tip {
  position: absolute; left: 10px; right: 10px; top: 10px; z-index: 3; padding: 9px 30px 9px 12px; border-radius: 11px;
  background: rgba(13,11,10,.86); border: 1px solid rgba(255,181,71,.45); color: var(--text-2); font-size: 12px; line-height: 1.4;
  backdrop-filter: blur(6px); animation: fade .3s ease both;
}
.phone-tip b { color: var(--amber); font-weight: 600; }
.phone-tip button { position: absolute; top: 5px; right: 6px; background: none; border: 0; color: var(--muted); font-size: 17px; line-height: 1; padding: 2px 5px; }
.phone-tip button:hover { color: var(--text); }
.hit.sel { box-shadow: 0 0 0 2px var(--amber), 0 0 18px rgba(255,181,71,.35); background: rgba(255,181,71,.10); }

.wordpop {
  position: absolute; z-index: 5; width: 264px; padding: 12px; max-height: calc(100% - 16px); overflow: auto; border-radius: 14px;
  background: rgba(22,18,16,.97); border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px -18px #000, 0 0 0 1px rgba(0,0,0,.4); display: grid; gap: 7px;
  animation: fade .15s ease both;
}
.wordpop[hidden] { display: none; }
.wp-head { display: flex; justify-content: space-between; align-items: center; font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.wp-x { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; }
.wp-x:hover { color: var(--text); }
.wp-label { font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-top: 3px; }
#wpText { width: 100%; font: 500 14px var(--sans); color: var(--text); }
.wp-marks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.wp-marks button {
  display: grid; justify-items: center; gap: 2px; padding: 6px 2px 5px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 9px; font-size: 10.5px; line-height: 1.15; color: var(--muted); transition: border-color .15s, color .15s, background .15s;
}
.wp-marks button:hover { color: var(--text); border-color: var(--line-2); background: var(--panel-2); }
.wp-marks button.on { border-color: var(--amber); color: var(--text); background: rgba(255,181,71,.12); }
.wp-marks b, .wp-marks em { font-size: 14px; line-height: 1.2; color: var(--text); }
.wp-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: var(--c); padding: 0; position: relative; cursor: pointer; }
.sw:hover { transform: scale(1.1); }
.sw.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--amber); }
.sw-none { background: linear-gradient(135deg, transparent 45%, var(--red) 45% 55%, transparent 55%), var(--panel-3); }
.sw-pick { background: conic-gradient(#f33, #fd0, #4d7, #3af, #b6f, #f33); overflow: hidden; }
.sw-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.wp-marks button[hidden] { display: none; }
.fx-ico { height: 17px; max-width: 52px; object-fit: contain; border-radius: 3px; }
.wp-note { margin: 0; font-size: 11px; line-height: 1.35; color: var(--text-2); }
.wp-note b { color: var(--amber); font-weight: 600; }
.wp-label small, .wp-label span { text-transform: none; letter-spacing: 0; font: 400 11px var(--sans); color: var(--muted); margin-left: 4px; }
.wp-hint { margin: 2px 0 0; font: 400 11px/1.4 var(--sans); color: var(--muted); }
.mk-break { font-size: 14px; }
.wp-marks button.wide { grid-column: span 2; grid-template-columns: auto auto; justify-content: center; align-items: center; gap: 6px; }
.mk-behind svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; vertical-align: -3px; }
.wp-behind { display: grid; gap: 6px; padding: 9px 10px; border-radius: 10px; border: 1px solid rgba(184,108,255,.45); background: rgba(184,108,255,.07); }
.wp-behind .wp-label { margin: 0; color: #cfa6ff; }
.wp-behind .ctl-top output { font: 400 11px var(--mono); color: var(--muted); }
.matte-state { font: 400 11px/1 var(--mono); color: #cfa6ff; white-space: nowrap; }

.tl-foot { display: flex; align-items: center; gap: 16px; min-height: 20px; margin-top: -2px; }
.tl-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: auto; flex-shrink: 0; cursor: help; }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend b { width: 12px; height: 8px; border-radius: 2px; }
.step-btns { margin-left: auto; display: flex; gap: 6px; }

.timeline { position: relative; height: 54px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.tl-track { position: absolute; inset: 10px 0 8px; }
.tl-scene { position: absolute; top: 0; bottom: 0; border-radius: 5px; opacity: .8; transition: opacity .15s, transform .15s; overflow: hidden; }
.tl-scene span { position: absolute; inset: 0; padding: 0 5px; display: flex; align-items: center; font: 500 10.5px/1 var(--sans); color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.35); pointer-events: none; }
.tl-scene.chunk span, .tl-scene.plain span, .tl-scene.card span { color: #1a1411; text-shadow: none; }
.tl-scene::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.tl-scene.chunk, .tl-scene.plain { background: var(--m-chunk); opacity: .62; }
.tl-scene.stack, .tl-scene.hero, .tl-scene.block, .tl-scene.fill { background: var(--m-stack); }
.tl-scene.stack.plain { background: #8c2b25; }
.tl-scene.solo { background: var(--m-solo); }
.tl-scene.solo span { color: #0d2416; text-shadow: none; }
.tl-scene.card { background: var(--m-card); }
.tl-scene.now { opacity: 1; box-shadow: 0 0 0 1.5px var(--text); }
.tl-scene.picked { opacity: 1; box-shadow: 0 0 0 2px var(--amber), 0 0 12px rgba(255,181,71,.5); }
.tl-scene.behind::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(184,108,255,.55) 0 4px, transparent 4px 9px); }
.tl-scene.behind.pending::before { animation: pend 1s linear infinite; background-size: 200% 100%; }
@keyframes pend { 50% { opacity: .35; } }
.m-behind { background: repeating-linear-gradient(135deg, #b86cff 0 3px, transparent 3px 6px); }
.tl-flashes { position: absolute; inset: 0; pointer-events: none; }
.tl-flash { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--cream); box-shadow: 0 0 8px var(--cream); opacity: .8; }
.tl-emph { position: absolute; top: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 6px rgba(255,181,71,.7); }
.tl-head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); pointer-events: none; box-shadow: 0 0 10px rgba(255,255,255,.4); }
.tl-head span { position: absolute; top: -1px; left: -5px; width: 12px; height: 8px; background: var(--text); clip-path: polygon(0 0, 100% 0, 50% 100%); }
#scrub { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.scene-now { flex: 1; min-width: 0; min-height: 20px; font: 400 12px/1.5 var(--sans); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-now b { color: var(--text-2); font-weight: 500; text-transform: uppercase; letter-spacing: .1em; margin-right: 8px; }

/* ---------------------------------------------------------------- inspetor */
.inspector { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: rgba(18,15,13,.75); }
.inspector.disabled .pane, .inspector.disabled .tabs { opacity: .35; pointer-events: none; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: 0; padding: 16px 8px 14px; color: var(--muted); font-weight: 500; font-size: 13px;
  display: flex; align-items: baseline; justify-content: center; gap: 7px; position: relative;
}
.tab-dot { position: absolute; top: 13px; margin-left: 58px; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 2px; background: var(--red); border-radius: 2px; }
.pane { display: none; flex: 1; min-height: 0; overflow: auto; padding: 18px 18px 28px; }
.pane.active { display: flex; flex-direction: column; gap: 12px; animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.pane-head { display: flex; align-items: baseline; justify-content: space-between; }
.pane-head h2 { margin: 0; font: 600 20px/1 var(--sans); letter-spacing: -.03em; }
.hint { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.save-state { font: 400 11px/1 var(--mono); color: var(--faint); }
.save-state.dirty { color: var(--amber); }
.save-state.ok { color: var(--green); }

.mk-serif { font: 700 16px/1.1 var(--sans) !important; }
.mk-hero { color: #f4fc14 !important; font-weight: 800; text-shadow: 0 0 8px rgba(244,252,20,.7); }
.mk-red { color: var(--red) !important; font: 700 15px/1.2 var(--sans); }
.mk-circle { padding: 0 6px; border: 1.5px solid var(--green); border-radius: 50%; font-size: 12px !important; }
.mk-under { text-decoration: underline wavy var(--text); text-underline-offset: 4px; }
.mk-box { background: var(--red); padding: 0 5px; }
.mk-solo { font-size: 18px !important; font-weight: 700; }
.mk-card { color: var(--m-card) !important; font: 700 17px var(--sans); }

.rich {
  flex: 1; min-height: 260px; overflow: auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2);
  font: 400 14px/2.05 var(--sans); color: var(--text-2); user-select: text; cursor: text;
}
.rich .w { cursor: pointer; border-radius: 4px; padding: 1px 1px; transition: background .12s, box-shadow .12s; }
.rich .w:hover { background: rgba(255,241,210,.08); box-shadow: 0 0 0 1px rgba(255,241,210,.25); }
.rich .w.now { color: var(--text); background: rgba(255,255,255,.07); }
.rich .w.sel { background: rgba(255,181,71,.18); box-shadow: 0 0 0 1.5px var(--amber); color: var(--text); }
.rich .f-auto { color: var(--text); font-weight: 600; text-decoration: underline 2px rgba(255,181,71,.55); text-underline-offset: 5px; }
.rich .f-emph { color: var(--text); font-weight: 700; text-decoration: underline 2px var(--amber); text-underline-offset: 5px; }
.rich .f-noemph { color: var(--muted); }
.rich .f-red { color: #ff4a43; font-weight: 600; }
.rich .f-circle { box-shadow: 0 0 0 1.5px var(--green); border-radius: 50%; padding: 1px 6px; }
.rich .f-underline { text-decoration: underline wavy 1.5px var(--text-2); text-underline-offset: 5px; }
.rich .f-box { background: var(--red); color: #fff; padding: 1px 5px; }
.rich .f-solo { font-size: 16px; font-weight: 700; color: var(--text); }
.rich .f-color { color: var(--wc); }
.rich .f-color.f-dark { background: rgba(255,255,255,.75); }
.rich .rt-break { display: inline-block; margin: 0 3px; padding: 0 5px; border-radius: 5px; background: var(--panel-3); color: var(--muted); font-size: 11px; line-height: 1.6; vertical-align: 1px; }
.rich .rt-q { color: var(--m-card); font-weight: 700; margin: 0 1px; }
.rich .rt-behind { display: inline-block; margin: 0 4px; padding: 0 6px; border-radius: 5px; background: rgba(184,108,255,.16); color: #cfa6ff; font-size: 11px; line-height: 1.6; vertical-align: 1px; }
.rich .f-behind { text-decoration: underline dotted 1.5px #b86cff; text-underline-offset: 5px; }
.text-tools { display: flex; align-items: center; gap: 12px; }
.rich-legend { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.rich-legend[hidden] { display: none; }
.rl-auto { width: 16px; height: 2px; background: rgba(255,181,71,.7); border-radius: 2px; }
textarea#text {
  flex: 1; min-height: 260px; resize: none; padding: 14px; line-height: 1.75; font: 400 13.5px/1.75 var(--sans);
  color: var(--text); background: var(--bg-2); border-radius: 12px;
}
.syntax { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.syntax summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.syntax table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12px; }
.syntax td { padding: 3px 0; color: var(--text-2); }
.syntax code { font: 400 11.5px var(--mono); color: var(--cream); }
.retrans-box { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
.retrans-box .hint { margin: 8px 0; font-size: 12px; }
.retrans { display: flex; gap: 8px; }
.retrans select { flex: 1; min-width: 0; }
.retrans .btn { flex-shrink: 0; }

/* presets */
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset {
  position: relative; border-radius: 13px; overflow: hidden; border: 1px solid var(--line); background: var(--panel);
  text-align: left; padding: 0; transition: border-color .15s, transform .15s;
}
.preset:hover { transform: translateY(-2px); border-color: var(--line-2); }
.preset.active { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 10px 30px -14px rgba(227,36,29,.8); }
.preset-media { position: relative; display: block; aspect-ratio: 340 / 380; background: #181412; }
.preset-media img, .preset-media video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.preset-media video { opacity: 0; transition: opacity .2s; }
.preset-media video.on { opacity: 1; }
.preset-name { display: block; padding: 6px 8px 0; font: 600 12px/1.1 var(--sans); letter-spacing: -.01em; }
.preset-tag { display: block; padding: 2px 8px 7px; font-size: 10.5px; line-height: 1.25; color: var(--muted); }
.preset.small .preset-name { font-size: 11px; padding: 5px 6px 0; }
.preset.small .preset-tag { font-size: 10px; padding: 1px 6px 6px; }
.preset.small:hover { transform: translateY(-1px); }
.preset-del { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: var(--text-2); font-size: 13px; line-height: 1; opacity: 0; }
.preset:hover .preset-del { opacity: 1; }
.preset-desc { font-size: 12px; color: var(--muted); margin: -2px 0 0; line-height: 1.45; }
.preset-desc b { display: block; color: var(--text-2); font-weight: 600; margin-bottom: 2px; }
.adv-toggle { align-self: flex-start; font: 500 12px var(--sans); letter-spacing: 0; }

.controls { display: flex; flex-direction: column; gap: 4px; }
.group { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.group > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; font-weight: 500; font-size: 12.5px; }
.group > summary::after { content: "+"; color: var(--muted); font: 400 15px var(--mono); }
.group[open] > summary::after { content: "–"; }
.group-body { padding: 2px 13px 13px; display: grid; gap: 12px; }
.ctl { display: grid; gap: 6px; }
.ctl-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); }
.ctl-top output { font: 400 11px var(--mono); color: var(--muted); }
.ctl.changed .ctl-top span::after { content: " •"; color: var(--amber); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--red) var(--p, 50%), var(--line-2) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); margin-top: -5.5px; box-shadow: 0 0 0 3px var(--panel); }
.ctl-color { display: flex; align-items: center; gap: 10px; }
.ctl-color input[type=color] { width: 34px; height: 26px; border: 1px solid var(--line-2); border-radius: 7px; padding: 0; background: none; }
.ctl-color input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; }
.ctl-color input[type=color]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.ctl-color code { font: 400 11px var(--mono); color: var(--muted); }
.switch { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-2); cursor: pointer; }
.switch input { appearance: none; width: 32px; height: 18px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .15s; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform .15s; }
.switch input:checked { background: var(--red); }
.switch input:checked::after { transform: translateX(14px); background: #fff; }
.ctl select { width: 100%; }

.save-preset { padding: 11px 13px; border-radius: 12px; border: 1px dashed var(--line-2); margin-top: 4px; }
.save-preset > summary { cursor: pointer; font-weight: 500; font-size: 12.5px; color: var(--text-2); list-style: none; }
.save-preset > summary::after { content: " +"; color: var(--muted); }
.save-preset[open] { display: grid; gap: 8px; }
.save-preset[open] > summary { margin-bottom: 2px; }
.save-preset[open] > summary::after { content: " –"; }

/* exportar */
.formats { display: grid; gap: 8px; }
.fmt { display: block; cursor: pointer; }
.fmt input { position: absolute; opacity: 0; }
.fmt-body { display: grid; gap: 3px; padding: 13px 14px 13px 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); position: relative; transition: border-color .15s; }
.fmt-body::before { content: ""; position: absolute; left: 14px; top: 16px; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.fmt input:checked + .fmt-body { border-color: var(--red); }
.fmt input:checked + .fmt-body::before { border-color: var(--red); background: radial-gradient(circle, var(--red) 45%, transparent 50%); }
.fmt-body b { font-weight: 500; font-size: 13px; }
.fmt-body small { color: var(--muted); font-size: 11.5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row label { display: grid; gap: 6px; font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.field-row select { text-transform: none; letter-spacing: 0; font: 400 12.5px var(--sans); color: var(--text-2); }
.export-progress { display: grid; gap: 8px; }
.bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red-deep), var(--red), var(--amber)); transition: width .3s; }
.exp-meta { display: flex; justify-content: space-between; font: 400 11px var(--mono); color: var(--muted); }
.exports { display: grid; gap: 10px; margin-top: 6px; }
.export-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel); display: grid; gap: 10px; animation: rise .4s ease both; }
.export-item video { width: 100%; max-height: 320px; border-radius: 9px; background: #000; }
.export-item.fresh { border-color: var(--red); }
.export-item .row { display: flex; gap: 8px; align-items: center; }
.export-item b { font-weight: 500; }
.export-item a { text-decoration: none; }
.exp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.exp-sub { color: var(--muted); font-size: 11.5px; margin-top: -6px; }
.exp-stale { font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--amber); border: 1px solid rgba(255,181,71,.45); border-radius: 99px; padding: 4px 8px; cursor: help; }
.exp-stale[hidden] { display: none; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px;
  background: var(--panel-3); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 11px; font-size: 12.5px;
  transition: opacity .2s, transform .2s; z-index: 50; box-shadow: 0 20px 40px -20px #000;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-act { background: none; border: 0; padding: 2px 0; color: var(--amber); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.toast-act[hidden] { display: none; }

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(5,4,3,.62); backdrop-filter: blur(4px); animation: fade .15s ease both; }
.modal[hidden] { display: none; }
.modal-card { width: min(420px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 20px 22px 18px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 30px 80px -20px #000; }
.modal.wide .modal-card { width: min(760px, 100%); }
.modal-card h3 { margin: 0 0 8px; font: 600 17px/1.3 var(--sans); letter-spacing: -.02em; }
.modal-body { color: var(--text-2); font-size: 13px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.help-grid h4 { margin: 4px 0 8px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.help-grid ol { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.help-grid table { border-collapse: collapse; width: 100%; }
.help-grid td { padding: 4px 0; vertical-align: top; }
.help-grid td:first-child { white-space: nowrap; padding-right: 12px; }
kbd { display: inline-block; min-width: 20px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px;
  background: var(--panel-2); font: 500 11px/1.3 var(--mono); color: var(--text); text-align: center; }
.toast.err { border-color: var(--red); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1440px) {
  .studio { grid-template-columns: 220px minmax(0, 1fr) 370px; }
  .brand-tag { display: none; }
}
@media (max-width: 1180px) {
  .studio { grid-template-columns: 190px minmax(0, 1fr) 330px; }
  .tl-legend { display: none; }
  .help-grid { grid-template-columns: 1fr; }
}
@media (max-height: 720px) {
  .topbar { height: 50px; }
  .studio { height: calc(100vh - 50px); }
  .wp-hint { display: none; }
  .tabs .tab { padding: 12px 8px 10px; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .studio { height: auto; grid-template-columns: 1fr; }
  .rail, .inspector { border: 0; border-top: 1px solid var(--line); }
  .stage { min-height: 80vh; }
  .project-title { display: none; }
}

/* ---- site: motor do PC não encontrado */
.gate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(5,4,3,.82); backdrop-filter: blur(6px); }
.gate[hidden] { display: none; }
.gate-card { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px 26px 22px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.gate-card h2 { margin: 6px 0 10px; font: 600 22px/1.25 var(--sans); letter-spacing: -.02em; }
.gate-card p { margin: 0 0 12px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.gate-steps { margin: 0 0 18px; padding-left: 20px; color: var(--text-2); font-size: 13px; line-height: 1.6; }
.gate-steps li { margin-bottom: 6px; }
.gate-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.gate-actions .btn { text-decoration: none; }
.gate-wait { margin: 14px 0 0 !important; font: 400 11.5px/1.4 var(--mono); color: var(--faint) !important; }
.gate-wait::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--amber, #ffb547); animation: gatepulse 1.2s ease-in-out infinite; vertical-align: 1px; }
@keyframes gatepulse { 50% { opacity: .25; } }
.gate-actions [hidden] { display: none; }
