/* Screenshot tour (AK + Amar, Nov 5 2026). Markup: views/partials/hx-tour.ejs. Script: public/v2/shared/tour.js. Data: constants/v2/tours.js.
   Whole screen first, then a zoom (transform on .hxt__cam only, GPU) into up to 3 stops, each with a soft spotlight (gold ring, ink
   dim outside) and a label chip; back out; loop. Brand tokens only: ink, lavender, mist, gold, slate, white.
   Base styles = the still view (reduced motion, no script support): whole screen, 3 numbered markers, the legend under it.
   The moving view only turns on under prefers-reduced-motion: no-preference AND scripting: enabled (browsers without the
   scripting query keep the still view). The box keeps the image's ratio (aspect-ratio), so nothing shifts as it loads or moves. */
.hxt { --ink: #110A33; --lav: #DDD6FF; --mist: #F6F4FF; --gold: #FFC61E; --slate: #5B6478; --violet: #341D99; --white: #fff;
  --hxt-in: 1100ms; --hxt-out: 800ms; --hxt-move: cubic-bezier(.45, 0, .2, 1); --hxt-fade: cubic-bezier(.23, 1, .32, 1); /* r3: a clear camera move in and out */
  container-type: inline-size; position: relative; min-width: 0; margin: 0; color: var(--ink); font-family: Manrope, Arial, sans-serif; text-align: left; }
.hxt *, .hxt *::before, .hxt *::after { box-sizing: border-box; }
.hxt :where(p, ol, li, b, small) { margin: 0; padding: 0; }

/* the screen */
.hxt__stage { position: relative; display: block; overflow: hidden; aspect-ratio: var(--hxt-ar, 2 / 1); border-radius: 16px; background: var(--white);
  box-shadow: 0 0 0 1px rgba(17, 10, 51, .1), 0 12px 32px -12px rgba(17, 10, 51, .22); isolation: isolate; }
.hxt__cam { position: absolute; inset: 0; transform-origin: 0 0; transform: translate(0, 0) scale(1); }
/* before tour.js runs (or with no script): an HTML screen's design canvas is scaled to the box from the box width alone (box width /
   design width, as a number via tan(atan2())); tour.js then sets the exact --fit on the stage. Older browsers keep the .45 default. */
@supports (scale: tan(atan2(1px, 1px))) and (width: 1cqw) { .hxt { --fit: tan(atan2(100cqw, var(--hxt-dw, 1200px))); } }
.hxt__cam img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; user-select: none; -webkit-user-drag: none; }

/* still view: numbered markers on the screen, the legend under it */
.hxt__mk, .hxt__n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--white);
  font: 800 12px/1 Manrope, Arial, sans-serif; font-variant-numeric: tabular-nums; }
.hxt__mk { position: absolute; z-index: 1; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--white), 0 2px 8px rgba(17, 10, 51, .3); }
.hxt__legend { margin-top: 12px; }
.hxt__legend ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px 16px; list-style: none; }
.hxt__legend li { display: flex; align-items: flex-start; gap: 10px; text-align: left; }
.hxt__n { flex: none; margin-top: 1px; }
.hxt__legend b { display: block; font: 700 15px/1.3 Manrope, Arial, sans-serif; color: var(--ink); }
.hxt__legend small { display: block; margin-top: 2px; font: 500 13px/1.4 Manrope, Arial, sans-serif; color: var(--slate); text-wrap: pretty; }
.hxt__spot, .hxt__chip, .hxt__cap, .hxt__bar, .hxt__steps { display: none; }
html body .hxt__pause { display: none; }
/* a control row that carries an extra control (e.g. /miia "Click to expand") stays in the still view, with only that control */
.hxt__bar--x { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 44px; margin-top: 12px; }

