/* Drift replay: a simulated desktop that replays a real Ecdotic run.
   The stage is laid out at a fixed 1000 x 625 logical size and scaled to fit
   (--replay-scale, set by replay.js). Below 640px the component switches to a
   compact layout (.is-compact): one or two windows at a time, no scaling. */

.replay {
  /* Keep the whole frame plus its controls on screen on short laptop displays. */
  max-width: min(100%, max(640px, calc((100vh - 240px) * 1.6)));
  margin-inline: auto;
  /* Status colors come from site.css so both files change together. */
  --r-ink: var(--ink);
  --r-ink-2: var(--ink-2);
  --r-ink-3: #69707b;
  --r-line: rgba(21, 23, 28, 0.1);
  --r-paper: #faf8f4;
  --r-hl: var(--diverged-soft);
  --r-hl-line: var(--diverged-line);
  --r-hl-ink: var(--diverged);
  --r-ok: var(--matches);
  --r-ok-soft: var(--matches-soft);
  --r-unknown: var(--unknown);
  --r-unknown-soft: var(--unknown-soft);
  /* Brand-dependent colors of the replay's desktop scene. Values match the
     current (pre-Ecdotic) palette; a restyle only edits this list. */
  --r-desk-frame: #0f1716;
  --r-desk-shadow-1: rgba(12, 20, 19, 0.6);
  --r-desk-shadow-2: rgba(12, 20, 19, 0.4);
  --r-desk-shadow-3: rgba(12, 20, 19, 0.1);
  --r-desk-text: #e6ece9;
  --r-desk-glow-accent: rgba(127, 207, 187, 0.22);
  --r-desk-glow-diverged: rgba(181, 84, 27, 0.2);
  --r-desk-bg: linear-gradient(160deg, #1e2d2a 0%, #131c1b 55%, #0c1211 100%);
  --r-desk-bar: rgba(9, 14, 13, 0.6);
  --r-hot-on-dark: #f3d3b6;
  --r-hot-on-dark-line: rgba(243, 211, 182, 0.35);
  --r-pulse-accent: rgba(127, 207, 187, 0.7);
  --r-pulse-accent-soft: rgba(127, 207, 187, 0.35);
  --r-pulse-accent-clear: rgba(127, 207, 187, 0);
  --r-app-runbook: linear-gradient(160deg, #3c8f7f, #0f6b5f);
  --r-app-report: linear-gradient(160deg, #d88a52, #b5541b);
  --r-term-bg: #0f1514;
  --r-term-bar: linear-gradient(#262d2c, #1b2120);
  --r-term-text: #d6e2de;
  --r-term-accent: #7fcfbb;
  --r-term-ok: #8fe0c9;
  --r-focus-glow: rgba(15, 107, 95, 0.28);
  --r-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r-camera-ease: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- Frame + stage ---------- */

.replay-frame {
  position: relative;
  /* Windows move between beats; never let the browser anchor scrolling to them. */
  overflow-anchor: none;
  aspect-ratio: 1000 / 625;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  background: var(--r-desk-frame);
  box-shadow:
    0 60px 110px -40px var(--r-desk-shadow-1),
    0 22px 44px -24px var(--r-desk-shadow-2),
    0 0 0 1px var(--r-desk-shadow-3);
}

.replay-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 625px;
  overflow: hidden;
  transform: scale(var(--replay-scale, 1));
  transform-origin: 0 0;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
  color: var(--r-ink);
  -webkit-font-smoothing: antialiased;
}

.replay-noscript {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--r-desk-text);
  text-align: center;
}

.replay-wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(110% 80% at 50% -12%, var(--r-desk-glow-accent), transparent 58%),
    radial-gradient(80% 70% at 105% 110%, var(--r-desk-glow-diverged), transparent 60%),
    repeating-linear-gradient(172deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 26px),
    var(--r-desk-bg);
}

.replay-world {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  transform: translate(var(--cam-x, 0px), var(--cam-y, 0px)) scale(var(--cam-k, 1));
  transition: transform 0.95s var(--r-camera-ease), opacity 0.4s ease;
}

.replay.is-resetting .replay-world {
  opacity: 0;
}

/* ---------- System bar + dock ---------- */

.replay-systembar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 30px;
  padding: 0 14px;
  background: var(--r-desk-bar);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.86);
  font-size: 11.5px;
}

