/* During-build walkthrough: a spotlight tour over a greyed report replica.

   Full-screen over the home page after sign-in. We render a greyed-out replica of
   the real report (top stats, the three act tabs, the left sub-tab rail, a
   skeleton body), then a four-panel dim mask covers everything EXCEPT the nav
   piece being introduced, while a coach bubble explains it. So the visitor walks
   the genuine layout while the data fills in behind the dim. No fabricated numbers
   ever paint - the body is skeleton-only.
   Brand tokens: plum #542C9E, deep plum #3D1E7A, tint #FAF7FD, hairline #DDD0EE. */

.welcome-screen {
  position: fixed; inset: 0; z-index: 10000; overflow: hidden;
  background: #FAF7FD;
  animation: welcome-fade 0.25s ease-out;
}
@keyframes welcome-fade { from { opacity: 0; } to { opacity: 1; } }
/* Ships with the `hidden` attribute; only revealed by JS after sign-in. The class
   rule sets a background (an author rule that would beat the UA [hidden] rule), so
   pin it off until JS shows it, else the replica leaks onto the homepage. */
.welcome-screen[hidden] { display: none; }
body.welcome-open { overflow: hidden; }

/* ── The greyed report replica ──────────────────────────────────────────────── */
.wlk-shell {
  position: absolute; inset: 0; overflow: hidden;
  max-width: 1120px; margin: 0 auto; padding: 22px 26px;
  display: flex; flex-direction: column; gap: 16px;
}

