/* ==========================================================================
   Xphias LLC Guest Speaker Manager
   06-tutorial.css
   Tutorial theatre: animations, 16:9 stage, scrubbable timeline and transport controls.
   ========================================================================== */

/* This used to read:
       .section-bar-light, .section-bar-light * { color: #0f172a !important; }
   -- a blanket near-black, forced onto every section bar and everything
   inside it, from a stylesheet that loads last and therefore won out.

   It only made sense while the bar had its pale background. Choose the
   "Modern Inline Accent" or "Minimalist Underline" header style and that
   background is removed, leaving near-black type sitting directly on a dark
   page: DIRECTORS, CINEMATOGRAPHY and every other section title went almost
   invisible, and so did their Edit buttons.

   It is scoped to the block style now, and takes the theme's own colour for
   text on that bar -- which setThm() guarantees is readable against it. */
body.head-block .section-bar-light,
body.head-block .section-bar-light *,
[data-bg="light"], [data-bg="light"] * {
  color: var(--col1-text, #0f172a) !important;
}

/* The two borderless header styles keep the brand colour, which is guarded
   against the page behind it. */
body.head-inline .section-bar-light,
body.head-inline .section-bar-light *,
body.head-underline .section-bar-light,
body.head-underline .section-bar-light * {
  color: var(--brand) !important;
}

/* Modern 12-Second Choreographed Tutorial Animations */
@keyframes tutProgressBar12s {
  0% { width: 0%; }
  100% { width: 100%; }
}

@keyframes tutPhasePill1 {
  0%, 25% { opacity: 1; border-color: var(--cyan); background: rgba(0, 180, 216, 0.25); color: #fff; transform: scale(1.04); }
  26%, 100% { opacity: 0.5; border-color: var(--c-border); background: var(--navy2); color: var(--muted); transform: scale(1); }
}
@keyframes tutPhasePill2 {
  0%, 25% { opacity: 0.5; border-color: var(--c-border); background: var(--navy2); color: var(--muted); transform: scale(1); }
  26%, 50% { opacity: 1; border-color: var(--brand); background: rgba(201, 168, 76, 0.25); color: #fff; transform: scale(1.04); }
  51%, 100% { opacity: 0.5; border-color: var(--c-border); background: var(--navy2); color: var(--muted); transform: scale(1); }
}
@keyframes tutPhasePill3 {
  0%, 50% { opacity: 0.5; border-color: var(--c-border); background: var(--navy2); color: var(--muted); transform: scale(1); }
  51%, 75% { opacity: 1; border-color: var(--green); background: rgba(45, 158, 107, 0.25); color: #fff; transform: scale(1.04); }
  76%, 100% { opacity: 0.5; border-color: var(--c-border); background: var(--navy2); color: var(--muted); transform: scale(1); }
}
@keyframes tutPhasePill4 {
  0%, 75% { opacity: 0.5; border-color: var(--c-border); background: var(--navy2); color: var(--muted); transform: scale(1); }
  76%, 100% { opacity: 1; border-color: var(--cyan); background: rgba(0, 180, 216, 0.25); color: #fff; transform: scale(1.04); }
}

@keyframes tutCursorPath12s {
  0% { transform: translate(30px, 280px); opacity: 0; }
  5% { transform: translate(50px, 140px); opacity: 1; }
  20% { transform: translate(110px, 70px); }
  25% { transform: translate(110px, 70px) scale(0.85); }
  30% { transform: translate(110px, 70px) scale(1); }
  45% { transform: translate(250px, 70px); }
  50% { transform: translate(250px, 70px) scale(0.85); }
  55% { transform: translate(250px, 70px) scale(1); }
  70% { transform: translate(280px, 180px); }
  75% { transform: translate(280px, 180px) scale(0.85); }
  80% { transform: translate(280px, 180px) scale(1); }
  95% { transform: translate(320px, 260px); opacity: 1; }
  100% { transform: translate(320px, 280px); opacity: 0; }
}

@keyframes tutPulseGlowCyan {
  0%, 100% { box-shadow: 0 0 5px rgba(0, 180, 216, 0.3); border-color: rgba(0, 180, 216, 0.5); }
  50% { box-shadow: 0 0 16px rgba(0, 180, 216, 0.85); border-color: var(--cyan); }
}
@keyframes tutPulseGlowGold {
  0%, 100% { box-shadow: 0 0 5px rgba(201, 168, 76, 0.3); border-color: rgba(201, 168, 76, 0.5); }
  50% { box-shadow: 0 0 16px rgba(201, 168, 76, 0.85); border-color: var(--brand); }
}

@keyframes tutDragFlight {
  0%, 25% { transform: translate(0, 0); box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
  35% { transform: translate(15px, -18px) scale(1.06); box-shadow: 0 12px 24px rgba(0,0,0,0.6); }
  55% { transform: translate(95px, 45px) scale(1.06); box-shadow: 0 12px 24px rgba(0,0,0,0.6); }
  70% { transform: translate(140px, 2px) scale(1.02); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
  75%, 100% { transform: translate(140px, 0) scale(1); box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
}

@keyframes tutConflictShake {
  0%, 45% { border-color: var(--c-border); background: var(--navy); }
  50%, 65% { border-color: var(--red); background: rgba(239, 68, 68, 0.18); transform: translateX(-3px); }
  55%, 60% { transform: translateX(3px); }
  70%, 100% { border-color: var(--c-border); background: var(--navy); transform: translateX(0); }
}

@keyframes tutToastSlideInOut {
  0%, 52% { opacity: 0; transform: translateY(12px); pointer-events: none; }
  56%, 85% { opacity: 1; transform: translateY(0); }
  90%, 100% { opacity: 0; transform: translateY(-8px); pointer-events: none; }
}

@keyframes tutCooldownTrack {
  0%, 26% { width: 0%; }
  27% { width: 100%; }
  100% { width: 25%; }
}

@keyframes tutColumnSwap {
  0%, 30% { transform: translateX(0); }
  45%, 75% { transform: translateX(112%); }
  90%, 100% { transform: translateX(0); }
}
@keyframes tutColumnSwapCounter {
  0%, 30% { transform: translateX(0); }
  45%, 75% { transform: translateX(-112%); }
  90%, 100% { transform: translateX(0); }
}

.tut-stage {
  width: 100%;
  min-height: 420px;
  height: 420px;
  background: #060b14;
  border: 1.5px solid var(--c-border);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 35px rgba(0,0,0,0.85), 0 10px 30px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}
.tut-stage-screen {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tut-timeline-bar-wrap {
  height: 26px;
  background: var(--navy2);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
}
.tut-timeline-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  overflow: hidden;
}
.tut-timeline-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--brand), var(--green));
  width: 0%;
  animation: tutProgressBar12s 12s linear infinite;
}
.tut-phase-badge-bar {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
}
.tut-phase-chip {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  border: 1px solid var(--c-border);
  transition: all 0.3s;
  white-space: nowrap;
}
.tut-chip-1 { animation: tutPhasePill1 12s infinite; }
.tut-chip-2 { animation: tutPhasePill2 12s infinite; }
.tut-chip-3 { animation: tutPhasePill3 12s infinite; }
.tut-chip-4 { animation: tutPhasePill4 12s infinite; }

/* 4.5s Fade & Zoom In Dashboard Animation */
/* 2.5-Second Fade and 1.5 Zoom-In Dashboard Transition Animation */
@keyframes dashFadeZoomIn25 {
  0% {
    opacity: 0;
    transform: scale(0.667);
    filter: blur(8px);
  }
  40% {
    opacity: 0.6;
    transform: scale(0.85);
    filter: blur(3px);
  }
  80% {
    opacity: 0.92;
    transform: scale(0.98);
    filter: blur(0.5px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0px);
  }
}
.dash-fade-zoom-25 {
  animation: dashFadeZoomIn25 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  transform-origin: center center !important;
}
.dash-fade-zoom-45 {
  animation: dashFadeZoomIn25 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  transform-origin: center center !important;
}

/* 4K Aspect Ratio (16:9) Help Modal Widening */
#mo.help-modal-mode .modal-box {
  width: 1540px !important;
  max-width: 97vw !important;
  max-height: 95vh !important;
  border: 1.5px solid var(--cyan) !important;
  box-shadow: 0 0 50px rgba(0, 180, 216, 0.35), 0 25px 70px rgba(0, 0, 0, 0.85) !important;
}

/* 4K 16:9 Theater Stage */
.tut-stage-4k {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 420px;
  max-height: 580px;
  background: #020617;
  border: 1.5px solid var(--c-border);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.95), 0 12px 36px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.tut-stage-screen-4k {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #091224 0%, #030712 100%);
}

/* Interactively Scrubbable Timeline Bar */
.tut-scrub-track-container {
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  padding: 0 4px;
  user-select: none;
}
.tut-scrub-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  position: relative;
  pointer-events: none;
}
.tut-scrub-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--brand), var(--green));
  border-radius: 3px;
  width: 0%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.tut-scrub-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 10px rgba(0, 180, 216, 0.9);
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  left: 0%;
  pointer-events: none;
  transition: transform 0.1s ease;
}
.tut-scrub-track-container:hover .tut-scrub-thumb,
.tut-scrub-track-container.active-scrub .tut-scrub-thumb {
  transform: translate(-50%, -50%) scale(1.35);
  box-shadow: 0 0 18px var(--cyan);
  background: var(--gold);
}

