/* Session replay: the Setup section, the list of recorded visits and the player
   (crates/tally-web/src/replay/). Tokens from tokens.css: visitors in blue (violet in
   the dark), coral for money and rage, ink controls. Squared corners in rank (panels 12,
   controls 8, bars 4), no pill shapes. Motion holds Outpost's bar and stands still under
   prefers-reduced-motion. */

.rp {
  --rp-rage: var(--revenue);
  --rp-rage-ink: var(--revenue-ink);
  --rp-goal: var(--brand);
  --rp-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ------------------------------------------------------------------ switches */

/* A real checkbox, drawn as the visitor list's squared track. */
.rp-toggle-row {
  position: relative;
}

.rp-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rp-toggle {
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.rp-toggle-track {
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  margin-top: 1px;
  border-radius: 6px;
  background: var(--line);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .25s ease;
}

.rp-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(11, 13, 18, .25);
  transition: transform .3s var(--ease-out);
}

.rp-toggle-input:checked + .rp-toggle .rp-toggle-track {
  background: var(--button-bg);
  box-shadow: none;
}

.rp-toggle-input:checked + .rp-toggle .rp-toggle-thumb {
  transform: translateX(14px);
}

.rp-toggle-input:focus-visible + .rp-toggle .rp-toggle-track {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.rp-toggle-text {
  display: grid;
  gap: 2px;
}

.rp-toggle-label {
  color: var(--ink);
  font-weight: 600;
  font-size: 14.5px;
}

.rp-toggle-hint {
  color: var(--muted);
  font-size: 13px;
}

/* The list's filter switches: rage in coral. */
.rp-switch-rage[aria-checked="true"] {
  border-color: var(--revenue-line);
  background: var(--revenue-bar);
}

/* ---------------------------------------------------------- setup section */

.rp-settings {
  margin-top: 16px;
  display: grid;
  gap: 18px;
  scroll-margin-top: 16px;
}

.rp-settings-lede {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.rp-form {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-control);
  background: var(--surface-2);
}

.rp-field {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.rp-segs {
  display: inline-flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.rp-seg {
  position: relative;
}

.rp-seg-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.rp-seg-label {
  display: block;
  min-width: 52px;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.rp-seg-label:hover {
  color: var(--ink);
}

.rp-seg-input:checked + .rp-seg-label {
  background: var(--button-bg);
  color: var(--button-ink);
}

.rp-seg-input:focus-visible + .rp-seg-label {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.rp-form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.rp-saved {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--live-ink);
  font-size: 14px;
  font-weight: 560;
  animation: rp-rise .5s var(--ease-out) both;
}

.rp-saved-mark {
  width: 12px;
  height: 7px;
  margin-top: -3px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.rp-error {
  margin: 0;
}

.rp-sub {
  font-size: 15px;
  font-weight: 620;
}

.rp-tag {
  display: grid;
  gap: 8px;
  animation: rp-rise .6s var(--ease-out) both;
}

.rp-tag-lede {
  color: var(--muted);
  font-size: 14px;
}

.rp-facts {
  margin: 0;
}

.rp-keep,
.rp-consent {
  margin-top: 0;
}

.rp-consent {
  padding: 10px 14px;
  max-width: none;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: var(--brand-tint);
  color: var(--ink-2);
}

/* ------------------------------------------------------------------- list */

.rp-tally {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}

.rp-menu-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.rp-menu-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-menu-count {
  color: var(--faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.rp-menu .menu-list {
  max-height: 340px;
  overflow-y: auto;
  min-width: 240px;
}

.rp-menu .menu-value {
  max-width: 14em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-panel {
  padding: 6px 0 0;
  overflow: hidden;
}

.rp-cols,
.rp-row-link {
  display: grid;
  grid-template-columns:
    minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 1.5fr) 92px 76px 84px 34px;
  grid-template-areas: "who src path dur rev seen play";
  align-items: center;
  column-gap: 16px;
  padding: 0 20px;
}

.rp-cols {
  height: 38px;
  color: var(--faint);
  font-size: 12.5px;
  border-bottom: 1px solid var(--line-2);
}

.rp-cols span:nth-child(5),
.rp-cols span:nth-child(6) {
  text-align: right;
}

.rp-rows {
  list-style: none;
  padding: 0;
}

.rp-row + .rp-row {
  border-top: 1px solid var(--line-2);
}

.rp-row {
  animation: rp-rise .5s var(--ease-out) both;
}

.rp-row-link {
  min-height: 74px;
  padding-top: 12px;
  padding-bottom: 12px;
  color: inherit;
  text-decoration: none;
  transition: background-color .15s ease;
}

.rp-row-link:hover {
  background: var(--surface-2);
}

.rp-row-link:focus-visible {
  outline-offset: -2px;
}

.rp-pages { grid-area: path; }
.rp-dur { grid-area: dur; }
.rp-play { grid-area: play; }

.rp-pages {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.rp-pages-n {
  color: var(--faint);
  font-size: 12px;
}

.rp-chips {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  min-width: 0;
}

.rp-chips .vis-chip {
  flex: 0 1 auto;
  min-width: 2.6em;
  max-width: 13em;
}

.rp-dur {
  display: grid;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}

.rp-dur-n {
  color: var(--ink);
  font-weight: 600;
}

.rp-clicks {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.rp-rage {
  color: var(--rp-rage-ink);
  font-weight: 600;
}

/* The play affordance: a squared button that fills in as the row is hovered. */
.rp-play {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.rp-play svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.rp-row-link:hover .rp-play,
.rp-row-link:focus-visible .rp-play {
  background: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-ink);
}

.rp-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 24px 52px;
  text-align: center;
}

.rp-empty-mark svg {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: var(--faint);
  stroke-width: 2;
  stroke-linejoin: round;
}

.rp-empty-title {
  color: var(--ink);
  font-size: 17px;
  font-weight: 620;
}

.rp-empty-text {
  max-width: 54ch;
  color: var(--muted);
  font-size: 14px;
}

.rp-empty .button {
  margin-top: 6px;
}

.rp-panel .vis-pager {
  padding: 12px 20px;
  border-top: 1px solid var(--line-2);
}

/* "Watch" on a journey's visit. */
.rp-watch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  margin-left: auto;
  padding: 0 10px 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.rp-watch svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.rp-watch:hover,
.rp-watch:focus-visible {
  background: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-ink);
}

/* ----------------------------------------------------------------- player */

.rp-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.rp-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.rp-screen {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(11, 13, 18, .04), 0 18px 48px -24px rgba(11, 13, 18, .25);
}

.rp-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.rp-bar-dots {
  display: inline-flex;
  gap: 6px;
}

.rp-bar-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}

.rp-bar-url {
  flex: 1;
  min-width: 0;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--rp-mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .3s ease;
}

.rp-bar-url[data-changed] {
  animation: rp-url .6s var(--ease-out);
}

.rp-bar-size {
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The stage keeps the recording's shape; the script sets its height once it knows. */
.rp-stage {
  position: relative;
  height: min(62vh, 560px);
  overflow: hidden;
  background:
    repeating-linear-gradient(45deg, transparent 0 10px, var(--line-2) 10px 11px),
    var(--paper);
  transition: height .45s var(--ease-out);
}

.rp-frame {
  position: absolute;
  inset: 0;
}

.rp-frame .replayer-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--line);
}

.rp-frame iframe {
  display: block;
  border: 0;
  pointer-events: none;
  background: #ffffff;
}

/* rrweb's cursor, in our own look: an ink arrow, a ring on each click. */
.replayer-mouse {
  position: absolute;
  z-index: 3;
  width: 22px;
  height: 22px;
  margin: -2px 0 0 -2px;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 2.5 19.5 12 12.4 13.7 9 20.5z' fill='%230b0d12' stroke='%23ffffff' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: left .05s linear, top .05s linear;
  pointer-events: none;
}

.replayer-mouse::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border: 2px solid var(--visitors);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.3);
}

.replayer-mouse.active::after {
  animation: rp-click .45s var(--ease-out);
}

.replayer-mouse.touch-device {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  background-image: none;
  border: 3px solid transparent;
  border-radius: 50%;
}

.replayer-mouse.touch-device.touch-active {
  border-color: var(--visitors);
  background: color-mix(in srgb, var(--visitors) 18%, transparent);
}

.replayer-mouse-tail {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Loading, error and the big play button sit over the stage. */
.rp-veil {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  transition: opacity .35s ease, visibility .35s;
}

.rp-veil > * {
  grid-area: 1 / 1;
}

.rp-veil-loading,
.rp-veil-error {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  visibility: hidden;
}

.rp-veil-error {
  color: var(--down);
}

[data-state="loading"] .rp-veil-loading {
  visibility: visible;
  animation: rp-breathe 1.6s ease-in-out infinite;
}

[data-state="error"] .rp-veil-error {
  visibility: visible;
}

.rp-big-play {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 16px;
  background: var(--button-bg);
  color: var(--button-ink);
  box-shadow: 0 18px 40px -12px rgba(11, 13, 18, .45);
  cursor: pointer;
  visibility: hidden;
  opacity: 0;
  transform: scale(.85);
  transition: opacity .3s ease, transform .4s var(--ease-out), visibility .3s;
}

.rp-big-play svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

[data-state="ready"] .rp-big-play,
[data-state="ended"] .rp-big-play {
  visibility: visible;
  opacity: 1;
  transform: none;
}

[data-state="playing"] .rp-veil,
[data-state="paused"] .rp-veil {
  pointer-events: none;
}

.rp-next {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 260px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-menu);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: rp-pop .45s var(--ease-out) both;
}

.rp-next[hidden] {
  display: none;
}

.rp-next-title {
  color: var(--faint);
  font-size: 12.5px;
}

.rp-next-when {
  color: var(--ink);
  font-weight: 620;
}

.rp-next-count {
  color: var(--muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

/* The controls. */
.rp-controls-bar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.rp-play-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--button-bg);
  color: var(--button-ink);
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}

.rp-play-btn:hover {
  background: var(--button-hover);
}

.rp-play-btn:active {
  transform: scale(.94);
}

.rp-play-btn:disabled {
  opacity: .4;
  cursor: default;
}

.rp-play-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.rp-i-pause,
[data-state="playing"] .rp-i-play {
  display: none;
}

[data-state="playing"] .rp-i-pause {
  display: block;
}

.rp-time {
  min-width: 88px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rp-time-sep {
  color: var(--faint);
}

/* The scrubber: a squared track with our events on it. */
.rp-scrub {
  position: relative;
  height: 34px;
  cursor: pointer;
  touch-action: none;
  outline: none;
}

.rp-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  margin-top: -3px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.rp-idle-spans {
  position: absolute;
  inset: 0;
}

.rp-idle-span {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 3px, transparent 3px 6px);
  opacity: .9;
}

.rp-fill {
  position: absolute;
  inset: 0;
  background: var(--visitors);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.rp-knob {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 2;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--visitors), 0 2px 6px rgba(11, 13, 18, .25);
  transition: transform .15s ease;
}

.rp-scrub:hover .rp-knob,
.rp-scrub[data-dragging] .rp-knob {
  transform: scale(1.15);
}

.rp-scrub:focus-visible .rp-knob {
  box-shadow: 0 0 0 2px var(--visitors), 0 0 0 5px var(--brand-tint);
}

.rp-hover {
  position: absolute;
  bottom: calc(100% + 4px);
  z-index: 6;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-menu);
  color: var(--ink);
  font-size: 12.5px;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}

.rp-hover[hidden] {
  display: none;
}

.rp-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.rp-mark {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 22px;
  margin: -11px 0 0 -7px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  animation: rp-mark-in .55s var(--ease-out) both;
}

.rp-mark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.rp-mark[data-kind="pageview"]::before {
  width: 3px;
  height: 16px;
  border-radius: 1px;
  background: var(--visitors);
  box-shadow: 0 0 0 1.5px var(--surface);
}

.rp-mark[data-kind="goal"]::before {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--rp-goal);
  box-shadow: 0 0 0 1.5px var(--surface);
  transform: translate(-50%, -50%) rotate(45deg);
}

.rp-mark[data-kind="outbound"]::before {
  width: 8px;
  height: 8px;
  border: 2px solid var(--muted);
  border-radius: 2px;
  background: var(--surface);
}

.rp-mark[data-kind="rage"]::before {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--rp-rage);
  filter: drop-shadow(0 0 1px var(--surface));
}

.rp-mark[data-kind="payment"]::before {
  content: "$";
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--revenue);
  box-shadow: 0 0 0 2px var(--surface);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.rp-mark:hover::before,
.rp-mark:focus-visible::before {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.rp-speeds {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-2);
}

.rp-speed {
  min-width: 36px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.rp-speed:hover {
  color: var(--ink);
}

.rp-speed[aria-pressed="true"] {
  background: var(--button-bg);
  color: var(--button-ink);
}

.rp-skip .rp-toggle {
  align-items: center;
}

.rp-skip .rp-toggle-label {
  font-size: 13.5px;
  font-weight: 560;
  white-space: nowrap;
}

/* The side panel. */
.rp-side {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.rp-side-block {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  display: grid;
  gap: 12px;
}

.rp-side-title {
  font-size: 14.5px;
  font-weight: 620;
}

.rp-visitor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rp-av .av-big {
  width: 52px;
  height: 52px;
}

.rp-visitor-id {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.rp-visitor-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.15;
}

.rp-visitor-id .vis-where-text {
  white-space: normal;
}

.rp-visitor-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.rp-visitor-facts > div {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  font-size: 13.5px;
}

.rp-visitor-facts dt {
  color: var(--faint);
}

.rp-visitor-facts dd {
  margin: 0;
  display: grid;
  min-width: 0;
  color: var(--ink-2);
}

.rp-bought {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  border: 1px solid var(--revenue-line);
  border-radius: var(--radius-control);
  background: var(--revenue-bar);
}

.rp-bought-text {
  color: var(--ink);
  font-weight: 560;
}

.rp-bought .vis-journey-link {
  margin-left: auto;
}

.rp-alone {
  margin: 0;
}

.rp-ev-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 2px;
  max-height: 360px;
  overflow-y: auto;
}

.rp-ev {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: rp-rise .45s var(--ease-out) both;
}

.rp-ev-jump {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 14px 40px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .15s ease;
}

.rp-ev-jump:hover,
.rp-ev-jump:focus-visible {
  background: var(--surface-2);
  outline-offset: -2px;
}

.rp-ev[aria-current="true"] .rp-ev-jump {
  background: var(--visitors-bar);
}

.rp-ev[data-passed] .rp-ev-title {
  color: var(--ink);
}

.rp-ev-mark {
  position: relative;
  width: 14px;
  height: 18px;
}

.rp-ev-mark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.rp-ev[data-kind="pageview"] .rp-ev-mark::before {
  width: 3px;
  height: 13px;
  border-radius: 1px;
  background: var(--visitors);
}

.rp-ev[data-kind="goal"] .rp-ev-mark::before {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--rp-goal);
  transform: translate(-50%, -50%) rotate(45deg);
}

.rp-ev[data-kind="outbound"] .rp-ev-mark::before {
  width: 7px;
  height: 7px;
  border: 2px solid var(--muted);
  border-radius: 2px;
}

.rp-ev[data-kind="rage"] .rp-ev-mark::before {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid var(--rp-rage);
}

.rp-ev[data-kind="payment"] .rp-ev-mark::before {
  content: "$";
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--revenue);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.rp-ev-time {
  color: var(--faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
}

.rp-ev-body {
  display: grid;
  min-width: 0;
}

.rp-ev-title {
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 560;
  overflow-wrap: anywhere;
}

.rp-ev[data-kind="payment"] .rp-ev-title,
.rp-ev[data-kind="rage"] .rp-ev-title {
  color: var(--revenue-ink);
}

.rp-ev-detail {
  color: var(--muted);
  font-family: var(--rp-mono);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.rp-ev-receipt {
  flex: none;
  padding: 2px 6px;
  color: var(--revenue-ink);
  font-size: 12.5px;
  font-weight: 600;
}

.rp-ev-empty {
  color: var(--muted);
  font-size: 13.5px;
}

/* The visits played back to back: under the player, a row of cards. */
.rp-pl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.rp-pl {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}

.rp-pl-item {
  animation: rp-rise .45s var(--ease-out) both;
}

.rp-pl-link {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  row-gap: 2px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-control);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}

.rp-pl-link:hover {
  border-color: var(--faint);
}

.rp-pl-item[aria-current="true"] .rp-pl-link {
  border-color: var(--visitors);
  background: var(--visitors-bar);
}

.rp-pl-n {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rp-pl-item[aria-current="true"] .rp-pl-n {
  background: var(--visitors);
  color: #ffffff;
}

.rp-pl-body {
  display: grid;
  min-width: 0;
}

.rp-pl-when {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 560;
}

.rp-pl-line {
  color: var(--muted);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-pl-now {
  grid-column: 2;
  color: var(--visitors);
  font-size: 12px;
  font-weight: 700;
}

.rp-autonext .rp-toggle {
  align-items: center;
}

.rp-autonext .rp-toggle-label {
  font-size: 13.5px;
  font-weight: 560;
}

.rp-privacy {
  margin-top: 16px;
}

/* ----------------------------------------------------------------- motion */

@keyframes rp-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes rp-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(.96);
  }
}

@keyframes rp-mark-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.4);
  }
}

