/* live: one camera feed being read in real time (people, tables, paths, heat, events) */
.lv-head { max-width: 780px; margin: 0 auto clamp(40px, 5vw, 64px); display: grid; justify-items: center; gap: 18px; }
.lv-sub { max-width: 640px; }

.lv-app { position: relative; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, #151515, #0f0f0f); overflow: hidden; box-shadow: 0 50px 120px -50px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.lv-app::before { content: ""; position: absolute; left: 10%; right: 10%; top: 0; height: 1px; background: linear-gradient(90deg, rgba(110, 147, 247, 0), rgba(110, 147, 247, 0.55), rgba(110, 147, 247, 0)); pointer-events: none; z-index: 3; }

/* top bar */
.lv-top { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.lv-cams, .lv-layers { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.02); }
.lv-cams button, .lv-layers button { appearance: none; border: 0; background: transparent; color: var(--mist); font: 500 11px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 9px 12px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.lv-cams button:hover, .lv-layers button:hover { color: var(--fg-2); }
.lv-cams button[aria-selected="true"] { background: rgba(255, 255, 255, 0.09); color: #fff; }
.lv-cams button i { width: 6px; height: 6px; border-radius: 50%; background: var(--mist-2); flex: none; }
.lv-cams button[aria-selected="true"] i { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.8); }
.lv-layers button[aria-pressed="true"] { color: #fff; background: rgba(255, 255, 255, 0.06); }
.lv-sw { width: 9px; height: 9px; border-radius: 2px; border: 1.5px solid currentColor; opacity: 0.35; flex: none; transition: opacity 0.2s; }
.lv-layers button[aria-pressed="true"] .lv-sw { opacity: 1; }
.lv-sw--people { color: #6E93F7; }
.lv-sw--tables { color: var(--ok); }
.lv-sw--trails { color: var(--amber); border-radius: 50%; }
.lv-sw--heat { color: transparent; background: linear-gradient(135deg, #3D6FF5, #F2A24A 60%, #C8541C); }
.lv-cams button:focus-visible, .lv-layers button:focus-visible, .lv-play:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }
.lv-meta { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lv-play { appearance: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background 0.2s, border-color 0.2s; flex: none; }
.lv-play:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.35); }
.lv-play svg { width: 14px; height: 14px; fill: currentColor; grid-area: 1 / 1; }
.lv-play .lv-i-play, .lv-play.is-paused .lv-i-pause { display: none; }
.lv-play.is-paused .lv-i-play { display: block; }

/* body: camera stage + rail */
.lv-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.lv-stage { position: relative; aspect-ratio: 16 / 9; background: #090909; overflow: hidden; }
.lv-stage video, .lv-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lv-stage video { object-fit: cover; }
.lv-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0) 16%, rgba(0, 0, 0, 0) 82%, rgba(0, 0, 0, 0.5)); }
.lv-tag, .lv-proc, .lv-clock, .lv-trk { position: absolute; z-index: 2; color: rgba(255, 255, 255, 0.88); font: 500 11px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; display: flex; align-items: center; gap: 9px; pointer-events: none; }
.lv-tag { left: 18px; top: 16px; }
.lv-tag i { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.8); animation: lv-rec 1.6s steps(1) infinite; }
.lv-proc { right: 16px; top: 12px; padding: 7px 10px; border-radius: 4px; background: rgba(10, 12, 16, 0.72); border: 1px solid rgba(110, 147, 247, 0.5); }
.lv-proc i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-2); box-shadow: 0 0 0 0 rgba(110, 147, 247, 0.6); animation: lv-ping 2s var(--ease) infinite; }
.lv-clock { left: 18px; bottom: 16px; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.72); white-space: pre; }
.lv-trk { right: 18px; bottom: 16px; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.72); }

