/* Live timeline: shared bar with hatched partial coverage, range marking/export, markers (2026-11-03 design C1). Loaded after app.css. */

/* ---- playhead: white (amber stays the brand), with a time bubble ---- */
.tlhead { background: var(--text); box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface) 70%, transparent); }
.tlhead::before { background: var(--text); }
.tlhead #tlHeadT { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); padding: 1px 6px; border-radius: 4px; background: var(--text); color: var(--surface); font-size: var(--fs-s); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 15px; white-space: nowrap; pointer-events: none; }
.tlhead #tlHeadT[data-edge="l"] { transform: translateX(-2px); }
.tlhead #tlHeadT[data-edge="r"] { transform: translateX(calc(-100% + 2px)); }

/* ---- one shared recording bar: solid = all shown cameras, hatched = some ---- */
.tlspans { height: 14px; top: 23px; }
.tlspans i { opacity: .7; }
.tlspans i.part { cursor: help; background: repeating-linear-gradient(135deg, var(--ok) 0 4px, color-mix(in srgb, var(--ok) 38%, #000) 4px 8px); opacity: .85; }
.tlspans i.tail { opacity: .55; }
.tlcov b { font-weight: 600; }

/* ---- loading: 2px indeterminate bar along the top of the strip ---- */
.tlload { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; pointer-events: none; z-index: 7; opacity: 0; transition: opacity .15s; }
.tlload::before { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--text); border-radius: 2px; animation: tlslide 1.1s ease-in-out infinite; }
.tlarea.loading .tlload { opacity: 1; }
@keyframes tlslide { 0% { left: -35%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .tlload::before { animation: none; width: 100%; opacity: .5; } }

/* ---- alert markers: one class color each (amber is not an alert color) ---- */
/* Solid colour with a high-contrast icon and word: readable in sunlight and on any theme. */
.tlm { --kc: var(--muted); width: 24px; height: 24px; transform: translateX(-12px); color: light-dark(#fff, #0b0d10); border-color: transparent; background: light-dark(color-mix(in srgb, var(--kc) 80%, #000), var(--kc)); box-shadow: 0 0 0 1px var(--surface); }
.tlm:hover, .tlm:focus-visible { transform: translateX(-12px) scale(1.12); }
.tlm .ic { width: 16px; height: 16px; stroke-width: 2.25; flex: none; }
.tlm.wd { width: auto; padding: 0 7px 0 4px; gap: 3px; white-space: nowrap; }
.tlm.wd span { font-size: 12px; font-weight: 700; line-height: 1; }
.tlm u { left: 12px; top: 27px; background: var(--kc); opacity: .8; }
.tlm.k-person { --kc: var(--person); }
.tlm.k-vehicle { --kc: var(--vehicle); }
.tlm.k-animal { --kc: var(--animal); }
.tlm.k-face { --kc: var(--face); }
.tlm.k-package { --kc: var(--package); }
.tlm.k-other { --kc: var(--muted); }
.tlkind.k-person { --kc: var(--person); } .tlkind.k-vehicle { --kc: var(--vehicle); } .tlkind.k-animal { --kc: var(--animal); }
.tlkind.k-face { --kc: var(--face); } .tlkind.k-package { --kc: var(--package); } .tlkind.k-other { --kc: var(--muted); }
.tlkind .ic { color: var(--kc); }
.tlkind.on { background: color-mix(in srgb, var(--kc) 18%, var(--surface)); border-color: var(--kc); }
.tlkinds { display: flex; gap: 4px; }
@media (pointer: coarse) { .tlm::after { inset: -6px -5px; } }

/* ---- second bar: zoom, range chips, go to, mark in / out ---- */
.tlbar2 { margin-top: calc(-1 * var(--s1, 4px)); }
.tlchips { display: flex; gap: 4px; }
.tlchip { min-width: 0; padding: 4px 9px; font-variant-numeric: tabular-nums; }
.tlchip.on { background: var(--surface2); border-color: var(--text); color: var(--text); font-weight: 600; }
.tlgoto { display: flex; align-items: center; gap: 6px; font-size: var(--fs-s); color: var(--muted); }
.tlgoto input { width: auto; min-width: 0; padding: 4px 6px; font-size: var(--fs-s); }
.tlmk { min-width: 0; font-variant-numeric: tabular-nums; }
@media (pointer: coarse) { .tlchip, .tlmk, .tlgoto input { min-height: 40px; } .tlmk { padding-left: 14px; padding-right: 14px; } }

/* ---- marked range ---- */
.tlrange { position: absolute; top: 0; bottom: 0; z-index: 3; background: color-mix(in srgb, var(--text) 14%, transparent); border-left: 2px solid var(--text); border-right: 2px solid var(--text); pointer-events: none; }
.tlrange.half { border-right: 0; background: none; }
.tlrh { position: absolute; top: 24px; bottom: 6px; width: 16px; pointer-events: auto; cursor: ew-resize; touch-action: none; }
.tlrh::before { content: ""; position: absolute; top: 50%; width: 6px; height: 26px; margin-top: -13px; border-radius: 3px; background: var(--text); border: 1px solid var(--surface); box-sizing: border-box; }
.tlrh[data-w="a"] { left: -9px; } .tlrh[data-w="a"]::before { right: 3px; }
.tlrh[data-w="b"] { right: -9px; } .tlrh[data-w="b"]::before { left: 3px; }
.tlrange.half .tlrh { display: none; }
@media (pointer: coarse) { .tlrh { width: 28px; } .tlrh[data-w="a"] { left: -15px; } .tlrh[data-w="a"]::before { right: 9px; } .tlrh[data-w="b"] { right: -15px; } .tlrh[data-w="b"]::before { left: 9px; } }
.tlexp { position: absolute; top: 2px; z-index: 8; height: 22px; padding: 0 10px; border-radius: 11px; border: 1px solid var(--text); background: var(--text); color: var(--surface); font-size: var(--fs-s); font-weight: 700; white-space: nowrap; cursor: pointer; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); }
.tlexp:hover, .tlexp:focus-visible { filter: brightness(1.12); }
.tlexp[hidden] { display: none; }
@media (pointer: coarse) { .tlexp { height: 32px; border-radius: 16px; padding: 0 14px; } }

/* ---- alert list (a mark that cannot be zoomed apart) ---- */
.tlpop { position: fixed; z-index: 125; overflow-y: auto; min-width: 240px; max-width: min(360px, calc(100vw - 12px)); background: var(--raised); color: var(--text); border: 1px solid var(--line2); border-radius: var(--r2); box-shadow: var(--shadow); padding: 4px; }
.tlpop[hidden] { display: none; }
.tlpoph { padding: 4px 8px; font-size: var(--fs-s); color: var(--muted); }
.tlpr { display: grid; grid-template-columns: 22px auto 1fr auto; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 4px 8px; background: none; border: 0; border-radius: var(--r1); color: var(--text); font: inherit; font-size: var(--fs-s); text-align: left; cursor: pointer; }
.tlpr:hover, .tlpr:focus-visible { background: var(--surface2); outline: none; }
.tlpr b { font-variant-numeric: tabular-nums; }
.tlpr em { font-style: normal; color: var(--muted); }
.tlpr .tlpi { display: flex; color: var(--kc, var(--muted)); }
.tlpr.k-person { --kc: var(--person); } .tlpr.k-vehicle { --kc: var(--vehicle); } .tlpr.k-animal { --kc: var(--animal); }
.tlpr.k-face { --kc: var(--face); } .tlpr.k-package { --kc: var(--package); }
.tlpr .ic { width: 16px; height: 16px; }
@media (pointer: coarse) { .tlpr { min-height: 44px; } }

/* ---- phone upright ---- */
@media (max-width: 640px) {
  .tlbar2 { gap: var(--s2); }
  .tlgoto span { display: none; }
  .tlgoto { order: 3; flex: 1 1 100%; min-width: 0; }
  .tlgoto input { width: 100%; }
  .tlbar2 .tlright { order: 2; margin-left: auto; }
}
/* ---- phone on its side: both bars are single scrolling rows ---- */
@media (max-height: 500px) and (pointer: coarse) {
  .tlbar, .tlbar2 { overflow-x: auto; scrollbar-width: none; }
  .tlbar::-webkit-scrollbar, .tlbar2::-webkit-scrollbar { display: none; }
  .tlbar2 { margin-top: 0; }
  .tlbar2 > * { flex: none; }
  .tlbar .tlgrp, .tlbar .tlspdsel { flex: none; }
  .tlbar2 .btn, .tlbar2 .tlgoto input { min-height: 34px; }
  .tlchip, .tlmk { padding: 2px 10px; }
  .tlgoto span { display: none; }
  .tlexp { height: 26px; }
}