.replay-sys-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.replay-sys-brand img {
  width: 16px;
  height: 16px;
  padding: 1px;
  border-radius: 4px;
  background: #f6f4ef;
}

.replay-sys-context {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
}

.replay-sys-pills {
  display: flex;
  gap: 6px;
}

.replay-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.replay-pill svg {
  width: 11px;
  height: 11px;
}

.replay-pill--synthetic {
  color: var(--r-hot-on-dark);
  border-color: var(--r-hot-on-dark-line);
}

.replay-pill.is-pulse {
  animation: replay-pill-pulse 1.8s ease 1;
}

@keyframes replay-pill-pulse {
  0% { box-shadow: 0 0 0 0 var(--r-pulse-accent); background: var(--r-pulse-accent-soft); }
  100% { box-shadow: 0 0 0 10px var(--r-pulse-accent-clear); background: rgba(255, 255, 255, 0.07); }
}

/* Dock styles stay for when SHOW_DOCK in replay.js is turned back on. */
.replay-dock {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 60;
  display: flex;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.replay-dock-app {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #ffffff;
  background: var(--app-bg, #3a3f4a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 10px -4px rgba(0, 0, 0, 0.5);
}

.replay-dock-app svg {
  width: 18px;
  height: 18px;
}

.replay-dock-app::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.replay-dock-app.is-open::after {
  opacity: 1;
}

.replay-dock-app.is-bounce {
  animation: replay-bounce 0.7s var(--r-ease) 1;
}

@keyframes replay-bounce {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(-9px); }
  65% { transform: translateY(-2px); }
}

.replay-dock-app--runbook { --app-bg: var(--r-app-runbook); }
.replay-dock-app--log { --app-bg: linear-gradient(160deg, #6b7a93, #465267); }
.replay-dock-app--terminal { --app-bg: linear-gradient(160deg, #3a3f4a, #15171c); }
.replay-dock-app--report { --app-bg: var(--r-app-report); }
.replay-dock-app--review { --app-bg: linear-gradient(160deg, #8a7fd0, #5b50a8); }
.replay-dock-app--summary { --app-bg: linear-gradient(160deg, #c9b37a, #9b8446); }

/* ---------- Windows ---------- */

.rwin {
  position: absolute;
  display: flex;
  flex-direction: column;
  border-radius: 11px;
  overflow: hidden;
  background: #ffffff;
  box-shadow:
    0 26px 54px -24px rgba(0, 0, 0, 0.6),
    0 8px 18px -10px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.97);
  transition:
    opacity 0.45s ease,
    transform 0.65s var(--r-ease),
    filter 0.45s ease,
    visibility 0s linear 0.65s;
}

.rwin.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.rwin.is-dim {
  filter: brightness(0.82) saturate(0.7);
}

.rwin-bar {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  background: linear-gradient(#fbfaf8, #f0eee9);
  border-bottom: 1px solid var(--r-line);
  color: var(--r-ink-2);
  font-size: 11.5px;
}

.rwin-dots {
  display: flex;
  gap: 5px;
}

.rwin-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e8695e;
}

.rwin-dots i:nth-child(2) { background: #efbd4c; }
.rwin-dots i:nth-child(3) { background: #5dbd66; }

.rwin-title {
  position: absolute;
  left: 64px;
  right: 64px;
  overflow: hidden;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rwin-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Desktop positions, in stage coordinates. */
.rwin--runbook { left: 32px; top: 48px; width: 408px; height: 300px; }
.rwin--log { left: 470px; top: 62px; width: 498px; height: 236px; }
.rwin--terminal { left: 70px; top: 300px; width: 560px; height: 245px; }
.rwin--report { left: 520px; top: 124px; width: 450px; height: 432px; }
.rwin--review { left: 270px; top: 105px; width: 460px; height: 360px; }
.rwin--summary { left: 170px; top: 140px; width: 660px; height: 300px; }

/* Reveal helper for content that appears in sequence. */
.rv {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.4s ease, transform 0.5s var(--r-ease);
}

.rv.is-shown {
  opacity: 1;
  transform: none;
}

.r-code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1efe9;
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.r-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.r-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.r-badge--matches { background: var(--r-ok-soft); color: var(--r-ok); }
.r-badge--diverged { background: var(--r-hl); color: var(--r-hl-ink); }
.r-badge--insufficient_evidence { background: var(--r-unknown-soft); color: var(--r-unknown); }
.r-badge--neutral { background: #eeece6; color: var(--r-ink-2); }
.r-badge--neutral::before { display: none; }

/* ---------- Runbook (document) ---------- */

.doc {
  padding: 14px 16px;
}

.doc-path {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--r-ink-3);
}

.doc-title {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--r-ink-3);
  font-size: 11px;
}

.doc-steps {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
}

.doc-step {
  display: grid;
  grid-template-columns: 50px 20px minmax(0, 1fr);
  align-items: center;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.doc-line {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--r-ink-3);
}

.doc-n {
  font-weight: 700;
  color: var(--r-ink-3);
}

.doc-step.is-hl,
.log-row.is-hl td {
  background: var(--r-hl);
}

.doc-step.is-hl {
  box-shadow: inset 3px 0 0 var(--r-hl-line);
}

.doc-step.is-hl .doc-n,
.doc-step.is-hl .doc-line {
  color: var(--r-hl-ink);
}

/* ---------- Deploy log ---------- */

.log {
  padding: 12px 14px;
}

.log-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--r-ink-3);
  font-size: 11px;
}

.log-head strong {
  color: var(--r-ink);
  font-weight: 600;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.log-table th {
  padding: 5px 8px;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--r-ink-3);
}

.log-table td {
  padding: 7px 8px;
  border-top: 1px solid var(--r-line);
  white-space: nowrap;
  transition: background-color 0.4s ease;
}

.log-row.is-hl td:first-child {
  box-shadow: inset 3px 0 0 var(--r-hl-line);
}

.log-ok {
  color: var(--r-ok);
}

.log-flag {
  margin-top: 10px;
}

/* ---------- Terminal ---------- */

.rwin--terminal {
  background: var(--r-term-bg);
}

.rwin--terminal .rwin-bar {
  background: var(--r-term-bar);
  border-bottom-color: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.66);
}

.term {
  padding: 12px 14px;
  color: var(--r-term-text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
}

.term-cmd {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term-prompt {
  color: var(--r-term-accent);
}

.term-caret {
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 1px;
  vertical-align: -2px;
  background: var(--r-term-accent);
  animation: replay-caret 1s steps(2, start) infinite;
}

.term.is-done .term-caret {
  display: none;
}

@keyframes replay-caret {
  to { visibility: hidden; }
}

.term-out {
  margin: 8px 0 0;
  font: inherit;
  white-space: pre;
}

.term-key { color: #a9c7f5; }
.term-str { color: #f2c38b; }
.term-hot { color: #ffb38a; font-weight: 700; }
.term-ok { color: var(--r-term-ok); }

/* ---------- Report (evaluation.md) ---------- */

.md {
  padding: 13px 16px;
  font-size: 11.5px;
}

.md-file {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--r-ink-3);
}

.md-title {
  margin-top: 3px;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
}

.md-note {
  margin: 7px 0 0;
  padding: 6px 9px;
  border-left: 3px solid #d9d3c5;
  background: var(--r-paper);
  color: var(--r-ink-2);
  font-size: 10.5px;
  line-height: 1.4;
}

.md-kv {
  display: grid;
  gap: 4px;
  margin-top: 9px;
}

.md-kv > div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.md-kv dt {
  color: var(--r-ink-3);
}

.md-kv dd {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.md-h {
  margin-top: 10px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--r-ink-3);
}

.md-list {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  padding: 0;
  list-style: none;
}

.md-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.md-arrow {
  color: var(--r-hl-line);
  font-weight: 700;
}

.md-hash {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--r-ink-2);
}

.md-limit {
  margin-top: 4px;
  color: var(--r-ink-2);
  font-size: 10.5px;
}

/* ---------- Review ---------- */

.review {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
}

.review-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--r-ink-3);
}

.review-claim {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.35;
}

.review-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--r-ink-3);
  font-size: 11px;
}

.review-state .r-badge {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.review-state .r-badge.is-accepted {
  background: var(--r-ok-soft);
  color: var(--r-ok);
}

.review-state .r-badge.is-accepted::before {
  display: inline-block;
}

.review-actions {
  display: flex;
  gap: 6px;
}

.rbtn {
  display: inline-flex;
  align-items: center;
  height: 27px;
  padding: 0 11px;
  border: 1px solid rgba(21, 23, 28, 0.18);
  border-radius: 7px;
  background: #ffffff;
  color: var(--r-ink-2);
  font-size: 11.5px;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.rbtn--accept {
  border-color: var(--r-ink);
  background: var(--r-ink);
  color: #ffffff;
}

.rbtn.is-pressed {
  transform: scale(0.94);
  box-shadow: 0 0 0 5px var(--r-focus-glow);
}

.review-note {
  color: var(--r-ink-2);
  font-size: 11px;
}

.review-draft {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px dashed #c9c2b2;
  border-radius: 9px;
  background: var(--r-paper);
}

.review-draft-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--r-ink-2);
}

.review-draft-text {
  font-size: 12.5px;
  color: var(--r-ink);
}

.review-draft-foot {
  font-size: 10.5px;
  color: var(--r-ink-3);
}

/* ---------- Summary (three runs) ---------- */

.summary {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
}

.summary-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
}

.summary-sub {
  margin-top: -4px;
  color: var(--r-ink-3);
  font-size: 11px;
}

.summary-rows {
  display: grid;
  gap: 7px;
  margin-top: 4px;
  padding: 0;
  list-style: none;
}

.summary-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--r-line);
  border-radius: 9px;
  font-size: 12px;
}

.summary-when {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--r-ink-3);
}

.summary-foot {
  color: var(--r-ink-2);
  font-size: 11.5px;
}

/* ---------- Cursor ---------- */

.replay-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 55;
  width: 20px;
  height: 20px;
  opacity: 0;
  pointer-events: none;
  transform: translate(var(--cur-x, 520px), var(--cur-y, 470px));
  transition: transform 1s var(--r-camera-ease), opacity 0.3s ease;
}

.replay-cursor.is-visible {
  opacity: 1;
}

.replay-cursor svg {
  width: 20px;
  height: 20px;
  transform-origin: 3px 2px;
  transition: transform 0.12s ease;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.replay-cursor.is-clicking svg {
  transform: scale(0.82);
}

/* ---------- Controls, caption, transcript ---------- */

.replay-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  margin-top: 18px;
}

.replay-buttons {
  display: flex;
  gap: 8px;
}

.replay-toggle,
.replay-restart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
  font: 600 0.875rem/1 var(--font-sans);
  cursor: pointer;
}