.lv-rail { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lv-kpis { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.lv-kpi { padding: 14px 16px 15px; display: grid; gap: 9px; min-width: 0; }
.lv-kpi:nth-child(odd) { border-right: 1px solid var(--line); }
.lv-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.lv-kpi b { font: 400 30px/1 var(--f-body); letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; }
.lv-kpi small { color: var(--mist); font-size: 15px; letter-spacing: 0; }
.lv-block { padding: 14px 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.lv-block--feed { flex: 1 1 0; min-height: 0; overflow: hidden; border-bottom: 0; position: relative; }
.lv-block--feed::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: linear-gradient(rgba(16, 16, 16, 0), #101010); pointer-events: none; }
.lv-block__h { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.lv-dim { color: var(--mist-2); }

.lv-tables { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.lv-tb { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 78px 34px; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.025); border: 1px solid transparent; font-size: 13px; color: var(--fg-2); transition: border-color 0.3s, background 0.3s; }
.lv-tb b { font: 500 11px/1 var(--f-mono); color: #fff; letter-spacing: 0.04em; }
.lv-tb__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-seats { display: flex; gap: 3px; }
.lv-seats i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.24); transition: background 0.3s, border-color 0.3s; }
.lv-seats i.on { background: var(--ok); border-color: var(--ok); }
.lv-tb__st { font: 500 10.5px/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--mist); }
.lv-tb__t { color: var(--mist-2); font: 400 11px/1 var(--f-mono); text-align: right; font-variant-numeric: tabular-nums; }
.lv-tb[data-s="seated"] .lv-tb__st { color: var(--ok); }
.lv-tb[data-s="left"] { border-color: rgba(242, 162, 74, 0.35); background: rgba(242, 162, 74, 0.06); }
.lv-tb[data-s="left"] .lv-tb__st { color: var(--amber); }
.lv-tb[data-s="left"] .lv-seats i { border-color: rgba(242, 162, 74, 0.5); }
.lv-tb.is-flash { border-color: rgba(110, 147, 247, 0.6); }

.lv-feed { list-style: none; margin: 0; padding: 0; display: grid; }
.lv-ev { display: grid; grid-template-columns: 58px 8px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; font-size: 13px; line-height: 1.35; color: var(--fg-2); border-bottom: 1px solid rgba(255, 255, 255, 0.05); animation: lv-in 0.6s var(--ease-out) both; }
.lv-ev time { color: var(--mist); font: 400 11px/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.lv-ev i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-2); }
.lv-ev[data-tone="ok"] i { background: var(--ok); }
.lv-ev[data-tone="warn"] i { background: var(--amber); box-shadow: 0 0 8px rgba(242, 162, 74, 0.6); }
.lv-ev[data-tone="mist"] i { background: var(--mist-2); }
.lv-ev:first-child span { color: #fff; }

/* timeline */
.lv-time { border-top: 1px solid var(--line); padding: 12px 16px 14px; }
.lv-time__h { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.lv-time canvas { display: block; width: 100%; height: 96px; cursor: pointer; touch-action: pan-y; }
.lv-app.is-static .lv-time canvas { cursor: default; }
.lv-note { text-align: center; margin-top: 18px; color: var(--mist-2); }

@keyframes lv-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes lv-rec { 0% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes lv-ping { 0% { box-shadow: 0 0 0 0 rgba(110, 147, 247, 0.6); } 70%, 100% { box-shadow: 0 0 0 7px rgba(110, 147, 247, 0); } }

@media (max-width: 1180px) {
  .lv-body { grid-template-columns: 1fr; }
  .lv-rail { border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; }
  .lv-kpis { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
  .lv-kpi:nth-child(odd) { border-right: 0; }
  .lv-kpi:nth-child(-n+2) { border-bottom: 0; }
  .lv-kpi + .lv-kpi { border-left: 1px solid var(--line); }
  .lv-block { border-bottom: 0; }
  .lv-block--feed { border-left: 1px solid var(--line); max-height: 300px; }
}
@media (max-width: 720px) {
  .lv-top { flex-wrap: wrap; gap: 10px; padding: 10px; }
  .lv-cams { flex: 1 1 100%; }
  .lv-cams button { flex: 1 1 0; justify-content: center; padding: 9px 6px; font-size: 10px; letter-spacing: 0.05em; }
  .lv-layers { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .lv-layers::-webkit-scrollbar { display: none; }
  .lv-layers button { padding: 8px 9px; font-size: 10px; letter-spacing: 0.05em; flex: 1 0 auto; justify-content: center; }
  .lv-sw { display: none; }
  .lv-meta .label { display: none; }
  .lv-tag { left: 12px; top: 11px; font-size: 9.5px; }
  .lv-proc { display: none; }
  .lv-clock, .lv-trk { font-size: 9.5px; bottom: 10px; }
  .lv-clock { left: 12px; }
  .lv-trk { right: 12px; }
  .lv-rail { grid-template-columns: 1fr; }
  .lv-kpis { grid-template-columns: 1fr 1fr; }
  .lv-kpi { padding: 12px 14px; }
  .lv-kpi + .lv-kpi { border-left: 0; }
  .lv-kpi:nth-child(odd) { border-right: 1px solid var(--line); }
  .lv-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .lv-kpi b { font-size: 26px; }
  .lv-block { border-bottom: 1px solid var(--line); padding: 12px 14px; }
  .lv-block--feed { border-left: 0; border-bottom: 0; max-height: 236px; }
  .lv-tb { grid-template-columns: 26px minmax(0, 1fr) auto 70px; gap: 8px; }
  .lv-tb__t { display: none; }
  .lv-time { padding: 12px 14px; }
  .lv-time canvas { height: 104px; }
}
@media (prefers-reduced-motion: reduce) {
  .lv-ev { animation: none; }
  .lv-tag i, .lv-proc i { animation: none; }
}
