/* «Лента» — the scene editor under the stage, «Объект» over the settings, the object's frame on
   the stage. Loaded after skin.css; same tokens (type 12/14/16, spacing 4…32, radii 8/12/16).
   The language of motion tools: ◆ a key (hollow — still, outlined — animated, filled — a key
   here), a block between two keys, hatching for a transition, the playhead in white. */

/* ---------- the strip ---------- */
.tl { grid-area: tl; position: relative; z-index: 8; min-width: 0; display: grid; grid-template-rows: auto auto; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); container-type: inline-size; overflow-x: clip; outline: none; }
.tl__bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); row-gap: 6px; padding: var(--s2) var(--s3); min-height: 56px; }
.tl__play { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--pill); background: var(--text); color: var(--on-acid); border: 0; flex: none; cursor: pointer; }
.tl__play:hover:not(:disabled) { background: #fff; }
.tl__play svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 2; pointer-events: none; }
.tl__play .i-pause, .tl.is-playing .tl__play .i-play { display: none; }
.tl.is-playing .tl__play .i-pause { display: block; }
.tl__play:disabled { opacity: .35; cursor: default; }
.tl__time { font-size: var(--fs-s); color: var(--mute); white-space: nowrap; min-width: 80px; margin-right: var(--s2); }
.tl__time b { color: var(--text); font-weight: 500; }
.tl__bar .btn { white-space: nowrap; min-height: 36px; }
.tl__bar .btn:disabled { opacity: .4; }
.tl__act { padding: 0 var(--s3); }
.tl__sp { flex: 1; }
.tl__scene { display: inline-flex; align-items: center; gap: 6px; border-color: transparent; color: var(--mute); max-width: 320px; }
.tl__scene span { overflow: hidden; text-overflow: ellipsis; }
.tl__scene svg { width: 16px; height: 16px; flex: none; }
.tl__scene:hover { color: var(--text); background: var(--raise); }
.tl__loop { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r); border: 0; background: transparent; color: var(--mute); cursor: pointer; }
.tl__loop svg { width: 18px; height: 18px; pointer-events: none; }
.tl__loop:hover { color: var(--text); background: var(--raise); }
.tl__loop[aria-pressed="true"] { color: var(--acid); }
.tl__loop[hidden], .tl__bar [hidden] { display: none; }
.tl__fold { flex: none; }
.tl__fold svg { transition: transform var(--ease); }
.tl.is-folded .tl__fold svg { transform: rotate(180deg); }
.tl.is-folded .tl__body, .tl.is-folded .tl__grip { display: none; }
.tl__short { display: none; }

.tl__body { height: var(--tl-body, 240px); display: flex; flex-direction: column; border-top: 1px solid var(--line); min-width: 0; overflow: hidden; border-radius: 0 0 var(--r-l) var(--r-l); }
.tl__grip { position: absolute; left: 0; right: 0; top: -8px; height: 12px; z-index: 6; cursor: ns-resize; touch-action: none; }
.tl__grip::after { content: ""; position: absolute; left: 50%; top: 4px; width: 48px; height: 3px; margin-left: -24px; border-radius: var(--pill); background: var(--line-2); transition: background var(--ease); }
.tl__grip:hover::after, .tl__grip:focus-visible::after { background: var(--mute); }
.is-resizing-v, .is-resizing-v * { cursor: ns-resize !important; user-select: none; }

/* before a scene: what it is and a ready start */
.tl__start { display: flex; align-items: center; gap: var(--s6, 24px); padding: var(--s4) var(--s4) var(--s4) var(--s6, 24px); overflow-y: auto; }
.tl__start[hidden], .tl__grid[hidden] { display: none; }
.tl__starttxt { flex: 1 1 320px; max-width: 60ch; }
.tl__starth { margin: 0 0 var(--s1); font-size: var(--fs); font-weight: 500; color: var(--text); line-height: 1.3; }
.tl__start p:not(.tl__starth) { margin: 0; font-size: var(--fs-s); color: var(--mute); line-height: 1.5; }
.tl__quick { flex: 1 1 360px; display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- the grid: names on the left, lanes on the right ---------- */
.tl__grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 208px minmax(0, 1fr); align-content: start; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--hover) transparent; }
.tl__names { border-right: 1px solid var(--line); background: var(--panel); position: sticky; left: 0; z-index: 3; }
.tl__rname { height: 36px; display: flex; align-items: center; gap: 2px; padding: 0 var(--s1) 0 var(--s3); border-bottom: 1px solid var(--line); }
.tl__rname--top { height: 28px; padding-left: var(--s2); gap: 0; }
.tl__rname--look { height: 48px; }
.tl__rname--add { border-bottom: 0; }
.tl__rn { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: var(--fs-s); color: var(--text); white-space: nowrap; overflow: hidden; }
.tl__rn b { font-weight: 500; }
.tl__rn small { font-size: var(--fs-xs); color: var(--mute); overflow: hidden; text-overflow: ellipsis; }
.tl__rname--look .tl__rn { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.3; }
.tl__z { height: 24px; min-width: 24px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.tl__z:hover { color: var(--text); background: var(--raise); }
.tl__zfit { margin: 0 2px; }
.tl__addrow { position: relative; font-size: var(--fs-s); color: var(--mute); display: inline-flex; align-items: center; height: 100%; cursor: pointer; }
.tl__addrow:hover { color: var(--text); }
.tl__addrow select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.tl__rx { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--faint); font-size: 16px; cursor: pointer; opacity: 0; }
.tl__rname:hover .tl__rx, .tl__rx:focus-visible { opacity: 1; }
.tl__rx:hover { background: var(--raise); color: var(--text); }