/* .screen-ex-btn styled a button in an earlier shape of the tutorial screen.
   Nothing writes that class name any more, in any script or in the page. */

/* Transport Controls & Prominent Playhead */
.tut-timeline-controls-bar {
  height: 38px;
  background: #070e1c;
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  user-select: none;
}

.tut-ctrl-btn {
  background: var(--navy2);
  border: 1px solid var(--c-border);
  color: #fff;
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  transition: all 0.2s ease;
}
.tut-ctrl-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 180, 216, 0.15);
  box-shadow: 0 0 8px rgba(0, 180, 216, 0.3);
}
.tut-ctrl-btn:active {
  transform: scale(0.95);
}
.tut-play-btn {
  border-color: var(--cyan);
  color: var(--cyan);
  min-width: 72px;
  justify-content: center;
}

.tut-time-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--cyan);
  font-family: monospace;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 180, 216, 0.25);
  min-width: 125px;
  text-align: center;
}

.tut-badge-loop {
  font-size: 9px;
  font-weight: 800;
  color: var(--green);
  background: rgba(45, 158, 107, 0.2);
  border: 1px solid var(--green);
  padding: 3px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}
.tut-badge-res {
  font-size: 9px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(201, 168, 76, 0.15);
  border: 1px solid var(--brand);
  padding: 3px 6px;
  border-radius: 3px;
  font-family: monospace;
}

