@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);
  --rail-w: 260px; --insp-w: 400px;
  display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--insp-w);
  transition: grid-template-columns .2s ease;
}
.studio.rail-collapsed { --rail-w: 52px; }

/* ---------------------------------------------------------------- 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));
}
.clone-cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin: 14px 12px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); text-align: left; }
.clone-cta[hidden] { display: none; }
.clone-cta:hover { border-color: var(--amber); background: var(--panel-3); }
.clone-cta svg { width: 20px; height: 20px; flex-shrink: 0; fill: var(--amber); }
.clone-cta b { display: block; font: 600 12.5px/1.3 var(--sans); }
.clone-cta small { display: block; margin-top: 2px; font: 400 11px/1.35 var(--sans); color: var(--muted); }
.rail-head { display: flex; align-items: center; gap: 8px; padding: 18px 12px 12px 16px; }
.rail-head .eyebrow { margin-right: auto; white-space: nowrap; }
.rail-lbl { font-weight: inherit; }
#btnNew { white-space: nowrap; }
.rail-toggle { display: grid; place-items: center; flex-shrink: 0; }
.rail-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
/* recolhido: faixa estreita só com expandir e o "+" de novo vídeo */
.rail-collapsed .rail { overflow: hidden; }
.rail-collapsed .rail-head { flex-direction: column-reverse; padding: 14px 0 10px; gap: 10px; }
.rail-collapsed .rail-head .eyebrow, .rail-collapsed .rail-lbl, .rail-collapsed .rail-search, .rail-collapsed .project-list { display: none !important; }
.rail-collapsed #btnNew { width: 32px; height: 32px; padding: 0; border-radius: 9px; }
.rail-collapsed #btnNew span { font-size: 18px; margin: -2px 0 0; }
.rail-collapsed .rail-toggle svg { transform: rotate(180deg); }
.rail-collapsed .clone-cta { width: 32px; height: 32px; margin: 12px auto 0; padding: 0; justify-content: center; border-radius: 9px; }
.rail-collapsed .clone-cta svg { width: 17px; height: 17px; }
.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); }
.proj.broken { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.proj.broken .proj-meta { color: var(--amber); white-space: normal; }
.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[type=email], input[type=password], 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.stuck .btn { margin-top: 14px; }
.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; }
.mk-join svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; vertical-align: -3px; }
.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: 96px; flex-shrink: 0; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  overflow-x: hidden; overflow-y: hidden; }
.timeline.zoomed { overflow-x: auto; }
.timeline::-webkit-scrollbar { height: 7px; }
.timeline::-webkit-scrollbar-thumb { border-width: 1px; }
.tl-inner { position: relative; width: 100%; height: 88px; min-width: 100%; cursor: ew-resize; touch-action: none; user-select: none; }
.tl-ruler { position: absolute; left: 0; right: 0; top: 0; height: 15px; border-bottom: 1px solid var(--line); pointer-events: none; }
.tl-ruler i { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line-2); padding-left: 3px; font: 400 9.5px/14px var(--mono); font-style: normal; color: var(--faint); white-space: nowrap; }
.tl-track { position: absolute; left: 0; right: 0; top: 19px; height: 26px; }
.tl-clips { position: absolute; left: 0; right: 0; top: 49px; height: 36px; }
.tl-clip { position: absolute; top: 0; bottom: 0; margin-left: 1px; border-radius: 6px; overflow: hidden; cursor: pointer;
  background: #2c3a46; box-shadow: inset 0 0 0 1px rgba(120,170,210,.35); transition: box-shadow .12s, filter .12s; }
.tl-clip canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .78; pointer-events: none; }
.tl-clip span { position: absolute; left: 5px; bottom: 3px; padding: 1px 4px; border-radius: 4px; background: rgba(10,8,7,.7);
  font: 500 9.5px/1.2 var(--mono); color: var(--text-2); pointer-events: none; white-space: nowrap; }