/* moving view */
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  .hxt__mk { display: none; }
  .hxt__legend { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .hxt__cam { transition: transform var(--hxt-out) var(--hxt-move); }
  .hxt.is-zoom .hxt__cam { transition-duration: var(--hxt-in); }
  .hxt.is-snap .hxt__cam, .hxt.is-snap .hxt__spot, .hxt.is-snap .hxt__chip { transition: none; }

  /* the spotlight: a gold ring round the area, the rest dimmed in ink. Placed while hidden, then faded in (opacity only). */
  .hxt__spot { display: block; position: absolute; left: 0; top: 0; z-index: 1; width: 0; height: 0; border-radius: 12px; pointer-events: none;
    box-shadow: 0 0 0 2px var(--gold), 0 0 0 200vmax rgba(17, 10, 51, .3); opacity: 0; transition: opacity 140ms var(--hxt-fade); }
  .hxt.is-label .hxt__spot { opacity: 1; transition-duration: 260ms; }

  /* the label chip: ink with white text (light screens), lavender with ink text (dark screens) */
  .hxt__chip { display: flex; position: absolute; left: 0; top: 0; z-index: 2; align-items: flex-start; gap: 8px; width: max-content; max-width: min(340px, calc(100% - 16px));
    padding: 8px 14px 9px 8px; border-radius: 12px; background: var(--ink); color: var(--white); box-shadow: 0 12px 32px -12px rgba(17, 10, 51, .5);
    pointer-events: none; opacity: 0; transform: translateY(6px); transition: opacity 140ms var(--hxt-fade), transform 140ms var(--hxt-fade); }
  .hxt.is-label .hxt__chip { opacity: 1; transform: none; transition-duration: 240ms; transition-delay: 60ms; }
  .hxt__chip i, .hxt__cap i { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: var(--ink);
    font: 800 12px/1 Manrope, Arial, sans-serif; font-style: normal; font-variant-numeric: tabular-nums; }
  .hxt__chip b { display: block; font: 700 14px/1.3 Manrope, Arial, sans-serif; text-wrap: balance; }
  .hxt__chip small { display: block; margin-top: 2px; font: 500 12px/1.4 Manrope, Arial, sans-serif; color: var(--lav); text-wrap: pretty; }
  .hxt--lav .hxt__chip { background: var(--lav); color: var(--ink); }
  .hxt--lav .hxt__chip small { color: var(--ink); }

  /* step buttons (1 2 3) and pause, under the screen */
  .hxt__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 0 8px; min-height: 44px; margin-top: 8px; }
  .hxt__steps { display: flex; margin-left: -10px; }
  .hxt__step { position: relative; display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 50%;
    background: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .hxt__step span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--mist); box-shadow: inset 0 0 0 1px var(--lav);
    color: var(--slate); font: 800 12px/1 Manrope, Arial, sans-serif; font-variant-numeric: tabular-nums;
    transition: background-color 160ms var(--hxt-fade), color 160ms var(--hxt-fade), transform 160ms var(--hxt-fade); }
  .hxt__step[aria-current="step"] span { background: var(--ink); color: var(--white); box-shadow: none; }
  @media (hover: hover) and (pointer: fine) { .hxt__step:not([aria-current="step"]):hover span { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); } }
  .hxt__step:active span { transform: scale(.96); }
  .hxt__step:focus-visible { outline: none; }
  .hxt__step:focus-visible span { outline: 2px solid var(--violet); outline-offset: 2px; }
  html body .hxt .hxt__pause { display: grid; }
  .hxt__bar .hxt__pause { margin-left: auto; }

  /* the label sits under the screen instead of over it, so it never covers the zoomed area (r3: every width, every tour; it was under 480px) */
  .hxt__cap { display: none; }
  @container (min-width: 0px) {
    .hxt__chip { display: none; }
    .hxt__cap { display: flex; align-items: flex-start; gap: 8px; height: auto; margin-top: 10px; padding: 0 2px; overflow: hidden; } /* r3: tour.js sets the height to the tour's tallest label: no empty band */
    .hxt__cap i { margin-top: 1px; }
    .hxt__cap:not(.is-on):not(.is-next) i { display: none; }
    .hxt__cap.is-next i { background: var(--mist); box-shadow: inset 0 0 0 1px var(--lav); color: var(--slate); }
    .hxt__cap b { display: block; font: 700 14px/1.3 Manrope, Arial, sans-serif; color: var(--ink); }
    .hxt__cap:not(.is-on):not(.is-next) b { font-weight: 600; color: var(--slate); }
    .hxt__cap small { display: block; margin-top: 1px; font: 500 12px/1.4 Manrope, Arial, sans-serif; color: var(--slate); text-wrap: pretty; }
    .hxt__cap > span { transition: opacity 160ms var(--hxt-fade); }
    .hxt__cap.is-swap > span { opacity: 0; transition-duration: 100ms; }
    .hxt__bar { margin-top: 4px; }
  }
}

