/* Slicfly — "ilhas" brancas flutuando sobre um fundo azul-acinzentado claro.
   Barra fina no topo, trilho de ícones à esquerda, painel, palco, propriedades, linha do tempo em baixo. */
:root {
  --bg: #EEF2F8;            /* fundo do app, cinza puxado para o azul */
  --island: #FFFFFF;
  --ink: #0F1B2D;
  --muted: #64748B;
  --line: #E3E9F2;
  --soft: #F5F8FC;
  --blue: #2F6BFF;
  --blue-ink: #1F4FD1;
  --blue-soft: #EAF0FF;
  --green: #12B76A;
  --green-ink: #0B8A4F;
  --stage: #E6ECF5;
  --shadow: 0 1px 2px rgba(15,27,45,.04), 0 8px 24px rgba(15,27,45,.06);
  --r: 16px;
  --ui: "Figtree", system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  color-scheme: light;
}
@font-face { font-family: "Figtree"; font-weight: 400; src: url(fonts/figtree-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Figtree"; font-weight: 600; src: url(fonts/figtree-latin-600-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Figtree"; font-weight: 800; src: url(fonts/figtree-latin-800-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Montserrat"; font-weight: 500; src: url(fonts/montserrat-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 900; src: url(fonts/montserrat-latin-900-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 900; src: url(fonts/montserrat-latin-ext-900-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Poppins"; font-weight: 800; src: url(fonts/Poppins-ExtraBold.ttf) format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 600; src: url(fonts/Poppins-SemiBold.ttf) format("truetype"); }
@font-face { font-family: "Anton"; src: url(fonts/Anton-Regular.ttf) format("truetype"); }
@font-face { font-family: "Bebas Neue"; src: url(fonts/BebasNeue-Regular.ttf) format("truetype"); }
@font-face { font-family: "Bangers"; src: url(fonts/Bangers-Regular.ttf) format("truetype"); }
@font-face { font-family: "Luckiest Guy"; src: url(fonts/LuckiestGuy-Regular.ttf) format("truetype"); }
@font-face { font-family: "Playfair Display"; font-weight: 500; font-style: italic; src: url(fonts/playfair-display-latin-500-italic.woff2) format("woff2"); }
@font-face { font-family: "Playfair Display"; font-weight: 700; font-style: italic; src: url(fonts/playfair-display-latin-700-italic.woff2) format("woff2"); }
@font-face { font-family: "Playfair Display"; font-weight: 700; src: url(fonts/playfair-display-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Serif"; src: url(fonts/instrument-serif-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; src: url(fonts/instrument-serif-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Pacifico"; src: url(fonts/pacifico-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Monoton"; src: url(fonts/monoton-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "VT323"; src: url(fonts/vt323-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Mono"; font-weight: 400; src: url(fonts/space-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Mono"; font-weight: 700; src: url(fonts/space-mono-latin-700-normal.woff2) format("woff2"); }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h3 { margin: 20px 0 10px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h3:first-child { margin-top: 4px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.big { width: 26px; height: 26px; }

/* ---------- layout em ilhas ---------- */
.app {
  height: 100%; display: grid; gap: 12px; padding: 0 12px 12px;
  grid-template-columns: 72px 300px minmax(0, 1fr) 300px;
  grid-template-rows: 64px minmax(0, 1fr) 286px;
  grid-template-areas: "top top top top" "rail side stage insp" "tl tl tl tl";
}
.island { background: var(--island); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid rgba(15,27,45,.04); }
.top { grid-area: top; display: flex; align-items: center; gap: 12px; padding: 0 4px; flex-wrap: wrap; }
.rail { grid-area: rail; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.side { grid-area: side; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.stage { grid-area: stage; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 0; min-width: 0;
  border-radius: var(--r); background-color: var(--stage);
  background-image: radial-gradient(rgba(15,27,45,.09) 1px, transparent 1px); background-size: 18px 18px; padding: 16px; }
.insp { grid-area: insp; padding: 18px; overflow: auto; min-height: 0; }
.timeline { grid-area: tl; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

/* ---------- topo ---------- */
.brand { display: flex; align-items: center; gap: 9px; font-size: 19px; color: var(--ink); text-decoration: none; margin-inline-end: 8px; }
.brand b { font-weight: 800; letter-spacing: -.03em; }
.logo { width: 30px; height: 30px; border-radius: 9px; position: relative; background: linear-gradient(135deg, var(--blue), #5B8CFF 45%, var(--green)); box-shadow: 0 4px 12px rgba(47,107,255,.3); }
.logo::after { content: ""; position: absolute; inset: 7px 9px; border-radius: 4px; border: 2px solid #fff; }
.spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--green-ink); background: #E7F8EF; border-radius: 99px; padding: 6px 12px; }
.chip .ic { width: 14px; height: 14px; }
.pillsel { position: relative; display: inline-flex; align-items: center; background: var(--island); border-radius: 99px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.pillsel select { appearance: none; border: 0; background: transparent; font: 600 13px var(--ui); color: var(--ink); padding: 9px 34px 9px 16px; cursor: pointer; max-width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748B' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.pillsel.lang .ic { position: absolute; inset-inline-start: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.pillsel.lang select { padding-inline-start: 34px; }
[dir="rtl"] .pillsel select { background-position: left 14px center; padding: 9px 16px 9px 34px; }
[dir="rtl"] .pillsel.lang select { padding-inline-start: 34px; }

/* ---------- botões ---------- */
.btn { font: 600 13px var(--ui); color: var(--ink); text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--island); transition: background .15s, box-shadow .15s, transform .1s; }
.btn:hover { background: var(--soft); border-color: #D3DCE9; }
.btn:active { transform: translateY(1px); }
.btn.blue { color: #fff; border-color: transparent; background: linear-gradient(180deg, #4A80FF, var(--blue)); box-shadow: 0 4px 12px rgba(47,107,255,.28), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.blue:hover { background: linear-gradient(180deg, #5A8CFF, #2560F0); }
.btn.green { color: #fff; border-color: transparent; border-radius: 99px; padding: 9px 18px; background: linear-gradient(180deg, #22C77C, var(--green)); box-shadow: 0 6px 16px rgba(18,183,106,.3), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.green:hover { background: linear-gradient(180deg, #2BD487, #0FA862); }
.btn.danger { color: #D92D20; }
.btn.danger:hover { background: #FEF3F2; border-color: #FBD5D1; }
.btn.small { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.sel, input[type=text], input[type=search], input[type=password], textarea {
  font: 400 13px var(--ui); color: var(--ink); width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--soft); transition: border-color .15s, background .15s;
}
.sel:focus, input[type=text]:focus, input[type=search]:focus, input[type=password]:focus, textarea:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px var(--blue-soft); }
textarea { resize: vertical; }
input[type=range] { width: 100%; accent-color: var(--blue); }
input[type=color] { width: 38px; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.field { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- trilho de abas ---------- */
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; border: 0; border-radius: 14px; background: transparent; color: var(--muted);
  font: 600 11px var(--ui); cursor: pointer; transition: background .15s, color .15s; }
.tab .ic { width: 22px; height: 22px; }
.tab:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--island); color: var(--blue); box-shadow: var(--shadow); }
.panel { padding: 16px; overflow: auto; min-height: 0; flex: 1; }

.drop { display: grid; place-items: center; gap: 4px; text-align: center; padding: 26px 14px; border: 1.5px dashed #BBCCEB; border-radius: 14px; background: linear-gradient(180deg, #F7FAFF, #EEF3FF); cursor: pointer; color: var(--blue); transition: border-color .15s, background .15s; }
.drop b { color: var(--ink); font-size: 14px; }
.drop span { font-size: 12px; color: var(--muted); }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-soft); }

.grid { display: grid; gap: 10px; }
.media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.style-grid, .look-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 6px; cursor: pointer; text-align: start; font: 600 12px var(--ui); color: var(--ink);
  display: flex; flex-direction: column; gap: 6px; min-width: 0; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: #C9D6EE; box-shadow: 0 6px 16px rgba(15,27,45,.08); transform: translateY(-1px); }
.card[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.card canvas, .card img, .card video { width: 100%; border-radius: 8px; display: block; background: #0B0B0C; }
.card small { color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .acts { display: flex; gap: 4px; flex-wrap: wrap; }
.seg { display: flex; padding: 3px; gap: 3px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.seg button { flex: 1; font: 600 12px var(--ui); padding: 7px 4px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(15,27,45,.12); }

/* ---------- palco ---------- */
.screen-wrap { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
#screen { max-width: 100%; max-height: 100%; border-radius: 14px; box-shadow: 0 20px 50px rgba(15,27,45,.22), 0 0 0 1px rgba(15,27,45,.06); background: #000; touch-action: none; }
.sample { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: #fff; background: rgba(15,27,45,.66); backdrop-filter: blur(6px); padding: 5px 12px; border-radius: 99px; pointer-events: none; white-space: nowrap; }
.transport { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); padding: 6px 8px 6px 6px; border-radius: 99px; box-shadow: var(--shadow); }
.playbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: linear-gradient(180deg, #4A80FF, var(--blue)); box-shadow: 0 4px 12px rgba(47,107,255,.35); }
.playbtn .tri { width: 0; height: 0; border-left: 12px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 3px; }
.playbtn.on .tri { width: 12px; height: 14px; border: 0; margin: 0; border-left: 4px solid #fff; border-right: 4px solid #fff; }
.time { font: 600 13px "Space Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; color: var(--ink); padding: 0 6px; }

/* ---------- propriedades ---------- */
.insp h2 { margin: 0 0 2px; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.insp .sub { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.insp .tips { margin: 12px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 12.5px; display: grid; gap: 10px; }
.insp .tips li { background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.insp kbd { font: 600 11px "Space Mono", monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: #fff; color: var(--ink); }

/* ---------- linha do tempo ---------- */
.tl-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px 6px; font-size: 13px; }
.tools { display: inline-flex; background: var(--soft); border-radius: 12px; padding: 3px; gap: 2px; }
.tools button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); font: 700 12.5px var(--ui); padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.tools button .ic { width: 16px; height: 16px; }
.tools button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(15,27,45,.12); }
.tools button[data-tool="cut"][aria-pressed="true"] { background: #FF4D4F; color: #fff; box-shadow: 0 4px 12px rgba(255,77,79,.35); }
.tl-hint { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zoom { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.zoom input { width: 120px; }
#tlFit[aria-pressed="true"] { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.tl-scroll { overflow: auto; flex: 1; min-height: 0; }
.tl-inner { position: relative; min-width: 100%; padding-inline-start: 86px; padding-bottom: 6px; }
[dir="rtl"] .tl-scroll { direction: ltr; }
[dir="rtl"] .tl-inner { padding-inline-start: 0; padding-left: 86px; }
.ruler { height: 30px; position: relative; cursor: pointer; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ruler span { position: absolute; top: 4px; font: 700 11px "Space Mono", monospace; color: var(--ink); transform: translateX(5px); }
.ruler i { position: absolute; bottom: 0; width: 1px; height: 12px; background: #9FB0C8; }
.ruler i.minor { height: 5px; background: #C9D4E4; }
.track { position: relative; height: 42px; }
.track.big { height: 92px; }
.track-name { position: absolute; left: -68px; width: 60px; top: 4px; bottom: 4px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--soft); border-radius: 10px; }
.lane { position: absolute; inset: 4px 8px 4px 0; }
.lane-empty { position: absolute; inset: 0; display: grid; place-items: center; border: 2px dashed #C9D6EE; border-radius: 12px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.blk { position: absolute; top: 0; bottom: 0; border-radius: 10px; overflow: hidden; cursor: grab; font: 600 11px var(--ui); color: #fff; padding: 5px 9px; white-space: nowrap; text-overflow: ellipsis; touch-action: none; user-select: none; }
.blk.clip { padding: 0; background: #1D3B8F; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); border-radius: 12px; }
.blk.clip .film { position: absolute; inset: 0; height: 100%; pointer-events: none; }
.blk.clip .lbl { position: absolute; left: 10px; top: 6px; background: rgba(15,27,45,.62); padding: 2px 7px; border-radius: 6px; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }
.blk.clip .dur { position: absolute; right: 12px; bottom: 6px; background: rgba(15,27,45,.62); padding: 2px 6px; border-radius: 6px; font: 700 10px "Space Mono", monospace; }
.blk.clip .hdl { width: 12px; background: rgba(255,255,255,.85); }
.blk.clip .hdl::after { content: ""; position: absolute; left: 5px; top: 35%; bottom: 35%; width: 2px; border-radius: 2px; background: #2F6BFF; }
.blk.dragging { z-index: 5; opacity: .85; box-shadow: 0 10px 24px rgba(15,27,45,.35); cursor: grabbing; }
.blk.txt { background: linear-gradient(135deg, #22C77C, #0E9A5A); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.blk.ov { background: linear-gradient(135deg, #8B5CF6, #6D3FE0); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.blk.ov .lbl { background: rgba(15,27,45,.3); padding: 1px 6px; border-radius: 6px; }
.blk.thin { padding-block: 0; font-size: 10px; line-height: 1; display: flex; align-items: center; }
.blk.thin .lbl { padding-block: 0; }
.blk.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #FFB020; }
.blk .hdl { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; background: rgba(255,255,255,.3); }
.blk .hdl.l { left: 0; } .blk .hdl.r { right: 0; }
.tl-inner.cutting, .tl-inner.cutting .blk, .tl-inner.cutting .lane { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23FF4D4F' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='6' cy='7' r='2.6' fill='white'/%3E%3Ccircle cx='6' cy='17' r='2.6' fill='white'/%3E%3Cpath d='M8 8.5L20 17M8 15.5L20 7'/%3E%3C/svg%3E") 14 14, crosshair; }
.tl-inner.cutting .hdl { display: none; }
.cutline { position: absolute; top: 30px; bottom: 0; width: 0; border-left: 2px dashed #FF4D4F; pointer-events: none; z-index: 6; }
.cutline span { position: absolute; top: -26px; left: 0; transform: translateX(-50%); background: #FF4D4F; color: #fff; font: 700 10.5px "Space Mono", monospace; padding: 3px 6px; border-radius: 6px; white-space: nowrap; }
.cutline.snap { animation: snap .35s ease-out; }
@keyframes snap { 0% { border-left-style: solid; box-shadow: 0 0 0 4px rgba(255,77,79,.35); } 100% { box-shadow: none; } }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #FF4D4F; pointer-events: none; z-index: 7; }
.ph-knob { position: absolute; top: 2px; left: 1px; transform: translateX(-50%); pointer-events: auto; cursor: ew-resize; background: #FF4D4F; color: #fff; font: 700 10.5px "Space Mono", monospace; padding: 4px 7px; border-radius: 8px; box-shadow: 0 4px 10px rgba(255,77,79,.35); white-space: nowrap; }
.ph-knob::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: #FF4D4F; }

/* ---------- mídia ---------- */
.card.media { position: relative; }
.card-del { position: absolute; top: 10px; right: 10px; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 9px; background: rgba(255,255,255,.94); color: #E5484D; cursor: pointer; box-shadow: 0 2px 8px rgba(15,27,45,.2); }
.card-del .ic { width: 16px; height: 16px; }
.card-del:hover { background: #E5484D; color: #fff; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; background: #0F1B2D; color: #fff; padding: 10px 12px 10px 18px; border-radius: 12px; font: 600 13px var(--ui); z-index: 50; box-shadow: 0 10px 30px rgba(15,27,45,.3); max-width: calc(100vw - 32px); }
.toast button { border: 0; background: #2F6BFF; color: #fff; font: 700 12.5px var(--ui); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.toast:not(:has(button)) { padding-right: 18px; }

/* ---------- exportar ---------- */
dialog { border: 0; border-radius: 20px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(15,27,45,.35); color: var(--ink); }
dialog::backdrop { background: rgba(15,27,45,.4); backdrop-filter: blur(3px); }
.dlg { padding: 22px 24px; }
.dlg h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.01em; }
.bar { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--green)); transition: width .2s; }
#exVideo { width: 100%; max-height: 50vh; border-radius: 12px; background: #000; }

/* ---------- telas menores ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: 72px 280px minmax(0, 1fr); grid-template-rows: 64px minmax(460px, 1fr) auto 286px; grid-template-areas: "top top top" "rail side stage" "rail insp insp" "tl tl tl"; height: auto; min-height: 100%; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "top" "stage" "rail" "side" "insp" "tl"; padding: 0 16px 16px; }
  .top { padding: 10px 0 0; gap: 8px; }
  .privacy { display: none; }
  .brand { margin-inline-end: auto; }
  .spacer { display: none; }
  .pillsel.lang select { max-width: 132px; }
  .btn.green { padding: 8px 14px; }
  .pillsel:not(.lang) { order: 5; flex-basis: 100%; }
  .pillsel:not(.lang) select { width: 100%; }
  .stage { padding: 12px; }
  .screen-wrap { height: 60vh; }
  .rail { flex-direction: row; justify-content: space-between; }
  .tab { flex: 1; }
  .timeline { height: 320px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
#tlFit { white-space: nowrap; }
@media (max-width: 760px) {
  .zoom input, .tl-hint { display: none; }
  .tl-head { justify-content: space-between; }
}

/* =====================================================================
   Tema papel: o app parece uma mesa de trabalho com folhas de papel,
   a tela fica sobre uma base de corte verde e a tesoura corta a fita do vídeo.
   ===================================================================== */
:root {
  --bg: #F8F7F3;
  --island: #FFFFFF;
  --line: #EAE3D4;
  --soft: #F7F2E8;
  --muted: #6E6758;
  --paper-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .36 0 0 0 0 .24 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --paper-fiber: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.008 .05' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .44 0 0 0 0 .3 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --shadow: 0 1px 0 rgba(110,90,50,.07), 0 2px 3px -1px rgba(110,90,50,.08), 0 14px 28px -12px rgba(70,55,25,.22);
}
/* fundo: papel branco amassado (imagem gerada, sem direitos de terceiros) */
body { background: #F8F7F3 url(paper.jpg) center / cover fixed; }
.island { background-color: var(--island); background-image: var(--paper-noise); border: 1px solid rgba(120,100,60,.08); }
.pillsel, .transport, .btn:not(.blue):not(.green) { background-color: var(--island); background-image: var(--paper-noise); }
/* base de corte: grelha verde com linhas maiores a cada 5 quadrados */
.stage {
  background-color: #DCEFE3;
  background-image:
    linear-gradient(rgba(11,120,70,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(11,120,70,.22) 1px, transparent 1px),
    linear-gradient(rgba(11,120,70,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(11,120,70,.10) 1px, transparent 1px),
    var(--paper-noise);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px, auto;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px, 0 0;
  box-shadow: inset 0 0 0 1px rgba(11,120,70,.15), inset 0 2px 10px rgba(11,80,50,.08);
}
#screen { box-shadow: 0 2px 0 rgba(0,0,0,.08), 0 24px 48px -12px rgba(30,40,30,.45); }
/* logotipo com tesoura */
.logo { display: grid; place-items: center; color: #fff; }
.logo::after { display: none; }
.logo .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.ver { font: 700 10px "Space Mono", monospace; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; letter-spacing: 0; }
/* área de soltar como um cupom: linha tracejada com tesoura */
.drop { position: relative; background: #FFFEFA; border: 2px dashed #CDBF9F; }
.drop-scissors { position: absolute; top: -12px; left: 18px; width: 22px; height: 22px; color: #B0A27F; background: var(--island); padding: 2px; transform: rotate(-90deg); }
.drop:hover .drop-scissors { color: #FF4D4F; }
/* trilho de abas como marcadores de papel */
.rail .tab[aria-selected="true"] { background-color: var(--island); background-image: var(--paper-noise); box-shadow: var(--shadow); }
/* nomes das faixas como pedaços de fita-cola: pontas rasgadas, riscas e sombra */
.track-name { background: none !important; clip-path: none; border-radius: 0; transform: rotate(-2deg); color: #5B4410;
  font: 800 12.5px var(--ui); letter-spacing: .01em; z-index: 1; filter: drop-shadow(0 2px 2px rgba(80,60,20,.22)); left: -78px; width: 70px; }
.track-name::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,.05) 45%, rgba(0,0,0,.05)), linear-gradient(180deg, #FFE08A, #F9CF5B);
  clip-path: polygon(4% 0, 96% 0, 100% 8%, 95% 18%, 100% 30%, 96% 42%, 100% 55%, 95% 67%, 100% 80%, 96% 92%, 98% 100%, 3% 100%, 0 90%, 5% 78%, 0 65%, 4% 52%, 0 40%, 5% 27%, 0 15%, 3% 6%); }
.track:nth-child(3) .track-name { transform: rotate(1.6deg); color: #183C9E; }
.track:nth-child(3) .track-name::before { background: linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,.05) 45%, rgba(0,0,0,.05)), linear-gradient(180deg, #B9D6FF, #8DB8FF); }
.track:nth-child(4) .track-name { transform: rotate(-1deg); color: #0A6B3D; }
.track:nth-child(4) .track-name::before { background: linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,.05) 45%, rgba(0,0,0,.05)), linear-gradient(180deg, #B7F0CF, #86DFAE); }
.track.big .track-name { font-size: 14px; }
/* trecho de vídeo como fita de filme com furinhos em cima e em baixo */
.blk.clip { border-radius: 6px; box-shadow: 0 2px 0 rgba(0,0,0,.12), 0 6px 14px -6px rgba(20,30,60,.4); }
.blk.clip::before, .blk.clip::after { content: ""; position: absolute; left: 0; right: 0; height: 9px; z-index: 1; pointer-events: none;
  background: #14181F radial-gradient(circle at 50% 50%, #F3EFE6 0 2px, transparent 2.6px) 0 0 / 12px 9px repeat-x; }
.blk.clip::before { top: 0; } .blk.clip::after { bottom: 0; }
.blk.clip .lbl { top: 13px; } .blk.clip .dur { bottom: 13px; }
.blk.clip .hdl { z-index: 2; }
.blk.txt, .blk.ov { border-radius: 6px; box-shadow: 0 2px 0 rgba(0,0,0,.1); }
/* corte: as duas partes afastam-se um pouco, como papel recém-cortado */
.blk.clip.cut-l { animation: cutL .45s cubic-bezier(.2,.9,.3,1.3); }
.blk.clip.cut-r { animation: cutR .45s cubic-bezier(.2,.9,.3,1.3); }
@keyframes cutL { 30% { transform: translateX(-6px) rotate(-1deg); } 100% { transform: none; } }
@keyframes cutR { 30% { transform: translateX(6px) rotate(1deg); } 100% { transform: none; } }
/* durante o corte, o trecho debaixo do rato mostra a linha "corte aqui" */
.tl-inner.cutting .blk:hover { filter: brightness(1.06); }
.lane.drop-target { outline: 2px dashed var(--blue); outline-offset: 2px; border-radius: 8px; background: rgba(47,107,255,.06); }
.dropmark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: var(--blue); border-radius: 2px; pointer-events: none; z-index: 6; }
.card.media[draggable="true"] { cursor: grab; }

/* ---------- balões ao lado direito do objeto escolhido ---------- */
.bubbles { position: absolute; z-index: 8; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 16px;
  background-color: #FFFDF8; background-image: var(--paper-noise); box-shadow: 0 2px 0 rgba(110,90,50,.1), 0 16px 32px -10px rgba(40,30,10,.35); border: 1px solid rgba(120,100,60,.12); }
.bubbles::before { content: ""; position: absolute; left: -9px; top: calc(var(--tip, 50%) - 9px); width: 18px; height: 18px; background: #FFFDF8; border-left: 1px solid rgba(120,100,60,.12); border-bottom: 1px solid rgba(120,100,60,.12); transform: rotate(45deg); border-radius: 0 0 0 4px; }
.bubbles.inside::before { display: none; }
.bubbles.in .bubble { animation: bubIn .32s cubic-bezier(.2,.9,.3,1.35) both; }
.bubbles.in .bubble:nth-child(2) { animation-delay: .04s; } .bubbles.in .bubble:nth-child(3) { animation-delay: .08s; } .bubbles.in .bubble:nth-child(4) { animation-delay: .12s; }
@keyframes bubIn { from { opacity: 0; transform: translateX(-10px) scale(.92); } to { opacity: 1; transform: none; } }
.bubble { display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer; font: 700 12.5px var(--ui); color: var(--ink); background: var(--soft); padding: 8px 12px 8px 9px; border-radius: 11px; white-space: nowrap; text-align: start; transition: background .12s, transform .12s; }
.bubble .ic { width: 17px; height: 17px; color: var(--blue); }
.bubble:hover { background: var(--blue-soft); transform: translateX(2px); }
.bubble.hot { background: linear-gradient(180deg, #4A80FF, var(--blue)); color: #fff; box-shadow: 0 6px 14px rgba(47,107,255,.3); position: relative; }
.bubble.hot .ic { color: #fff; }
.bubble.hot::after { content: ""; position: absolute; inset: -3px; border-radius: 14px; border: 2px solid rgba(47,107,255,.35); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { from { opacity: 1; transform: scale(.96); } to { opacity: 0; transform: scale(1.08); } }
.bubble.danger { color: #D92D20; } .bubble.danger .ic { color: #D92D20; } .bubble.danger:hover { background: #FEF3F2; }

/* ---------- cartões de modelo ---------- */
.card.tpl { position: relative; display: flex; flex-direction: column; gap: 6px; }
.card.tpl .tpl-name { font-weight: 700; line-height: 1.2; }
.tpl-anim { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; color: #fff; background: rgba(15,27,45,.6); backdrop-filter: blur(4px); }
.card.tpl:hover .tpl-anim { background: #FF4D4F; }

/* ---------- conta ---------- */
.acct { position: relative; }
.acct-btn { gap: 6px; padding: 8px 14px; font: 700 12px "Space Mono", monospace; color: var(--ink); cursor: pointer; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 250px; display: grid; gap: 8px; padding: 14px; border-radius: 14px;
  background-color: var(--island); background-image: var(--paper-noise); box-shadow: var(--shadow); border: 1px solid var(--line); }
.acct-menu .hint { margin: 0 0 4px; }
/* ---------- comunidade ---------- */
.tpl-src { margin-bottom: 12px; }
.community-note { display: grid; gap: 2px; padding: 12px 14px; margin-bottom: 10px; border-radius: 12px; font-size: 12.5px; color: #5B4410;
  background: linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,.05) 45%, rgba(0,0,0,.05)), linear-gradient(180deg, #FFE9A8, #FBD873); transform: rotate(-.4deg); box-shadow: 0 2px 4px rgba(80,60,20,.15); }
.community-note b { font-size: 13.5px; }
.comm-tools { gap: 8px; margin-bottom: 10px; }
.comm-tools input { flex: 1; min-width: 0; }
.comm-tools select { width: auto; }
.tpl-meta { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.tpl-x { position: absolute; top: 10px; left: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: rgba(255,255,255,.92); color: #D92D20; box-shadow: 0 1px 4px rgba(0,0,0,.2); opacity: 0; transition: opacity .15s; }
.card.tpl:hover .tpl-x, .tpl-x:focus { opacity: 1; }
#tplPublishBtn { margin-top: 14px; }
.pub-row { display: flex; gap: 14px; align-items: flex-start; margin: 10px 0; }
.pub-row canvas { border-radius: 10px; box-shadow: var(--shadow); flex: none; }
.pub-fields { flex: 1; display: grid; gap: 6px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.acct-menu .idsmall { font: 700 12.5px "Space Mono", monospace; background: var(--soft); border: 1px dashed #CDBF9F; border-radius: 10px; padding: 8px 10px; user-select: all; text-align: center; }
.acct-menu .row { gap: 6px; } .acct-menu .row input { flex: 1; min-width: 0; }
.acct-menu .err { color: #D92D20; margin: 0; }
.acct-menu { width: 280px; }

.track-name { filter: none; }

/* ---------- fita adesiva: cor sólida, pontas em zigue-zague (como fita rasgada com a mão) ---------- */
.track-name::before, .community-note {
  clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 12.5%, 100% 25%, calc(100% - 7px) 37.5%, 100% 50%, calc(100% - 7px) 62.5%, 100% 75%, calc(100% - 7px) 87.5%, 100% 100%, 0 100%, 7px 87.5%, 0 75%, 7px 62.5%, 0 50%, 7px 37.5%, 0 25%, 7px 12.5%) !important; border-radius: 0;
  background: var(--paper-noise), linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.03)), var(--stk, #EADCC8) !important; box-shadow: none;
}
.track-name { filter: drop-shadow(0 2px 2px rgba(60,40,10,.22)); }
.community-note { filter: drop-shadow(0 2px 3px rgba(60,40,10,.2)); padding-inline: 20px; }
.track:nth-child(2) .track-name::before { --stk: #F3D98A; }
.track:nth-child(3) .track-name::before { --stk: #BCD2F3; }
.track:nth-child(4) .track-name::before { --stk: #C2E5CB; }
.community-note { --stk: #F3D98A; }
/* fitas: cores vivas, uma só cor */
.track-name::before, .community-note { background: var(--stk) !important; }
.track:nth-child(2) .track-name::before, .community-note { --stk: #FCD877; }
.track:nth-child(3) .track-name::before { --stk: #9DC2FE; }
.track:nth-child(4) .track-name::before { --stk: #92E2B5; }

/* ---------- balão "ver inteiro" ---------- */
.fullbtn { position: absolute; z-index: 7; display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(120,100,60,.14); cursor: pointer;
  font: 700 12.5px var(--ui); color: var(--ink); background: #fff; padding: 8px 12px 8px 10px; border-radius: 12px 12px 12px 3px;
  box-shadow: 0 2px 0 rgba(110,90,50,.08), 0 10px 22px -10px rgba(40,30,10,.4); white-space: nowrap; transition: transform .12s, background .12s; }
.fullbtn .ic { width: 16px; height: 16px; color: var(--blue); }
.fullbtn:hover { transform: translateY(-2px); background: var(--blue-soft); }
/* tela cheia: só o vídeo, centrado num fundo preto */
.screen-wrap:fullscreen { background: #000; display: flex; align-items: center; justify-content: center; }
.screen-wrap:fullscreen #screen { max-width: 100vw; max-height: 100vh; width: auto; height: 100vh; border-radius: 0; box-shadow: none; }
.screen-wrap:fullscreen .bubbles, .screen-wrap:fullscreen .sample { display: none !important; }
.screen-wrap:fullscreen .fullbtn { top: 18px !important; left: auto !important; right: 18px; background: rgba(255,255,255,.92); }

/* ---------- zoom da prévia ---------- */
.screen-scroll { position: absolute; inset: 0; display: flex; overflow: hidden; }
.screen-scroll #screen { margin: auto; flex: none; }
.screen-wrap.zoomed .screen-scroll { overflow: auto; cursor: grab; }
.screen-wrap.zoomed .screen-scroll.panning { cursor: grabbing; }
.screen-wrap.zoomed #screen { max-width: none; max-height: none; }
.zoombox { position: absolute; z-index: 7; display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: #fff;
  border: 1px solid rgba(120,100,60,.14); box-shadow: 0 2px 0 rgba(110,90,50,.08), 0 10px 22px -10px rgba(40,30,10,.4); }
.zoombox button { border: 0; background: transparent; cursor: pointer; font: 800 16px var(--ui); color: var(--ink); width: 30px; height: 30px; border-radius: 9px; }
.zoombox button:hover { background: var(--blue-soft); color: var(--blue); }
.zoombox .zl { width: auto; min-width: 52px; padding: 0 6px; font: 700 12px "Space Mono", monospace; }
.screen-wrap:fullscreen .zoombox { display: none; }
.screen-wrap:fullscreen .screen-scroll { overflow: hidden !important; }
.screen-wrap:fullscreen #screen { width: auto !important; height: 100vh !important; }

/* ---------- botões de fonte ---------- */
.fontgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.fontbtn { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; color: var(--ink); transition: border-color .12s, transform .12s; }
.fontbtn b { font-size: 22px; line-height: 1.1; }
.fontbtn small { font: 600 10px var(--ui); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fontbtn:hover { border-color: #C9D6EE; transform: translateY(-1px); }
.fontbtn[aria-checked="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.fontbtn[aria-checked="true"] small { color: var(--blue); }

/* músicas do Slicfly */
.gengrid { display: grid; gap: 8px; margin: 10px 0 6px; }
.gencard { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.gencard.rec { border-color: #9DC2FE; box-shadow: 0 0 0 3px var(--blue-soft); }
.gtop { display: flex; align-items: center; gap: 10px; }
.gtop b { display: block; font-size: 14px; }
.gtop small { color: var(--muted); font-size: 11px; }
.gemo { font-size: 22px; }
.gplay { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 14px; cursor: pointer; }
.gplay.busy, .gencard .btn.busy { opacity: .55; cursor: progress; }
.gacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.viral-links { display: grid; gap: 6px; margin-top: 8px; }
.vlink { display: block; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none; }
.vlink:hover { border-color: var(--blue); }
.vlink b { display: block; font-size: 13px; }
.vlink small { color: var(--muted); font-size: 11px; }
.hint.warn { background: #FFF6DA; border: 1px solid #F3DE94; border-radius: 10px; padding: 8px 10px; }
.seg.wrap { flex-wrap: wrap; } .seg.wrap button { flex: 1 1 30%; }
.row.check input { width: 18px; height: 18px; accent-color: var(--blue); }
/* X para fechar o balão */
.bub-x { position: absolute; top: -11px; right: -11px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: #1D2433; color: #fff;
  font: 700 17px/1 var(--ui); display: grid; place-items: center; padding: 0 0 2px; cursor: pointer; box-shadow: 0 3px 8px rgba(0,0,0,.25); z-index: 2; transition: transform .12s, background .12s; }
.bub-x:hover { background: #E5484D; transform: scale(1.1); }

/* ---------- faixa "Modelos" (vários modelos seguidos) ---------- */
.track.t-scene { height: 46px; }
.track.big.t-video { height: 82px; }
.track.t-video .track-name::before { --stk: #FCD877; }
.track.t-scene .track-name { transform: rotate(1.4deg); color: #4A3B22; }
.track.t-scene .track-name::before { --stk: #D6C3A0; background: var(--stk) !important; }
.track.t-ov .track-name { transform: rotate(-1.2deg); color: #183C9E; }
.track.t-ov .track-name::before { --stk: #9DC2FE; background: var(--stk) !important; }
.track.t-txt .track-name { transform: rotate(1deg); color: #0A6B3D; }
.track.t-txt .track-name::before { --stk: #92E2B5; background: var(--stk) !important; }
.blk.scene { display: flex; align-items: center; gap: 7px; padding: 3px 10px 3px 4px; color: #3A2E22; border-radius: 4px; overflow: visible;
  background: linear-gradient(rgba(236,226,206,.5), rgba(236,226,206,.35)), #FBF7EE url("paper.jpg") center / 600px; border: 1px solid rgba(150,130,95,.35); box-shadow: 0 1px 0 rgba(90,70,30,.15), 0 5px 12px -6px rgba(60,40,10,.45); }
.blk.scene::before { content: ""; position: absolute; left: -6px; top: -5px; width: 30px; height: 12px; background: #C9B48C; opacity: .9; transform: rotate(-14deg);
  clip-path: polygon(0 0, 8% 25%, 0 50%, 8% 75%, 0 100%, 100% 100%, 92% 75%, 100% 50%, 92% 25%, 100% 0); }
.blk.scene .sthumb { height: 100%; max-height: 36px; border-radius: 3px; box-shadow: 0 0 0 2px #fff, 0 2px 4px rgba(0,0,0,.2); flex: none; pointer-events: none; }
.blk.scene .lbl { font: 700 11.5px var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.blk.scene .hdl.r { background: transparent; width: 10px; right: -2px; }
.blk.scene .hdl.r::after { content: ""; position: absolute; right: 3px; top: 30%; bottom: 30%; width: 3px; border-radius: 3px; background: #B8A47F; }
.blk.scene.snapped .hdl.r::after { background: #2F6BFF; }
.blk.scene.empty { background: repeating-linear-gradient(-45deg, rgba(150,130,95,.1) 0 8px, transparent 8px 16px); border: 2px dashed #CDBF9F; box-shadow: none; color: #7A6A4C; }
.blk.scene.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2F6BFF; }
.lane-empty.scene-empty { border-color: #D8CCB2; color: #7A6A4C; background: rgba(150,130,95,.05); font-size: 12px; }
.lane.drop-hint { border-radius: 8px; animation: dropPulse 1s ease-in-out infinite alternate; }
@keyframes dropPulse { from { box-shadow: 0 0 0 2px rgba(47,107,255,.2); } to { box-shadow: 0 0 0 4px rgba(47,107,255,.45); background: rgba(47,107,255,.06); } }
#laneScene.drop-target { outline-color: #2F6BFF; background: rgba(47,107,255,.08); }
.drag-tip { display: flex; align-items: center; gap: 8px; margin: -2px 0 10px; font-size: 12px; color: #6B5D45; }
.tip-tape { width: 26px; height: 11px; flex: none; background: #D6C3A0; transform: rotate(-8deg); clip-path: polygon(0 0, 10% 30%, 0 60%, 10% 100%, 100% 100%, 90% 70%, 100% 40%, 90% 0); }

/* ---------- grampo nas emendas (transições) ---------- */
.staple { position: absolute; top: 50%; z-index: 4; transform: translate(-50%, -50%); width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: #FFFDF8; box-shadow: 0 0 0 1.5px rgba(120,100,60,.25), 0 3px 8px rgba(40,30,10,.25); display: grid; place-items: center; cursor: pointer; transition: transform .15s; }
.staple .stp { width: 15px; height: 15px; fill: none; stroke: #8792A2; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.staple:hover { transform: translate(-50%, -50%) scale(1.18) rotate(-6deg); }
.staple:hover .stp { stroke: #2F6BFF; }
.staple.on { width: auto; height: auto; background: none; box-shadow: none; border-radius: 0; }
.tr-tape { display: flex; align-items: center; gap: 4px; padding: 3px 9px; background: var(--tc); color: #3A2E22; transform: rotate(-7deg); font: 700 10px var(--ui); white-space: nowrap;
  clip-path: polygon(0 0, 6% 25%, 0 50%, 6% 75%, 0 100%, 100% 100%, 94% 75%, 100% 50%, 94% 25%, 100% 0); box-shadow: inset 0 6px 0 rgba(255,255,255,.3); opacity: .96; }
.tr-tape b { font-size: 12px; } .tr-tape small { font: inherit; max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
.staple.on:hover { transform: translate(-50%, -50%) scale(1.08); }
.staple.sel .tr-tape, .staple.sel:not(.on) { outline: 2px solid #2F6BFF; outline-offset: 2px; }
.track.big .staple.on { top: 22%; }

/* ---------- gaveta de transições (cartões de papel) ---------- */
.trgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; margin: 6px 2px 14px; }
.trcard { position: relative; padding: 7px 7px 26px; border: 0; cursor: pointer; background: #FBF7EE url("paper.jpg") center / 500px; transform: rotate(var(--rot));
  box-shadow: 0 1px 0 rgba(90,70,30,.12), 0 8px 16px -8px rgba(60,40,10,.45); transition: transform .18s cubic-bezier(.2,.9,.3,1.3), box-shadow .18s; }
.trcard canvas { display: block; width: 100%; height: auto; border-radius: 2px; }
.trcard:hover { transform: rotate(0deg) translateY(-4px); box-shadow: 0 1px 0 rgba(90,70,30,.12), 0 14px 22px -10px rgba(60,40,10,.5); }
.trname { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%) rotate(-2deg); padding: 2px 10px; background: var(--tc); font: 700 11px var(--ui); color: #3A2E22; white-space: nowrap;
  clip-path: polygon(0 0, 5% 25%, 0 50%, 5% 75%, 0 100%, 100% 100%, 95% 75%, 100% 50%, 95% 25%, 100% 0); }
.trcard.on::before { content: ""; position: absolute; top: -5px; left: 50%; width: 42px; height: 9px; transform: translateX(-50%) rotate(-3deg); border-radius: 3px; z-index: 2;
  background: linear-gradient(180deg, #F2F4F7, #9AA3AF 55%, #E5E7EB); box-shadow: 0 2px 3px rgba(0,0,0,.3); }
.trcard.on { box-shadow: 0 0 0 3px #2F6BFF, 0 10px 18px -8px rgba(60,40,10,.5); }
.scene-head { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px dashed #E3D7BF; }

/* pegas de esticar nos modelos: bem visíveis, com duas risquinhas */
.blk.scene .hdl.grip { top: 3px; bottom: 3px; width: 14px; z-index: 3; border-radius: 5px; background: #FFFFFF; box-shadow: 0 0 0 1.5px #B8A47F, 0 2px 5px rgba(60,40,10,.25); cursor: ew-resize; opacity: .9; transition: transform .12s, opacity .12s, box-shadow .12s; }
.blk.scene .hdl.grip.r { right: -7px; } .blk.scene .hdl.grip.l { left: -7px; }
.blk.scene .hdl.grip::after { content: ""; position: absolute; left: 4px; right: 4px; top: 30%; bottom: 30%; width: auto; border-radius: 0; background: none; border-left: 2px solid #8A7650; border-right: 2px solid #8A7650; }
.blk.scene:hover .hdl.grip, .blk.scene.sel .hdl.grip { opacity: 1; }
.blk.scene .hdl.grip:hover { transform: scaleY(1.12); box-shadow: 0 0 0 2px #2F6BFF, 0 3px 8px rgba(47,107,255,.35); }
.blk.scene .hdl.grip:hover::after { border-color: #2F6BFF; }
.blk.scene.snapped .hdl.grip { box-shadow: 0 0 0 2px #2F6BFF; }
/* o grampo da transição fica em cima da emenda, sem tapar as pegas */
#laneScene .staple { top: -4px; }
#laneScene .staple.on { top: -6px; }

/* cursor grande de "esticar" (setas brancas e azuis), bem visível em cima das pegas da linha do tempo */
.tl-inner .blk .hdl, .blk.scene .hdl.grip { cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%3E%3Cg%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cg%20stroke%3D%22%23111%22%20stroke-width%3D%226%22%3E%3Cpath%20d%3D%22M5%2020h30M11%2013l-7%207%207%207M29%2013l7%207-7%207M17%2010v20M23%2010v20%22/%3E%3C/g%3E%3Cg%20stroke%3D%22%23fff%22%20stroke-width%3D%222.6%22%3E%3Cpath%20d%3D%22M5%2020h30M11%2013l-7%207%207%207M29%2013l7%207-7%207%22/%3E%3C/g%3E%3Cg%20stroke%3D%22%232F6BFF%22%20stroke-width%3D%222.6%22%3E%3Cpath%20d%3D%22M17%2010v20M23%2010v20%22/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 20 20, ew-resize; }
.tl-inner .blk .hdl::before { content: ""; position: absolute; top: 0; bottom: 0; left: -6px; right: -6px; }
/* pegas invisíveis: só o mouse de esticar aparece ao passar por cima da ponta */
.blk.scene .hdl.grip, .blk.scene .hdl.grip:hover, .blk.scene.snapped .hdl.grip { background: transparent !important; box-shadow: none !important; transform: none !important; opacity: 1; }
.blk.scene .hdl.grip::after { display: none !important; }

/* tutorial */
.tut-btn { display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--ui); cursor: pointer; }
.tut-dlg { width: min(460px, calc(100vw - 32px)); }
.tut-card { position: relative; margin: 6px 0 12px; padding: 22px 20px 18px; background: #FBF7EE url("paper.jpg") center / 600px; border-radius: 4px; box-shadow: 0 1px 0 rgba(90,70,30,.12), 0 10px 20px -10px rgba(60,40,10,.45); transform: rotate(-.6deg); }
.tut-card::before { content: ""; position: absolute; top: -8px; left: 50%; width: 70px; height: 16px; transform: translateX(-50%) rotate(-3deg); background: #FCD877; opacity: .92;
  clip-path: polygon(0 0, 6% 25%, 0 50%, 6% 75%, 0 100%, 100% 100%, 94% 75%, 100% 50%, 94% 25%, 100% 0); }
.tut-ic { font-size: 30px; display: block; margin-bottom: 4px; }
.tut-card small { position: absolute; right: 14px; top: 12px; font: 700 11px "Space Mono", monospace; color: #8A7650; }
.tut-card h3 { margin: 4px 0 6px; font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.tut-card p { margin: 0; color: #3A2E22; line-height: 1.5; }
.tut-keys { font-size: 12.5px; color: var(--muted); line-height: 2; }
.tut-keys kbd { font: 700 11px "Space Mono", monospace; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.tut-dots { display: flex; justify-content: center; gap: 6px; margin: 4px 0 10px; }
.tut-dots i { width: 7px; height: 7px; border-radius: 50%; background: #D8CCB2; } .tut-dots i.on { background: var(--blue); width: 18px; border-radius: 4px; }
.tut-open { margin-top: 16px; }

/* =====================================================================
   Modo app (celular): tela cheia como um aplicativo. Prévia em cima,
   linha do tempo no meio, barra de abas em baixo; os painéis sobem como gavetas.
   ===================================================================== */
.rail .tab-edit, .sheet-x { display: none; }
.app-btn, .tut-btn { white-space: nowrap; }
html.appmode, html.appmode body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.appmode .app { display: flex; flex-direction: column; height: 100dvh; padding: 0; gap: 0; overflow: hidden; }
html.appmode .top { order: 0; flex: none; flex-wrap: nowrap; height: 52px; padding: 0 10px; gap: 6px; background: var(--island); border-bottom: 1px solid var(--line); }
html.appmode .top .ver, html.appmode .top .privacy, html.appmode .top .spacer, html.appmode .tut-btn span:last-child, html.appmode .app-btn span:last-child { display: none; }
html.appmode .brand { margin-inline-end: auto; }
html.appmode .brand b { font-size: 16px; }
html.appmode .top .pillsel { padding: 4px 8px; }
html.appmode .top .pillsel select { max-width: 92px; font-size: 12px; }
html.appmode #exportBtn { padding: 7px 12px; }
html.appmode #exportBtn span { display: none; }
html.appmode .acct-btn span { max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
html.appmode .stage { order: 1; flex: 1 1 auto; min-height: 0; border-radius: 0; padding: 8px 8px 6px; gap: 6px; }
html.appmode .screen-wrap { height: auto; }
html.appmode .transport { padding: 4px 6px 4px 4px; gap: 6px; }
html.appmode .transport .btn span { display: none; }
html.appmode .transport .btn { padding: 7px 9px; }
html.appmode .timeline { order: 2; flex: none; height: min(34dvh, 250px); border-radius: 0; border-left: 0; border-right: 0; }
html.appmode .tl-head { padding: 6px 8px 2px; gap: 6px; }
html.appmode .tl-hint, html.appmode .zoom input { display: none; }
html.appmode .tools button span { display: none; }
html.appmode .rail { order: 3; flex: none; flex-direction: row; gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: var(--island); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(15,27,45,.06); z-index: 60; }
html.appmode .rail .tab { flex: 1; min-width: 0; padding: 6px 2px; font-size: 10.5px; border-radius: 12px; }
html.appmode .rail .tab-edit { display: flex; }
html.appmode .rail .tab[aria-selected="true"] { color: var(--blue); }
/* gavetas */
html.appmode .side, html.appmode .insp {
  position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); height: 58dvh; z-index: 55; margin: 0;
  border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(15,27,45,.22); transform: translateY(110%); transition: transform .28s cubic-bezier(.2,.9,.3,1); visibility: hidden; }
html.appmode .side.open, html.appmode .insp.open { transform: none; visibility: visible; }
html.appmode .side::before, html.appmode .insp::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: #D8CCB2; margin: 8px auto 2px; flex: none; }
html.appmode .insp { overflow: auto; padding: 4px 16px 24px; }
html.appmode .sheet-x:not([hidden]) { display: grid; place-items: center; position: fixed; z-index: 70; right: 12px; bottom: calc(60px + env(safe-area-inset-bottom) + 58dvh - 46px);
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: #1D2433; color: #fff; font: 700 20px/1 var(--ui); box-shadow: 0 3px 8px rgba(0,0,0,.25); }
html.appmode .bubbles { transform: scale(.92); transform-origin: left center; }
html.appmode .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.appmode .fullbtn span { display: none; }
@media (hover: none) { .tl-inner .blk .hdl { width: 18px; } }
html.appmode .top { overflow-x: auto; scrollbar-width: none; }
html.appmode .brand b { display: none; }
html.appmode .top .pillsel.lang select { max-width: 64px; }
html.appmode .top .pillsel:not(.lang) select { max-width: 78px; }
html.appmode .top > * { flex: none; }
/* modo app: linha do tempo mais compacta e barra de ações embaixo da prévia */
html.appmode .tl-inner { padding-inline-start: 50px; }
html.appmode [dir="rtl"] .tl-inner { padding-left: 50px; }
html.appmode .track-name { left: -48px; width: 44px; font-size: 9.5px !important; padding: 0 2px; line-height: 1.1; text-align: center; overflow: hidden; }
html.appmode .track.big .track-name { font-size: 11px !important; }
html.appmode .track { height: 34px; }
html.appmode .track.big.t-video { height: 58px; }
html.appmode .track.t-scene { height: 36px; }
html.appmode .ruler { height: 24px; }
html.appmode .lane-empty { font-size: 10.5px; padding: 0 6px; text-align: center; line-height: 1.2; }
html.appmode .zoombox { display: none !important; }
html.appmode .fullbtn { padding: 6px 8px; }
html.appmode .bubbles.dock { position: absolute; left: 6px !important; right: 6px; top: auto !important; bottom: 6px; z-index: 9; flex-direction: row; gap: 6px; padding: 6px;
  overflow-x: auto; scrollbar-width: none; border-radius: 14px; transform: none; justify-content: flex-start; }
html.appmode .bubbles.dock::before { display: none; }
html.appmode .bubbles.dock .bubble { flex: none; padding: 8px 10px; font-size: 12px; white-space: nowrap; }
html.appmode .bubbles.dock .bub-x { position: static; flex: none; order: -1; width: 30px; height: 30px; align-self: center; }
html.appmode .stage { padding: 6px; }
html.appmode #screen { border-radius: 10px; }
/* minhas músicas */
#musicDrop { margin-bottom: 6px; }
.mylist { display: grid; gap: 8px; margin: 6px 0 4px; }
.mycard { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 30px 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.mycard.on { border-color: #9DC2FE; box-shadow: 0 0 0 3px var(--blue-soft); }
.myinfo b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.myinfo small { color: var(--muted); font-size: 11px; }
.mycard.on .myinfo small { color: var(--blue); font-weight: 700; }
.mycard .card-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; }
.mycard .card-del:hover { background: #FDECEC; color: #D92D20; }
.mylist .hint.empty { margin: 0; }
/* na aba Música o ícone é a nota musical: fica em pé (só a tesoura é que fica deitada) */
#musicDrop .drop-scissors { transform: none; }
#musicDrop:hover .drop-scissors { color: var(--blue); }
