.persistent-replay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 41;
  color: var(--text-primary, #d5d7df);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.25;
}
.persistent-replay .replay-video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #090b10;
}
.persistent-replay[data-active="true"] .replay-video {
  display: block;
}
.persistent-replay .replay-hold:not([hidden]) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #090b10;
  pointer-events: none;
}
.replay-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.video-pane-canvas:hover .replay-controls,
.replay-controls:focus-within,
.replay-controls[data-held="true"],
.replay-controls[data-touch="true"] {
  opacity: 1;
  pointer-events: auto;
}
.video-pane-canvas[data-replay-idle="true"] .replay-controls {
  opacity: 0;
  pointer-events: none;
}
.persistent-replay[data-driving="true"] .replay-controls {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.video-pane-canvas[data-replay-idle="true"],
.video-pane-canvas[data-replay-idle="true"] * {
  cursor: none !important;
}
.replay-strip {
  position: relative;
  padding: 0 12px;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #090b1099;
  pointer-events: inherit;
}
.replay-strip[hidden] { display: none; }
.replay-strip button {
  border: 0;
  border-radius: 4px;
  color: inherit;
  background: transparent;
  padding: 4px;
  cursor: pointer;
  font: inherit;
  transition: color 120ms ease, background-color 120ms ease;
}
.replay-strip button:hover { background: #ffffff0a; color: #fff; }
.replay-strip button:focus-visible, .replay-track:focus-visible {
  outline: 2px solid var(--accent, #879ef5);
  outline-offset: 2px;
}
.replay-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
}
.replay-toggle svg { display: block; width: 16px; height: 16px; }
.replay-live {
  flex: 0 0 auto;
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  gap: 6px;
  font-weight: 500;
}
.replay-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #858995; }
.replay-live.is-live::before { background: #7fdca8; }
.replay-track {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 24px;
  border-radius: 3px;
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.replay-coverage, .replay-played {
  position: absolute;
  inset: 11px 0;
  height: 2px;
  transition: height 100ms ease, top 100ms ease;
}
.replay-coverage span, .replay-played span {
  position: absolute;
  height: 100%;
  background: #ffffff30;
  border-radius: 2px;
}
.replay-played span { background: var(--accent, #879ef5); }
.replay-track:hover .replay-coverage, .replay-track:hover .replay-played,
.replay-track:focus-visible .replay-coverage, .replay-track:focus-visible .replay-played {
  top: 10px;
  height: 4px;
}
.replay-position {
  position: absolute;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #879ef5);
  transform: translateX(-50%) scale(0);
  transition: transform 100ms ease;
  pointer-events: none;
}
.replay-track:hover .replay-position, .replay-track:focus-visible .replay-position,
.replay-controls[data-held="true"] .replay-position { transform: translateX(-50%) scale(1); }
.replay-hover {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed #d6d9e680;
  pointer-events: none;
}
.replay-preview-card {
  display: none;
  position: absolute;
  bottom: 30px;
  transform: translateX(-50%);
  padding: 4px;
  background: #121519;
  border: 1px solid #ffffff1a;
  border-radius: 6px;
  box-shadow: 0 4px 14px #00000040;
  white-space: normal;
  width: max-content;
  box-sizing: border-box;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.replay-track[data-hover="true"]:hover .replay-hover,
.replay-track[data-hover="true"]:hover .replay-hover-preview {
  display: block;
}
.replay-time {
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
  color: var(--text-secondary, #aeb4c0);
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.video-pane-canvas--replay .hud {
  display: none;
}

.replay-thumbnail { display: block; width: 160px; height: 90px; background: #090b10; border-radius: 3px; }
.replay-thumbnail[hidden] { display: none; }
.replay-hover-time { display: block; padding: 4px 6px 1px; line-height: 16px; text-align: center; }
.replay-hover-date, .replay-hover-end, .replay-hover-offset { display: block; }
.replay-hover-end[hidden], .replay-hover-offset[hidden] { display: none; }
.replay-hover-offset { color: var(--text-secondary, #aeb4c0); font-size: 10px; }
.replay-temporal-preview { bottom: calc(100% + 8px); }
.replay-temporal-preview[data-visible="true"] { display: block; }
.replay-thumbnail { max-width: 100%; height: auto; aspect-ratio: 16 / 9; }
@media (prefers-reduced-motion: reduce) {
  .replay-controls, .replay-strip button, .replay-position, .replay-coverage, .replay-played { transition: none; }
}

.video-pane-canvas:has(.replay-strip:not([hidden])) .hud {
  bottom: calc(32px + var(--spacing-md, 12px));
}

.video-pane-canvas:has(.replay-strip:not([hidden])):has(.replay-overview:not([hidden])) .hud {
  bottom: calc(32px + var(--replay-window-height, 24px) + 6px + var(--spacing-md, 12px));
}

.replay-toggle:disabled { opacity: .35; cursor: default; }
.replay-track[aria-disabled="true"] { cursor: default; }
.replay-track[aria-disabled="true"]::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 11px;
  height: 2px;
  background: #ffffff30;
  border-radius: 2px;
}
.replay-track[aria-disabled="true"] .replay-hover,
.replay-track[aria-disabled="true"] .replay-hover-preview,
.replay-track[aria-disabled="true"] .replay-position { display: none; }
.replay-toggle[data-icon="loading"] { opacity: 1; }
.replay-toggle[data-icon="loading"] svg { animation: replay-spin .8s linear infinite; }
@keyframes replay-spin { to { transform: rotate(360deg); } }

.replay-timeline {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.replay-timeline .replay-track {
  flex: none;
  width: 100%;
}
.video-pane-canvas { --replay-window-height: 24px; }
.replay-controls {
  display: grid;
  grid-template-columns: 28px max-content minmax(0, 1fr) 48px max-content;
  column-gap: 8px;
  padding-inline: 12px;
  background: #090b1099;
}
.replay-controls:has(.replay-overview:not([hidden])) { padding-top: 6px; }
.replay-strip {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 2;
  grid-template-columns: subgrid;
  padding: 0;
  background: transparent;
}
.replay-controls:has(.replay-strip[hidden]) { display: none; }
.replay-overview {
  position: relative;
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  height: var(--replay-window-height, 24px);
  touch-action: none;
  cursor: pointer;
  pointer-events: inherit;
}
.replay-overview::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 0;
  right: 0;
  height: 20px;
  background: #ffffff16;
  border-radius: 2px;
}
.replay-overview-coverage span {
  position: absolute;
  top: 5px;
  height: 14px;
  background: #a6b6f580;
}
.replay-overview-before,
.replay-overview-after {
  position: absolute;
  top: 2px;
  height: 20px;
  background: #090b10b3;
  pointer-events: none;
}
.replay-overview-before {
  left: 0;
}
.replay-overview-after {
  right: 0;
}
.replay-window {
  --frame-width: min(100%, max(28px, var(--range-width)));
  position: absolute;
  left: clamp(0px, var(--range-start), calc(100% - var(--frame-width)));
  width: var(--frame-width);
  top: 1px;
  height: 22px;
  box-sizing: border-box;
  border: 1px solid #b8c7ff;
  border-radius: 3px;
  background: #879ef529;
  cursor: grab;
}
.replay-window i {
  position: absolute;
  top: 0;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
}
.replay-window i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 3px;
  width: 2px;
  height: 12px;
  border-radius: 1px;
  background: #d6dfff;
}
.replay-window i[data-edge="start"] {
  left: 0;
}
.replay-window i[data-edge="end"] {
  right: 0;
}
.replay-overview[data-all="true"],
.replay-overview[data-all="true"] .replay-window {
  cursor: default;
}
.replay-window-start,
.replay-window-end {
  grid-row: 1;
  display: block;
  align-self: center;
  height: 12px;
  min-width: 0;
  line-height: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: inherit;
}
.replay-window-start {
  grid-column: 1 / 3;
  padding-right: 0;
  text-align: right;
}
.replay-window-end {
  grid-column: 4 / 6;
  padding-left: 0;
  text-align: left;
}
.replay-window-date { font: inherit; color: inherit; }
.replay-window-date::after { content: " "; white-space: pre; }
.replay-window-clock { line-height: 12px; }
.replay-window-start[hidden],
.replay-window-end[hidden] { display: none; }
.replay-hover-preview { bottom: calc(100% + var(--replay-window-height, 24px) + 10px); }
.replay-temporal-preview { bottom: calc(100% + 8px); }
.replay-range {
  flex: 0 0 48px;
  width: 48px;
  padding: 2px 0;
  border: 0;
  border-radius: 3px;
  background: #090b10b3;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.replay-range option {
  background: #171a23;
}
.replay-overview:focus-visible,
.replay-range:focus-visible {
  outline: 2px solid var(--accent, #879ef5);
  outline-offset: 2px;
}
.replay-position[hidden],
.replay-overview[hidden] {
  display: none;
}
.persistent-replay[data-driving="true"] .replay-controls .replay-overview,
.video-pane-canvas[data-replay-idle="true"] .replay-controls .replay-overview,
.replay-controls .replay-overview[inert] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