/* ◆ — the same key toggle here, in «Объект» and next to a slider */
.kd { width: 28px; height: 28px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--faint); cursor: pointer; }
.kd svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; pointer-events: none; }
.kd:hover { background: var(--raise); color: var(--text); }
.kd[data-state="anim"] { color: var(--acid); }
.kd[data-state="key"] { color: var(--acid); }
.kd[data-state="key"] svg { fill: currentColor; }
.kd[hidden] { display: none; }
.rng__top .kd { width: 24px; height: 24px; margin: -4px -4px -4px 4px; align-self: center; }
.rng__top .kd svg { width: 12px; height: 12px; }

.tl__scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--hover) transparent; }
.tl__lanes { position: relative; min-height: 100%; cursor: default; user-select: none; touch-action: pan-y; }
.tl__ruler { position: relative; height: 28px; border-bottom: 1px solid var(--line); overflow: hidden; cursor: ew-resize; }
.tl__tick { position: absolute; bottom: 0; width: 1px; height: 5px; background: var(--line-2); }
.tl__tick--n { height: 28px; width: auto; background: transparent; padding: 5px 0 0 4px; border-left: 1px solid var(--line-2); font-size: var(--fs-xs); line-height: 1.3; color: var(--faint); white-space: nowrap; }
.tl__lane { position: relative; height: 36px; border-bottom: 1px solid var(--line); }
.tl__lane--look { height: 48px; }
.tl__lane--add { border-bottom: 0; height: 36px; }
.tl__base { position: absolute; top: 50%; height: 1px; background: var(--line-2); pointer-events: none; }

