[hidden] { display: none !important; }
@font-face { font-family: "Anton"; src: url(fonts/anton-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Bebas Neue"; src: url(fonts/bebas-neue-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Bangers"; src: url(fonts/bangers-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Luckiest Guy"; src: url(fonts/luckiest-guy-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Montserrat Black"; src: url(fonts/montserrat-latin-900-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url(fonts/permanent-marker-latin-400-normal.woff2) format("woff2"); font-display: swap; }

:root {
  --bg: #0b0b12;
  --panel: #14141f;
  --panel-2: #1c1c2b;
  --line: #2a2a3d;
  --text: #f2f2f7;
  --muted: #9a9ab0;
  --accent: #ff2e63;
  --accent-2: #ffe600;
  --ok: #22c55e;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.brand { font-family: "Anton", sans-serif; font-size: 24px; letter-spacing: .5px; text-decoration: none; display: inline-flex; align-items: center; }
.brand::before { content: ""; width: 1.25em; height: 1.25em; flex: none; margin-right: 8px; background: url(/logo-mark.svg) center / contain no-repeat; }
.brand span { color: var(--accent); }
.btn { text-decoration: none; display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.yellow { background: var(--accent-2); color: #111; }
input[type=text], input[type=url], input[type=number], select, textarea {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.muted { color: var(--muted); }

/* ---------- app ---------- */
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.topbar .spacer { flex: 1; }
.start { max-width: 760px; margin: 60px auto; padding: 0 16px; text-align: center; }
.start h1 { font-family: "Anton", sans-serif; font-weight: 400; font-size: 44px; line-height: 1.1; margin: 0 0 10px; }
.start h1 em { color: var(--accent-2); font-style: normal; }
.linkrow { display: flex; gap: 10px; margin-top: 24px; }
.linkrow input { flex: 1; font-size: 16px; padding: 14px 16px; }
.or { margin: 14px 0; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; cursor: pointer; color: var(--muted); }
.dropzone.drag { border-color: var(--accent); color: var(--text); }
.status { margin: 40px auto; text-align: center; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: #ff8a8a; }

.editor { display: grid; grid-template-columns: 280px 1fr 360px; gap: 18px; padding: 18px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.panel h3 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.clips { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 120px); overflow: auto; }
.clip { display: flex; gap: 10px; padding: 8px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; background: var(--panel-2); }
.clip.active { border-color: var(--accent); }
.clip img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; background: #000; }
.clip .score { font-weight: 800; color: var(--accent-2); }
.tag { display: inline-block; font-size: 11px; background: #2b2b40; padding: 1px 7px; border-radius: 99px; margin: 2px 2px 0 0; }

.stage { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.phone { width: min(360px, 100%); aspect-ratio: 9/16; background: #000; border-radius: 22px; overflow: hidden; border: 6px solid #222; position: relative; }
.phone canvas { width: 100%; height: 100%; display: block; }
.transport { display: flex; gap: 8px; align-items: center; width: min(560px, 100%); }
.transport input[type=range] { flex: 1; }
.timeline { position: relative; width: min(560px, 100%); height: 34px; background: var(--panel-2); border-radius: 8px; overflow: hidden; }
.timeline .sel { position: absolute; top: 0; bottom: 0; background: rgba(255,46,99,.35); border-left: 3px solid var(--accent); border-right: 3px solid var(--accent); }
.timeline .head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent-2); }

.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.seg { display: flex; background: var(--panel-2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--accent); color: #fff; }
.fonts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fonts button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px; cursor: pointer; font-size: 17px; }
.fonts button.on { border-color: var(--accent-2); }
.section { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.result video { width: 100%; border-radius: 10px; margin-top: 10px; background: #000; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: none; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.modal.open { display: flex; }
.modal .box { background: var(--panel); border-radius: var(--radius); padding: 16px; width: min(900px, 100%); }
.camsel { position: relative; width: 100%; user-select: none; cursor: crosshair; }
.camsel canvas { width: 100%; display: block; border-radius: 8px; }
.camsel .rect { position: absolute; border: 3px solid var(--accent-2); background: rgba(255,230,0,.12); pointer-events: none; }

@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .clips { flex-direction: row; overflow-x: auto; max-height: none; }
  .clip { min-width: 240px; }
}
@media (max-width: 560px) {
  .linkrow { flex-direction: column; }
  .start h1 { font-size: 34px; }
  .editor { padding: 10px; }
}
input[type=range] { width: 100%; accent-color: var(--accent); }
.dropzone.big { display:block; margin-top:28px; padding:56px 20px; background:var(--panel); transition:border-color .15s; }
.dropzone.big:hover { border-color: var(--accent); }

/* studio polish */
.topbar { position: sticky; top: 0; z-index: 9; background: rgba(11,11,18,.85); backdrop-filter: blur(10px); }
.toplinks { display: flex; gap: 16px; margin-left: 10px; }
.toplinks a { color: var(--muted); text-decoration: none; font-size: 14px; }
.toplinks a:hover { color: var(--text); }
.usage-pill { background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 13px; color: var(--muted); cursor: pointer; }
.usage-pill b { color: var(--text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; font-weight: 800; cursor: pointer; }
.auth-card { max-width: 420px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 30px 26px; }
.auth-card h1 { font-size: 34px; }
.auth-card a { color: var(--accent); }
.tips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.tips span { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.recent-h { text-align: left; margin: 40px 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; text-align: left; }
.recent a { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); }
.recent a:hover { border-color: var(--accent); }
.recent img, .recent .ph { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000; display: block; }
.recent .ph { display: grid; place-items: center; font-size: 28px; }
.recent div.t { padding: 8px 10px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent div.m { padding: 0 10px 10px; font-size: 12px; color: var(--muted); }
.progress-card { max-width: 480px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 30px; }
.steps { list-style: none; padding: 0; margin: 22px 0 16px; display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); counter-reset: s; }
.steps li { flex: 1; text-align: center; }
.steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; margin: 0 auto 6px; border-radius: 50%; border: 2px solid var(--line); font-weight: 800; }
.steps li.done { color: var(--text); }
.steps li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.cur { color: var(--text); font-weight: 700; }
.steps li.cur::before { border-color: var(--accent); color: var(--accent); }
.bar { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .5s ease; }
@media (max-width: 700px) { .toplinks { display: none; } .usage-pill { display: none; } .topbar { gap: 8px; padding: 12px; } }

/* ===== editor v2 ===== */
.ed { display: grid; grid-template-columns: 78px 340px 1fr; grid-template-rows: minmax(0, 1fr) 300px; height: calc(100vh - 65px); background: #0d0d16; }
.ed-rail { grid-row: 1 / 3; border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; }
.ed-rail button { background: none; border: 0; border-radius: 12px; color: var(--muted); font-size: 12px; font-weight: 600; padding: 10px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ed-rail button span { font-size: 20px; filter: grayscale(.6); }
.ed-rail button:hover { background: var(--panel-2); color: var(--text); }
.ed-rail button.on { background: rgba(255,46,99,.14); color: var(--text); }
.ed-rail button.on span { filter: none; }
.ed-panel { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.ed-panel-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.ed-panel-head h2 { margin: 0; font-size: 20px; }
.ed-panel-head .muted { font-size: 13px; }
.ed-panel-body { overflow: auto; padding: 14px; flex: 1; }
.card-s { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card-s-h { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.card-s label { margin-top: 10px; }
.card-s textarea { min-height: 110px; }
.ed .clips { max-height: none; overflow: visible; flex-direction: column; }
.ed .clip { background: var(--panel-2); border: 1px solid var(--line); padding: 10px; }
.ed .clip.active { border-color: var(--accent); background: rgba(255,46,99,.08); }
.ed .clip img { width: 110px; height: 62px; }
.layout-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.layout-pick button { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; padding: 10px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.layout-pick button.on { border-color: var(--accent); color: var(--text); }
.lp { width: 34px; height: 60px; border-radius: 6px; display: block; background: #3a3a55; position: relative; overflow: hidden; }
.lp-fill { background: linear-gradient(160deg, #7c2d12, #1f2937); }
.lp-cam { background: linear-gradient(#3b4fd8 0 38%, #7c2d12 38%); }
.lp-fit { background: #3b1d2e; }
.lp-fit::after { content: ""; position: absolute; left: 0; right: 0; top: 36%; bottom: 36%; background: linear-gradient(160deg, #7c2d12, #1f2937); }

.ed-stage { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ed-top { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.ed-top .spacer { flex: 1; }
.ed-title b { font-size: 16px; margin-right: 10px; }
.ed-title .muted { font-size: 13px; }
.btn.glow { box-shadow: 0 8px 30px -8px rgba(255,46,99,.7); }
.ed-preview { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background:
  radial-gradient(circle at 50% 40%, rgba(255,46,99,.08), transparent 60%),
  repeating-conic-gradient(#11111a 0 25%, #0d0d16 0 50%) 0 0 / 22px 22px; }
.ed-preview .phone { height: 100%; width: auto; max-width: 100%; aspect-ratio: 9/16; border: 2px solid var(--accent); border-radius: 6px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.8); }

.ed-timeline { grid-column: 2 / 4; border-top: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-width: 0; }
.tl-tools { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.tl-tools .spacer { flex: 1; }
.tl-tools input[type=range] { width: 120px; }
.ic { background: none; border: 0; color: var(--text); font-size: 18px; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; }
.ic:hover { background: var(--panel-2); }
.ic.play { background: var(--accent); width: 42px; height: 42px; border-radius: 50%; font-size: 16px; }
.tl-time { font-variant-numeric: tabular-nums; font-size: 14px; margin-left: 10px; min-width: 150px; }
.tl-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; position: relative; }
.tl-inner { position: relative; height: 100%; min-width: 100%; padding: 0 0 6px; user-select: none; cursor: pointer; }
.tl-ruler { height: 26px; position: relative; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.tl-ruler span { position: absolute; top: 6px; transform: translateX(-50%); white-space: nowrap; }
.tl-ruler i { position: absolute; bottom: 0; width: 1px; height: 6px; background: var(--line); }
.tl-track { position: relative; margin: 5px 0; border-radius: 8px; }
.tl-track.subs, .tl-track.txt { height: 30px; background: rgba(255,255,255,.02); }
.tl-track.subs b { position: absolute; top: 0; bottom: 0; background: rgba(124,58,237,.25); border: 1px solid rgba(124,58,237,.6); border-radius: 6px; font-size: 11px; font-weight: 600; padding: 0 6px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; color: #ddd6fe; }
.tl-track.vid { height: 50px; background: #1d1d2b center / 100% 100% no-repeat; border: 1px solid var(--line); overflow: hidden; }
.tl-track.aud { height: 42px; cursor: pointer; background: rgba(88,101,242,.08); border: 1px solid rgba(88,101,242,.25); overflow: hidden; }
.tl-track.aud canvas { width: 100%; height: 100%; display: block; }
.tl-label { position: absolute; left: 6px; top: 6px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.6); padding: 2px 7px; border-radius: 6px; pointer-events: none; }
.tl-dim { position: absolute; top: 26px; bottom: 0; background: rgba(8,8,14,.6); pointer-events: none; }
.tl-dim.l { left: 0; } .tl-dim.r { right: 0; }
.tl-sel { position: absolute; top: 26px; bottom: 0; border: 2px solid var(--accent); border-radius: 8px; pointer-events: none; }
.tl-sel .h { position: absolute; top: 0; bottom: 0; width: 14px; background: var(--accent); pointer-events: auto; cursor: ew-resize; }
.tl-sel .h::after { content: ""; position: absolute; left: 5px; top: 40%; height: 20%; width: 4px; border-left: 2px solid #fff; border-right: 2px solid #fff; box-sizing: border-box; }
.tl-sel .h.l { left: -2px; border-radius: 7px 0 0 7px; }
.tl-sel .h.r { right: -2px; border-radius: 0 7px 7px 0; }
.tl-head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent-2); pointer-events: none; }
.tl-head b { position: absolute; top: 0; left: -6px; width: 14px; height: 14px; background: var(--accent-2); border-radius: 3px 3px 50% 50%; }

@media (max-width: 1000px) {
  .ed { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; height: auto; }
  .ed-rail { grid-row: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .ed-rail button { flex: 1; min-width: 64px; }
  .ed-panel { order: 3; border-right: 0; }
  .ed-stage { order: 1; }
  .ed-preview { height: 62vh; }
  .ed-timeline { grid-column: auto; order: 2; height: 240px; }
  .tl-tools input[type=range], #zoomOut, #zoomIn, #zoomFit, #resetTrim { display: none; }
  .tl-time { min-width: 0; font-size: 12px; }
  #clipMeta { display: none; }
  .ed-timeline { height: 300px; }
}

/* ===== editor v3: editable tracks ===== */
.tl-track.txt b { position: absolute; top: 0; bottom: 0; background: rgba(255,230,0,.18); border: 1px solid rgba(255,230,0,.6); border-radius: 6px; font-size: 11px; font-weight: 700; padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; color: #fff7a8; }
.tl-track.subs b, .tl-track.txt b { cursor: grab; z-index: 2; }
.tl-track.subs b::before, .tl-track.subs b::after, .tl-track.txt b::before, .tl-track.txt b::after { content: ""; position: absolute; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.tl-track.subs b::before, .tl-track.txt b::before { left: 0; } .tl-track.subs b::after, .tl-track.txt b::after { right: 0; }
.tl-track b.on { outline: 2px solid #fff; outline-offset: -1px; z-index: 3; }
.tl-track .tl-label { z-index: 4; }
.tl-fade { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.tl-fade.in { background: linear-gradient(90deg, rgba(8,8,14,.85), transparent); }
.tl-fade.out { background: linear-gradient(270deg, rgba(8,8,14,.85), transparent); }
.lines { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: 340px; overflow: auto; }
.lines:empty { display: none; }
.ln { display: grid; grid-template-columns: 52px 1fr 26px; gap: 6px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px; }
.ln.on { border-color: var(--accent); }
.ln .t { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; cursor: pointer; }
.ln input { padding: 6px 8px; font-size: 13px; background: transparent; border: 0; }
.ln input:focus { background: var(--panel-2); }
.ln .x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; }
.ln .x:hover { color: var(--accent); }
.phone canvas { touch-action: none; }

/* ===== editor v4: pro polish ===== */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; display: block; }
.btn .ico { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; margin-right: 7px; }
.ed-rail button .ico { width: 22px; height: 22px; opacity: .8; }
.ed-rail button.on .ico { opacity: 1; color: var(--accent); }
.ed-rail button { transition: background .15s, color .15s; }
.ic { display: inline-flex; align-items: center; justify-content: center; color: #c9c9d6; transition: background .12s, color .12s, transform .08s; }
.ic:hover:not(:disabled) { color: #fff; }
.ic:active:not(:disabled) { transform: scale(.92); }
.ic:disabled { opacity: .3; cursor: default; }
.ic .ico { width: 18px; height: 18px; }
.ic.play { color: #fff; box-shadow: 0 6px 18px -6px rgba(255,46,99,.8); }
.ic.play .ico { width: 18px; height: 18px; }
.ic.play:hover { filter: brightness(1.1); }
.tl-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.tl-time { color: var(--muted); }
.tl-time b { color: var(--text); font-weight: 600; }
.tl-label { background: rgba(13,13,22,.85); color: #b9b9c9; letter-spacing: .3px; text-transform: uppercase; font-size: 10px; }
.tl-inner { cursor: text; }
.tl-hover { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.35); pointer-events: none; z-index: 5; }
.tl-hover span { position: absolute; top: 3px; left: 6px; font-size: 10px; font-weight: 600; background: #fff; color: #111; padding: 1px 5px; border-radius: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-snap { position: absolute; top: 26px; bottom: 0; width: 0; border-left: 1px dashed var(--accent-2); pointer-events: none; z-index: 6; }
.tl-head { z-index: 7; box-shadow: 0 0 8px rgba(255,230,0,.6); }
.tl-track b { transition: filter .12s, box-shadow .12s; }
.tl-track b:hover { filter: brightness(1.25); }
.tl-track b.on { box-shadow: 0 0 0 1px #fff, 0 4px 14px -4px rgba(0,0,0,.8); }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none !important; }
.pane:not([hidden]) { animation: paneIn .18s ease-out; }
@keyframes paneIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ed-preview .phone { transition: box-shadow .2s; }
@media (min-width: 1001px) {
  body.ed-on { overflow: hidden; height: 100vh; }
  body.ed-on .ed { height: calc(100vh - var(--tb, 65px)); }
}

/* ===== editor v5: grab-only playhead, selectable tracks ===== */
.tl-inner { cursor: default; }
.tl-head b { pointer-events: auto; cursor: grab; top: -1px; left: -8px; width: 18px; height: 18px; }
.tl-head i { position: absolute; top: 18px; bottom: 0; left: -5px; width: 12px; pointer-events: auto; cursor: ew-resize; }
.tl-head:hover b, body.dragging .tl-head b { transform: scale(1.12); }
.tl-track.vid, .tl-track.aud { cursor: pointer; transition: box-shadow .12s; }
.tl-track.on { box-shadow: 0 0 0 2px #fff inset, 0 0 0 1px rgba(255,255,255,.4); }
.tl-track b.editing { outline: 2px solid var(--accent-2); background: #1b1b28; color: #fff; cursor: text; overflow: visible; min-width: 120px; z-index: 8; user-select: text; }

/* ===== editor v6: stickers, effects, music, cuts ===== */
.ed { grid-template-rows: minmax(0, 1fr) auto; }
.ed-timeline { min-height: 300px; }
.tl-scroll { min-height: 230px; }
.tl-track.stk, .tl-track.fx, .tl-track.mus { height: 26px; background: rgba(255,255,255,.02); }
.tl-track.stk b { position: absolute; top: 0; bottom: 0; background: rgba(34,197,94,.2); border: 1px solid rgba(34,197,94,.65); border-radius: 6px; font-size: 11px; font-weight: 700; padding: 0 8px 0 4px; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; color: #bbf7d0; }
.tl-track.stk b img { height: 18px; width: auto; pointer-events: none; }
.tl-track.fx b { position: absolute; top: 0; bottom: 0; background: rgba(56,189,248,.2); border: 1px solid rgba(56,189,248,.65); border-radius: 6px; font-size: 11px; font-weight: 700; padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; color: #bae6fd; }
.tl-track.mus b { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(90deg, rgba(251,146,60,.28) 0 3px, rgba(251,146,60,.14) 3px 6px); border: 1px solid rgba(251,146,60,.7); border-radius: 6px; font-size: 11px; font-weight: 700; padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; color: #fed7aa; }
.tl-track.stk b, .tl-track.fx b, .tl-track.mus b { cursor: grab; z-index: 2; }
.tl-track.stk b::before, .tl-track.stk b::after, .tl-track.fx b::before, .tl-track.fx b::after { content: ""; position: absolute; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.tl-track.stk b::before, .tl-track.fx b::before { left: 0; } .tl-track.stk b::after, .tl-track.fx b::after { right: 0; }
.segs { position: absolute; inset: 0; z-index: 1; }
.segs .cut { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(8,8,14,.88) 0 6px, rgba(40,40,56,.88) 6px 12px); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; }
.segs .cut button { background: #fff; color: #111; border: 0; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 3px 9px; cursor: pointer; white-space: nowrap; }
.segs .split { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px #000; }
.segs .pick { position: absolute; top: 0; bottom: 0; border: 2px solid #fff; border-radius: 6px; background: rgba(255,255,255,.12); pointer-events: none; }
.upl { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.stk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stk-grid button { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; height: 74px; padding: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color .12s, transform .08s; }
.stk-grid button:hover { border-color: var(--accent); }
.stk-grid button:active { transform: scale(.95); }
.stk-grid img { max-width: 100%; max-height: 100%; }
.flt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.flt-grid button { background: none; border: 2px solid transparent; border-radius: 10px; padding: 0; cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 600; overflow: hidden; }
.flt-grid button img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 8px; }
.flt-grid button span { display: block; padding: 4px 0 2px; }
.flt-grid button.on { border-color: var(--accent); color: var(--text); }
.seg-s { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; background: var(--panel); border-radius: 10px; padding: 4px; }
.seg-s button { background: none; border: 0; border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 700; padding: 8px 0; cursor: pointer; }
.seg-s button.on { background: var(--accent); color: #fff; }