/* still view on request (tStill: e.g. the full view in a pop-up): markers + legend, whatever the motion setting */
.hxt--still .hxt__mk { display: grid; }
.hxt--still .hxt__legend { position: static; width: auto; height: auto; margin: 16px 0 0; overflow: visible; clip-path: none; white-space: normal; }
.hxt--still .hxt__spot, .hxt--still .hxt__chip, .hxt--still .hxt__cap, .hxt--still .hxt__bar { display: none !important; }
.hxt--still .hxt__cam { transform: none !important; transition: none !important; }

/* Windows high contrast: box-shadow rings disappear, so draw real outlines */
@media (forced-colors: active) {
  .hxt__spot { outline: 2px solid Highlight; }
  .hxt__step span, .hxt__mk, .hxt__n { border: 1px solid ButtonText; }
  .hxt__step[aria-current="step"] span { outline: 2px solid Highlight; }
}

/* ---- Multi-screen tours (Nov 5, second round: one tour per use case, up to 3 product screens) ----
   Layers share the stage; the open one is opaque. A screen change is a cross-fade with a slight settle (scale 1.02 to 1), opacity and
   transform only. The bar names the product on screen. Reduced motion: 3 small stills framed on each stop (built by tour.js). */
.hxt--multi .hxt__stage { background: var(--mist); }
.hxt__layer { position: absolute; inset: 0; opacity: 0; }
.hxt__layer.is-on { opacity: 1; z-index: 0; }
.hxt__layer .hxt__cam { position: absolute; inset: 0; }
.hxt--multi .hxt__spot, .hxt--multi .hxt__chip { z-index: 2; }
.hxt--multi .hxt__chip { z-index: 3; }
.hxt__scr { display: none; }
.hxt__stills { display: none; }

@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  .hxt__layer { transform: scale(1.02); transition: opacity 520ms var(--hxt-fade), transform 700ms var(--hxt-move); }
  .hxt__layer.is-on { transform: none; }
  .hxt.is-snap .hxt__layer, .hxt__layer.is-snap, .hxt__layer.is-snap .hxt__cam { transition: none; }
  .hxt--multi .hxt__stills { display: none !important; }
  /* the product on screen, beside the step buttons */
  .hxt__scr { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; margin: 0 0 0 4px; color: var(--slate); font: 600 13px/1.2 Manrope, Arial, sans-serif;
    transition: opacity 160ms var(--hxt-fade), transform 160ms var(--hxt-fade); }
  .hxt__scr img { flex: none; width: 18px; height: 18px; border-radius: 50%; }
  .hxt__scr span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .hxt__scr.is-swap { opacity: 0; transform: translateY(3px); transition-duration: 120ms; }
  .hxt--multi .hxt__bar { flex-wrap: nowrap; }
  @container (max-width: 299px) { .hxt__scr { display: none; } }
  @container (max-width: 379px) { .hxt__scr { font-size: 12px; gap: 6px; } .hxt__scr img { width: 16px; height: 16px; } }
}