/* the look track: a stretch per look, the transition hatched at its start */
.tl__seg { position: absolute; top: 5px; bottom: 5px; border-radius: var(--r); background: var(--raise); border: 1px solid var(--line-2); overflow: hidden; cursor: pointer; }
.tl__seg:hover { background: var(--hover); }
.tl__seg[data-sel="true"] { border-color: var(--acid); }
.tl__segbody { position: absolute; inset: 0; display: flex; align-items: center; gap: 6px; padding-right: 8px; pointer-events: none; }
.tl__segbody img { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; flex: none; }
.tl__segn { font-size: var(--fs-xs); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl__chip { position: absolute; left: 0; top: 0; bottom: 0; z-index: 2; display: flex; align-items: center; padding: 0 6px; border: 0; border-right: 1px dashed rgba(232, 232, 12, .6); background: repeating-linear-gradient(135deg, rgba(232, 232, 12, .2) 0 4px, transparent 4px 9px); color: var(--acid); font: inherit; font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; cursor: pointer; }
.tl__chip span { background: rgba(5, 5, 6, .75); padding: 1px 4px; border-radius: 4px; pointer-events: none; }
.tl__chip:hover { background-color: rgba(232, 232, 12, .08); }
.tl__chip i { position: absolute; right: -6px; top: 0; bottom: 0; width: 12px; cursor: ew-resize; }
.tl__chip--none { width: auto; background: transparent; border-right: 0; color: var(--faint); }
.tl__chip--none span { background: transparent; }
.tl__chip--none:hover { color: var(--text); background: transparent; }
.tl__cut { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; z-index: 3; cursor: ew-resize; }
.tl__cut::after { content: ""; position: absolute; left: 2px; top: 8px; bottom: 8px; width: 2px; border-radius: 1px; background: var(--line-2); }
.tl__seg:hover .tl__cut::after { background: var(--mute); }

/* animated properties: a block from key to key, the keys on its ends */
/* the button lies between the two keys (they stay grabbable); the bar under it runs key to key */
.tl__blk { position: absolute; top: 1px; bottom: 2px; display: flex; align-items: center; gap: 4px; padding: 0 2px; border: 0; background: transparent; color: var(--acid); font: inherit; font-size: var(--fs-xs); white-space: nowrap; cursor: grab; }
.tl__blk::before { content: ""; position: absolute; left: calc(-1 * var(--kh, 14px)); right: calc(-1 * var(--kh, 14px)); top: 50%; height: 18px; margin-top: -9px; border-radius: 4px; background: rgba(232, 232, 12, .18); z-index: -1; }
.tl__blk:hover::before { background: rgba(232, 232, 12, .28); }
.tl__blk[aria-pressed="true"]::before { background: rgba(232, 232, 12, .4); }
.tl__blk[aria-pressed="true"] { color: var(--text); }
.tl__blk span { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); opacity: .85; pointer-events: none; }
.tl__blk--hold::before { background: transparent; border-top: 2px dotted var(--line-2); border-radius: 0; height: 0; margin-top: -1px; }
.tl__blk--hold:hover::before, .tl__blk--hold[aria-pressed="true"]::before { background: transparent; border-top-color: var(--acid); }
.tl__blk .ez { width: 16px; height: 16px; flex: none; }
.tl__lane[data-g] { isolation: isolate; }
.tl__key { position: absolute; top: 4px; z-index: 2; width: 28px; height: 28px; margin-left: -14px; padding: 0; border: 0; background: transparent; cursor: grab; }
.tl__key::before { content: ""; position: absolute; left: 8px; top: 8px; width: 12px; height: 12px; transform: rotate(45deg); border-radius: 2px; border: 2px solid var(--panel); background: var(--text); box-sizing: content-box; margin: -2px; }
.tl__key:hover::before { background: #fff; }
.tl__key[aria-pressed="true"]::before { background: var(--acid); }
.tl__key:focus-visible, .tl__blk:focus-visible, .tl__chip:focus-visible { outline: 2px solid var(--acid); outline-offset: 1px; }
.tl__marq { position: absolute; z-index: 6; border: 1px solid var(--acid); background: rgba(232, 232, 12, .08); pointer-events: none; }
.tl__marq[hidden] { display: none; }
.tl__head { position: absolute; left: 0; top: 0; bottom: 0; width: 0; z-index: 5; pointer-events: none; will-change: transform; }
.tl__head i { position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: var(--text); }
.tl__head i::before { content: ""; position: absolute; left: -5px; top: 0; width: 12px; height: 12px; border-radius: 2px 2px 6px 6px; background: var(--text); }
.ez { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- popovers over the strip ---------- */
.tl__pop { position: absolute; z-index: 40; width: 320px; max-height: min(70vh, 560px); overflow-y: auto; display: grid; gap: var(--s2); align-content: start; padding: var(--s4); border-radius: var(--r-l); background: var(--panel); box-shadow: var(--float); scrollbar-width: thin; }
.tl__pop--wide { width: 520px; }
.tl__pop[hidden] { display: none; }
.tl__pop .seg { margin: 0; }
.tl__pop .seg button:disabled { opacity: .35; cursor: default; }
.tl__seg2 button { flex: 1 1 40%; }
.tl__seg4 button { flex: 1 1 22%; }
.tl__seg1 { flex-direction: column; }
.tl__poph { margin: var(--s2) 0 0; font-size: var(--fs-xs); color: var(--faint); }
.tl__poph:first-child { margin: 0; font-size: var(--fs-s); color: var(--text); font-weight: 500; }
.tl__popg { margin: var(--s2) 0 0; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.tl__popv { margin: 0; font-size: var(--fs-s); color: var(--mute); }
.tl__popn { margin: 0; font-size: var(--fs-xs); color: var(--mute); line-height: 1.5; }
.tl__popact { display: flex; justify-content: space-between; gap: var(--s2); }
.tl__popact:empty { display: none; }
.tl__popact .link { min-height: 36px; }
.tl__del { color: var(--mute); }
.tl__del:hover { color: #ff8a7a; }
.tl__field { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-s); color: var(--mute); white-space: nowrap; }
.tl__field input[type="text"] { width: 72px; height: 36px; padding: 0 8px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--sunk); color: var(--text); font: inherit; }
.tl__field input:focus-visible { outline: 2px solid var(--acid); outline-offset: 1px; }
.tl__field--wide { display: grid; gap: 6px; }
.tl__fields { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.tl__ezs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.tl__ezs button { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border: 1px solid transparent; border-radius: var(--r); background: var(--sunk); color: var(--mute); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.tl__ezs button .ez { width: 28px; height: 28px; }
.tl__ezs button:hover { color: var(--text); }
.tl__ezs button[aria-pressed="true"] { color: var(--acid); border-color: rgba(232, 232, 12, .5); background: var(--raise); }
.tl__menu { display: grid; gap: 1px; margin: 0 calc(-1 * var(--s2)); }
.tl__menu button { display: flex; align-items: center; gap: var(--s2); min-height: 36px; padding: 0 var(--s2); border: 0; border-radius: var(--r); background: transparent; color: var(--text); font: inherit; font-size: var(--fs-s); text-align: left; cursor: pointer; }
.tl__menu button:hover, .tl__menu button:focus-visible { background: var(--raise); outline: none; }
.tl__menu button small { margin-left: auto; font-size: var(--fs-xs); color: var(--faint); }
.tl__menu .ez { width: 18px; height: 18px; color: var(--mute); }
.tl__pop:has(> .tl__menu:only-child) { width: 240px; padding: var(--s2) var(--s3); }
.tl__looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--s2); }
.tl__lk { display: grid; gap: 4px; padding: 4px; border: 1px solid transparent; border-radius: var(--r-m); background: transparent; color: var(--mute); font: inherit; font-size: var(--fs-xs); text-align: left; cursor: pointer; }
.tl__lk img, .tl__lk i { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r); object-fit: cover; background: var(--sunk); }
.tl__lk span { padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl__lk:hover { color: var(--text); background: var(--raise); }
.tl__lk:focus-visible { outline: 2px solid var(--acid); outline-offset: 1px; }

/* ---------- «Объект»: place, size, turn of the object ---------- */
.obj { display: grid; gap: var(--s2); padding-bottom: var(--s4); margin-bottom: var(--s4); border-bottom: 1px solid var(--line-2); }
.obj[hidden] { display: none; }
.obj__head .set3__h { margin: 0; }
.obj__note { margin: 2px 0 var(--s1); font-size: var(--fs-xs); color: var(--faint); line-height: 1.5; }
.obj__row { display: grid; grid-template-columns: 84px minmax(0, 1fr) 28px; align-items: center; gap: var(--s2); }
.obj__n { font-size: var(--fs-s); color: var(--text); }
.obj__row[data-state="anim"] .obj__n, .obj__row[data-state="key"] .obj__n { color: var(--acid); }
.obj__fs { display: flex; gap: 6px; min-width: 0; }
.nf { flex: 1 1 0; min-width: 0; display: flex; align-items: center; height: 32px; border-radius: var(--r); background: var(--sunk); box-shadow: 0 0 0 1px var(--line-2); }
.nf:focus-within { box-shadow: 0 0 0 2px var(--acid); }
.nf__l { flex: none; width: 24px; height: 100%; display: grid; place-items: center; font-size: var(--fs-xs); color: var(--faint); cursor: ew-resize; touch-action: none; user-select: none; }
.nf__l:hover { color: var(--text); }
.nf input { flex: 1; min-width: 0; width: 100%; height: 100%; padding: 0 2px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-s); }
.nf[data-solo="true"] input { padding-left: 10px; }
.nf input:focus { outline: none; }
.nf__u { flex: none; padding-right: 8px; font-size: var(--fs-xs); color: var(--faint); }
.obj__row[data-state="key"] .nf { box-shadow: 0 0 0 1px rgba(232, 232, 12, .5); }
.is-scrubbing, .is-scrubbing * { cursor: ew-resize !important; user-select: none; }

/* the look under the playhead, over the settings */
.frm { display: grid; gap: 2px; padding-bottom: var(--s4); margin-bottom: var(--s4); border-bottom: 1px solid var(--line-2); }
.frm[hidden] { display: none; }
.frm__k { margin: 0; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.frm__h { margin: 0; font-size: var(--fs); font-weight: 500; line-height: 1.3; color: var(--text); }
.frm__note { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--faint); line-height: 1.5; }

/* ---------- the object's frame on the stage ---------- */
.v3__stage { user-select: none; -webkit-user-select: none; }
.gz { position: absolute; z-index: 3; border: 1px solid rgba(232, 232, 12, .55); border-radius: 2px; pointer-events: none; }
.gz[hidden] { display: none; }
.gz b { position: absolute; width: 10px; height: 10px; margin: -6px; border: 2px solid var(--acid); border-radius: 2px; background: var(--bg); pointer-events: auto; touch-action: none; }
.gz b::after { content: ""; position: absolute; inset: -12px; }
.gz [data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.gz [data-h="se"] { right: 0; bottom: 0; cursor: nwse-resize; }
.gz [data-h="ne"] { right: 0; top: 0; cursor: nesw-resize; }
.gz [data-h="sw"] { left: 0; bottom: 0; cursor: nesw-resize; }
.gz .gz__turn { left: 50%; top: -28px; margin-left: -6px; border-radius: 50%; cursor: ew-resize; }
.gz .gz__turn::before { content: ""; position: absolute; left: 50%; top: 10px; width: 1px; height: 16px; background: rgba(232, 232, 12, .55); }
.gz.is-drag { border-color: var(--acid); }
canvas.v3__gl[data-over="in"] { cursor: move; }
canvas.v3__gl[data-over="out"] { cursor: grab; }

/* ---------- narrow strip: the stage column can be squeezed, phones ---------- */
@container (max-width: 900px) {
  .tl__long { display: none; } .tl__short { display: inline; }
  #tlAll { display: none; } .tl__time { min-width: 0; }
  .tl__scene { max-width: 200px; }
}
@container (max-width: 600px) {
  .tl__grid { grid-template-columns: 136px minmax(0, 1fr); }
  .tl__rn small { display: none; }
  .tl__zfit { display: none; }
  .tl__bar { gap: 4px; padding: var(--s2); }
  .tl__time { display: none; }
}
@media (max-width: 899px) {
  .tl { border-radius: 0; border-width: 1px 0; }
  .tl__body { height: auto; }
  .tl__grid { max-height: 210px; }
  .tl__grip { display: none; }
  .tl__start { flex-direction: column; align-items: stretch; padding: var(--s4); gap: var(--s3); }
  .tl__pop, .tl__pop--wide { position: fixed; left: var(--s4); right: var(--s4); top: 64px; bottom: auto; width: auto; max-height: calc(100vh - 140px); }
}
@media (pointer: coarse), (max-width: 899px) {
  .tl__bar .btn, .tl__play, .tl__loop { min-height: 44px; min-width: 44px; }
  .tl__play { width: 44px; height: 44px; }
  .tl__rname, .tl__lane { height: 48px; }
  .tl__rname--look, .tl__lane--look { height: 56px; }
  .tl__rname--top, .tl__ruler { height: 44px; }
  .tl__tick--n { height: 44px; padding-top: 12px; }
  .tl__z { height: 44px; min-width: 44px; }
  .kd, .tl__rx { width: 44px; height: 44px; }
  .tl__rx { opacity: 1; }
  .tl__key { top: 2px; width: 44px; height: 44px; margin-left: -22px; }
  .tl__key::before { left: 16px; top: 16px; }
  .tl__blk::before { height: 22px; margin-top: -11px; }
  .tl__blk--hold::before { height: 0; margin-top: -1px; }
  .tl__seg { top: 3px; bottom: 3px; }
  .tl__chip { min-width: 48px; }
  .tl__chip i, .tl__cut { display: none; }          /* on a finger: start and length are fields in the transition */
  .tl__menu button, .tl__popact .link { min-height: 44px; }
  .tl__field input[type="text"], .nf { height: 44px; }
  .nf__l { width: 32px; }
  .obj__row { grid-template-columns: 84px minmax(0, 1fr) 44px; }
  .gz b { width: 16px; height: 16px; margin: -9px; }
  .gz .gz__turn { top: -36px; margin-left: -9px; }
}
@media (prefers-reduced-motion: reduce) { .tl__fold svg, .tl__grip::after { transition: none; } }
.toast .toast__act { color: inherit; font-weight: 500; }
/* before a scene: the bar is only a title, the body only as tall as its text */
.tl__title { display: none; font-size: var(--fs-s); font-weight: 500; color: var(--text); padding-left: var(--s1); }
.tl:not(.has-scene) .tl__title { display: inline; }
.tl:not(.has-scene) :is(.tl__play, .tl__time, .tl__act, .tl__scene, .tl__loop) { display: none; }
.tl:not(.has-scene) .tl__sp { order: 1; }
.tl:not(.has-scene) .tl__fold { order: 2; }
.tl:not(.has-scene) .tl__body { height: auto; }
@media (pointer: coarse), (max-width: 899px) { .tl__rx { display: none; } }
.tl__scenebtn { display: inline-grid; justify-items: start; gap: 0; padding: 6px var(--s3); min-height: 48px; border-color: rgba(232, 232, 12, .5); line-height: 1.3; text-align: left; }
.tl__scenebtn b { font-weight: 500; }
.tl__scenebtn small { font-size: var(--fs-xs); color: var(--mute); }

/* ===== transitions as in CapCut: a block on the cut, half on each side, ⋈ inside ===== */
.tl__trb { position: absolute; top: 3px; bottom: 3px; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0; border: 1px solid rgba(232, 232, 12, .55); border-radius: 4px; background: repeating-linear-gradient(135deg, rgba(232, 232, 12, .22) 0 4px, rgba(12, 12, 14, .82) 4px 9px); color: var(--acid); font: inherit; font-size: var(--fs-xs); white-space: nowrap; overflow: visible; cursor: grab; }
.tl__trb:hover { border-color: var(--acid); }
.tl__trb[aria-pressed="true"] { border: 1px solid #fff; box-shadow: 0 0 0 1px #fff; }
.tl__trb[aria-pressed="true"]::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--acid); pointer-events: none; }
.tl__trb--in[aria-pressed="true"]::after { display: none; }
.tl__trb span { overflow: hidden; text-overflow: ellipsis; pointer-events: none; background: rgba(5, 5, 6, .75); padding: 0 4px; border-radius: 3px; }
.tl__bow { width: 18px; height: 18px; flex: none; fill: currentColor; pointer-events: none; }
.tl__trb i { position: absolute; top: -3px; bottom: -3px; width: 8px; cursor: ew-resize; z-index: 1; }
.tl__trb i[data-h="trl"] { left: -4px; }
.tl__trb i[data-h="trr"] { right: -4px; }
.tl__trb i::after { content: ""; position: absolute; left: 3px; top: 30%; bottom: 30%; width: 2px; border-radius: 1px; background: transparent; }
.tl__trb:hover i::after, .tl__trb[aria-pressed="true"] i::after { background: #fff; }
.tl__cutglow { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--acid); box-shadow: 0 0 12px rgba(232, 232, 12, .8); z-index: 4; pointer-events: none; }
.tl__cutglow[hidden], .tl__snapl[hidden], .tl__hov[hidden] { display: none; }
.tl__snapl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--acid); z-index: 6; pointer-events: none; }
.tl__hov { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .35); z-index: 4; pointer-events: none; }
.tl__dropg { position: absolute; top: 5px; bottom: 5px; z-index: 4; display: flex; align-items: center; padding: 0 8px; border: 1px dashed var(--acid); border-radius: var(--r); background: rgba(232, 232, 12, .12); color: var(--text); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; pointer-events: none; }
.tl__ghost { position: fixed; left: 0; top: 0; z-index: 100; padding: 6px 10px; border-radius: var(--r); background: var(--raise); color: var(--mute); font-size: var(--fs-xs); box-shadow: var(--float); pointer-events: none; white-space: nowrap; }
.tl__ghost.is-on { color: var(--on-acid); background: var(--acid); }
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none; }
.v3__card img { -webkit-user-drag: none; }

