/* DNEG AI Roadmap: views/timeline.css
   Extras for the Timeline lens only (root class .tlv). Colours come from tokens.css; the quarter scrubber is the
   presentation's .tl component from site.css, tuned here. The head, the brief and the folded blocks (lk-*) are the shared kit;
   the chart, its controls and the side panel sit in the first block, open. */

.tlv { --lw: 232px; --qw: 80px; }

/* toolbar */
.tlv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 0 0 10px; }
.tlv-tool { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tlv-seg { display: inline-flex; gap: 4px; }
.tlv-sel { max-width: 8rem; }

/* scrubber, chart, legend and side panel share one grid; the panel moves under the scrubber on narrow screens */
.tlv-main { display: grid; grid-template-columns: minmax(0, 1fr) 290px; grid-template-areas: "scrub panel" "chart panel" "foot panel"; column-gap: 20px; align-items: start; }
.tlv-scrubwrap { grid-area: scrub; min-width: 0; margin-bottom: 4px; }
.tlv-scroll, .tlv-main > .empty { grid-area: chart; min-width: 0; }
.tlv-foot { grid-area: foot; min-width: 0; }
.tlv-panelhost { grid-area: panel; min-width: 0; position: sticky; top: calc(var(--stick, var(--topbar-h)) + 16px); max-height: calc(100vh - var(--stick, var(--topbar-h)) - 32px); overflow: auto; scrollbar-width: thin; }
.tlv-scrubwrap .eyebrow { margin-bottom: 0; }
.tlv .tl { margin: .2rem 0 0; padding: 0 30px; }
.tlv .tl .track { margin-top: 1.1rem; }
.tlv .tl .d { padding: 0; }
.tlv .tl .d .m { font-size: .64rem; }
.tlv .tl .d.on .m { color: var(--fg); }
.tlv .tl .d:hover { border-color: var(--accent2); }
.tlv .tl input[type=range] { margin-top: 2.1rem; margin-bottom: 0; }

/* chart */
.tlv-scroll { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel), var(--bg2)); scrollbar-width: thin; }
.tlv-scroll:focus-visible { outline-offset: 0; }
.tlv-inner { position: relative; isolation: isolate; min-width: calc(var(--lw) + var(--nq) * var(--qw)); }

