/* ── Timeline ─────────────────────────────────────────── */
.tl { --th: 172px; height: 100%; display: flex; flex-direction: column; min-height: 0; font-size: var(--fs); position: relative; }
.tl-top { flex: none; display: grid; grid-template-columns: var(--th) minmax(0, 1fr); height: 58px; border-bottom: 1px solid #141414; }
.tl-tcbox { display: flex; flex-direction: column; justify-content: space-between; padding: 4px 6px 3px 8px; border-right: 1px solid #141414; min-width: 0; }
.tl-tcbox .tc { font-size: 17px; }
.tl-tools { display: flex; gap: 1px; }
.tl-tools .tbtn { width: 22px; height: 20px; }
.tl-tools .tbtn .i { width: 14px; height: 14px; }
.tl-ruler { position: relative; overflow: hidden; cursor: pointer; }
.tl-ruler canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.tl-ruler .renderbar { position: absolute; left: 0; bottom: 0; height: 3px; }

.tl-mid { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--th) minmax(0, 1fr); position: relative; overflow-y: auto; overflow-x: hidden; }
.tl-heads { position: relative; border-right: 1px solid #141414; background: var(--panel); z-index: 2; }
.tl-lanes { position: relative; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; background: #171717; }
.tl-lanes::-webkit-scrollbar { display: none; }
.tl-content { position: relative; min-width: 100%; }

.track { position: relative; height: var(--h, 28px); border-bottom: 1px solid #121212; }
.track.tall { --h: var(--tall-h, 50px); }
.tl-mid { overflow-y: auto; }
.tl.big-tracks .clip.v1 .cn { font-size: 12.5px; }
.track.divider { border-bottom: 3px solid #0d0d0d; }
.lane.track { background: #1b1b1b; }
.lane.track.v { background: #1c1c1c; }
.lane.track.a { background: #1a1a1a; }

.th {
  display: grid; grid-template-columns: 18px 18px 26px 1fr; align-items: center; gap: 2px; padding: 0 4px 0 2px;
  background: var(--panel);
}
.th .patch { height: 20px; width: 18px; display: grid; place-items: center; border-radius: 2px; color: var(--text-3); font-size: 10px; font-weight: 600; }
.th .patch.on { background: #2b5d9c; color: #fff; }
.th .tname { height: 20px; display: grid; place-items: center; border-radius: 3px; font-size: 11px; font-weight: 600; color: var(--text-hi); background: #2f2f2f; }
.th .tname.target { background: #3b5f8c; }
.th .tbtns { display: flex; align-items: center; gap: 1px; justify-content: flex-end; min-width: 0; overflow: hidden; }
.th .tb { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 3px; color: var(--text-3); font-size: 10.5px; font-weight: 700; flex: none; }
.th .tb:hover { background: var(--panel-3); color: var(--text-hi); }
.th .tb .i { width: 13px; height: 13px; }
.th .tb.m.on { background: #2d7a3f; color: #fff; }
.th .tb.s.on { background: #b8932c; color: #111; }
.th .tb.eye.on { color: var(--danger); }
.th .tb.lk.on { color: var(--warn); }
.th .vol { grid-column: 3 / -1; color: var(--text-3); font-size: 10px; display: none; }
.th.tall .vol { display: block; }
.th.mix { grid-template-columns: 1fr auto; padding-left: 10px; color: var(--text-2); }

/* clips */
.clip {
  position: absolute; top: 1px; bottom: 1px; border-radius: 3px; overflow: hidden;
  background: var(--cc, var(--c-violet));
  color: #12101b; font-size: 11px; line-height: 1.15;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.18);
  cursor: pointer; contain: layout paint;
}
.clip:hover { filter: brightness(1.08); }
.clip.sel { box-shadow: inset 0 0 0 1.5px #fff, 0 0 0 1px rgba(0,0,0,.4); }
.clip.cur::after { content: ''; position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.35); border-radius: 3px; pointer-events: none; }
.clip .cn { position: absolute; left: 4px; right: 4px; top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; z-index: 1; display: flex; gap: 4px; align-items: center; }
.clip .fxb { font-size: 8.5px; font-weight: 700; font-style: italic; background: rgba(0,0,0,.55); color: #f0e05a; border-radius: 2px; padding: 0 2px; line-height: 11px; flex: none; }
.clip.v1.narrow .cn { left: 4px; }
.clip.a canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.clip.a .cn { color: #0d1d18; }
.clip .rubber { position: absolute; left: 0; right: 0; top: 46%; height: 1px; background: rgba(255,255,255,.65); pointer-events: none; }
.clip.gfx { --cc: var(--c-lavender); }
.clip.adj { --cc: #b9a37d; }
.clip .trans { position: absolute; top: 0; bottom: 0; width: 18px; background: linear-gradient(90deg, rgba(255,255,255,.55), rgba(255,255,255,.15)); border-radius: 2px; }
.clip.ghost { opacity: .5; pointer-events: none; }
.tl-razor-line { position: absolute; top: 0; bottom: 0; width: 1px; background: #fff; pointer-events: none; display: none; z-index: 4; }
.tl-content.razor .clip { cursor: crosshair; }
.tl-content.hand { cursor: grab; }
.tl-content.hand.dragging { cursor: grabbing; }

/* playhead across lanes */
.tl-ph { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--playhead); pointer-events: none; z-index: 3; }
.tl-inout { position: absolute; top: 0; bottom: 0; background: var(--in-out); pointer-events: none; z-index: 0; }
.tl-marker-line { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(76, 200, 90, .5); pointer-events: none; z-index: 2; }
.tl-snap { position: absolute; top: 0; bottom: 0; width: 1px; background: #fff; pointer-events: none; z-index: 4; display: none; }

.tl-bottom { flex: none; display: grid; grid-template-columns: var(--th) minmax(0, 1fr); height: 16px; border-top: 1px solid #141414; }
.tl-bottom .left { border-right: 1px solid #141414; }
.zoombar { position: relative; margin: 3px 6px; border-radius: 5px; background: #121212; }
.zoombar .thumb { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: #4a4a4a; min-width: 18px; cursor: grab; }
.zoombar .thumb:hover { background: #5a5a5a; }
.zoombar .thumb::before, .zoombar .thumb::after { content: ''; position: absolute; top: 1px; bottom: 1px; width: 8px; border-radius: 4px; background: #777; cursor: ew-resize; }
.zoombar .thumb::before { left: 1px; }
.zoombar .thumb::after { right: 1px; }

.tl-hint { position: absolute; left: calc(var(--th) + 12px); bottom: 24px; z-index: 6; pointer-events: none;
  background: rgba(20,20,20,.92); border: 1px solid #3a3a3a; border-radius: 5px; padding: 6px 10px; color: var(--text-2);
  font-size: var(--fs); opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.tl-hint.on { opacity: 1; transform: none; }
.tl-hint .kbd-cap { margin: 0 2px; }

/* geometry driven by CSS vars: --z (px/sec), --s (start sec), --d (duration sec) */
.tl-content .clip { left: calc(var(--s) * var(--z) * 1px); width: max(2px, calc(var(--d) * var(--z) * 1px - 1px)); container-type: inline-size; }
.tl-ph { left: calc(var(--ph, 0) * var(--z) * 1px); }
.tl-marker-line { left: calc(var(--s) * var(--z) * 1px); }
.tl-inout { left: calc(var(--s) * var(--z) * 1px); width: calc(var(--d) * var(--z) * 1px); }
.clip.a { background-repeat: repeat-x; background-size: calc(var(--z) * 14px) 100%, auto; background-color: var(--cc); }
.clip.a .cn { top: 1px; }
.tl.no-waves .clip.a { background-image: none !important; }
.tl.no-names .clip .cn { display: none; }
@container (max-width: 26px) { .clip .cn { display: none; } }
.clip.nest { --cc: var(--c-forest); color: #0c1f0e; }
.clip.gfx { color: #2a0d2a; }
.cutmark { position: absolute; top: 0; bottom: 0; width: 0; left: calc(var(--o) * var(--z) * 1px); border-left: 1px dashed rgba(0,0,0,.75); z-index: 2; }
.cutmark::after { content: ''; position: absolute; top: 0; left: -4px; border: 4px solid transparent; border-top-color: #111; }
.lane.locked { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 6px, transparent 6px 12px); }
.lane.locked .clip { filter: saturate(.35) brightness(.8); }
.lane.off .clip { opacity: .35; }
.lane.track.mix { height: 26px; background: #161616; border-bottom: 0; }
.tl.zoomed-out .clip .fxb { display: none; }

/* V1 filmstrip: name band in the label colour on top, thumbnails always visible below */
.clip.v1 .cn { left: 0; right: 0; top: 0; height: 17px; padding: 0 5px; line-height: 17px; }
.clip.v1 .cstrip {
  position: absolute; left: 0; right: 0; top: 17px; bottom: 0;
  background-color: #111; background-repeat: repeat-x; background-size: auto 100%; background-position: left center;
  border-top: 1px solid rgba(0,0,0,.4);
}
.clip.v1.sel .cstrip { box-shadow: inset 0 0 0 1.5px #fff; }
.tl.no-thumbs .clip.v1 .cstrip { display: none; }
@container (max-width: 26px) { .clip.v1 .cn { display: none; } .clip.v1 .cstrip { top: 0; border-top: 0; } }

/* ── Editing sandbox: drag to move, drop line, reset ─────────── */
.tl-drop { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; left: calc(var(--s) * var(--z) * 1px); background: #ffd23f; box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 0 10px rgba(255,210,63,.6); pointer-events: none; display: none; z-index: 6; }
.clip.moving { z-index: 5; opacity: .85; box-shadow: 0 6px 16px rgba(0,0,0,.6), 0 0 0 1px #ffd23f; cursor: grabbing; }
.tl-content.dragging-clip { cursor: grabbing; }
.tl-reset { align-self: center; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 21px; margin-right: 6px; padding: 0 10px; border-radius: 11px;
  background: rgba(255, 210, 63, .14); border: 1px solid rgba(255, 210, 63, .6); color: #ffe08a; font-weight: 600; font-size: 11.5px; white-space: nowrap; }
.tl-reset:hover { background: rgba(255, 210, 63, .26); color: #fff; }
.tl-reset .i { width: 13px; height: 13px; }
.tl-reset[hidden] { display: none; }