.tl-clip:hover { filter: brightness(1.15); }
.tl-clip.sel { box-shadow: inset 0 0 0 2px var(--amber), 0 0 12px rgba(255,181,71,.45); }
.tl-clip.sel canvas { opacity: 1; }
.tl-join { position: absolute; top: 15px; height: 72px; width: 0; border-left: 2px dashed var(--red); margin-left: -1px; opacity: .8; }
.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; left: 0; right: 0; top: 15px; height: 32px; 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; height: 87px; width: 2px; z-index: 2; 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%); }
.tl-tools { display: flex; align-items: center; gap: 5px; flex-shrink: 0; margin-left: auto; }
.tl-tools + .step-btns { margin-left: 6px; }
.tl-tools .btn-ghost { display: grid; place-items: center; font: 500 17px/1 var(--sans); }
.tl-tools svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tl-sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 4px; }
.tl-zoom { min-width: 34px; text-align: center; font: 500 11px/1 var(--mono); color: var(--muted); }
.tl-fit { padding: 5px 9px; font-size: 11.5px; }
.pv-box { flex: 1; overflow: hidden; }
.exp-cuts { color: var(--amber); }
.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); }
/* junta com a anterior: um arco no espaço entre as duas */
.rich .f-join::before { content: "‿"; color: var(--amber); margin: 0 1px 0 -3px; }
.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-cut { color: var(--faint); text-decoration: line-through 1.5px var(--red); opacity: .6; }
.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-cell { position: relative; display: grid; min-width: 0; }
.preset-fav { position: absolute; top: 6px; left: 6px; z-index: 2; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.62); color: var(--text-2); opacity: 0; transition: opacity .12s, color .12s; }
.preset-fav svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.preset-cell:hover .preset-fav, .preset-fav:focus-visible, .preset-fav[aria-pressed=true] { opacity: 1; }
.preset-fav:hover, .preset-fav[aria-pressed=true] { color: var(--amber); }
.preset-fav[aria-pressed=true] svg { fill: currentColor; }
.preset-fav:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.preset-group { grid-column: 1 / -1; margin: 8px 0 0; font: 500 10px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.preset-group:first-child { margin-top: 0; }
@media (hover: none) { .preset-fav { width: 32px; height: 32px; 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 {
  /* em cima (abaixo da barra do topo): embaixo ele cobria a faixa de vídeo da linha do tempo */
  position: fixed; left: 50%; top: 70px; transform: translate(-50%, -14px); 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: 65; 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; }
.modal-body[hidden] { display: none; }
#cloneModal .modal-actions { position: sticky; bottom: -18px; margin: 18px -22px -18px; padding: 12px 22px; background: var(--panel); border-top: 1px solid var(--line); }
.clone-drop { display: grid; place-items: center; width: 100%; min-height: 120px; margin: 14px 0 10px; border-radius: 12px; border: 1px dashed var(--line-2); background: var(--panel-2); color: var(--text); font: 500 13.5px/1.4 var(--sans); }
.clone-drop:hover, .clone-drop.over { border-color: var(--amber); background: var(--panel-3); }
.clone-fine { margin: 8px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.clone-msg { margin: 6px 0 12px; color: var(--text); font-weight: 500; }
.clone-result { display: grid; grid-template-columns: minmax(0, 230px) minmax(0, 1fr); gap: 16px; align-items: start; }
.clone-result video { width: 100%; max-height: 52vh; border-radius: 10px; background: #000; }
.clone-side { min-width: 0; }
.clone-name { display: grid; gap: 6px; font-size: 12px; color: var(--text-2); }
.clone-name input { width: 100%; font-size: 14px; }
.clone-anims { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.clone-anims b { color: var(--text); font-weight: 600; }
.clone-anims[hidden] { display: none; }
.clone-notes { margin: 12px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.5; color: var(--text-2); }
.clone-notes[hidden] { display: none; }
.clone-notes li { margin-bottom: 4px; }
.clone-chat { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 14px; }
.clone-log { display: grid; gap: 6px; max-height: 190px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.clone-log[hidden] { display: none; }
.clone-say { max-width: 92%; margin: 0; padding: 7px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.clone-say.me { justify-self: end; background: var(--panel-3); }
.clone-say.ai { justify-self: start; color: var(--text-2); }
.clone-say.wait { color: var(--muted); }
.clone-ask { display: flex; gap: 8px; }
.clone-ask input { flex: 1; min-width: 0; font-size: 14px; }
.clone-undo { justify-self: start; padding: 4px 0; border: 0; background: none; color: var(--muted); font: 500 12px/1.4 var(--sans); text-decoration: underline; cursor: pointer; }
.clone-undo:hover { color: var(--text); }
.clone-undo[hidden] { display: none; }
.clone-label { margin: 16px 0 8px; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.clone-compare { display: block; width: 100%; border-radius: 10px; }
@media (max-width: 560px) {
  .clone-result { grid-template-columns: minmax(0, 1fr); }
  .clone-result video { max-height: 48vh; }
}
.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:not(.rail-collapsed) { --rail-w: 220px; }
  .studio { --insp-w: 370px; }
  .rail-head .eyebrow { display: none; }
  .rail-head { justify-content: space-between; }
  .brand-tag { display: none; }
}
@media (max-width: 1180px) {
  .studio:not(.rail-collapsed) { --rail-w: 190px; }
  .studio { --insp-w: 330px; }
  .tl-fit { display: none; }
  .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-collapsed .rail-head { flex-direction: row; justify-content: flex-start; padding: 8px 12px; }
  .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; }

/* ---- online: conta, entrar e administração */
.acct { position: relative; }
.acct[hidden], .acct-menu[hidden], .cred[hidden], .form-err[hidden] { display: none; }
.acct-btn { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px 0 3px; border-radius: 99px; border: 1px solid var(--line); background: none; color: var(--text-2); font: 500 12.5px/1 var(--sans); }
.acct-btn:hover, .acct-btn[aria-expanded=true] { border-color: var(--line-2); color: var(--text); }
.acct-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber, #ffb547); }
.avatar { flex-shrink: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--panel-3); color: var(--cream); font: 600 10.5px/1 var(--sans); letter-spacing: .02em; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 220px; padding: 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -18px #000; display: grid; }
.acct-who { margin: 0 0 4px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 3px; }
.acct-who b { font-weight: 500; font-size: 13px; }
.acct-who small { color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.acct-menu button { text-align: left; padding: 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font: 400 13px/1.2 var(--sans); }
.acct-menu button:hover, .acct-menu button:focus-visible { background: var(--panel-3); color: var(--text); outline: none; }
.acct-menu button[hidden] { display: none; }

.field { display: grid; gap: 6px; margin-bottom: 12px; font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.field small { text-transform: none; letter-spacing: 0; font: 400 11px var(--sans); color: var(--faint); }
.field input { width: 100%; padding: 11px 12px; font: 400 14px var(--sans); color: var(--text); text-transform: none; letter-spacing: 0; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--red); }
.check small { color: var(--faint); font-size: 11.5px; }
.form-err { margin: 0 0 12px !important; padding: 9px 12px; border-radius: 9px; background: rgba(227,36,29,.12); border: 1px solid rgba(227,36,29,.35); color: #ffb3ad !important; font-size: 12.5px !important; }

#admin, #wsPanel, #devicesPanel { z-index: 55; }   /* abaixo da janela de confirmação e do aviso */
#userModal { z-index: 58; }                         /* abre por cima de Contas e convites */
.admin-card { width: min(760px, 100%); }
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.admin-head h2 { margin-bottom: 0; }
.admin-new { display: grid; grid-template-columns: 1fr 1.3fr auto; align-items: end; gap: 0 10px; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 14px; }
.admin-new .check { grid-column: 1 / 3; }
.admin-new .btn { grid-row: 1; grid-column: 3; margin-bottom: 12px; height: 42px; }
.cred { margin-bottom: 14px; padding: 14px; border-radius: 12px; border: 1px solid #2f4a37; background: rgba(73,220,123,.07); }
.cred p { margin: 0 0 10px !important; font-size: 13px !important; }
.cred pre { margin: 0 0 12px; padding: 12px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); font: 400 12.5px/1.6 var(--mono); color: var(--cream); white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.cred .row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-users { display: grid; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.user-row.off { opacity: .6; }
.user-row .avatar { width: 34px; height: 34px; font-size: 12px; }
.user-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.user-main b { font-weight: 500; font-size: 13.5px; }
.user-main b small { color: var(--muted); font-weight: 400; }
.user-main > small { flex-basis: 100%; color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.tag { padding: 3px 7px; border-radius: 99px; border: 1px solid var(--line-2); font: 500 9.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.tag-off { color: var(--muted); }
.tag-warn { color: #ffb3ad; border-color: rgba(227,36,29,.45); }
.tag-ok { color: var(--green); border-color: #2f4a37; }
.user-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.user-acts:empty { display: none; }
.user-row.open { cursor: pointer; transition: border-color .12s, background .12s; }
.user-row.open:hover, .user-row.open:focus-visible { border-color: var(--line-2); background: var(--panel-3); outline: none; }
.user-chev { flex-shrink: 0; color: var(--faint); font-size: 18px; line-height: 1; }

/* ---- workspace e aparelhos */
.ws-chip { max-width: 190px; height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 99px; background: none; color: var(--text-2); font: 500 12px/1 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-chip:hover { border-color: var(--line-2); color: var(--text); }
.acct-ws { display: grid; margin: 0 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.acct-ws small { padding: 4px 10px 2px; color: var(--faint); font: 500 9.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.acct-menu .acct-ws button { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acct-ws button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-ws button[aria-current=true] { color: var(--text); }
.acct-ws button[aria-current=true]::after { content: "✓"; color: var(--amber); }
.ws-lead { margin-bottom: 14px; }
.ws-invite { grid-template-columns: 1fr 1.3fr .8fr auto; }
.ws-invite .btn { grid-column: 4; height: 45px; }
.ws-invite select { width: 100%; height: 45px; padding-left: 12px; font: 400 14px var(--sans); color: var(--text); text-transform: none; letter-spacing: 0; }
.ws-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ws-foot:empty { display: none; }
.device-ico { flex-shrink: 0; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--panel-3); color: var(--text-2); }
.device-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---- tudo de uma conta (administrador) */
.gate-card.user-card { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); width: min(1020px, 100%); height: min(780px, calc(100vh - 32px)); padding: 0; overflow: hidden; }
.um-head { display: flex; align-items: center; gap: 14px; padding: 20px 22px 14px; }
.um-avatar { width: 46px; height: 46px; font-size: 15px; }
.um-id { flex: 1; min-width: 0; }
.um-id h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.um-id p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 3px 0 0; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.um-facts { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0; padding: 0 22px 14px; }
.um-facts div { display: grid; gap: 2px; }
.um-facts dt { color: var(--faint); font: 500 9.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.um-facts dd { margin: 0; color: var(--text); font: 500 13px/1.3 var(--sans); }
.um-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.um-tab { position: relative; flex-shrink: 0; padding: 11px 10px; border: 0; background: none; color: var(--muted); font: 500 12.5px/1 var(--sans); }
.um-tab b { margin-left: 3px; color: var(--faint); font: 500 11px/1 var(--mono); }
.um-tab:hover { color: var(--text-2); }
.um-tab[aria-selected=true] { color: var(--text); }
.um-tab[aria-selected=true]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--red); }
.um-tab:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.um-body { min-height: 0; padding: 16px 22px 22px; overflow-y: auto; }
.um-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.um-item { display: grid; gap: 7px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; text-align: left; }
.um-media { position: relative; aspect-ratio: 9 / 13; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-3); overflow: hidden; }
.um-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.um-media i { position: absolute; right: 6px; bottom: 6px; padding: 3px 5px; border-radius: 5px; background: rgba(10,8,7,.75); color: var(--text); font: 500 10.5px/1 var(--mono); font-style: normal; }
.um-item:hover .um-media { border-color: var(--muted); }
.um-item:focus-visible { outline: none; }
.um-item:focus-visible .um-media { outline: 2px solid var(--amber); outline-offset: 2px; }
.um-item b { font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-item small { color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.um-item > span:last-child { display: grid; gap: 1px; min-width: 0; }
.um-empty { margin: 26px 0; color: var(--muted); text-align: center; }
.um-section + .um-section { margin-top: 20px; }
.um-section h3 { margin: 0 0 8px; color: var(--faint); font: 500 10px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.um-rows { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: 7px 18px; margin: 0; font-size: 13px; }
.um-rows dt { color: var(--muted); }
.um-rows dd { margin: 0; overflow-wrap: anywhere; }
.um-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.um-player video { display: block; width: 100%; max-height: 62vh; border-radius: 10px; background: #000; }
.um-player .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.um-player a { text-decoration: none; }

@media (max-width: 640px) {
  .ws-chip { display: none; }
  .ws-invite { grid-template-columns: 1fr; }
  .ws-invite .btn { grid-column: auto; }
  .ws-invite select { font-size: 16px; }
  .gate-card.user-card { height: calc(100vh - 32px); }
  .um-head { padding: 16px 16px 10px; }
  .um-facts { padding: 0 16px 12px; gap: 6px 18px; }
  .um-tabs { padding: 0 8px; }
  .um-body { padding: 14px 16px 18px; }
  .um-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .um-rows { grid-template-columns: 1fr; gap: 1px; }
  .um-rows dd { margin-bottom: 8px; }
}

@media (max-width: 640px) {
  .acct-name { display: none; }
  .acct-btn { padding: 0 3px; }
  .admin-new { grid-template-columns: 1fr; }
  .admin-new .check { grid-column: auto; margin-bottom: 12px; }
  .admin-new .btn { grid-row: auto; grid-column: auto; margin-bottom: 0; }
  .user-row { flex-wrap: wrap; }
  .user-acts { flex-basis: 100%; justify-content: flex-start; }
  .user-acts .btn { flex: 1; min-height: 40px; }
  .gate-card { padding: 22px 18px 18px; }
  .transport { flex-wrap: wrap; gap: 10px; }   /* no celular as ferramentas da linha do tempo descem de linha */
  .tl-tools { margin-left: 0; }
  .history { margin-right: 0; }
}

/* ---- atualização do motor */
button.chip { cursor: pointer; font: inherit; }
.upd-badge { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 999px;
  border: 1px solid #5a4421; background: rgba(255,181,71,.10); color: var(--amber, #ffb547); font: 500 12px/1 var(--sans);
  cursor: pointer; white-space: nowrap; }
.upd-badge[hidden] { display: none; }
.upd-badge:hover { background: rgba(255,181,71,.18); }
.upd-badge.busy { cursor: default; }
.hw-list { margin: 0 0 14px; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.7; color: var(--text-2); }
.hw-list b { color: var(--text); font-weight: 500; }
.upd-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; font-size: 13px; }
.upd-row input { accent-color: var(--red); width: 16px; height: 16px; }
.upd-note { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* vários estilos no mesmo vídeo: blocos do texto ({estilo:id}) */
.mk-sec { font-size: 15px; }
.secbar:empty { display: none; }
.sec-tip { margin: 0; font-size: 11.5px; color: var(--faint); line-height: 1.45; }
.sec-tip b { color: var(--muted); font-weight: 500; }
.sec-label { font: 500 11px/1.3 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.sec-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sec-chip { display: grid; gap: 1px; text-align: left; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text-2); font: 400 11.5px/1.25 var(--sans); cursor: pointer; transition: border-color .12s, background .12s; }
.sec-chip b { font-weight: 600; color: var(--text); font-size: 12px; }
.sec-chip small { color: var(--faint); font: 400 10.5px/1.2 var(--mono); }
.sec-chip:hover { border-color: var(--muted); }
.sec-chip.on { border-color: var(--amber); background: rgba(255,181,71,.1); box-shadow: 0 0 0 1px var(--amber) inset; }
.rich .rt-sec { display: flex; align-items: center; gap: 6px; width: fit-content; margin: 10px 0 4px; padding: 2px 4px 2px 9px; border-radius: 6px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted); font-size: 11px; line-height: 1.7; cursor: pointer; }
.rich .rt-sec:first-child { margin-top: 0; }
.rich .rt-sec b { color: var(--text-2); font-weight: 600; }
.rich .rt-sec:hover { border-color: var(--muted); }
.rich .rt-sec.on { border-color: var(--amber); color: var(--text-2); }
.rich .rt-sec-x { font-style: normal; padding: 0 6px; border-radius: 4px; color: var(--faint); font-size: 13px; }
.rich .rt-sec-x:hover { background: rgba(227,36,29,.18); color: var(--text); }
.rich .rt-sec:not(:has(.rt-sec-x)) { padding-right: 9px; }
.tl-sec { position: absolute; top: 15px; height: 72px; width: 0; border-left: 2px solid var(--amber); margin-left: -1px; opacity: .9;
  font: 600 10px/1 var(--mono); color: #1a1411; }
.tl-sec i { position: absolute; top: -1px; left: 0; padding: 1px 4px; border-radius: 0 4px 4px 0; background: var(--amber); font-style: normal; }

/* copiar / colar formatação */
.wp-anim { margin-top: 8px; }
.wp-anim[hidden] { display: none; }
.wp-anim-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wp-anim-list .btn { font-size: 11.5px; padding-left: 8px; padding-right: 8px; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-anim-list .btn.on { border-color: var(--amber); color: var(--text); background: rgba(255,181,71,.12); }
.wp-fmt { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.wp-fmt .btn { font-size: 11.5px; padding-left: 6px; padding-right: 6px; }