/* the transitions library */
.tl__trs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.tl__trc { display: grid; gap: 4px; padding: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--sunk); color: var(--text); font: inherit; font-size: var(--fs-xs); text-align: left; cursor: grab; touch-action: none; }
.tl__trc:hover { border-color: var(--acid); }
.tl__trc b { font-weight: 500; }
.tl__trc small { color: var(--faint); }
.tl__trv { display: block; height: 32px; border-radius: 6px; background: linear-gradient(90deg, #6b5a2a 0 50%, #2a4a6b 50%); }
.tl__trv--morph { background: linear-gradient(90deg, #6b5a2a, #2a4a6b); }
.tl__trv--dust { background: radial-gradient(circle, #c9a95a 1px, transparent 1.5px) 0 0 / 6px 6px, linear-gradient(180deg, #6b5a2a, #2a4a6b); }
.tl__trv--smooth { background: linear-gradient(90deg, #6b5a2a 30%, #2a4a6b 70%); }
.tl__trv--dip { background: linear-gradient(90deg, #6b5a2a, #050506 50%, #2a4a6b); }
.tl__trv--gather, .tl__trv--scatter { background: radial-gradient(circle, #c9a95a 1.2px, transparent 1.7px) 0 0 / 7px 7px, #121214; }

/* the transition's panel takes the right column (the rest steps aside while it is open) */
.trp { display: none; }
.v3__set[data-mode="tr"] .trp { display: grid; gap: var(--s3); }
.v3__set[data-mode="tr"] .sheet__body > :not(.trp), .v3__set[data-mode="tr"] .set3__act { display: none !important; }
.trp__head { display: flex; align-items: center; justify-content: space-between; }
.trp__head .set3__h { margin: 0; }
.trp__where { margin: 0; font-size: var(--fs); font-weight: 500; color: var(--text); line-height: 1.3; }
.trp__types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.trp__types button { min-height: 40px; padding: 0 var(--s2); border: 1px solid var(--line-2); border-radius: var(--r); background: var(--sunk); color: var(--mute); font: inherit; font-size: var(--fs-s); text-align: left; cursor: pointer; }
.trp__types button:hover { color: var(--text); }
.trp__types button[aria-pressed="true"] { color: var(--text); border-color: var(--acid); background: var(--raise); }
.trp__note, .trp__lim { margin: 0; font-size: var(--fs-xs); color: var(--faint); line-height: 1.5; }
.trp__h { margin: var(--s2) 0 0; font-size: var(--fs-xs); color: var(--faint); }
.trp__row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: var(--s2); font-size: var(--fs-s); color: var(--text); }
.trp__row:not(:has(.nf)) { grid-template-columns: 96px minmax(0, 1fr); }
.trp__row input[type="range"] { width: 100%; accent-color: var(--acid); }
.trp__nf { width: 104px; flex: none; }
.trp__act { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line); }

/* ▲▼ inside a number field: shown on hover and focus */
.nf { position: relative; }
.nf__st { display: none; flex-direction: column; flex: none; height: 100%; border-left: 1px solid var(--line-2); }
.nf:hover .nf__st, .nf:focus-within .nf__st { display: flex; }
.nf__st button { flex: 1; width: 18px; padding: 0; border: 0; background: transparent; color: var(--faint); font-size: 8px; line-height: 1; cursor: pointer; }
.nf__st button:hover { color: var(--text); background: var(--raise); }
/* ‹ ◆ › — to the previous key, set or remove one here, to the next key */
.kn { display: inline-flex; align-items: center; flex: none; }
.kn[hidden], .kn__a[hidden] { display: none; }
.kn__a { width: 18px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--faint); font-size: 16px; line-height: 1; cursor: pointer; }
.kn__a:hover { color: var(--text); background: var(--raise); }
.obj__row { grid-template-columns: 84px minmax(0, 1fr) auto; }
.obj__row .kn { min-width: 64px; justify-content: flex-end; }
.rng__top .kn { margin: -4px -4px -4px 4px; }
.rng__top .kn__a { height: 24px; }

/* the stage: a value next to the frame while it is turned or sized; the lines it sticks to */
.gz__tip { position: absolute; left: 50%; top: -60px; transform: translateX(-50%); padding: 2px 8px; border-radius: var(--pill); background: var(--acid); color: var(--on-acid); font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; pointer-events: none; }
.gz__tip[hidden] { display: none; }
.sg { position: absolute; z-index: 4; background: var(--acid); pointer-events: none; }
.sg--v { width: 1px; }
.sg--h { height: 1px; }

@media (pointer: coarse), (max-width: 899px) {
  .tl__trb i { width: 22px; }
  .tl__trb i[data-h="trl"] { left: -11px; }
  .tl__trb i[data-h="trr"] { right: -11px; }
  .tl__trb { min-width: 44px; }
  .kn__a { width: 32px; height: 44px; }
  .nf__st { display: flex; }
  .nf__st button { width: 28px; font-size: 10px; }
  .trp__types button { min-height: 44px; }
  .tl__trs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* the video dialog */
.vid .dlg__in { width: min(460px, calc(100vw - 32px)); }
.vid__h { margin: var(--s2) 0 6px; font-size: var(--fs-xs); color: var(--faint); }
.vid .seg { margin-bottom: 0; }
.vid .seg button:disabled { opacity: .35; cursor: default; }
.vid__sizes button { flex: 1 1 30%; }

/* «Запись» — changes key themselves; the view switch Лента / Шаги */
.tl__autokey { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 var(--s2); border: 1px solid var(--line-2); border-radius: var(--r); background: transparent; color: var(--mute); font: inherit; font-size: var(--fs-s); cursor: pointer; white-space: nowrap; }
.tl__autokey i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.tl__autokey[aria-pressed="true"] { color: var(--text); border-color: rgba(255, 90, 80, .6); }
.tl__autokey[aria-pressed="true"] i { background: #ff5a50; box-shadow: 0 0 8px rgba(255, 90, 80, .8); }
.tl__autokey:disabled { opacity: .4; }
.tl:not(.has-scene) :is(.tl__autokey, .tl__view) { display: none; }
.tl__view { margin: 0; flex: none; }
.tl__view button { min-height: 32px; padding: 0 var(--s3); }

/* «Шаги»: the scene as rows of plain fields */
.tl__steps { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s2) var(--s3) var(--s3); scrollbar-width: thin; }
.tl__steps[hidden] { display: none; }
.st__list { display: grid; gap: 4px; }
.st { display: grid; grid-template-columns: 150px 110px minmax(0, 1fr) auto 32px; align-items: center; gap: var(--s2); min-height: 44px; padding: 4px var(--s2); border-radius: var(--r); background: var(--sunk); border: 1px solid transparent; cursor: pointer; }
.st:hover { border-color: var(--line-2); }
.st.is-now { border-color: rgba(232, 232, 12, .45); }
.st--look { background: var(--raise); }
.st--look { grid-template-columns: 150px 110px auto minmax(0, 1fr) 32px; }
.st__t { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-s); color: var(--text); }
.st__t b { font-weight: 500; padding-left: 8px; }
.st__t i { color: var(--faint); font-style: normal; }
.st__t small, .st__tr small { color: var(--faint); font-size: var(--fs-xs); }
.st input[type="text"] { width: 52px; height: 32px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: inherit; font-size: var(--fs-s); }
.st input[type="text"]:focus-visible, .st select:focus-visible { outline: 2px solid var(--acid); outline-offset: 1px; }
.st select { height: 32px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: inherit; font-size: var(--fs-s); max-width: 190px; }
.st__what { font-size: var(--fs-s); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st--blk .st__what { color: var(--acid); }
.st__fx { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px 0 4px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg); color: var(--text); font: inherit; font-size: var(--fs-s); cursor: pointer; white-space: nowrap; }
.st__fx img { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; }
.st__fx svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; color: var(--faint); }
.st__tr { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--faint); min-width: 0; flex-wrap: wrap; }
.st__vals { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.st__v { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--faint); }
.st__arr { font-style: normal; color: var(--acid); padding: 0 2px; }
.st__x { width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); font-size: 16px; cursor: pointer; }
.st__x:hover { color: #ff8a7a; background: var(--raise); }
.st__add { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s2); flex-wrap: wrap; }
.st__addbtn { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.st__addbtn select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.st__hint { font-size: var(--fs-xs); color: var(--faint); }
@container (max-width: 900px) {
  .st, .st--look { grid-template-columns: 1fr auto; grid-auto-flow: row; }
  .st__what { grid-column: 1; }
  .st__x { grid-column: 2; grid-row: 1; }
  .st__vals, .st__tr, .st__fx, .st__ease { grid-column: 1 / -1; }
  .tl__autokey { padding: 0 6px; }
}
@media (pointer: coarse), (max-width: 899px) {
  .st input[type="text"], .st select, .st__fx { height: 44px; }
  .st__x { width: 44px; height: 44px; }
  .tl__autokey, .tl__view button { min-height: 44px; }
}
.frm__src { display: grid; gap: 4px; margin-top: var(--s2); font-size: var(--fs-xs); color: var(--faint); }
.frm__src select { height: 36px; padding: 0 8px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--sunk); color: var(--text); font: inherit; font-size: var(--fs-s); }
@media (pointer: coarse), (max-width: 899px) { .frm__src select { height: 44px; } }

/* ---------- the axis widget in the stage's corner (camera-ui.js) ---------- */
/* the axes in the stage's top right corner: no card, quiet until the pointer comes near */
.cam { position: absolute; top: var(--s4); right: var(--s4); z-index: 3; width: 60px; height: 60px; opacity: 0.6; touch-action: none; user-select: none; -webkit-user-select: none; transition: opacity var(--ease); }
.cam:hover, .cam:focus-within { opacity: 1; }
.cam[hidden] { display: none; }
.cam__ax { display: block; width: 100%; height: 100%; overflow: visible; }
.cam__line { stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; }
.cam__end { cursor: pointer; outline: none; }
.cam__hit, .cam__dot, .cam__t { stroke: none; }   /* skin.css gives every svg a stroke */
.cam__hit { fill: transparent; }
.cam__dot { fill: var(--mute); transition: fill var(--ease); }
.cam__end.is-near .cam__dot { fill: var(--text); }
.cam__end:hover .cam__dot, .cam__end:focus-visible .cam__dot { fill: var(--acid); }
.cam__end:active .cam__dot { fill: var(--text); }
.cam__end:focus-visible .cam__hit { stroke: var(--acid); stroke-width: 1.5; }
.cam__t { font: 600 var(--fs-xs) var(--font); fill: var(--on-acid); pointer-events: none; }
@media (pointer: coarse), (max-width: 899px) {
  .cam { top: var(--s2); right: var(--s2); opacity: 0.85; }
}

/* ---------- dial rows on the strip: a heading that folds them, and the band of running motions ---------- */
.tl__rname[hidden], .tl__lane[hidden] { display: none; }
.tl__rname--h, .tl__lane--h { height: 26px; background: var(--sunk); }
.tl__rname--h { padding: 0; }
.tl__hd { display: flex; align-items: center; gap: 4px; width: 100%; height: 100%; padding: 0 var(--s2); border: 0; background: none; color: var(--faint); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; text-align: left; cursor: pointer; }
.tl__hd:hover { color: var(--text); }
.tl__hd small { margin-left: auto; font-weight: 400; letter-spacing: 0; }
.tl__hd svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--ease); }
.tl__hd[aria-expanded="false"] svg { transform: rotate(-90deg); }
.tl__rname--mods { align-items: flex-start; padding-top: 6px; }
.tl__lane--mods { position: relative; }
.tl__mod { position: absolute; height: 3px; border-radius: 2px; background: var(--acid); opacity: 0.75; pointer-events: none; }
.tl__mod--loop { background: repeating-linear-gradient(90deg, var(--acid) 0 10px, transparent 10px 14px); }

/* ---------- the marks beside a dial: ‹ ◆ › and the wave that opens its motion ---------- */
.dn { display: inline-flex; align-items: center; flex: none; }
.dn .kn { margin: 0; }
.wv { width: 28px; height: 28px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--faint); cursor: pointer; }
.wv svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.wv:hover { background: var(--raise); color: var(--text); }
.wv[aria-pressed="true"] { color: var(--acid); }
.rng__top .wv { width: 24px; height: 24px; margin: -4px -4px -4px 0; align-self: center; }
.rng__top .wv svg { width: 14px; height: 14px; }
.kd:focus-visible, .wv:focus-visible, .kn__a:focus-visible, .tl__hd:focus-visible { outline: 2px solid var(--acid); outline-offset: -2px; }
@media (pointer: coarse), (max-width: 899px) {
  .tl__rname--h, .tl__lane--h { height: 36px; }
  .tl__hd { min-height: 44px; }
  .wv, .rng__top .wv { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .tl__hd svg { transition: none; } }

/* the sound under the ruler: one quiet waveform, not interactive */
.tl__rname--snd, .tl__lane--snd { height: 28px; }
.tl__lane--snd svg { position: absolute; top: 4px; height: 20px; pointer-events: none; }
.tl__lane--snd polygon { fill: var(--faint); opacity: 0.55; }
.tl__rname--snd .tl__rn { font-size: var(--fs-xs); color: var(--mute); }
.tl__rname--snd[hidden] { display: none; }
.tl__autokey--snd[aria-pressed="true"] { border-color: var(--acid); }
.tl__autokey--snd[aria-pressed="true"] i { background: var(--acid); box-shadow: none; }
.tl__autokey--snd[hidden] { display: none; }
.tl__mod--snd { background: var(--faint); height: 2px; }
@media (pointer: coarse), (max-width: 899px) {
  .tl__rname--snd, .tl__lane--snd { height: 32px; }
  .tl__lane--snd svg { height: 24px; }
}
