/* Standwell guide and tips (guide.js): Desk, Your shops, login and sign-up.
   Calm but easy to spot: a white bubble with a medium-blue edge and dark words, a soft shadow,
   a faint veil over the page with the thing to press left clear. Tips are a touch lighter. */

/* The veil. Its huge shadow lightly shades everything except its own box (the clear spot).
   It never takes clicks, so the target and the rest of the page still work. */
.tour-shade {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  border-radius: 12px;
  box-shadow: 0 0 0 200vmax rgba(15, 23, 42, 0.1);
  transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease;
}
.tour-shade[hidden] { display: none; }

.tour-bubble {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  box-sizing: border-box;
  width: max-content;
  max-width: 340px;
  min-width: 220px;
  padding: 0.85rem 1rem 0.8rem;
  border-radius: 12px;
  background: #ffffff;
  color: #1f2937;
  border: 2px solid #60a5fa;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  font: 400 0.95rem/1.5 "Segoe UI", system-ui, sans-serif;
  text-align: left;
  overflow-y: auto;
}
.tour-bubble[data-side="bottom"], .tour-bubble[data-side="top"],
.tour-bubble[data-side="left"], .tour-bubble[data-side="right"] { overflow: visible; }
.tour-bubble[hidden] { display: none; }

/* The first bubble, and the login / sign-up notes: only a little bigger. */
.tour-bubble.is-big, .tour-bubble.is-note { max-width: 360px; font-size: 1rem; }
.tour-bubble.is-big .tour-title { font-size: 1.15rem; }

