/* Klipo — "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" "rail 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], 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, 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: 68px; padding-bottom: 6px; }
[dir="rtl"] .tl-scroll { direction: ltr; }
[dir="rtl"] .tl-inner { padding-inline-start: 0; padding-left: 68px; }
.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" "rail 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: #F3EFE6;
  --island: #FFFDF8;
  --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);
}
body { background-color: var(--bg); background-image: var(--paper-noise), var(--paper-fiber); }
.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 fita-cola */
.track-name { background: rgba(252,228,160,.78); color: #6B5320; border-radius: 2px; transform: rotate(-1.2deg);
  clip-path: polygon(0 6%, 6% 0, 12% 5%, 18% 0, 24% 6%, 30% 0, 36% 5%, 42% 0, 48% 6%, 54% 0, 60% 5%, 66% 0, 72% 6%, 78% 0, 84% 5%, 90% 0, 96% 6%, 100% 2%, 100% 98%, 94% 100%, 88% 95%, 82% 100%, 76% 94%, 70% 100%, 64% 95%, 58% 100%, 52% 94%, 46% 100%, 40% 95%, 34% 100%, 28% 94%, 22% 100%, 16% 95%, 10% 100%, 4% 94%, 0 98%); }
.track:nth-child(3) .track-name { background: rgba(200,226,255,.85); color: #1F4FD1; transform: rotate(1deg); }
.track:nth-child(4) .track-name { background: rgba(196,240,214,.9); color: #0B8A4F; transform: rotate(-.6deg); }
/* 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; }