@keyframes rp-click {
  0% {
    opacity: .9;
    transform: translate(-50%, -50%) scale(.3);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.4);
  }
}

@keyframes rp-url {
  0% {
    color: var(--visitors);
  }
}

@keyframes rp-breathe {
  50% {
    opacity: .55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rp-row,
  .rp-ev,
  .rp-pl-item,
  .rp-mark,
  .rp-tag,
  .rp-saved,
  .rp-next,
  .rp-bar-url[data-changed],
  [data-state="loading"] .rp-veil-loading {
    animation: none;
  }

  .rp-stage,
  .rp-toggle-thumb,
  .rp-big-play,
  .replayer-mouse {
    transition: none;
  }

  .replayer-mouse.active::after {
    animation: none;
  }
}

/* ------------------------------------------------------------- narrow screens */

@media (max-width: 1080px) {
  .rp-player {
    grid-template-columns: minmax(0, 1fr);
  }

  .rp-side {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: start;
  }
}

@media (max-width: 900px) {
  .rp-cols {
    display: none;
  }

  .rp-row-link {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "who  rev"
      "src  seen"
      "path path"
      "dur  play";
    padding: 12px 14px;
    row-gap: 8px;
  }

  .rp-dur {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }

  .rp-play {
    width: 30px;
    height: 30px;
  }

  .rp-row-link .vis-rev .vis-none {
    visibility: hidden;
  }

  .rp-controls {
    width: 100%;
    margin-left: 0;
  }

  .rp-controls .vis-switch {
    flex: 1 1 calc(50% - 5px);
    justify-content: flex-start;
  }

  .rp-controls .rp-menu {
    flex: 1 1 0;
    min-width: 0;
  }

  .rp-controls .rp-menu .menu-button {
    width: 100%;
    justify-content: space-between;
  }

  .rp-controls .rp-menu:first-of-type .menu-list {
    left: 0;
    right: auto;
  }

  .rp-controls-bar {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "play time  time"
      "scrub scrub scrub"
      "speed speed skip";
    row-gap: 6px;
  }

  .rp-play-btn { grid-area: play; }
  .rp-time { grid-area: time; }
  .rp-scrub { grid-area: scrub; }
  .rp-speeds { grid-area: speed; justify-self: start; }
  .rp-skip { grid-area: skip; justify-self: end; }
}

@media (max-width: 560px) {
  .rp-bar-size {
    display: none;
  }

  .rp-controls .rp-menu {
    flex: 1 1 calc(50% - 5px);
  }

  .rp-controls .rp-menu:last-child {
    flex-basis: 100%;
  }

  .rp-controls .rp-menu:last-child .menu-list {
    right: 0;
    left: auto;
  }

  .rp-menu .menu-value {
    max-width: 8em;
  }

  .rp-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .rp-stage {
    height: 320px;
  }

  .rp-form {
    padding: 14px;
  }

  .rp-seg-label {
    min-width: 44px;
    padding: 6px 8px;
  }

  .jr-visit-head .rp-watch {
    margin-left: 0;
  }
}
