/* ============================================================
   GetEYT guided tour
   Loads LAST, after motion.css. Nothing in here redefines a class
   owned by app.css, v2.css, fixes.css, tables.css, motion.css or
   orgtree.css. Every selector starts with `tour-`, a prefix that
   appears nowhere else in the product, checked by grep before a
   line was written.

   Three layers, each with exactly one job, all driven from the
   same measured rectangle:

     .tour-hole   paints the dim. One element, one huge box-shadow
                  spread, so the hole is a real rounded rectangle
                  rather than four butted panels with square
                  corners. Never takes a pointer event.
     .tour-block  four transparent panels around the hole. These
                  take the pointer events, which is what makes the
                  spotlit control genuinely clickable while the
                  rest of the page is not. A single overlay cannot
                  do both jobs, which is why there are two.
     .tour-card   the step itself. Focus lives here for the whole
                  step, so a keyboard or screen reader user is
                  never dropped into the dimmed page behind.

   Durations and easings are motion.css tokens. This file defines
   no easing and no duration of its own.
   ============================================================ */

/* ------------------------------------------------------------
   The layer. Fixed and clipped, because .tour-hole carries a
   9999px shadow spread and an unclipped one lengthens the
   document on some engines.
   ------------------------------------------------------------ */
.tour-layer {
  position: fixed;
  inset: 0;
  z-index: 9600; /* above .pnback 9200 and .pinback 9500 */
  overflow: hidden;
  pointer-events: none;
}

.tour-hole {
  position: absolute;
  border-radius: var(--r);
  box-shadow:
    0 0 0 9999px rgba(36, 28, 43, 0.62),
    0 0 0 1.5px rgba(255, 255, 255, 0.9) inset;
  pointer-events: none;
  /* both ends of this move are known, which is what --e-inout is for */
  transition:
    top var(--m-base) var(--e-inout),
    left var(--m-base) var(--e-inout),
    width var(--m-base) var(--e-inout),
    height var(--m-base) var(--e-inout);
}

/* The ring. Separate from the hole so its colour can pulse once on
   arrival without re-animating the dim, which would flash the whole
   screen every step. */
.tour-ring {
  position: absolute;
  border-radius: var(--r);
  border: 2px solid var(--plum);
  box-shadow: 0 0 0 5px rgba(91, 61, 117, 0.22);
  pointer-events: none;
  transition:
    top var(--m-base) var(--e-inout),
    left var(--m-base) var(--e-inout),
    width var(--m-base) var(--e-inout),
    height var(--m-base) var(--e-inout);
}
.tour-ring.tour-ring--land {
  animation: tour-land var(--m-slow) var(--e-out);
}
@keyframes tour-land {
  from {
    box-shadow: 0 0 0 14px rgba(91, 61, 117, 0);
  }
}

/* the four pointer traps. Transparent on purpose: the dim is the
   hole's shadow, these only exist to swallow clicks. */
.tour-block {
  position: absolute;
  pointer-events: auto;
  background: transparent;
}

/* ------------------------------------------------------------
   The step card
   ------------------------------------------------------------ */
.tour-card {
  position: fixed;
  z-index: 9602;
  width: 372px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  /* Deliberately NOT transitioned between steps. The card's height
     changes the instant its copy does, while a transitioned top would
     still be gliding from the last step's position, and a short card
     becoming a tall one overhangs the bottom of the screen for the
     length of the glide. Measured at 990px against a 950px viewport
     before this was removed.

     So the light travels and the card arrives. It re-enters on
     tour-card-in below, which reads as a new card rather than as the
     same card sliding, and that is the more honest gesture anyway. */
}
.tour-card.tour-card--in {
  animation: tour-card-in var(--m-base) var(--e-out) both;
}
@keyframes tour-card-in {
  from {
    opacity: 0;
    transform: translateY(var(--m-lift));
  }
}

/* the arrow, pointed at the thing being explained. Rotated square
   rather than a border triangle so it inherits the card's own
   border and reads as one object. */