/* still view (reduced motion), multi: the stills replace the stage */
.hxt--multi.has-stills .hxt__stage { display: none; }
.hxt--multi.has-stills .hxt__legend { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hxt--multi.has-stills .hxt__stills { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.hxt__still { min-width: 0; }
.hxt__sbox { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 12px; background: var(--white); box-shadow: 0 0 0 1px rgba(17, 10, 51, .1), 0 2px 8px rgba(17, 10, 51, .08); }
.hxt__sbox .hxt__canvas { transform-origin: 0 0; }
.hxt__still > p { display: flex; gap: 8px; margin-top: 8px; }
.hxt__still > p > i { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--white); font: 800 11px/1 Manrope, Arial, sans-serif; font-style: normal; }
.hxt__still > p b { display: block; font: 700 14px/1.3 Manrope, Arial, sans-serif; color: var(--ink); text-wrap: balance; }
.hxt__still > p small { display: block; margin-top: 2px; font: 500 12px/1.4 Manrope, Arial, sans-serif; color: var(--slate); text-wrap: pretty; }
/* multi-screen tours live in smaller boxes (use-case panels, reels): up to 600px the label sits under the screen (as on phones), never over it */
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  @container (min-width: 480px) and (max-width: 599px) {
    .hxt--multi .hxt__chip { display: none; }
    .hxt--multi .hxt__cap { display: flex; align-items: flex-start; gap: 8px; height: 58px; margin-top: 10px; padding: 0 2px; overflow: hidden; }
    .hxt--multi .hxt__cap i { margin-top: 1px; }
    .hxt--multi .hxt__cap:not(.is-on) i { display: none; }
    .hxt--multi .hxt__cap b { display: block; font: 700 15px/1.3 Manrope, Arial, sans-serif; color: var(--ink); }
    .hxt--multi .hxt__cap:not(.is-on) b { font-weight: 600; color: var(--slate); }
    .hxt--multi .hxt__cap small { display: block; margin-top: 1px; font: 500 13px/1.4 Manrope, Arial, sans-serif; color: var(--slate); text-wrap: pretty; }
    .hxt--multi .hxt__cap > span { transition: opacity 160ms var(--hxt-fade); }
    .hxt--multi .hxt__cap.is-swap > span { opacity: 0; transition-duration: 100ms; }
    .hxt--multi .hxt__bar { margin-top: 2px; }
  }
}
/* multi, whole screen: the label row shows the stop that comes next, same style, with a quiet number (AK Nov 5: no big caption, no empty band).
   Its height is set by tour.js to this tour's tallest label. */
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  @container (max-width: 599px) {
    .hxt--multi .hxt__cap { height: auto; min-height: 0; margin-top: 10px; }
    .hxt--multi .hxt__cap.is-next i { display: grid; background: var(--mist); box-shadow: inset 0 0 0 1px var(--lav); color: var(--slate); }
    .hxt--multi .hxt__cap.is-next b { font-weight: 700; color: var(--ink); }
    .hxt--multi .hxt__bar { margin-top: 4px; }
  }
}

/* AK Nov 5 r3: "Open the full Walmart report" under a tour that shows the Account Research Agent report: quiet, one line, 44px tap height */
.hxt__open { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0 16px; margin: 0; }
.hxt__open a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px; color: var(--violet, #341D99); font: 700 13px/1.2 Manrope, Arial, sans-serif; text-decoration: underline; text-decoration-color: rgba(52, 29, 153, .35); text-underline-offset: 3px; }
.hxt__open svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hxt__open a:focus-visible { outline: 2px solid var(--violet, #341D99); outline-offset: 2px; border-radius: 6px; }
@media (hover: hover) and (pointer: fine) { .hxt__open a:hover { text-decoration-color: currentColor; } }
.hxt__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hxt--still .hxt__open { margin-top: 8px; }
