body .tour-target-active:not(:focus-visible) { outline: none !important; }

.tour-spotlight {
  border: 1.5px solid #eceef2;
  box-shadow: 0 0 0 2px #ffffff15, 0 0 12px #ffffff18, 0 0 0 9999px #050609a6;
}

.tour-spotlight.tour-r2-step-motion {
  transition: left 250ms ease-out, top 250ms ease-out, width 250ms ease-out, height 250ms ease-out;
}

.tour-dialog > .tour-card {
  border: 1px solid #2a2d32;
  border-radius: 16px;
  background: #16181c;
  color: #eceef2;
  box-shadow: 0 20px 40px #0008;
}

.tour-card h2 { color: #eceef2; }
.tour-card [data-tour-text] { color: #b4b7be; }
.tour-card [data-tour-count] { color: #a1a4aa; font-size: 12px; }

.tour-card .tour-scene {
  margin-block-start: 9px;
  border: 1px solid #292b30;
  background: #101113;
}

.tour-card .scene-canvas { background: #101113; padding: 9px; }
.tour-r2-example {
  padding: 6px 8px;
  border: 1px solid #303238;
  border-radius: 8px;
  background: #1b1d21;
  color: #c8cbd1;
  font-size: 12px;
}

.tour-card .scene-demo-button,
.tour-card [data-tour-next] {
  border-color: #e5e7eb;
  border-radius: 9px;
  background: linear-gradient(#eceef2, #d8dae0);
  color: #121418;
  font-weight: 650;
}

.tour-card .scene-demo-button {
  display: inline-block;
  margin-block-start: 7px;
  padding: 5px 11px;
}
.tour-card .scene-mini-progress { background: #292b2f; }
.tour-card .scene-mini-progress::after { content: none; animation: none; }
.tour-card .scene-mini-progress::before {
  display: block;
  height: 100%;
  content: "";
  width: var(--tour-progress, 50%);
  transform-origin: left;
  background: #eceef2;
  animation: none;
}
.tour-card [data-tour-prev] {
  border-color: #41444a;
  background: transparent;
  color: #eceef2;
}
.tour-card [data-tour-prev]:disabled { display: none; }
.tour-card .actions { background: transparent; }
.tour-card .actions [data-tour-skip] {
  margin-inline-end: auto;
  padding-inline: 0;
  border-color: transparent;
  background: transparent;
  color: #9ea2a9;
  white-space: nowrap;
}
.tour-card [data-tour-skip]:hover { text-decoration: underline; color: #eceef2; }

.tour-r2-dots { display: flex; align-items: center; gap: 4px; }
.tour-r2-dots > span { width: 5px; height: 5px; border-radius: 5px; background: #55585d; }
.tour-r2-dots > [data-current] { width: 15px; background: #eceef2; }
.tour-r2-mask { display: inline-block; }

.tour-card.tour-r2-exit { pointer-events: none !important; animation: tour-r2-fade-out 160ms ease-out forwards; }
.tour-card.tour-r2-enter { animation: tour-r2-fade-in 170ms ease-out 160ms both; }
.tour-r2-playing .tour-r2-mask { opacity: 0; animation: tour-r2-dot 250ms ease-out var(--tour-dot-delay, 0ms) forwards; }
.tour-card .tour-r2-playing .scene-demo-button { animation: tour-r2-press 2400ms ease-out forwards; }
.tour-card .tour-r2-playing .scene-mini-progress::before { animation: tour-r2-fill 2400ms ease-out forwards; }
@keyframes tour-r2-dot { to { opacity: 1; } }
@keyframes tour-r2-press { 0%, 44%, 58%, 100% {transform: scale(1);} 51% {transform: scale(.97);} }
@keyframes tour-r2-fill { 0%, 55% {transform: scaleX(0);} 92%, 100% {transform: scaleX(1);} }
@keyframes tour-r2-fade-in { from {opacity:0;} to {opacity:1;} }
@keyframes tour-r2-fade-out { from {opacity:1;} to {opacity:0;} }

body:has(#flow-content :is(input,textarea,[contenteditable]):focus) .tour-spotlight { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .tour-spotlight { transition: none !important; }
  .tour-card, .tour-card *, .tour-card .scene-mini-progress::before { animation: none !important; }
  .tour-card.tour-r2-exit { opacity: 0; }
  .tour-card .tour-r2-mask { opacity: 1; }
}

/* The legacy scene dimensions and card-placement rules remain in effect. */
.tour-card .tour-r3-scene,
.tour-card .tour-r3-scene * {
  pointer-events: none;
  cursor: default;
  user-select: none;
}

.tour-card .tour-r3-scene .scene-canvas {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 3px;
  gap: 6px;
  height: 100%;
  min-height: 0;
  padding: 8px;
  color: #c8cbd1;
  line-height: 1.25;
}

.tour-r3-content {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  font-size: 11px;
}

.tour-r3-box {
  padding: 5px 7px;
  border: 1px solid #303238;
  border-radius: 7px;
  background: #1b1d21;
  overflow-wrap: anywhere;
}

.tour-r3-dim { color: #a1a4aa; }
.tour-r3-mono, .tour-r3-pasted { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.tour-r3-code-source { display: flex; align-items: center; gap: 6px; }
.tour-r3-code-source .tour-r3-action { margin-inline-start: auto; }
.tour-r3-code-source .tour-r3-mono { overflow-wrap: normal; white-space: nowrap; }

.tour-r3-action {
  position: relative;
  justify-self: start;
  display: inline-flex;
  align-items: end;
  gap: 4px;
  width: max-content;
  max-width: 100%;
}

.tour-card .tour-r3-demo-button {
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: #B4B8C0;
  color: #16181C;
  font: inherit;
  font-weight: 400;
  white-space: nowrap;
}

.tour-r3-finger { line-height: 1; transform-origin: left bottom; }
.tour-r3-field { border-color: #676c76; }
.tour-r3-caret {
  display: inline-block;
  height: .92em;
  margin-inline-start: 3px;
  border-inline-end: 1px solid #eceef2;
  vertical-align: -.1em;
}

.tour-r3-check { color: #8FC7AA; }
[data-scene="validate"] .tour-r3-check {
  padding: 5px 7px;
  border: 1px solid #8FC7AA38;
  border-radius: 6px;
  background: #8FC7AA13;
}

.tour-r3-window { border: 1px solid #303238; border-radius: 8px; overflow: hidden; background: #15171a; }
.tour-r3-address-bar { display: flex; align-items: center; gap: 7px; padding: 4px 6px; background: #1b1d21; }
.tour-r3-window-dots { color: #65686d; font-size: 6px; white-space: nowrap; }
.tour-r3-address { flex: 1; min-width: 0; padding: 2px 5px; border-radius: 4px; background: #101113; overflow-wrap: anywhere; }
.tour-r3-window-body { display: grid; gap: 5px; padding: 6px; }
.tour-r3-account { display: flex; align-items: center; gap: 5px; }
.tour-r3-avatar { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #303238; }
.tour-r3-json-start { overflow-wrap: anywhere; }

.tour-r3-json-selection { padding-block: 4px; font-size: 9px; line-height: 1.34; }
.tour-r3-json-line { position: relative; isolation: isolate; width: fit-content; max-width: 100%; white-space: pre-wrap; }
.tour-r3-json-line::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #424a5a; }
.tour-r3-shortcuts, .tour-r3-shortcut { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.tour-r3-shortcuts { column-gap: 10px; }
.tour-r3-keycap { padding: 1px 4px; border: 1px solid #494c53; border-radius: 4px; color: #eceef2; }

.tour-r3-summary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 9px; overflow-wrap: anywhere; }
.tour-r3-progress { height: 3px; border-radius: 3px; background: #363940; overflow: hidden; }
.tour-r3-progress::before { display: block; height: 100%; content: ""; background: #eceef2; transform-origin: left; }

.tour-r3-playing .tour-r3-cue { animation: tour-r3-reveal 270ms ease-out 500ms both; }
.tour-r3-playing .tour-r3-pasted { animation: tour-r3-reveal 360ms ease-out 850ms both; }
.tour-r3-playing .tour-r3-result { animation: tour-r3-reveal 320ms ease-out 1160ms both; }
.tour-r3-playing .tour-r3-account { animation: tour-r3-reveal 320ms ease-out 420ms both; }
.tour-r3-playing .tour-r3-opened-window { animation: tour-r3-reveal 320ms ease-out 880ms both; }
.tour-r3-playing .tour-r3-json-start { animation: tour-r3-reveal 300ms ease-out 1210ms both; }
.tour-r3-playing .tour-r3-finger, .tour-r3-playing .tour-r3-demo-button { animation: tour-r3-press 210ms ease-out 460ms both; }
.tour-r3-playing[data-scene="code"] .tour-r3-finger,
.tour-r3-playing[data-scene="code"] .tour-r3-demo-button { animation-delay: 210ms; }
.tour-r3-playing[data-scene="confirm"] .tour-r3-finger,
.tour-r3-playing[data-scene="confirm"] .tour-r3-demo-button { animation-delay: 890ms; }
.tour-r3-playing .tour-r3-json-line::before { animation: tour-r3-reveal 180ms ease-out var(--tour-r3-select-at, 820ms) both; }
.tour-r3-json-line:nth-child(2) { --tour-r3-select-at: 950ms; }
.tour-r3-json-line:nth-child(3) { --tour-r3-select-at: 1080ms; }
.tour-r3-json-line:nth-child(4) { --tour-r3-select-at: 1210ms; }
.tour-r3-playing .tour-r3-shortcut { animation: tour-r3-reveal 220ms ease-out 460ms both; }
.tour-r3-playing .tour-r3-shortcut:last-child { animation-delay: 1470ms; }
.tour-r3-playing .tour-r3-progress::before { animation: tour-r3-progress 2500ms ease-out both; }

@keyframes tour-r3-reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes tour-r3-press { 0%, 100% { transform: scale(1); } 48% { transform: scale(.96); } }
@keyframes tour-r3-progress {
  0%, 26% { transform: scaleX(0); }
  96%, 100% { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .tour-r3-playing .tour-r3-json-line::before,
  .tour-r3-playing .tour-r3-progress::before { animation: none; }
}