.tour-card__arrow {
  position: absolute;
  width: 13px;
  height: 13px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  transform: rotate(45deg);
}
.tour-card[data-side="bottom"] .tour-card__arrow {
  top: -7.5px;
  border-right: 0;
  border-bottom: 0;
}
.tour-card[data-side="top"] .tour-card__arrow {
  bottom: -7.5px;
  border-left: 0;
  border-top: 0;
}
.tour-card[data-side="right"] .tour-card__arrow {
  left: -7.5px;
  border-right: 0;
  border-top: 0;
}
.tour-card[data-side="left"] .tour-card__arrow {
  right: -7.5px;
  border-left: 0;
  border-bottom: 0;
}
.tour-card[data-side="center"] .tour-card__arrow {
  display: none;
}

.tour-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 14px 0 16px;
}
.tour-card__chapter {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--plum);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tour-card__count {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tour-card__x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0;
  transition: background-color var(--m-fast) var(--e-out);
}
.tour-card__x:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.tour-card__body {
  padding: 6px 16px 2px;
}
.tour-card__t {
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.34;
  margin: 0 0 5px;
  letter-spacing: -0.006em;
}
.tour-card__p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}
.tour-card__p b {
  font-weight: 650;
  color: var(--ink);
}

.tour-card__rail {
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  margin: 13px 16px 0;
  overflow: hidden;
}
.tour-card__fill {
  height: 100%;
  background: var(--plum);
  border-radius: 2px;
  transition: width var(--m-base) var(--e-out);
}

.tour-card__acts {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px 13px 16px;
}
.tour-card__spacer {
  flex: 1;
}

/* Buttons are named tour-btn, not btn. actions.js opens an inferred
   panel for any button.btn without a handler, and a tour that opens
   a settings sheet every time you press Next is not a tour. */
.tour-btn {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-sm);
  padding: 7px 13px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition:
    background-color var(--m-fast) var(--e-out),
    transform var(--m-instant) var(--e-spring);
}
.tour-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.tour-btn:active {
  transform: scale(0.975);
}
.tour-btn--primary {
  background: var(--plum);
  border-color: var(--plum);
  color: #fff;
}
.tour-btn--primary:hover {
  background: var(--plum-700);
  border-color: var(--plum-700);
  color: #fff;
}
.tour-btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding-left: 6px;
  padding-right: 6px;
}
.tour-btn--quiet:hover {
  background: transparent;
  color: var(--ink-2);
  text-decoration: underline;
}
.tour-btn[disabled] {
  opacity: 0.42;
  cursor: default;
  pointer-events: none;
}
.tour-btn:focus-visible,
.tour-card__x:focus-visible,
.tour-launch:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 2px;
}

/* Named after the key it responds to, so the shortcut is legible
   from the interface rather than from documentation. Same rule the
   hotkey bar follows. */
.tour-card__keys {
  font-size: 11px;
  color: var(--muted);
  padding: 0 16px 12px;
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 9px;
}
.tour-card__keys kbd {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 4px;
  color: var(--ink-2);
}

/* ------------------------------------------------------------
   The launcher in the topbar
   ------------------------------------------------------------ */
.tour-launch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--plum-050);
  background: var(--plum-050);
  color: var(--plum);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color var(--m-fast) var(--e-out),
    transform var(--m-instant) var(--e-spring);
}
.tour-launch:hover {
  background: #eae0f2;
}
.tour-launch:active {
  transform: scale(0.97);
}
.tour-launch svg {
  width: 15px;
  height: 15px;
  flex: none;
}
/* one dot, only while there is an unfinished pass to come back to */
.tour-launch__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--plum);
  flex: none;
}

/* ------------------------------------------------------------
   The first visit offer. Shown once, dismissible, and dismissing
   it is remembered. Nothing in this product may be hidden without
   leaving a way back, and the way back is the topbar launcher,
   which the offer points at by name.
   ------------------------------------------------------------ */