.replay-toggle {
  width: 46px;
  min-height: 46px;
  border-color: var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
}

.replay-toggle .icon {
  width: 18px;
  height: 18px;
}

.replay-toggle .icon--play,
.replay.is-paused .replay-toggle .icon--pause {
  display: none;
}

.replay.is-paused .replay-toggle .icon--play {
  display: block;
}

.replay-restart {
  padding: 0 14px;
  border-radius: 999px;
}

.replay-restart .icon {
  width: 16px;
  height: 16px;
}

.replay-toggle:hover {
  background: #2a2f37;
}

.replay-restart:hover {
  border-color: var(--ink-3);
}

.replay-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.replay-step {
  position: relative;
  display: grid;
  gap: 1px;
  width: 100%;
  height: 100%;
  min-height: 46px;
  padding: 7px 10px 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-2);
  font: 600 0.8125rem/1.25 var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.replay-step:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.replay-step-num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ink-3);
}

.replay-step[aria-current="step"] {
  border-color: var(--accent);
  color: var(--ink);
}

.replay-step-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
}

.replay-caption {
  overflow-anchor: none;
  min-height: 3.3em;
  margin-top: 16px;
  max-width: 72ch;
  color: var(--ink-2);
  font-size: 1.0625rem;
}

.replay-caption strong {
  color: var(--ink);
}