/* Tips: a touch lighter than guide steps. */
.tour-bubble.is-hint {
  min-width: 0;
  max-width: 280px;
  padding: 0.7rem 0.85rem 0.6rem;
  border: 1px solid #93c5fd;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

/* The tip's ×: closing it this way snoozes tips a little longer each time. */
.tour-x { display: none; }
.tour-bubble.is-hint { padding-right: 2rem; }
.tour-bubble.is-hint .tour-x:not([hidden]) {
  display: block;
  position: absolute;
  top: 0.25rem;
  right: 0.3rem;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font: 400 1.25rem/1 "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}
.tour-bubble.is-hint .tour-x:hover { background: #eff6ff; color: #1d4ed8; }
.tour-bubble.is-hint .tour-x:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 1px; }

/* The arrow: a small turned square, white with the bubble's blue edge. */
.tour-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid #60a5fa;
  transform: translate(-50%, -50%) rotate(45deg);
  display: none;
}
.tour-bubble.is-hint .tour-arrow { border-width: 1px; border-color: #93c5fd; }
.tour-bubble[data-side="bottom"] .tour-arrow { display: block; top: 0; border-right: 0; border-bottom: 0; }
.tour-bubble[data-side="top"] .tour-arrow { display: block; top: 100% !important; border-left: 0; border-top: 0; }
.tour-bubble[data-side="right"] .tour-arrow { display: block; left: 0 !important; border-right: 0; border-top: 0; }
.tour-bubble[data-side="left"] .tour-arrow { display: block; left: 100% !important; border-left: 0; border-bottom: 0; }

.tour-chapter {
  margin: 0 0 0.1rem;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 600;
}
.tour-chapter:empty { display: none; }
.tour-count {
  margin: 0 0 0.2rem;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tour-count:empty, .tour-title:empty { display: none; }
.tour-title { margin: 0 0 0.3rem; font-size: 1.05rem; font-weight: 700; color: #0f172a; line-height: 1.25; }
.tour-text { margin: 0; }
.tour-nice {
  margin: 0.5rem 0 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
  width: fit-content;
}
.tour-buttons { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.75rem; flex-wrap: wrap; }
.tour-gap { flex: 1; }
.tour-buttons button,
.tour-menu button {
  font: 600 0.88rem "Segoe UI", system-ui, sans-serif;
  padding: 0.34rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background: #ffffff;
  color: #1d4ed8;
  cursor: pointer;
}
.tour-buttons button[hidden] { display: none; }
.tour-buttons .tour-next,
.tour-menu button.tour-next { background: #2563eb; border-color: #2563eb; color: #ffffff; }
.tour-buttons .tour-skip,
.tour-buttons .tour-tips-off { border-color: transparent; background: transparent; color: #475569; padding-left: 0.3rem; padding-right: 0.3rem; text-decoration: underline; }
.tour-buttons button:hover { background: #eff6ff; }
.tour-buttons .tour-next:hover { background: #1d4ed8; }
.tour-buttons button:focus-visible,
.tour-menu button:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }

.tour-menu { margin-top: 0.6rem; }
.tour-menu[hidden] { display: none; }
.tour-menu-top { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.tour-chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.tour-menu button { text-align: left; }
.tour-menu .tour-chapter-btn { width: 100%; border-radius: 10px; font-weight: 550; color: #1f2937; border-color: #dbeafe; }
.tour-menu .tour-chapter-btn:hover { background: #eff6ff; border-color: #93c5fd; }

.tour-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The control the bubble points at: a soft breathing ring. */
.tour-spot {
  border-radius: 12px;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.8), 0 0 10px 2px rgba(147, 197, 253, 0.5);
  animation: tour-aura 3.2s ease-in-out infinite;
}
.desk-actions button.tour-spot, .tool-row button.tour-spot, .account-pay.tour-spot, #guide-open.tour-spot { border-radius: 999px; }
#templates-rail.tour-spot {
  border-radius: 0;
  box-shadow: inset 0 0 0 2px rgba(96, 165, 250, 0.8), inset 0 0 14px rgba(147, 197, 253, 0.4);
  animation: tour-aura-in 3.2s ease-in-out infinite;
}
.tour-spot-soft { animation-duration: 4s; }
/* The traveling light rests while any bubble is up; the Choose a template callout steps aside for the bubble. */
body.is-touring .template-wave { display: none !important; }

/* Entrance: a gentle pop-in and one soft pulse, then still. */
.tour-bubble.is-pop { animation: tour-pop 0.25s ease-out, tour-pulse 1.2s ease-in-out 0.3s 1; }
@keyframes tour-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes tour-pulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16); }
  50% { box-shadow: 0 0 0 6px rgba(147, 197, 253, 0.35), 0 10px 28px rgba(15, 23, 42, 0.16); }
}
@keyframes tour-aura {
  0%, 100% { box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.7), 0 0 6px rgba(147, 197, 253, 0.3); }
  50% { box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.95), 0 0 14px 3px rgba(147, 197, 253, 0.6); }
}
@keyframes tour-aura-in {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(147, 197, 253, 0.7), inset 0 0 8px rgba(147, 197, 253, 0.25); }
  50% { box-shadow: inset 0 0 0 2px rgba(96, 165, 250, 0.95), inset 0 0 16px rgba(147, 197, 253, 0.5); }
}
/* Reduced motion: no movement at all; the colors, ring and veil stay. */
@media (prefers-reduced-motion: reduce) {
  .tour-bubble, .tour-bubble.is-pop, .tour-spot, #templates-rail.tour-spot { animation: none; }
  .tour-shade { transition: none; }
}
@media (max-width: 640px) {
  .tour-bubble { min-width: 0; font-size: 0.92rem; }
  .tour-bubble.is-big { font-size: 0.95rem; }
  .tour-bubble.is-big .tour-title { font-size: 1.08rem; }
}

/* ----- Coming and going (tip-fade.js, CHANGELOG section 31) -----
   wait / gone: not seen and never in the way of clicks. faint: a quarter, fading fast; it can be
   pointed at to bring it back. full: shown. The veil and the ring follow the bubble. */
.tour-bubble[data-presence="full"] { opacity: 1; transition: opacity 0.15s ease-out; }
.tour-bubble[data-presence="faint"] { opacity: 0.25; transition: opacity 0.25s ease-out; }
.tour-bubble[data-presence="wait"] { opacity: 0; visibility: hidden; pointer-events: none; transition: none; }
.tour-bubble[data-presence="gone"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease-in, visibility 0s linear 0.6s;
}
.tour-bubble[data-presence="faint"].is-pop,
.tour-bubble[data-presence="gone"].is-pop,
.tour-bubble[data-presence="wait"].is-pop { animation: none; }
.tour-shade { transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease, opacity 0.25s ease-out; }
body:not([data-guide-presence="full"]) .tour-shade { opacity: 0; }
body[data-guide-presence="wait"] .tour-spot,
body[data-guide-presence="gone"] .tour-spot,
body[data-guide-presence="off"] .tour-spot { animation: none; box-shadow: none; }
body[data-guide-presence="faint"] .tour-spot { animation: none; box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.6); }
#templates-rail.tour-spot { transition: none; }

/* The small ? button: brings tips back, or reopens the one that faded. */
.guide-help {
  position: fixed;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 998;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  background: #ffffff;
  color: #1d4ed8;
  font: 700 1rem/1 "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  opacity: 0.85;
}
.guide-help:hover, .guide-help:focus-visible { opacity: 1; background: #eff6ff; }
.guide-help:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }
.guide-help[hidden] { display: none; }
.guide-help.is-inline {
  position: static;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  margin-left: 0.15rem;
  padding: 0;
  font: 700 1rem/1 "Segoe UI", system-ui, sans-serif;
  box-shadow: none;
  vertical-align: middle;
}
/* Inline, it keeps its place (no jumping) and only dims while a bubble is fully up. */
.guide-help.is-inline[hidden] { display: inline-block; visibility: hidden; }
/* Inline it sits in the Desk's button row, a flex row: there a z-index still lifts it, and 998
   put the ? on top of the Preview layer (CHANGELOG 100). Inline it needs no lifting. */
.guide-help.is-inline { z-index: auto; }
/* Nothing of the editor's help shows over "the page as a visitor sees it". */
body.is-look-preview .guide-help,
body.is-look-preview .guide-help.is-inline[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .tour-bubble[data-presence], .tour-shade { transition: none; }
}
