/* timeline.css — Review Room track deck + karaoke text track. Owner: TL (CONTRACT §M, I.3-I.5, CA-13).
   AyP glass look: navy trays, dusty-rose hairlines, rounded "AI clip" bodies (canvas), studio pink playhead.
   CSP: this file is the only place styles live (no inline style attributes); JS sets geometry via CSSOM only. */

.tl-root {
  --tl-head-w: 104px;
  --tl-rose: #D5B1B2; --tl-rose-lt: #EDDADB; --tl-text: #d3ddec; --tl-dim: #6b7c95;
  --tl-ease: var(--ease, cubic-bezier(.22, .8, .24, 1));
  --tl-lens-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative; width: 100%; height: var(--tl-h, 302px); box-sizing: border-box;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--tl-text); font-variant-numeric: tabular-nums;
  transition: height .25s var(--tl-ease);
}
.tl-root * { box-sizing: border-box; }
.tl-heads { position: absolute; left: 0; top: 0; width: var(--tl-head-w); height: 100%; }
.tl-body { position: absolute; left: var(--tl-head-w); right: 0; top: 0; height: 100%; }
.tl-canvas { position: absolute; left: 0; top: 0; display: block; touch-action: none; cursor: default; }
.tl-canvas.is-clickable { cursor: pointer; }
.tl-overlay { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; }

/* ── playhead: the studio's .head (tracks.html:292-295), knob on the ruler ─────────────────────────────────────── */
.tl-playhead {
  position: absolute; left: 0; top: 0; width: 2px; z-index: 5; pointer-events: none; will-change: transform;
  background: #FFBCCD;
  box-shadow: 0 0 0 .5px #FFE7ED, 0 0 6px 1px rgba(255, 188, 205, .95), 0 0 18px 4px rgba(248, 113, 156, .55);
}
.tl-playhead::before {
  content: ""; position: absolute; top: 4px; left: -4px; width: 10px; height: 10px; border-radius: 50%;
  background: #FFBCCD; box-shadow: 0 0 0 1.5px #FFE7ED, 0 0 14px 2px #F8719C;
}
.tl-root.is-compact .tl-playhead::before { top: 2px; width: 9px; height: 9px; left: -3.5px; }