.replay-transcript {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.replay-transcript summary {
  width: max-content;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.replay-transcript ol {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-left: 1.4em;
  max-width: 72ch;
}

@media (max-width: 760px) {
  .replay-controls {
    grid-template-columns: 1fr;
  }

  .replay-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Instant mode (seeking) ---------- */

.replay.is-instant *,
.replay.is-instant *::before,
.replay.is-instant *::after {
  transition: none !important;
  animation: none !important;
}

/* ---------- Compact layout (narrow screens) ---------- */

.replay.is-compact .replay-frame {
  aspect-ratio: auto;
  height: clamp(500px, 150vw, 660px);
  border-radius: 16px;
}

.replay.is-compact .replay-stage {
  width: 100%;
  height: 100%;
  transform: none;
}

.replay.is-compact .replay-world {
  transform: none;
}

.replay.is-compact .replay-dock,
.replay.is-compact .replay-sys-context {
  display: none;
}

.replay.is-compact .replay-systembar {
  padding: 0 10px;
}

.replay.is-compact .rwin {
  left: 10px;
  right: 10px;
  width: auto;
  height: auto;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.4s ease,
    transform 0.55s var(--r-ease),
    visibility 0s linear 0.55s;
}

.replay.is-compact .rwin.is-dim {
  filter: none;
}

.replay.is-compact .rwin[data-slot] {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.replay.is-compact .rwin[data-slot="solo"] {
  top: 42px;
  bottom: 12px;
}

.replay.is-compact .rwin[data-slot="top"] {
  top: 42px;
  bottom: calc(50% + 4px);
}

.replay.is-compact .rwin[data-slot="bottom"] {
  top: calc(50% + 14px);
  bottom: 12px;
}

.replay.is-compact .doc {
  padding: 10px 12px;
}

.replay.is-compact .doc-steps {
  margin-top: 8px;
  gap: 2px;
}

.replay.is-compact .doc-step {
  grid-template-columns: 44px 16px minmax(0, 1fr);
  padding: 5px 6px;
  font-size: 12px;
}

.replay.is-compact .doc-meta {
  display: none;
}

.replay.is-compact .log {
  padding: 8px 10px;
}

.replay.is-compact .log-table {
  font-size: 11px;
}

.replay.is-compact .log-table td,
.replay.is-compact .log-table th {
  padding: 5px 5px;
}

.replay.is-compact .log-col-event,
.replay.is-compact .log-col-outcome {
  display: none;
}

.replay.is-compact .log-flag {
  margin-top: 6px;
}

/* The system bar already says "Synthetic data", so the report drops its
   disclaimer and trace id on narrow screens to keep the evidence visible. */
.replay.is-compact .md {
  padding: 10px 12px;
}

.replay.is-compact .md-note,
.replay.is-compact .md-trace {
  display: none;
}

.replay.is-compact .md-kv > div {
  grid-template-columns: 118px minmax(0, 1fr);
}

.replay.is-compact .md-h {
  margin-top: 8px;
}

.replay.is-compact .summary-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.replay.is-compact .summary-when {
  grid-column: 1 / -1;
}

@media (prefers-reduced-motion: reduce) {
  .replay-world,
  .rwin,
  .replay-cursor,
  .rv {
    transition: none;
  }
}