.tlv-row { display: grid; grid-template-columns: var(--lw) minmax(0, 1fr); min-height: 32px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.tlv-row:last-child { border-bottom: 0; }
.tlv-row.root { min-height: 46px; }
.tlv-lab { position: sticky; left: 0; z-index: 4; display: flex; align-items: center; gap: 4px; min-width: 0; padding: 3px 10px 3px 8px; background: var(--panel); border-right: 1px solid var(--line); }
.tlv-ltext { flex: 1 1 auto; min-width: 0; }
.tlv-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: .82rem; line-height: 1.25; color: var(--fg); text-decoration: none; }
a.tlv-name:hover { color: var(--accent2); text-decoration: underline; }
.tlv-name.plain { color: var(--muted); }
.tlv-sub { font-size: .68rem; line-height: 1.3; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlv-cell { position: relative; min-height: 32px; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / var(--nq)) 100%; }
.tlv-row:not(.head):not(.grp):hover .tlv-cell { background-color: color-mix(in srgb, var(--accent) 6%, transparent); }
.tlv-row:not(.head):not(.grp):hover .tlv-lab { background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.tlv-row.hl .tlv-lab { box-shadow: inset 3px 0 0 var(--accent2); }
.tlv-row.ctx .tlv-name { color: var(--muted); }
.tlv-row.lv-phase .tlv-name, .tlv-row.lv-epic .tlv-name { font-size: .78rem; }
.tlv-row.lv-task .tlv-name, .tlv-row.lv-subtask .tlv-name, .tlv-row.lv-story .tlv-name { font-size: .76rem; color: var(--muted); }

/* header and group rows */
.tlv-row.head { position: relative; z-index: 5; min-height: 0; background: var(--panel); }
.tlv-row.head .tlv-lab { padding-top: 5px; padding-bottom: 5px; }
.tlv-row.head .tlv-cell { display: flex; flex-direction: column; background-image: none; }
.tlv-hzs { position: relative; height: 15px; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.tlv-hz { position: absolute; top: 0; bottom: 0; padding: 0 8px; overflow: hidden; font-family: var(--mono); font-size: .58rem; line-height: 14px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; color: var(--muted); border-left: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.tlv-hz.now { color: var(--accent2); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.tlv-hz.next { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tlv-todaytag { position: absolute; top: 3px; transform: translateX(-50%); z-index: 2; padding: 0 5px; border-radius: 4px; background: var(--accent); color: var(--on-accent); font-family: var(--mono); font-size: .6rem; line-height: 1.5; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.tlv-ys, .tlv-qs { display: flex; }
.tlv-y { flex: 1 1 0; min-width: 0; padding: 3px 8px 0; border-left: 1px solid var(--line); font-family: var(--mono); font-size: .72rem; color: var(--accent2); }
.tlv-q { flex: 1 1 0; min-width: 0; padding: 1px 0 4px; border-left: 1px solid var(--line); text-align: center; font-family: var(--mono); font-size: .66rem; color: var(--muted); white-space: nowrap; }
.tlv-row.head .tlv-q { cursor: pointer; }
.tlv-row.head .tlv-q:hover { color: var(--fg); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tlv-q.now { color: var(--fg); font-weight: 600; }
.tlv-q.sel { color: var(--accent2); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tlv-row.grp { min-height: 34px; background: var(--panel2); }
.tlv-row.grp .tlv-lab { background: var(--panel2); }
.tlv-row.grp .tlv-cell { display: flex; align-items: center; background: var(--panel2); background-image: none; }
.tlv-row.grp .tlv-qs { flex: 1; }
.tlv-row.grp .tlv-q { padding: 0; border-left-color: color-mix(in srgb, var(--line) 60%, transparent); opacity: .75; }
.tlv-gname { color: var(--fg); font-weight: 600; font-size: .86rem; text-decoration: none; }
a.tlv-gname:hover { color: var(--accent2); text-decoration: underline; }

/* expand toggle */
.tlv-tw { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; min-width: 28px; height: 24px; padding: 0 5px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.tlv-tw:hover { border-color: var(--line); color: var(--fg); background: var(--panel2); }
.tlv-tw.spacer { cursor: default; pointer-events: none; padding: 0; }
.tlv-caret::before { content: "\25B8"; display: inline-block; font-size: .78rem; transition: transform .15s var(--ease); }
.tlv-tw[aria-expanded="true"] .tlv-caret::before { transform: rotate(90deg); }
.tlv-cnt { font-size: .66rem; }

/* overlays: the selected quarter and today */
.tlv-band { position: absolute; top: 0; bottom: 0; z-index: 1; pointer-events: none;
  left: calc(var(--lw) + (100% - var(--lw)) * var(--bi) / var(--nq)); width: calc((100% - var(--lw)) / var(--nq));
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--accent2) 45%, transparent); border-right: 1px solid color-mix(in srgb, var(--accent2) 45%, transparent); }
.tlv-today { position: absolute; top: 0; bottom: 0; z-index: 3; pointer-events: none; width: 0; left: calc(var(--lw) + (100% - var(--lw)) * var(--tp)); border-left: 2px solid var(--accent2); }

/* bars */
.tlv-bar { --c: var(--muted); position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: flex; align-items: center; height: 18px; min-width: 7px; overflow: hidden; container-type: inline-size;
  border: 1px solid var(--c); border-radius: 5px; background: color-mix(in srgb, var(--c) 30%, var(--bg2)); color: var(--fg); text-decoration: none; }
.tlv-bar:hover { background: color-mix(in srgb, var(--c) 48%, var(--bg2)); }
.tlv-bar:focus-visible { outline-offset: 1px; }
.tlv-bar.prog { --c: var(--accent); }
.tlv-bar.done { --c: var(--ok); }
.tlv-bar.hold { --c: var(--human); background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--human) 40%, var(--bg2)) 0 6px, color-mix(in srgb, var(--human) 14%, var(--bg2)) 6px 12px); }
.tlv-bar.todo { --c: var(--muted); background: color-mix(in srgb, var(--muted) 20%, var(--bg2)); }
.tlv-bar.lv-initiative { height: 20px; }
.tlv-bar.lv-phase { height: 12px; border-radius: 4px; }
.tlv-bar.lv-epic { height: 9px; border-radius: 3px; }
.tlv-bar.lv-task, .tlv-bar.lv-subtask, .tlv-bar.lv-story { height: 7px; border-radius: 3px; }
.tlv-bar.derived { background: transparent; border-style: dashed; }
.tlv-bar.derived:hover { background: color-mix(in srgb, var(--c) 18%, transparent); }
.tlv-bar.pt { min-width: 10px; height: 10px; border-radius: 50%; }
.tlv-bar.late { box-shadow: inset -3px 0 0 var(--bad); }
.tlv-bar.ctx { opacity: .55; }
.tlv-bar.clip-l { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dashed; -webkit-mask-image: linear-gradient(to right, transparent, #000 16px); mask-image: linear-gradient(to right, transparent, #000 16px); }
.tlv-bar.clip-r { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: dashed; -webkit-mask-image: linear-gradient(to left, transparent, #000 16px); mask-image: linear-gradient(to left, transparent, #000 16px); }
.tlv-bar.clip-l.clip-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent); }
.tlv-bt { padding: 0 8px; font-size: .68rem; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .02em; }
@container (max-width: 76px) { .tlv-bt { display: none; } }

/* diamonds */
.tlv-dia { position: absolute; z-index: 2; width: 11px; height: 11px; transform: translate(-50%, -50%) rotate(45deg); border: 1px solid var(--bg); border-radius: 2px; background: var(--accent2); cursor: pointer; }
span.tlv-dia { cursor: default; }
.tlv-dia:hover, .tlv-dia:focus-visible { background: var(--fg); outline-offset: 3px; }
.tlv-dia.k-release { background: var(--accent); }
.tlv-dia.k-decision, .tlv-dia.k-pilot, .tlv-dia.k-demo { background: var(--bg2); border-color: var(--accent2); }

/* legend */
.tlv-legend { row-gap: 6px; }
.tlv-legend span { display: inline-flex; align-items: center; }
.tlv-sw { display: inline-block; width: 22px; height: 9px; margin-right: 7px; border-radius: 3px; border: 1px solid var(--c, var(--line)); background: color-mix(in srgb, var(--c, var(--muted)) 30%, var(--bg2)); }
.tlv-legend .tlv-sw { border-radius: 3px; }
.tlv-sw.prog { --c: var(--accent); }
.tlv-sw.done { --c: var(--ok); }
.tlv-sw.hold { --c: var(--human); background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--human) 40%, var(--bg2)) 0 4px, color-mix(in srgb, var(--human) 14%, var(--bg2)) 4px 8px); }
.tlv-sw.todo { --c: var(--muted); background: color-mix(in srgb, var(--muted) 20%, var(--bg2)); }
.tlv-sw.late { --c: var(--accent); box-shadow: inset -3px 0 0 var(--bad); }
.tlv-sw.derived { --c: var(--accent); background: transparent; border-style: dashed; }
.tlv-sw.dia { width: 9px; height: 9px; margin: 0 8px 0 3px; transform: rotate(45deg); background: var(--accent2); border-color: var(--bg); border-radius: 2px; }

/* side panel */
.tlv-panel { padding: 16px 16px 14px; margin: 0; }
.tlv-panel .eyebrow { margin-bottom: .2rem; }
.tlv-ptitle { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-family: var(--mono); letter-spacing: -.01em; }
.tlv-prange { margin-top: .15rem; color: var(--muted); font-size: .74rem; }
.tlv-psum { margin-top: .5rem; color: var(--fg); font-size: .88rem; }
.tlv-panel h3 { margin: 1rem 0 .3rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tlv-panel .n { margin-left: 4px; color: var(--accent2); letter-spacing: 0; }
.tlv-plist { list-style: none; margin: 0; padding: 0; }
.tlv-pi { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 8px; padding: 5px 6px; margin: 0 -6px; border-radius: 8px; color: var(--fg); text-decoration: none; font-size: .84rem; line-height: 1.3; }
a.tlv-pi:hover { background: var(--panel2); }
.tlv-pi .dot { width: 8px; height: 8px; margin-top: .4em; border-radius: 50%; background: var(--muted); }
.tlv-pi .dot.prog { background: var(--accent); }
.tlv-pi .dot.done { background: var(--ok); }
.tlv-pi .dot.hold { background: var(--human); }
.tlv-pi .pt { grid-column: 2; }
.tlv-pi .pd { grid-column: 2; font-size: .68rem; color: var(--muted); }
.tlv-plist.ms .tlv-pi { grid-template-columns: minmax(0, 1fr); }
.tlv-plist.ms .pt, .tlv-plist.ms .pd { grid-column: 1; }
.tlv-plist.ms .kind { justify-self: start; margin-top: 3px; }
.tlv-pd { margin-top: .6rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.tlv-pd.first { margin-top: 1rem; }
.tlv-pd summary { cursor: pointer; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tlv-pd summary:hover { color: var(--fg); }
.tlv-pd[open] summary { margin-bottom: .3rem; }

/* undated (the fold names it) */
.tlv-ulist { margin-top: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel), var(--bg2)); overflow: hidden; }
.tlv-ug { border-bottom: 1px solid var(--line); }
.tlv-ug:last-child { border-bottom: 0; }
.tlv-ug > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 11px 16px; cursor: pointer; list-style: none; }
.tlv-ug > summary::-webkit-details-marker { display: none; }
.tlv-ug > summary::before { content: "\25B8"; color: var(--muted); font-size: .8rem; transition: transform .15s var(--ease); }
.tlv-ug[open] > summary::before { transform: rotate(90deg); }
.tlv-ug > summary:hover { background: color-mix(in srgb, var(--panel2) 55%, transparent); }
.tlv-ug .un { font-weight: 500; }
.tlv-ug .ucount { color: var(--muted); font-size: .82rem; }
.tlv-ul { list-style: none; margin: 0; padding: 0 16px 10px 40px; }
.tlv-ul li { display: grid; grid-template-columns: 8.4rem minmax(0, 1fr) 4.6rem auto; align-items: center; gap: 4px 12px; padding: 5px 0; border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent); font-size: .86rem; }
.tlv-ul li:first-child { border-top: 0; }
.tlv-ul .ut { color: var(--fg); text-decoration: none; }
.tlv-ul .ut:hover { color: var(--accent2); text-decoration: underline; }
.tlv-ul .lvl { font-size: .74rem; }

/* narrow screens */
@media (max-width: 1100px) {
  .tlv-main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "scrub" "panel" "chart" "foot"; }
  .tlv-panelhost { position: static; max-height: none; margin: 8px 0 16px; overflow: visible; }
}
@media (max-width: 760px) {
  .tlv { --lw: 170px; }
  .tlv .tl { padding: 0 24px; }
  .tlv .tl .d .m { display: none; }
  .tlv .tl .d:first-child .m, .tlv .tl .d:last-child .m, .tlv .tl .d.on .m { display: block; }
  .tlv .tl .d.on .m { z-index: 2; padding: 0 3px; background: var(--bg); }
  .tlv-ul { padding-left: 16px; }
  .tlv-ul li { grid-template-columns: minmax(0, 1fr) auto; }
  .tlv-ul li .ut { grid-column: 1 / -1; order: 3; }
}

@media print {
  .tlv-scroll { overflow: visible; }
  .tlv-tools, .tlv-scrubwrap { display: none; }
  .tlv-panelhost { position: static; max-height: none; overflow: visible; }
}

/* the empty state (nothing at all) stands where the brief would be, above the block that holds the controls */
.tlv > .empty { margin-bottom: 1.4rem; }