/* ── track headers ─────────────────────────────────────────────────────────────────────────────────────────────── */
.tl-hc-corner { position: absolute; left: 0; top: 0; right: 6px; }
.tl-hc {
  position: absolute; left: 0; right: 6px; display: flex; align-items: center; gap: 4px;
  padding: 0 5px 0 13px; border-radius: 9px; overflow: hidden;
  background: linear-gradient(180deg, rgba(27, 37, 55, .82), rgba(13, 20, 31, .82));
  border: 1px solid rgba(213, 177, 178, .11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 -1px 0 rgba(0, 0, 0, .35), 0 8px 16px -12px rgba(0, 0, 0, .9);
  transition: top .25s var(--tl-ease), height .25s var(--tl-ease), opacity .2s;
}
.tl-root.is-compact .tl-hc { padding-left: 10px; padding-right: 4px; border-radius: 8px; }
.tl-cbar {
  position: absolute; left: 4px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px;
  background: var(--c, var(--tl-rose-lt)); box-shadow: 0 0 6px -1px var(--c, transparent);
  transition: width .2s var(--tl-ease), box-shadow .2s;
}
.tl-hc.is-short .tl-cbar { top: 4px; bottom: 4px; }
.tl-hc.is-solo .tl-cbar { width: 5px; box-shadow: 0 0 10px 1px var(--c); }
.tl-hc--text .tl-cbar { background: linear-gradient(180deg, #FFBCCD, #647694); box-shadow: 0 0 8px -2px #F8719C; }
.tl-hc.is-silent .tl-hc-name { color: #8796ab; }
.tl-hc.is-silent .tl-cbar { opacity: .45; }

.tl-hc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.tl-hc-namerow { display: flex; align-items: center; gap: 3px; min-width: 0; }
.tl-hc-name {
  font-size: 12px; font-weight: 600; line-height: 14px; letter-spacing: -.2px; color: var(--tl-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.tl-root.is-compact .tl-hc-name { font-size: 11px; line-height: 13px; }
.tl-hc-sub { display: flex; align-items: center; gap: 4px; min-width: 0; height: 16px; }
.tl-root.is-compact .tl-hc-sub { height: 14px; }
.tl-hc.is-short .tl-hc-main { gap: 1px; }
.tl-hc.is-short .tl-hc-sub { height: 13px; }
.tl-hc-meta {
  font-size: 9.5px; font-weight: 500; letter-spacing: .6px; text-transform: uppercase; color: #8796ab;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.tl-root.is-compact .tl-hc-meta { font-size: 9px; letter-spacing: .5px; }
.tl-root.is-compact .tl-hc--text .tl-hc-meta, .tl-root.is-compact .tl-hc--vo .tl-hc-meta { display: none; }
.tl-ico { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.tl-folder { width: 13px; height: 13px; flex: none; color: var(--c, #6DA5EC); opacity: .9; }
.tl-folder .tl-ico, svg.tl-folder { stroke-width: 1.8; }

/* small round header buttons (solo, twisty) */
:where(.tl-root) button { font-family: inherit; color: inherit; margin: 0; line-height: 1; }
.tl-solo, .tl-twisty {
  flex: none; width: 18px; height: 18px; padding: 3px; border-radius: 50%; cursor: pointer;
  color: #8fa0b8; background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  border: 1px solid rgba(213, 177, 178, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 4px -2px #000;
  transition: color .15s, background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.tl-solo { margin-left: auto; }
.tl-solo:hover, .tl-twisty:hover { color: var(--tl-rose-lt); border-color: rgba(213, 177, 178, .42); }
.tl-solo:active, .tl-twisty:active { transform: translateY(.5px) scale(.96); }
.tl-solo.is-on {
  color: #1a1016; background: linear-gradient(180deg, #F0DCDD, #C99FA1); border-color: rgba(255, 231, 237, .7);
  box-shadow: 0 0 10px -1px rgba(213, 177, 178, .75), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.tl-twisty { width: 14px; height: 14px; padding: 2px; border: 0; background: none; box-shadow: none; color: #9db0c9; transition: transform .2s var(--tl-ease); }
.tl-twisty.is-open { transform: rotate(90deg); }
.tl-root.is-compact .tl-solo { width: 16px; height: 16px; padding: 2.5px; }
.tl-solo:focus-visible, .tl-twisty:focus-visible, .tl-chip:focus-visible, .tl-keep:focus-visible, .tl-lane-badge:focus-visible, .tl-takes-btn:focus-visible {
  outline: 1.5px solid var(--tl-rose-lt); outline-offset: 1px;
}

/* chips: "muted" (voRef / any muted stem), "takes" toggle */
.tl-chip, .tl-takes-btn {
  flex: none; display: inline-flex; align-items: center; gap: 2px; height: 15px; padding: 0 6px 0 4px; border-radius: 999px; cursor: pointer;
  font-size: 9px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; line-height: 1;
  border: 1px solid rgba(213, 177, 178, .28); background: rgba(213, 177, 178, .08); color: #c9b5b7;
  transition: background .15s, border-color .15s, color .15s;
}
.tl-chip .tl-ico, .tl-takes-btn .tl-ico { width: 10px; height: 10px; stroke-width: 2.2; flex: none; }
.tl-takes-btn { padding: 0 5px 0 3px; font-size: 8.5px; }
.tl-chip:hover, .tl-takes-btn:hover { background: rgba(213, 177, 178, .16); border-color: rgba(213, 177, 178, .5); color: var(--tl-rose-lt); }
.tl-chip.is-on { color: #EDCF70; border-color: rgba(237, 207, 112, .38); background: rgba(237, 207, 112, .10); }
.tl-hc.is-short .tl-chip { height: 13px; font-size: 8.5px; }
.tl-takes-btn .tl-ico { transition: transform .2s var(--tl-ease); }
.tl-takes-btn.is-open .tl-ico { transform: rotate(90deg); }
.tl-spk { display: inline-flex; gap: 2px; align-items: center; }
.tl-spk i { width: 6px; height: 6px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); }

/* music: name / meta / solo stacked (86 px of height, narrow column) */
.tl-hc--music .tl-hc-main { padding-right: 17px; gap: 4px; }
.tl-hc--music .tl-hc-sub { flex-wrap: wrap; height: auto; row-gap: 5px; }
.tl-hc--music .tl-hc-meta { flex: 1 0 100%; }
.tl-hc--music .tl-solo { margin-left: 0; }
.tl-root.is-compact .tl-hc--music .tl-hc-sub { row-gap: 3px; }

/* music lane number badges, aligned with the lanes */
.tl-lane-badges { position: absolute; right: 4px; top: -1px; bottom: -1px; width: 15px; }
.tl-lane-badge {
  position: absolute; left: 0; width: 15px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #7d8ca3;
}
.tl-lane-badge::before {
  content: ""; position: absolute; left: 1px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px; border-radius: 50%;
  border: 1px solid rgba(239, 151, 109, .30); background: rgba(239, 151, 109, .06); z-index: -1;
}
.tl-root.is-compact .tl-lane-badge::before { width: 11px; height: 11px; margin-top: -5.5px; left: 2px; }
.tl-lane-badge { z-index: 0; isolation: isolate; }
.tl-lane-badge.is-selected { color: #1b1209; }
.tl-lane-badge.is-selected::before { background: linear-gradient(180deg, #F6B08F, #D9805A); border-color: rgba(255, 220, 200, .8); box-shadow: 0 0 8px -1px rgba(239, 151, 109, .8); }
.tl-lane-badge.is-approved { color: #92ECB1; }
.tl-lane-badge.is-approved::before { border-color: rgba(107, 186, 124, .75); background: rgba(107, 186, 124, .16); }
.tl-lane-badge.is-approved.is-selected { color: #0d1d12; }
.tl-lane-badge.is-approved.is-selected::before { background: linear-gradient(180deg, #a6efbd, #6BBA7C); box-shadow: 0 0 8px -1px rgba(107, 186, 124, .9); }

/* take row numbers (1 / 2 / 3) in the VO header, aligned with the rows; row 0 is the original (top) */
.tl-take-tags { position: absolute; right: 2px; top: -1px; bottom: -1px; width: 11px; }
.tl-take-tag { position: absolute; right: 0; width: 11px; display: flex; align-items: center; justify-content: center; font-size: 8.5px; font-weight: 700; color: #7d8ca3; }
.tl-take-tag::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 11px; margin-top: -5.5px; border-radius: 50%; border: 1px solid rgba(237, 207, 112, .28); }
.tl-hc.has-takes { align-items: flex-start; padding-top: 7px; }
.tl-hc.has-takes .tl-hc-sub { padding-right: 12px; flex-wrap: wrap; height: auto; row-gap: 4px; }
.tl-hc.has-takes .tl-solo { margin-left: 0; }
.tl-hc.has-takes .tl-hc-meta { display: none; }
.tl-hc.has-takes .tl-hc-main { gap: 6px; }

/* ── music lane overlays: description chip + "✓ Keep" pill ──────────────────────────────────────────────────────── */
.tl-lane { position: absolute; left: 0; right: 0; pointer-events: none; }
.tl-lane-label {
  position: absolute; left: 7px; top: 50%; transform: translateY(-50%); height: 12px; max-width: 46%;
  display: flex; align-items: center; gap: 3px; padding: 0 6px; border-radius: 6px;
  font-size: 9px; font-weight: 600; letter-spacing: .2px; white-space: nowrap; color: rgba(239, 151, 109, .78);
  background: rgba(7, 11, 16, .74); box-shadow: inset 0 0 0 1px rgba(239, 151, 109, .14);
}
.tl-lane-desc { overflow: hidden; text-overflow: ellipsis; }
.tl-lane.is-selected .tl-lane-label { color: #FFE3D6; box-shadow: inset 0 0 0 1px rgba(239, 151, 109, .45); background: rgba(10, 14, 20, .82); }
.tl-lane.is-approved .tl-lane-label { color: #92ECB1; box-shadow: inset 0 0 0 1px rgba(107, 186, 124, .40); }
.tl-lane-ok { width: 9px; height: 9px; stroke-width: 2.6; flex: none; }
.tl-root.is-compact .tl-lane-label { height: 10px; font-size: 8px; padding: 0 5px; left: 5px; }
/* SFX folder rows (CA-13): group names on the left, like the music option labels, in the group's blue */
.tl-folder-label { height: 10px; font-size: 8px; color: color-mix(in srgb, var(--gc, #6DA5EC) 88%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gc, #6DA5EC) 30%, transparent); }
.tl-root.is-compact .tl-folder-label { height: 8px; font-size: 7px; padding: 0 4px; border-radius: 4px; }
.tl-keep {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); height: 13px; padding: 0 7px 0 5px;
  display: none; align-items: center; gap: 3px; border-radius: 999px; cursor: pointer; pointer-events: auto;
  font-size: 9px; font-weight: 700; letter-spacing: .3px; line-height: 1;
  color: #EDDADB; background: rgba(8, 12, 20, .88); border: 1px solid rgba(213, 177, 178, .45);
  box-shadow: 0 2px 6px -2px #000; transition: background .15s, border-color .15s, color .15s;
}
.tl-keep .tl-ico { width: 9px; height: 9px; stroke-width: 2.6; }
.tl-keep:hover { background: rgba(213, 177, 178, .22); border-color: rgba(237, 218, 219, .8); color: #fff; }
.tl-keep[aria-pressed="true"] { color: #92ECB1; border-color: rgba(107, 186, 124, .7); background: rgba(14, 30, 20, .9); }
.tl-keep[aria-pressed="true"]:hover { background: rgba(107, 186, 124, .22); }
.tl-lane.is-hover .tl-keep, .tl-lane.is-selected .tl-keep, .tl-keep:focus-visible { display: flex; }
.tl-root.is-compact .tl-keep { height: 11px; font-size: 8px; right: 6px; }

/* ── take rows (I.5) ────────────────────────────────────────────────────────────────────────────────────────────── */
.tl-take { position: absolute; pointer-events: none; border-radius: 7px; transition: box-shadow .15s; }
.tl-take.is-hover { box-shadow: 0 0 0 1px rgba(237, 218, 219, .65), 0 0 10px -2px rgba(213, 177, 178, .6); }
.tl-take.is-rendering { border: 1.5px solid rgba(213, 177, 178, .75); animation: tl-pulse 1.3s ease-in-out infinite; }
@keyframes tl-pulse { 0%, 100% { border-color: rgba(213, 177, 178, .25); box-shadow: none; } 50% { border-color: rgba(237, 218, 219, .9); box-shadow: 0 0 10px -2px rgba(213, 177, 178, .8); } }
.tl-take-badge {
  position: absolute; left: calc(100% + 3px); top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; padding: 2px;
  color: #10151d; background: linear-gradient(180deg, #F0DCDD, #C99FA1); box-shadow: 0 0 8px -1px rgba(213, 177, 178, .8);
}
.tl-take-badge .tl-ico { stroke-width: 3; }

/* ── karaoke text track: the studio lens (tracks.html:328-335) on its own row ───────────────────────────────────── */
.tl-textrow { position: absolute; left: 0; right: 0; pointer-events: none; overflow: hidden; border-radius: 9px; }
.tl-text .tl-lens { position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow: hidden;
  /* words that run past the track edge fade out instead of being cut in half */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%); }
.tl-text .tl-lens-ref { display: none; }
.tl-text.has-ref .tl-lens-primary { bottom: auto; top: 2px; height: 29px; }
.tl-text.has-ref .tl-lens-ref { display: block; top: auto; bottom: 2px; height: 17px; opacity: .55; }
.tl-text .rstrip { position: absolute; top: 50%; left: 0; transform: translate(0, -50%); will-change: transform; display: none; }
.tl-text .rstrip.active { display: block; }
.tl-text .rw {
  position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; padding: 0 3px;
  font-family: var(--tl-lens-family); font-size: 20px; font-weight: 700; line-height: 1; letter-spacing: .1px;
  color: #647694; text-shadow: 0 1px 7px #000, 0 0 4px #000, 0 0 2px #000;
}
.tl-text .rw.spoken { color: var(--sc, #a7bcda); }
.tl-text .rw.cur { color: #ffffff; }
.tl-text .rw.cur .rc.f { color: #FFBCCD; text-shadow: 0 0 15px #F8719C, 0 1px 6px #000; }
.tl-text .tl-lens-ref .rw { font-size: 13px; font-weight: 600; }
.tl-root.is-compact .tl-text .rw { font-size: 17px; }
.tl-root.is-compact .tl-text .tl-lens-ref .rw { font-size: 11px; }
.tl-root.is-compact .tl-text.has-ref .tl-lens-primary { top: 1px; height: 24px; }
.tl-root.is-compact .tl-text.has-ref .tl-lens-ref { bottom: 1px; height: 14px; }

@media (prefers-reduced-motion: reduce) {
  .tl-root, .tl-hc { transition: none; }
  .tl-take.is-rendering { animation: none; border-color: rgba(213, 177, 178, .6); }
}
