:host {
  display: block;
  max-width: 100%;
  margin: 16px 0;
  font: inherit;
  color: inherit;
}
:host([hidden]) {
  display: none;
}
* {
  box-sizing: border-box;
}
figure {
  margin: 0;
  border: 1px solid var(--border, var(--vp-c-divider, #dfe3da));
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface, var(--vp-c-bg-soft, #fff));
  color: var(--vp-c-text-1, inherit);
}
.screen {
  width: 100%;
  max-width: 100%;
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  background: #f4f5f1;
  aspect-ratio: 4/3;
  overflow: hidden;
}
:host([step="agent"]) .screen {
  aspect-ratio: 2/1;
  min-height: 300px;
}
:host([step="install"]) .screen,
:host([step="github"]) .screen,
:host([step="server"]) .screen {
  min-height: 340px;
}
.frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.screen-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.screen-hit:hover {
  background: transparent;
}
svg.motion-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  fill: none;
  stroke: none;
}
.pencil-stroke {
  fill: none;
  stroke: #e54d34;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.click-ring {
  fill: #e54d3420;
  stroke: #e54d34;
}
.typed-text {
  stroke: none;
}
.image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
}
.image svg.capture-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.foot {
  display: var(--demo-footer-display, block);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.caption {
  display: var(--demo-caption-display, block);
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  min-height: var(--demo-caption-height, 3em);
}
.caption[data-error="true"] {
  display: block;
  min-height: 0;
}
.controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: var(--demo-controls-gap, 8px);
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  padding: 8px 12px;
}
button:hover {
  background: var(--soft-surface, var(--vp-c-bg-alt, #edf0e9));
}
button:focus-visible {
  outline: 2px solid var(--focus, #2159b1);
  outline-offset: -3px;
}
.step {
  min-width: 44px;
  padding: 8px;
}
.step[aria-pressed="true"] {
  border-color: currentColor;
  font-weight: 700;
}
.play {
  margin-left: auto;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.diagram {
  min-width: 0;
  width: 100%;
  padding: 24px;
  color: #20241e;
  font-family: Arial, sans-serif;
}
.diagram strong {
  font-size: clamp(17px, 3vw, 23px);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #c6cbbb;
  padding-bottom: 16px;
  font-size: 13px;
}
.address {
  min-width: 0;
  flex: 1;
  background: #fff;
  border-radius: 5px;
  padding: 10px;
  overflow: hidden;
  white-space: nowrap;
}
.icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}
svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chrome-card {
  margin: 24px auto 0;
  background: white;
  border: 1px solid #c6cbbb;
  border-radius: 8px;
  padding: 20px;
  max-width: 340px;
}
.store-action {
  display: block;
  width: fit-content;
  background: #17324d;
  color: white;
  padding: 10px 14px;
  border-radius: 5px;
  margin-top: 16px;
  font-size: 14px;
}
.extension-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 12px 0;
}
.sequence {
  display: grid;
  gap: 12px;
}
.sequence div {
  padding: 16px;
  background: #fff;
  border: 1px solid #d0d5c8;
  border-radius: 6px;
  font-size: 15px;
  opacity: 0.6;
}
.sequence div.active {
  opacity: 1;
  border-color: #17324d;
}
.sequence small {
  display: block;
  margin-top: 6px;
  color: #596054;
}
.agent-note {
  background: white;
  padding: 24px;
  border: 1px solid #c6cbbb;
  border-radius: 8px;
}
.prompt-input {
  min-height: 76px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #8c9785;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.5;
  background: #f8faf5;
}
.agent-note small {
  display: block;
  color: #596054;
  line-height: 1.5;
}
.agent-note p {
  line-height: 1.6;
  font-size: 15px;
  margin-bottom: 0;
}

/* Hosts can bound a walkthrough without cropping its screenshot or controls. */
.screen {
  height: var(--demo-screen-height, auto);
}
:host([step="agent"]) .screen {
  min-height: min(300px, var(--demo-screen-height, 300px));
}
/* Chrome pinning: show the menu, pin and toolbar result at the click moment. */
:host([step="pin"]) .screen {
  aspect-ratio: auto;
  height: 240px;
}
.pin-browser {
  align-self: start;
  padding: 16px;
}
.pin-browser .chrome-card {
  margin: 12px 0 0 auto;
  max-width: 280px;
  padding: 16px;
}
.pin-browser .extension-row {
  margin-top: 8px;
  padding: 8px 0 0;
}
.extension-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.pin-browser .pinned-icon,
.extension-name .icon {
  color: #fff;
  background: #17324d;
  border-radius: 6px;
}
.pin[data-pinned="true"] {
  color: #17324d;
  background: #dce8f2;
  border-radius: 6px;
}
.pin[data-pinned="true"] svg {
  fill: currentColor;
}
.review-started {
  margin-top: 24px;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #c6cbbb;
}
.review-started p {
  margin: 8px 0 0;
  font-size: 15px;
}

/* Recording walkthroughs reuse the shipped inspector, with the same player controls. */
.screen[data-kind="recording"] {
  display: block;
  aspect-ratio: auto;
  height: auto;
  background: #fff;
}
.screen[data-kind="recording"] .frame {
  position: relative;
  display: block;
}
.screen-hit[hidden] {
  display: none;
}
:host([step="recording"]) .step {
  font-size: 12px;
}
:host([step="recording"]) .foot {
  padding: 10px 12px;
}
:host([step="recording"]) .caption {
  font-size: 13px;
  min-height: 3em;
}

:host([step="discussion"]) .screen {
  aspect-ratio: 4 / 3;
  background: #f7f8f7;
}
:host([step="discussion"]) .diagram {
  padding: clamp(18px, 4vw, 36px);
}
:host([step="discussion"]) .step {
  font-size: 13px;
}
.quick-handoff {
  width: 100%;
}
.handoff-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.handoff-heading span {
  font-size: 13px;
  color: #596054;
  white-space: nowrap;
}
.quick-handoff .prompt-input {
  min-height: 170px;
  padding: 20px;
  border: 1px solid #c6cbbb;
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  line-height: 1.5;
}
.handoff-paste p {
  margin: 0 0 12px;
}
.handoff-task {
  color: #596054;
}
.handoff-context {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #17324d;
}
.handoff-ready {
  margin-top: 16px;
  color: #285831;
  font-size: 14px;
}
@media (max-width: 500px) {
  .handoff-heading {
    margin-bottom: 14px;
  }
  .handoff-heading strong {
    font-size: 17px;
  }
  .quick-handoff .prompt-input {
    padding: 14px;
    min-height: 150px;
    font-size: 14px;
  }
  .handoff-ready {
    margin-top: 10px;
    font-size: 12px;
  }
}

/* Landing depth uses the playback clock and preference. Individual rotate and
   translate compose with the slow sweep without restarting its animation. */
:host([depth]) {
  --depth-scale: 1.4;
}
:host([depth]) .depth-stage {
  position: relative;
  perspective: 1000px;
  isolation: isolate;
  padding: 10px 8px 42px;
}
:host([depth]) .depth-stage::before {
  content: "";
  position: absolute;
  inset: 18px 4px 38px 16px;
  border-radius: 16px;
  background:
    radial-gradient(
      ellipse at var(--depth-light-x, 50%) var(--depth-light-y, 20%),
      #fff 0,
      #ffffff00 65%
    ),
    linear-gradient(135deg, #ffffffc9, #e2e9e0b0 65%, #c9dbe482);
  box-shadow:
    inset 0 1px 0 #fff,
    inset -1px -1px 0 #ffffff9c;
  translate: var(--depth-shadow-x, 0px) 0;
  pointer-events: none;
  z-index: -1;
}
:host([depth]) .depth-stage::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 8%;
  bottom: 28px;
  height: 12px;
  border-radius: 50%;
  background: #17324d16;
  box-shadow: 0 12px 22px 6px #17324d1a;
  transform: translateX(var(--depth-shadow-x, 0px)) perspective(600px) rotateX(55deg)
    scaleX(var(--depth-shadow-scale, 1));
  pointer-events: none;
  z-index: -1;
}
:host([depth]) .depth-stage > figure {
  position: relative;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
  -webkit-box-reflect: below 8px linear-gradient(transparent 90%, #ffffff50 100%);
  transform-origin: center;
  rotate: var(--depth-tilt, 0deg);
  translate: 0 var(--depth-scroll, 0px);
  animation: review-depth 6s ease-in-out infinite alternate paused;
}
:host([depth]) .depth-stage > figure::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    ellipse at var(--depth-light-x, 50%) var(--depth-light-y, 20%),
    #ffffff18,
    #ffffff00 60%
  );
  box-shadow:
    inset 0 1px 0 #ffffffd9,
    inset 1px 0 0 #ffffff70;
}
:host([depth][data-motion-running]) .depth-stage > figure {
  animation-play-state: running;
}
:host([depth]) .depth-stage:hover > figure,
:host([depth]) .depth-stage:focus-within > figure {
  /* Hold the plane while someone approaches or uses its controls. Playback
     continues; leaving the surface resumes depth without changing preference. */
  animation-play-state: paused;
}
@keyframes review-depth {
  from {
    transform: scale(0.97) rotateX(calc(4deg * var(--depth-scale)))
      rotateY(calc(-5deg * var(--depth-scale))) translateY(calc(5px * var(--depth-scale)));
  }
  to {
    transform: scale(0.97) rotateX(calc(-3deg * var(--depth-scale)))
      rotateY(calc(4deg * var(--depth-scale))) translateY(calc(-7px * var(--depth-scale)));
  }
}
@media (max-width: 800px) {
  :host([depth]) {
    --depth-scale: 0.35;
  }
  :host([depth]) .depth-stage > figure {
    animation-duration: 7s;
    rotate: none;
    translate: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  :host([depth]) .depth-stage > figure {
    animation: none;
    transform: none;
    rotate: none;
    translate: none;
  }
}