/* Playhead Needle */
.tut-playhead {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 32px;
  cursor: grab;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
}
.tut-playhead:active, .tut-playhead.dragging {
  cursor: grabbing;
}
.tut-playhead-cap {
  width: 16px;
  height: 14px;
  background: linear-gradient(180deg, #ffffff 0%, var(--brand, #c9a84c) 100%);
  clip-path: polygon(0% 0%, 100% 0%, 100% 65%, 50% 100%, 0% 65%);
  box-shadow: 0 0 14px rgba(201, 168, 76, 0.95), 0 2px 6px rgba(0,0,0,0.9);
  border-top: 1px solid #fff;
  transition: transform 0.1s ease;
}
.tut-playhead-line {
  width: 2px;
  height: 18px;
  background: var(--brand, #c9a84c);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.9);
}
.tut-playhead:hover .tut-playhead-cap,
.tut-playhead.dragging .tut-playhead-cap {
  transform: scale(1.3);
  background: linear-gradient(180deg, #ffffff 0%, var(--cyan, #00b4d8) 100%);
  box-shadow: 0 0 18px var(--cyan);
}
.tut-playhead:hover .tut-playhead-line,
.tut-playhead.dragging .tut-playhead-line {
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.tut-click-ripple {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  transition: all 0.35s ease-out;
  z-index: 22;
}

/* ==========================================================================
   THE GUIDED TOUR
   --------------------------------------------------------------------------
   The dim is one element casting a very large shadow outwards, so the lit
   area and the dim area can never drift apart the way four separate
   rectangles do.
   ========================================================================== */
#xp-tour-mask {
  /* Longhands before `inset`, which Safari only learned in 2021. Without
     them an older browser gives this element no size at all and the tour's
     dim never appears. */
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  inset: 0; z-index: 99990;
  pointer-events: auto; background: transparent;
}

#xp-tour-hole {
  position: fixed; z-index: 99991; pointer-events: none;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(3, 8, 20, .76),
              0 0 0 2px var(--cyan, #00b4d8),
              0 0 22px 4px rgba(0, 180, 216, .45);
  transition: top .28s cubic-bezier(.4,0,.2,1),
              left .28s cubic-bezier(.4,0,.2,1),
              width .28s cubic-bezier(.4,0,.2,1),
              height .28s cubic-bezier(.4,0,.2,1);
}

#xp-tour-bubble {
  position: fixed; z-index: 99992;
  background: var(--navy2, #16233c);
  border: 1px solid var(--c-border, #2b3a55);
  border-top: 3px solid var(--cyan, #00b4d8);
  border-radius: 10px;
  padding: 14px 16px 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .66);
  transition: top .28s cubic-bezier(.4,0,.2,1), left .28s cubic-bezier(.4,0,.2,1);
}

.xp-tour-count {
  font-size: 9px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--gold, #c9a84c); font-weight: 700; margin-bottom: 7px;
}
.xp-tour-say {
  font-size: 12.5px; line-height: 1.58; color: var(--text, #e2e8f0);
}
.xp-tour-miss {
  margin-top: 9px; padding: 7px 9px; border-radius: 5px; font-size: 10.5px;
  background: rgba(201, 168, 76, .12); color: var(--gold, #c9a84c);
  border-left: 3px solid currentColor;
}
.xp-tour-btns {
  display: flex; gap: 7px; margin-top: 13px; align-items: center;
}
.xp-tour-b {
  font-family: inherit; font-size: 10.5px; font-weight: 600;
  padding: 7px 13px; border-radius: 5px; cursor: pointer;
  background: transparent; color: var(--text, #e2e8f0);
  border: 1px solid var(--c-border, #2b3a55);
}
.xp-tour-b:hover:not(:disabled) { border-color: var(--cyan, #00b4d8); }
.xp-tour-b:disabled { opacity: .35; cursor: not-allowed; }
.xp-tour-b-main {
  background: var(--cyan, #00b4d8); border-color: var(--cyan, #00b4d8);
  color: #041018; margin-right: auto;
}
.xp-tour-b-quiet { opacity: .7; font-weight: 500; }

/* A tour running on the real app must not let a click through to the app
   underneath — the point is to look, not to set things off by accident. */
body.xp-tour-on { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  #xp-tour-hole, #xp-tour-bubble { transition: none; }
}

/* ==========================================================================
   THE THEATER
   --------------------------------------------------------------------------
   A real, sealed copy of the app in a 16:9 frame. It is rendered at a fixed
   1600x900 and then scaled down to whatever room the dialog has, so the app
   inside believes it is on a wide screen and lays itself out accordingly,
   instead of collapsing into its narrow-window layout.
   ========================================================================== */
.xp-theater {
  /* The height is set in JS (see fitHelpFrame) so it can be capped against
     the window as well as the dialog width. aspect-ratio alone would make a
     wide dialog produce a stage taller than the screen. */
  position: relative; width: 100%; min-height: 220px;
  background: #060b16; border: 1px solid var(--c-border, #2b3a55);
  border-radius: 10px; overflow: hidden;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .6);
}
.xp-theater-frame {
  position: absolute; top: 0; left: 0;
  width: 1600px; height: 900px; border: 0;
  transform-origin: top left;
}
.xp-theater-veil {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  inset: 0; display: flex;
  align-items: center; justify-content: center; flex-direction: column;
  gap: 10px; background: #060b16; color: var(--muted, #94a3b8);
  font-size: 12px; transition: opacity .4s ease; z-index: 3;
}
.xp-theater-veil.gone { opacity: 0; pointer-events: none; }
.xp-theater-spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--c-border, #2b3a55);
  border-top-color: var(--cyan, #00b4d8);
  animation: xp-theater-spin 0.9s linear infinite;
}
@keyframes xp-theater-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .xp-theater-spin { animation-duration: 3s; } }

/* A live badge, so it is never in doubt that this is the real software. */
.xp-theater-badge {
  position: absolute; top: 10px; right: 12px; z-index: 4;
  font-size: 8.5px; font-weight: 700; letter-spacing: .8px;
  padding: 4px 8px; border-radius: 3px;
  background: rgba(45, 158, 107, .22); color: var(--green, #22c55e);
  border: 1px solid rgba(45, 158, 107, .45);
}

.xp-help-intro {
  font-size: 12px; line-height: 1.6; color: var(--muted, #94a3b8);
  margin-bottom: 14px;
}
.xp-help-intro strong { color: var(--text, #e2e8f0); }

.xp-help-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }

.xp-transport {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding: 9px 11px; border-radius: 7px;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--c-border, #2b3a55);
}
.xp-transport-dots { display: flex; gap: 5px; margin-left: auto; }
.xp-transport-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-border, #2b3a55); transition: background .2s;
}
.xp-transport-dot.on { background: var(--cyan, #00b4d8); }
.xp-transport-label {
  font-size: 10px; color: var(--muted, #94a3b8); letter-spacing: .4px;
}

/* When the preview will not start, this is all that is said before the tour
   takes over on the real screen. One line, not a lecture. */
.xp-theater-handoff {
  max-width: 420px; text-align: center; padding: 0 20px;
  color: var(--text, #e2e8f0);
}
.xp-theater-handoff strong {
  display: block; font-size: 13px; margin-bottom: 6px; color: var(--cyan, #00b4d8);
}
.xp-theater-handoff p {
  font-size: 11.5px; line-height: 1.6; color: var(--muted, #94a3b8); margin: 0;
}

/* ==========================================================================
   THE WRITTEN WALKTHROUGH
   --------------------------------------------------------------------------
   The part of the Help screen that has nothing to load and so can never be
   blank. It is the body of the page, not a footnote to the preview.
   ========================================================================== */
.xp-steps {
  list-style: none; margin: 14px 0 0; padding: 0;
  counter-reset: none;
}
.xp-step {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 13px; margin-bottom: 8px;
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--c-border, #2b3a55);
  border-left: 3px solid var(--cyan, #00b4d8);
  border-radius: 7px;
}
.xp-step-n {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--cyan, #00b4d8); color: #041018;
  font-size: 10.5px; font-weight: 800; line-height: 1;
}
.xp-step-say {
  font-size: 12.5px; line-height: 1.62; color: var(--text, #e2e8f0);
  /* A span by default, so the field list and the note inside it took their
     width from the longest line and every dotted rule ended somewhere
     different. Block, and filling the row, lines them all up. */
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.xp-theater-wrap { margin-top: 16px; }
.xp-theater-wrap[hidden] { display: none; }


/* ==========================================================================
   THE FIELD LIST  (v3.28.1)

   A step in "Filling In Each Section" carries the actual fields it is
   describing and one short note about the thing that is not obvious. Both
   are drawn by xpStepDetailHtml(), which the tour bubble and this page share,
   so they are styled once here and look the same in both places.
   ========================================================================== */
.xp-step-how {
  list-style: none;
  margin: 9px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.xp-step-how li {
  position: relative;
  padding: 4px 0 4px 15px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text, #e2e8f0);
  border-bottom: 1px dotted rgba(255, 255, 255, .09);
}
.xp-step-how li:last-child { border-bottom: 0; }
.xp-step-how li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan, #00b4d8);
}

.xp-step-note {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.52;
  background: rgba(201, 168, 76, .10);
  color: var(--gold, #c9a84c);
  border-left: 3px solid currentColor;
}

/* Inside the tour bubble the type comes down a step -- the bubble is 360px
   at most and a nine-line field list has to stay readable in it. */
.xp-tour-bubble .xp-step-how li { font-size: 10.8px; padding-left: 13px; }
.xp-tour-bubble .xp-step-how li::before { top: 10px; }
.xp-tour-bubble .xp-step-note { font-size: 10.4px; }

/* A long field list must not push the buttons off the bottom of the screen. */
.xp-tour-bubble .xp-step-how { max-height: 40vh; overflow-y: auto; }


/* ==========================================================================
   THE ENCYCLOPEDIA, AT THE HEAD OF THE HELP SCREEN

   Deliberately the first thing on the screen and deliberately not a tab.
   The walkthroughs answer "how do I", the book answers "why did it do that
   on its own", and the second question is the one this application creates.
   ========================================================================== */
.xp-help-book {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(201,168,76,.14), rgba(0,180,216,.08));
  border: 1.5px solid var(--brand);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.xp-help-book-icon { font-size: 30px; flex: 0 0 auto; line-height: 1; }
.xp-help-book-text { flex: 1 1 260px; min-width: 0; }
.xp-help-book-title {
  font-size: 14px; font-weight: 800; color: var(--brand); margin-bottom: 3px;
}
.xp-help-book-sub { font-size: 11px; color: #cbd5e1; line-height: 1.45; }
.xp-help-book-btns { display: flex; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; }
.xp-help-book-btn { font-size: 10px; padding: 7px 13px; text-decoration: none; }

/* ==========================================================================
   THE TOUR, SEEN THROUGH THE PREVIEW WINDOW

   On a real screen the spotlight dims everything around it to 76% black,
   which is right: you are looking at your own application and the dim is
   what makes the one lit thing obvious.

   Inside the preview the same dim is wrong. The picture is already a
   shrunken copy of the app on a stage inside a dialog, and 76% black on top
   of that is a dark rectangle with a faint shape in it — which is exactly
   what "the preview doesn't work" looks like. So the sealed copy dims less
   and lights more, and the same tour becomes something you can actually
   read from a normal viewing distance.
   ========================================================================== */
body.xp-demo #xp-tour-hole {
  box-shadow: 0 0 0 9999px rgba(3, 8, 20, .42),
              0 0 0 3px var(--cyan, #00b4d8),
              0 0 34px 8px rgba(0, 180, 216, .55);
}
/* Bigger type in the bubble, because it is being shrunk with everything
   else and a 10px note at 60% is not a note any more. */
body.xp-demo #xp-tour-bubble { font-size: 15px; max-width: 460px; }
body.xp-demo .xp-tour-say { font-size: 15.5px; line-height: 1.5; }
body.xp-demo .xp-tour-count { font-size: 12px; }
body.xp-demo .xp-tour-b { font-size: 13px; padding: 7px 13px; }

/* ==========================================================================
   THE HELP SCREEN, v3.41.0

   WHAT WAS WRONG

   Seventeen walkthroughs were laid out as a single row of tabs across the
   top. Seventeen does not fit across anything, so each name was squeezed to
   about eighty pixels and broke over two lines, and the strip read as a wall
   of crushed buttons with the content pushed below the fold. Under it sat a
   title bar, then a separate pair of action buttons, then the steps — three
   strips doing the work of one header.

   WHAT IT IS NOW

   A list down the left and the walkthrough on the right, which is the shape
   the thing actually is: seventeen items is a list. Every name gets a line
   of its own, the icons line up in a column, and the one being read is
   marked rather than merely highlighted. The right-hand side opens with one
   header — what this walkthrough is, how many steps, and the two ways to
   take it — and then the steps.
   ========================================================================== */

.xp-help-layout {
  display: grid;
  grid-template-columns: 252px 1fr;
  gap: 18px;
  align-items: start;
}

/* ---- the list of walkthroughs ------------------------------------------ */
.xp-help-nav {
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(0, 0, 0, .20);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 10px 8px;
  max-height: 62vh;
  overflow-y: auto;
  scrollbar-width: thin;
  position: sticky; top: 0;
}
.xp-help-nav::-webkit-scrollbar { width: 8px; }
.xp-help-nav::-webkit-scrollbar-thumb {
  background: var(--c-border); border-radius: 4px;
}
.xp-help-nav-head {
  font-size: 9.5px; font-weight: 900; letter-spacing: 1.3px;
  text-transform: uppercase; color: var(--muted);
  padding: 2px 8px 8px; border-bottom: 1px solid var(--c-border);
  margin-bottom: 6px;
}
.xp-help-nav-foot {
  font-size: 9.5px; color: var(--muted); text-align: center;
  padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--c-border);
}

.xp-help-nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent;
  border-radius: 7px; padding: 8px 9px;
  color: #cbd5e1; font-size: 11.5px; font-weight: 600;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  /* One line each. A name that will not fit is trimmed rather than wrapped,
     because a wrapped list is the thing this replaced. */
  white-space: nowrap;
}
.xp-help-nav-icon {
  flex: 0 0 20px; font-size: 14px; line-height: 1; text-align: center;
}
.xp-help-nav-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.xp-help-nav-item:hover {
  background: rgba(255, 255, 255, .05); color: #fff;
}
.xp-help-nav-item.active {
  background: rgba(0, 180, 216, .12);
  border-color: rgba(0, 180, 216, .45);
  color: #fff;
}
/* The marker down the left edge, so the current one is obvious at a glance
   rather than a slightly different shade of the same thing. */
.xp-help-nav-item.active .xp-help-nav-icon {
  position: relative;
}
.xp-help-nav-item.active .xp-help-nav-icon::before {
  content: ""; position: absolute; left: -9px; top: -3px; bottom: -3px;
  width: 3px; border-radius: 2px; background: var(--cyan);
}

/* ---- the walkthrough itself -------------------------------------------- */
.xp-help-stage { min-width: 0; }

.xp-help-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--c-border);
}
.xp-help-head-text { min-width: 0; flex: 1 1 320px; }
.xp-help-head-title {
  margin: 0; font-size: 17px; font-weight: 800; color: #fff;
  letter-spacing: .2px;
}
.xp-help-head-sub {
  margin: 4px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5;
}
.xp-help-head-n {
  display: inline-block; margin-left: 6px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase; color: var(--cyan);
  background: rgba(0, 180, 216, .10);
  border: 1px solid rgba(0, 180, 216, .32);
  border-radius: 999px; padding: 2px 8px;
}
.xp-help-actions {
  display: flex; gap: 10px; flex: 0 0 auto; flex-wrap: wrap;
}
.xp-help-actions .btn { padding: 9px 15px; font-size: 10.5px; }

/* ---- on a narrow screen the list goes back across the top --------------- */
@media (max-width: 900px) {
  .xp-help-layout { grid-template-columns: 1fr; gap: 12px; }
  .xp-help-nav {
    position: static; max-height: none;
    flex-direction: row; overflow-x: auto; overflow-y: hidden;
    gap: 6px; padding: 8px;
  }
  .xp-help-nav-head, .xp-help-nav-foot { display: none; }
  .xp-help-nav-item { width: auto; flex: 0 0 auto; }
  .xp-help-nav-item.active .xp-help-nav-icon::before { display: none; }
  .xp-help-head { flex-direction: column; align-items: stretch; }
}

/* The transport bar reads left to right like a deck: the two that move a
   step sit either side of the play control, the two that change what you
   are watching sit apart from them, and the counter and the dots go to the
   far end. It used to be one undifferentiated row of five, which is how a
   "Hide preview" button ends up next to "Next". */
.xp-transport { justify-content: flex-start; padding: 10px 14px; }
.xp-transport .xp-tour-b { min-width: 86px; justify-content: center; }
.xp-transport .xp-tour-b-quiet { margin-left: 18px; min-width: 0; }
.xp-transport-label { margin-left: 14px; }