.tour-offer {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9400;
  width: 330px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 15px 16px 13px;
  font-family: var(--font-ui);
  animation: tour-offer-in var(--m-base) var(--e-out) both;
}
@keyframes tour-offer-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.tour-offer.tour-offer--out {
  animation: tour-offer-out var(--m-fast) var(--e-in) both;
}
@keyframes tour-offer-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}
.tour-offer__t {
  font-size: 13px;
  font-weight: 650;
  margin: 0 0 4px;
}
.tour-offer__p {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 11px;
}
.tour-offer__acts {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ------------------------------------------------------------
   Screen reader announcement. Every step names the control it is
   pointing at, because the visual spotlight carries no meaning
   through a screen reader.
   ------------------------------------------------------------ */
.tour-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The page is NOT scroll locked while a tour runs, deliberately. The
   engine scrolls each target into view itself, and if the reader then
   scrolls by hand the spotlight follows, because a locked page with a
   spotlight glued to a rectangle you cannot reach is worse than either
   on its own.

   Which means the hole has to be repositioned every frame while that
   is happening, and a 230ms transition on top of a per frame write
   reads as lag. So the transition is on for the one move between two
   steps, and off for the tracking that follows it. */
.tour-layer.tour-noanim .tour-hole,
.tour-layer.tour-noanim .tour-ring {
  transition: none;
}

/* Where there is no topbar to mount into, the launcher docks itself
   at the same corner the offer uses. Same rule as the hotkey bar:
   nothing may be present in one surface and simply absent in another
   with no way to reach it. */
.tour-launch--float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9300;
  height: 36px;
  box-shadow: var(--shadow);
}

/* ------------------------------------------------------------
   Reduced motion kills the movement, never the tour. The hole, the
   ring and the card all jump to their new rectangle; every step
   still runs, in the same order, with the same copy.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .tour-hole,
  .tour-ring,
  .tour-card__fill {
    transition: none;
  }
  .tour-ring.tour-ring--land,
  .tour-card.tour-card--in,
  .tour-offer,
  .tour-offer.tour-offer--out {
    animation: none;
  }
}

/* Narrow screens: the card stops chasing the target and docks to
   the bottom, because a 372px card beside a 340px viewport is a
   card on top of the thing it is describing. */
@media (max-width: 700px) {
  .tour-card {
    left: 12px !important;
    right: 12px;
    top: auto !important;
    bottom: 12px;
    width: auto;
  }
  .tour-card__arrow {
    display: none;
  }
}

/* ---------- the room chooser ----------
   The launcher offers a choice when there is one to make: the whole tour,
   or only the room you are standing in. Two options, never more. A third
   would make this a menu, and a menu is the thing the eight rooms exist to
   remove. */
.tour-choose {
  position: fixed;
  z-index: 10050;
  min-width: 268px;
  background: var(--surface);
  border: 1px solid var(--w-line, var(--line));
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: tour-choose-in 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes tour-choose-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tour-choose {
    animation: none;
  }
}
.tour-choose__o {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  padding: 9px 11px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.tour-choose__o:hover,
.tour-choose__o:focus-visible {
  background: var(--surface-2);
}
.tour-choose__o b {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.tour-choose__o span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

/* ---------- the finish ----------
   A tour that ends by quietly restoring the product leaves a studio owner
   who has just seen 21 screens with no idea which one to touch first. This
   hands over instead. */
.tour-done {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(36, 28, 43, 0.42);
  animation: tour-done-in 0.2s ease-out both;
}
.tour-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.tour-done__card {
  position: relative;
  z-index: 2;
  width: min(468px, calc(100vw - 40px));
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 26px 26px 20px;
  animation: tour-done-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.tour-done__t {
  font-family: var(--font-brand);
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 10px;
}
.tour-done__p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 12px;
}
.tour-done__acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
@keyframes tour-done-in {
  from {
    opacity: 0;
  }
}
@keyframes tour-done-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tour-done,
  .tour-done__card {
    animation: none;
  }
}