/* Top: identity (avatar + greeting) on the left, four stat tiles on the right. */
.wlk-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.wlk-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wlk-id-avatar {
  width: 54px; height: 54px; border-radius: 50%; object-fit: cover;
  border: 2px solid #fff; box-shadow: 0 4px 14px rgba(84, 44, 158, 0.16);
  background: #EDE4FA; flex: none;
}
.wlk-id-name {
  font-size: 1.45rem; font-weight: 800; line-height: 1.1; color: #1c1130;
  letter-spacing: -0.02em;
}
.wlk-id-name span { color: #542C9E; }
.wlk-id-meta { margin-top: 6px; }

.wlk-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.wlk-stat {
  background: #fff; border: 1px solid #ECE2FA; border-radius: 12px;
  padding: 10px 14px; min-width: 96px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.wlk-stat-lbl {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: #9A86B6;
}
/* Live rolling number that replaces the skeleton bar while the build runs. It
   churns continuously (never settles on a value), so it reads as "your numbers
   are coming in", not a fabricated stat. Tabular figures keep the width steady. */
.wlk-stat-num {
  font-size: 1.15rem; font-weight: 800; color: #3D1E7A; line-height: 1;
  font-variant-numeric: tabular-nums; min-height: 22px;
  display: flex; align-items: center;
}

/* Act pill bar: a faithful mirror of the report's .report-acts segmented nav. */
.wlk-acts {
  display: flex; align-items: stretch; gap: 0;
  background: #EDE4F7; border: 1px solid #E0D2F0; border-radius: 14px; padding: 5px;
}
.wlk-act {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 11px 16px; border-radius: 10px; background: transparent;
  color: #7B5E9A; transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.wlk-act.active { color: #3D1E7A; background: #FFFFFF; box-shadow: inset 0 0 0 1px #D9C7EE; }
.wlk-act-num {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 800; line-height: 1;
  background: #E3D4F4; color: #7B5E9A; border: 1px solid #D6C4ED;
}
.wlk-act.active .wlk-act-num { background: #542C9E; color: #FAF8FF; border-color: #542C9E; }
.wlk-act-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wlk-act-name {
  font-size: 0.86rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wlk-act-tag {
  font-size: 0.78rem; font-weight: 600; opacity: 0.78; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Body: left sub-tab rail + the skeleton content column. */
.wlk-layout { display: flex; gap: 18px; flex: 1 1 auto; min-height: 0; align-items: flex-start; }
.wlk-rail {
  /* align-self:flex-start so the rail shrinks to its sub-tabs instead of
     stretching to the full container height - otherwise the rail's box (and the
     spotlight around it) runs far below the last tab, swallowing most of the
     page. Shrunk, the rail ends right under its last sub-tab (Reels / Gaps / The
     Future), so the spotlight stops there. */
  flex: none; align-self: flex-start; width: 188px;
  display: flex; flex-direction: column; gap: 5px;
  background: #fff; border: 1px solid #ECE2FA; border-radius: 14px; padding: 12px 10px;
}
.wlk-rail-tab {
  display: block; padding: 9px 12px; border-radius: 9px;
  font-size: 0.84rem; font-weight: 600; color: #6E5A8C;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wlk-rail-tab.active { background: #542C9E; color: #fff; }

.wlk-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.wlk-card {
  background: #fff; border: 1px solid #ECE2FA; border-radius: 16px; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.wlk-sk-grid { display: flex; gap: 14px; }

/* Skeleton primitives: a soft shimmering placeholder, never a number. */
.wlk-sk {
  display: block; border-radius: 8px;
  background: linear-gradient(100deg, #EFE7F8 30%, #F7F2FC 50%, #EFE7F8 70%);
  background-size: 220% 100%;
  animation: wlk-shimmer 1.6s ease-in-out infinite;
}
@keyframes wlk-shimmer { from { background-position: 180% 0; } to { background-position: -40% 0; } }
.wlk-sk-num  { width: 56px; height: 22px; border-radius: 6px; }
.wlk-sk-line { width: 170px; height: 12px; }
.wlk-sk-h    { width: 44%; height: 18px; }
.wlk-sk-bar  { width: 100%; height: 12px; }
.wlk-sk-bar.short { width: 72%; }
.wlk-sk-block { flex: 1 1 0; height: 78px; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .wlk-sk { animation: none; } }

/* ── Spotlight mask ─────────────────────────────────────────────────────────── */
/* Four dim panels surround the highlighted target, leaving only it bright. */
.wlk-mask { position: fixed; inset: 0; z-index: 10010; pointer-events: none; }
.wlk-panel {
  position: fixed; background: rgba(22, 13, 40, 0.82);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.wlk-ring {
  position: fixed; display: none; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(84, 44, 158, 0.55);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
/* First paint: panels start with no geometry, so suppress the sweep-in once (JS
   adds .no-anim for the first placement, then removes it). */
.wlk-mask.no-anim .wlk-panel, .wlk-mask.no-anim .wlk-ring { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .wlk-panel, .wlk-ring { transition: none; }
}

/* ── Coach bubble ───────────────────────────────────────────────────────────── */
.wlk-coach {
  position: fixed; z-index: 10020; width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 24px); overflow-y: auto;
  background: #fff; border: 1px solid #E4D8F7; border-radius: 16px;
  padding: 18px 20px; box-shadow: 0 18px 44px rgba(20, 12, 40, 0.22);
  opacity: 0; transform: translateY(4px); pointer-events: auto;
  transition: opacity 0.22s ease, transform 0.22s ease, top 0.32s cubic-bezier(0.4, 0, 0.2, 1), left 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.wlk-coach.is-shown { opacity: 1; transform: translateY(0); }
.wlk-coach-arrow {
  position: absolute; width: 16px; height: 16px; background: #fff;
  border: 1px solid #E4D8F7; transform: rotate(45deg); display: none;
}
.wlk-coach.arrow-up   .wlk-coach-arrow { display: block; top: -9px; border-right: 0; border-bottom: 0; }
.wlk-coach.arrow-down .wlk-coach-arrow { display: block; bottom: -9px; border-left: 0; border-top: 0; }

.wlk-coach-tag {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #542C9E; margin: 0 0 6px;
}
.wlk-coach-title {
  font-size: 1.25rem; font-weight: 800; color: #1c1130; letter-spacing: -0.01em; margin: 0 0 7px;
}
.wlk-coach-text { font-size: 0.94rem; line-height: 1.5; color: #3D2E4D; margin: 0; }

/* Progress dots: a subtle 6-position progress bar under the copy. The step label
   itself lives in the tag ("Step 1/2/3"), so no numeric counter rides here. */
.wlk-progress { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; }
.wlk-dots { display: flex; gap: 6px; }
.wlk-dot { width: 6px; height: 6px; border-radius: 50%; background: #DDD0EE; transition: width 0.2s, background 0.2s; }
.wlk-dot.on { background: #542C9E; width: 18px; border-radius: 999px; }

/* Last-step helper: turns the build wait into an explicit "you're done, it opens
   itself" message instead of a dead-end disabled button. */
.wlk-help {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 10px;
  background: #FAF7FD; border: 1px solid #ECE2FA;
  font-size: 0.84rem; line-height: 1.45; color: #5A4A72;
}
.wlk-help[hidden] { display: none; }

/* Control row: Back + Skip on the left, the primary Next button pushed right. */
.wlk-coach-nav {
  display: flex; align-items: center; gap: 10px; margin-top: 16px;
}
.wlk-back, .wlk-skip {
  flex: none; background: none; border: 0; cursor: pointer; font-family: inherit;
  font-weight: 700; color: #8A7AA6; padding: 8px 4px;
}
.wlk-back { font-size: 0.86rem; }
.wlk-skip { font-size: 0.8rem; font-weight: 600; }
.wlk-back[hidden], .wlk-skip[hidden] { display: none; }
.wlk-back:hover, .wlk-skip:hover { color: #542C9E; }

/* The primary Next button (becomes "Show my report" on the last step). Sits on
   its own to the right so it always reads as "the way forward". margin-left:auto
   keeps it right-aligned even when Back is hidden on step 1. */
.wlk-cta {
  flex: none; margin-left: auto; background: #542C9E; color: #fff; border: 0;
  border-radius: 10px; font-family: inherit; font-size: 0.95rem; font-weight: 800;
  cursor: pointer; padding: 12px 22px;
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease;
}
.wlk-cta[disabled] { opacity: 0.55; cursor: default; }
.wlk-cta:not([disabled]):hover { transform: translateY(-1px); background: #46237F; }
/* The ready "Show my report" state gets a green wash so it reads as "go". */
.wlk-cta.is-ready { background: #1f8a4c; }
.wlk-cta.is-ready:not([disabled]):hover { background: #1a7541; }

/* Build status line, under the controls. */
.wlk-build {
  display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid #F0E8FA;
  font-size: 0.8rem; font-weight: 600; color: #7B5E9A;
}
.wlk-build.is-ready { color: #1f8a4c; }
.wlk-build-spin {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid #DDD0EE; border-top-color: #542C9E;
  animation: wlk-spin 0.8s linear infinite;
}
.wlk-build.is-ready .wlk-build-spin { display: none; }
.wlk-build-tick { display: none; font-weight: 800; color: #1f8a4c; }
.wlk-build.is-ready .wlk-build-tick { display: inline; }
@keyframes wlk-spin { to { transform: rotate(360deg); } }

/* "Open now" shortcut: shown only once the report is ready, on earlier steps. */
.wlk-open-now {
  margin-left: auto; flex: none; background: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: 0.82rem; font-weight: 800; color: #1f8a4c;
  padding: 4px 2px; text-decoration: underline;
}
.wlk-open-now[hidden] { display: none; }
.wlk-open-now:hover { color: #1a7541; }

/* ── Waiting screen ─────────────────────────────────────────────────────────── */
/* Shown when "Show my report" is pressed before the build lands: the spotlight
   tour is dropped and the greyed replica becomes a clean "report loading"
   skeleton, with the sitewide build banner raised to the top and this centered
   loading card ticking down. It opens the real report itself when ready. */
.wlk-wait {
  position: fixed; inset: 0; z-index: 10015;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; padding: 24px;
}
.wlk-wait[hidden] { display: none; }
.wlk-wait-card {
  pointer-events: auto; background: #fff; border: 1px solid #E4D8F7;
  border-radius: 18px; padding: 28px 32px; text-align: center; max-width: 380px;
  box-shadow: 0 18px 50px rgba(20, 12, 40, 0.18);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
}
.wlk-wait-spin {
  width: 34px; height: 34px; border-radius: 50%; margin-bottom: 4px;
  border: 3px solid #E3D4F4; border-top-color: #542C9E;
  animation: wlk-spin 0.8s linear infinite;
}
.wlk-wait-title { font-size: 1.2rem; font-weight: 800; color: #1c1130; letter-spacing: -0.01em; }
.wlk-wait-note { font-size: 0.95rem; font-weight: 700; color: #542C9E; }
.wlk-wait-sub { font-size: 0.85rem; line-height: 1.45; color: #6E5A8C; }
@media (prefers-reduced-motion: reduce) { .wlk-wait-spin { animation: none; } }

/* Screen-reader-only live region (step announcements). */
.wlk-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Reduced motion: also calm the coach glide-between-steps and the build spinner
   (the skeleton shimmer + mask transitions are already handled above). */
@media (prefers-reduced-motion: reduce) {
  .welcome-screen { animation: none; }
  .wlk-coach { transition: opacity 0.2s ease; transform: none; }
  .wlk-build-spin { animation: none; }
}

/* ── Phones ─────────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .wlk-shell { padding: 16px 14px; gap: 12px; }
  .wlk-id-name { font-size: 1.2rem; }
  .wlk-stats { gap: 7px; }
  .wlk-stat { min-width: 70px; padding: 8px 9px; }
  .wlk-stat-lbl { font-size: 0.58rem; }
  /* Collapse the act pills to just their labels so three fit a narrow row, like
     the report's nav does on the tightest phones. */
  .wlk-act { padding: 10px 6px; gap: 0; justify-content: center; }
  .wlk-act-num, .wlk-act-tag { display: none; }
  /* Only the name shows on mobile (centred in the pill). letter-spacing leaves a
     trailing gap after the last letter, which pulls centred text slightly left;
     a matching text-indent adds the same gap up front so the word sits dead
     centre. */
  .wlk-act-name { font-size: 0.72rem; letter-spacing: 0.04em; text-indent: 0.04em; }
  /* The rail sits above the body as a wrapping chip cloud so EVERY section is
     visible and readable while the spotlight rings it - never a clipped strip
     (the visitor must be able to read the whole section list, Benchmarks ->
     Reels, for the act being introduced). */
  .wlk-layout { flex-direction: column; gap: 12px; }
  .wlk-rail {
    width: auto; flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 10px;
  }
  .wlk-rail-tab { font-size: 0.78rem; padding: 7px 11px; }
  /* Tighten the coach on phones so the WHOLE card - copy, controls and the
     "Your report is ready / Open now" build line - fits on screen alongside the
     tall wrapped rail, instead of overflowing so the ready CTA scrolls out of
     view at the bottom. */
  .wlk-coach { width: calc(100vw - 28px); padding: 14px 15px; }
  .wlk-coach-title { font-size: 1.06rem; margin-bottom: 5px; }
  .wlk-coach-text { font-size: 0.88rem; line-height: 1.42; }
  .wlk-progress { margin-top: 10px; }
  .wlk-coach-nav { margin-top: 12px; }
  .wlk-cta { padding: 10px 18px; font-size: 0.9rem; }
  .wlk-back { padding: 6px 4px; }
  .wlk-skip { padding: 6px 4px; }
  .wlk-build { margin-top: 10px; padding-top: 10px; }
}
