/* =============================================================
   SenseiDesk Tour v3 — Storytelling edition
   Narrative-driven. Each scene: Pain → Shift → Relief.
   Scoped to .tour-root — no global bleed.
   ============================================================= */

/* ---------- Scoped reset + tokens ---------- */
.tour-root, .tour-root *, .tour-root *::before, .tour-root *::after {
  box-sizing: border-box;
}
.tour-root {
  /* Brand palette (SenseiDesk) */
  --sd-bg:        #09090b;
  --sd-bg-2:      #141417;
  --sd-bg-3:      #1e1e22;
  --sd-bg-4:      #2a2a30;
  --sd-ink:       #fafafa;
  --sd-ink-2:     rgba(255,255,255,0.72);
  --sd-ink-3:     rgba(255,255,255,0.48);
  --sd-ink-4:     rgba(255,255,255,0.28);
  --sd-rule:      rgba(255,255,255,0.08);
  --sd-rule-2:    rgba(255,255,255,0.16);

  /* Pain-side warm tones (for empathy scenes) */
  --pain-bg:      #1a1614;
  --pain-paper:   #efe8dc;   /* aged paper */
  --pain-ink:     #3a302a;
  --pain-ink-2:   #6b5d51;
  --pain-accent:  #c6a97a;   /* muted amber */
  --pain-line:    #d8cdb8;
  --pain-warn:    #c86f5a;   /* faded red */

  --sd-violet:    #7c3aed;
  --sd-violet-2:  #a78bfa;
  --sd-blue:      #3b82f6;
  --sd-cyan:      #06b6d4;
  --sd-green:     #10b981;
  --sd-amber:     #f59e0b;
  --sd-red:       #ef4444;

  --sd-gradient:  linear-gradient(135deg, #a78bfa 0%, #60a5fa 45%, #22d3ee 100%);
  --sd-gradient-soft: linear-gradient(135deg, rgba(167,139,250,0.15), rgba(34,211,238,0.12));

  --sd-display:   'Sora', system-ui, -apple-system, sans-serif;
  --sd-body:      'Outfit', system-ui, -apple-system, sans-serif;

  --sd-shadow:    0 24px 60px -15px rgba(0,0,0,0.6),
                  0 0 0 1px rgba(255,255,255,0.04);
  --sd-ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --sd-ease-io:   cubic-bezier(0.65, 0, 0.35, 1);

  font-family: var(--sd-body);
  color: var(--sd-ink);
  -webkit-font-smoothing: antialiased;
}
.tour-root h1, .tour-root h2, .tour-root h3, .tour-root h4 {
  font-family: var(--sd-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tour-root button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 4px 8px; }
.tour-root a { color: inherit; text-decoration: none; }

/* ============================================================
   ROOT OVERLAY
   ============================================================ */
.tour-root[hidden] { display: none !important; }
.tour-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--sd-bg);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s var(--sd-ease);
}
.tour-root.is-open { opacity: 1; }

/* Ambient glow */
.tour-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
  transition: opacity 1s var(--sd-ease);
}
.tour-glow--violet { background: var(--sd-violet); width: 640px; height: 640px; top: -16%; left: 8%; }
.tour-glow--blue   { background: var(--sd-blue);   width: 520px; height: 520px; bottom: -20%; right: 4%; }
.tour-glow--cyan   { background: var(--sd-cyan);   width: 400px; height: 400px; top: 38%; right: 26%; opacity: 0.12; }

/* Subtle noise */
.tour-root::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* Dim glow when in pain mode */
.tour-root[data-mode="pain"] .tour-glow--violet,
.tour-root[data-mode="pain"] .tour-glow--blue,
.tour-root[data-mode="pain"] .tour-glow--cyan { opacity: 0.04; }

/* ============================================================
   TOP CHROME
   ============================================================ */
.tour-chrome {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  gap: 16px;
}
.tour-chrome-left {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--sd-display);
  font-weight: 700;
  font-size: 14px;
}
.tour-chapter-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--sd-rule);
  font-family: var(--sd-body);
  font-weight: 500;
  font-size: 11.5px;
  color: var(--sd-ink-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tour-chapter-badge span:first-child {
  font-family: var(--sd-display);
  font-weight: 700;
  color: var(--sd-ink);
  letter-spacing: 0;
}
.tour-chapter-badge .sep { opacity: 0.35; }

.tour-chrome-right { display: flex; align-items: center; gap: 12px; }

.tour-progress {
  display: flex; align-items: center; gap: 6px;
}
.tour-progress-dot {
  width: 22px; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.12);
  transition: all 0.35s var(--sd-ease);
}
.tour-progress-dot.is-done { background: rgba(255,255,255,0.32); }
.tour-progress-dot.is-active {
  background: var(--sd-gradient);
  width: 36px;
}
.tour-progress-counter {
  font-family: var(--sd-display);
  font-weight: 600;
  font-size: 11.5px;
  color: var(--sd-ink-3);
  letter-spacing: 0.08em;
  min-width: 36px;
  text-align: right;
}

.tour-skip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--sd-rule);
  color: var(--sd-ink-3);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.2s var(--sd-ease);
}
.tour-skip:hover {
  background: rgba(255,255,255,0.08);
  color: var(--sd-ink);
  border-color: var(--sd-rule-2);
}
.tour-skip svg { width: 12px; height: 12px; }

/* ============================================================
   STAGE + SCENE
   ============================================================ */
.tour-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 70px 32px 28px;
  display: grid;
  place-items: center;
}
@media (max-width: 768px) {
  .tour-stage { padding: 62px 14px 18px; }
}

.tour-scene {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: auto;
  max-height: min(720px, calc(100vh - 98px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s var(--sd-ease-io), transform 0.55s var(--sd-ease-io);
}
.tour-scene.is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .tour-scene {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    max-height: none;
  }
}

.tour-scene-visual {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--sd-rule);
  display: grid;
  place-items: center;
  padding: 24px;
  transition: background 0.6s var(--sd-ease);
}
.tour-scene[data-mode="pain"] .tour-scene-visual {
  background: linear-gradient(180deg, #1f1a15 0%, #15110d 100%);
}
.tour-scene[data-mode="relief"] .tour-scene-visual {
  background:
    radial-gradient(circle at 30% 20%, rgba(167,139,250,0.16), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(34,211,238,0.12), transparent 50%),
    var(--sd-bg-2);
}

.tour-scene-caption {
  padding: 32px 8px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.tour-scene-chapter {
  font-family: var(--sd-display);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--sd-violet-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tour-scene-chapter::before {
  content: '';
  width: 28px; height: 2px;
  background: var(--sd-gradient);
  border-radius: 2px;
}

.tour-scene-headline {
  font-size: clamp(28px, 3.8vw, 44px);
  line-height: 1.08;
  margin: 0 0 18px;
  color: var(--sd-ink);
}
.tour-scene-headline em {
  font-style: normal;
  background: var(--sd-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tour-scene-body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--sd-ink-2);
  margin: 0 0 28px;
  max-width: 44ch;
  font-weight: 300;
}
.tour-scene-body strong {
  color: var(--sd-ink);
  font-weight: 600;
}
.tour-scene-body .danger {
  color: #fff;
  font-weight: 600;
  background: #c86f5a;
  padding: 1px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.tour-scene-body .success {
  color: #fff;
  font-weight: 600;
  background: var(--sd-green);
  padding: 1px 8px;
  border-radius: 4px;
}

/* mode toggle card ("Pain" label / "SenseiDesk way" label) */
.tour-mode-label {
  position: absolute;
  top: 16px; left: 16px;
  font-family: var(--sd-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 999px;
  z-index: 5;
  transition: all 0.5s var(--sd-ease);
}
.tour-scene[data-mode="pain"] .tour-mode-label {
  background: rgb(255 255 255);
  color: #bf4720;
  border: 1px solid rgba(200, 111, 90, 0.3);
}
.tour-scene[data-mode="relief"] .tour-mode-label {
  background: rgb(255 255 255);
  color: #6e4dcf;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

/* Pain / relief toggle buttons */
.tour-mode-switch {
  display: inline-flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--sd-rule);
  border-radius: 999px;
  padding: 4px;
  margin-top: 10px;
  align-self: flex-start;
}
.tour-mode-switch button {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sd-ink-3);
  transition: all 0.25s var(--sd-ease);
}
.tour-mode-switch button:not(.is-active):hover {
  color: var(--sd-ink);
  background: rgba(255,255,255,0.06);
}
.tour-mode-switch button.is-active {
  background: var(--sd-ink);
  color: var(--sd-bg);
}

/* Scene footer — navigation */
.tour-scene-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
}
.tour-scene-nav-counter {
  font-family: var(--sd-display);
  font-weight: 600;
  font-size: 12px;
  color: var(--sd-ink-3);
  letter-spacing: 0.08em;
}
.tour-scene-nav-actions { display: flex; gap: 8px; }
.tour-nav-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--sd-body);
  transition: all 0.2s var(--sd-ease);
}
.tour-nav-btn--next {
  background: var(--sd-gradient);
  color: #fff;
}
.tour-nav-btn--solution {
  background: var(--sd-gradient) !important;
  color: #fff !important;
  font-weight: bold !important;
  padding: 6px 14px !important;
}
.tour-nav-btn--chapter {
  background: var(--sd-gradient) !important;
  color: #fff !important;
  font-weight: bold !important;
  padding: 6px 14px !important;
}
.tour-nav-btn--back {
  padding: 13px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--sd-rule);
  color: var(--sd-ink-3);
}
.tour-nav-btn--back:hover {
  background: rgba(255,255,255,0.08);
  color: var(--sd-ink);
  border-color: var(--sd-rule-2);
}
.tour-nav-btn svg { width: 13px; height: 13px; }

/* ============================================================
   ILLUSTRATION PRIMITIVES
   (All CSS/SVG — no image assets needed)
   ============================================================ */

/* Scene 1 — The package that never ends */
.ill-calendar {
  width: min(440px, 100%);
  aspect-ratio: 5/4;
  background: var(--pain-paper);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  position: relative;
  color: var(--pain-ink);
  font-family: var(--sd-display);
  transform: rotate(-1.5deg);
}
.ill-calendar-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 10px; border-bottom: 1px solid var(--pain-line);
  margin-bottom: 12px;
}
.ill-calendar-head h4 { font-size: 18px; margin: 0; font-weight: 700; }
.ill-calendar-head span { font-size: 11px; color: var(--pain-ink-2); font-family: var(--sd-body); }
.ill-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.ill-calendar-day {
  aspect-ratio: 1;
  background: transparent;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 11px;
  font-family: var(--sd-body);
  color: var(--pain-ink-2);
  position: relative;
}
.ill-calendar-day.is-dim { opacity: 0.3; }
.ill-calendar-day.is-pkg {
  background: var(--pain-accent);
  color: var(--pain-paper);
  font-weight: 700;
}
.ill-calendar-day.is-extra {
  background: var(--pain-warn);
  color: white;
  animation: ill-extra-pulse 2.4s infinite var(--sd-ease);
}
.ill-calendar-day.is-extra::after {
  content: '+';
  position: absolute; top: -2px; right: -2px;
  font-size: 10px; font-weight: 900;
  color: var(--pain-warn);
  background: white;
  width: 12px; height: 12px;
  border-radius: 50%;
  display: grid; place-items: center;
}
@keyframes ill-extra-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.ill-calendar-note {
  position: absolute;
  right: -30px; top: 40%;
  transform: rotate(6deg);
  font-size: 14px;
  color: #fff;
  font-weight: 600;
  max-width: 140px;
  line-height: 1.2;
  background: #c86f5a;
  border: 1px solid #a85440;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 14px #000;
}
.ill-calendar-note::before {
  content: '';
  position: absolute;
  left: -24px; top: 50%;
  width: 20px; height: 1.5px;
  background: var(--pain-warn);
  transform: translateY(-50%);
}

/* Scene 1 relief — session counter */
.ill-sessions {
  width: min(380px, 100%);
  background: var(--sd-bg);
  border: 1px solid var(--sd-rule-2);
  border-radius: 16px;
  padding: 22px;
  position: relative;
}
.ill-sessions-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.ill-sessions-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: white;
  font-family: var(--sd-display);
}
.ill-sessions-head h4 { font-size: 15px; margin: 0; }
.ill-sessions-head p { font-size: 11.5px; margin: 2px 0 0; color: var(--sd-ink-3); }
.ill-sessions-bar {
  height: 10px; border-radius: 6px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  margin-bottom: 10px;
}
.ill-sessions-bar-fill {
  height: 100%;
  width: 0;
  background: var(--sd-gradient);
  border-radius: 6px;
  transition: width 1.8s var(--sd-ease);
}
.tour-scene.is-visible .ill-sessions-bar-fill { width: 100%; }
.ill-sessions-dots {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 5px;
  margin: 14px 0;
}
.ill-sessions-dot {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  font-family: var(--sd-display);
  font-size: 9px;
  display: grid; place-items: center;
  color: rgba(255,255,255,0.25);
  transition: all 0.35s var(--sd-ease);
  transition-delay: calc(var(--i) * 60ms);
}
.tour-scene.is-visible .ill-sessions-dot {
  background: var(--sd-violet);
  color: white;
}
.ill-sessions-cta {
  margin-top: 8px;
  padding: 11px 14px;
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 10px;
  color: var(--sd-violet-2);
  font-size: 12.5px;
  font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}

/* ==== Scene 2 — The coach who didn't want to ask ==== */
.ill-gym {
  width: min(460px, 100%);
  aspect-ratio: 5/3.6;
  position: relative;
  background: linear-gradient(180deg, #2a221c 0%, #18120e 100%);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(200,111,90,0.15);
}
.ill-gym-floor {
  position: absolute; inset: auto 0 0 0;
  height: 40%;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent 40px, rgba(198,169,122,0.08) 40px, rgba(198,169,122,0.08) 41px),
    linear-gradient(180deg, rgba(198,169,122,0.06), rgba(198,169,122,0.12));
  border-top: 1px solid rgba(198,169,122,0.15);
}
.ill-figure {
  position: absolute;
  bottom: 14%;
  font-family: var(--sd-display);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ill-figure-body {
  width: 42px; height: 80px;
  background: var(--pain-ink-2);
  border-radius: 21px 21px 6px 6px;
  position: relative;
}
.ill-figure-body::before {
  content: '';
  position: absolute;
  top: -22px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 30px;
  background: var(--pain-ink-2);
  border-radius: 50%;
}
.ill-figure-label {
  font-size: 10px;
  font-family: var(--sd-body);
  color: var(--pain-ink-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ill-figure--coach { left: 16%; }
.ill-figure--coach .ill-figure-body { background: var(--pain-accent); }
.ill-figure--coach .ill-figure-body::before { background: var(--pain-accent); }
.ill-figure--parent { right: 16%; }
.ill-figure--parent .ill-figure-body {
  background: #8a7b6a;
  height: 72px;
}
.ill-figure--parent .ill-figure-body::before { background: #8a7b6a; }

.ill-bubble {
  position: absolute;
  left: 22%;
  top: 20%;
  padding: 14px 18px;
  background: var(--pain-paper);
  color: var(--pain-ink);
  border-radius: 16px 16px 16px 4px;
  font-family: var(--sd-display);
  font-size: 14px;
  font-weight: 500;
  max-width: 220px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  animation: ill-bubble-fade 4s infinite var(--sd-ease);
  opacity: 0.75;
}
.ill-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px; left: 18px;
  width: 14px; height: 14px;
  background: var(--pain-paper);
  transform: rotate(45deg);
}
@keyframes ill-bubble-fade {
  0% { opacity: 0.3; transform: translateY(6px); }
  30% { opacity: 0.85; transform: translateY(0); }
  70% { opacity: 0.85; transform: translateY(0); }
  100% { opacity: 0.1; transform: translateY(-8px); }
}

/* Scene 2 relief — auto-sent reminders list */
.ill-reminders {
  width: min(420px, 100%);
  background: var(--sd-bg);
  border: 1px solid var(--sd-rule-2);
  border-radius: 16px;
  overflow: hidden;
}
.ill-reminders-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--sd-rule);
  display: flex; justify-content: space-between; align-items: center;
}
.ill-reminders-head h4 { font-size: 14px; margin: 0; }
.ill-reminders-head span {
  font-size: 10.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16,185,129,0.12);
  color: #34d399;
  font-weight: 600;
}
.ill-reminder {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--sd-rule);
  font-size: 12.5px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--sd-ease), transform 0.4s var(--sd-ease);
  transition-delay: calc(var(--i) * 140ms);
}
.tour-scene.is-visible .ill-reminder { opacity: 1; transform: none; }
.ill-reminder:last-child { border-bottom: none; }
.ill-reminder-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
  color: white;
  font-family: var(--sd-display);
}
.ill-reminder-name { font-weight: 500; color: var(--sd-ink); font-size: 12.5px; }
.ill-reminder-sub { font-size: 11px; color: var(--sd-ink-3); margin-top: 1px; }
.ill-reminder-status {
  font-size: 10.5px;
  color: #34d399;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ==== Scene 3 — The attendance notebook ==== */
.ill-notebook {
  width: min(420px, 100%);
  aspect-ratio: 3/4;
  background: linear-gradient(180deg, #efe8dc 0%, #e4dbc9 100%);
  border-radius: 4px 14px 14px 4px;
  padding: 30px 24px 30px 38px;
  position: relative;
  color: var(--pain-ink);
  font-family: var(--sd-display);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  transform: rotate(1deg);
  border-left: 6px solid #8b6a3e;
}
.ill-notebook::before {
  /* Coffee ring */
  content: '';
  position: absolute;
  right: 40px; top: 36px;
  width: 70px; height: 70px;
  border: 3px solid rgba(139, 106, 62, 0.3);
  border-radius: 50%;
  transform: rotate(15deg);
  opacity: 0.6;
}
.ill-notebook::after {
  /* Lines */
  content: '';
  position: absolute;
  inset: 76px 24px 24px 38px;
  background-image: repeating-linear-gradient(180deg, transparent 0 25px, rgba(139,106,62,0.18) 25px 26px);
  pointer-events: none;
}
.ill-notebook h4 {
  font-size: 17px;
  margin: 0 0 6px;
  color: var(--pain-ink);
}
.ill-notebook .date {
  font-family: var(--sd-body);
  font-size: 11px;
  color: var(--pain-ink-2);
  margin-bottom: 22px;
}
.ill-notebook-entry {
  position: relative;
  padding: 3px 0;
  font-size: 14px;
  font-family: 'Caveat', 'Kalam', cursive, var(--sd-body);
  font-weight: 600;
  color: var(--pain-ink);
  line-height: 26px;
  letter-spacing: 0.02em;
}
.ill-notebook-entry.is-strike { text-decoration: line-through; color: var(--pain-ink-2); }
.ill-notebook-entry.is-smudge {
  color: rgba(58,48,42,0.3);
  filter: blur(0.6px);
}
.ill-notebook-entry.is-lost {
  text-decoration: line-through;
  text-decoration-style: wavy;
  color: var(--pain-warn);
  opacity: 0.8;
}
.ill-notebook-qmark {
  position: absolute;
  right: -40px; top: 50%;
  transform: translateY(-50%) rotate(8deg);
  font-size: 40px;
  color: var(--pain-warn);
  opacity: 0.75;
}

/* Scene 3 relief — attendance chips */
.ill-chips {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.ill-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--sd-rule);
  border-radius: 12px;
  transition: all 0.5s var(--sd-ease);
  transition-delay: calc(var(--i) * 120ms);
  opacity: 0;
  transform: translateY(6px);
}
.tour-scene.is-visible .ill-chip {
  opacity: 1;
  transform: none;
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.28);
}
.ill-chip-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: white;
  font-family: var(--sd-display);
}
.ill-chip-name { font-size: 12.5px; font-weight: 600; }
.ill-chip-belt { font-size: 10.5px; color: var(--sd-ink-3); }
.ill-chip-check {
  margin-left: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--sd-green);
  display: grid; place-items: center;
  color: white;
  font-size: 11px; font-weight: 900;
  opacity: 0;
  transition: opacity 0.35s var(--sd-ease) calc(var(--i) * 120ms + 300ms);
}
.tour-scene.is-visible .ill-chip-check { opacity: 1; }

/* Phone ping inside relief */
.ill-phone-ping {
  grid-column: 1 / -1;
  margin-top: 6px;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 12px;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.5s var(--sd-ease) 1.3s;
}
.tour-scene.is-visible .ill-phone-ping { opacity: 1; transform: none; }
.ill-phone-ping-icon {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--sd-gradient);
  display: grid; place-items: center;
  color: var(--sd-bg);
}
.ill-phone-ping-icon svg { width: 13px; height: 13px; }
.ill-phone-ping-msg { font-size: 12px; color: var(--sd-ink-2); }
.ill-phone-ping-msg strong { color: var(--sd-ink); font-weight: 600; }

/* ==== Scene 4A — PTA forms pain ==== */
.ill-forms {
  position: relative;
  width: min(420px, 100%);
  aspect-ratio: 1/1;
  display: grid;
  place-items: center;
}
.ill-forms-stack {
  position: relative;
  width: 220px;
  height: 280px;
}
.ill-forms-sheet {
  position: absolute;
  inset: 0;
  background: var(--pain-paper);
  border-radius: 4px;
  box-shadow: 0 14px 32px rgba(0,0,0,0.35);
  padding: 22px 18px;
  color: var(--pain-ink);
  font-family: var(--sd-display);
}
.ill-forms-sheet::before {
  content: '';
  position: absolute;
  left: 18px; right: 18px; top: 52px;
  height: 1px;
  background: repeating-linear-gradient(180deg, rgba(58,48,42,0.15) 0 1px, transparent 1px 16px);
  box-shadow:
    0 16px 0 rgba(58,48,42,0.15), 0 32px 0 rgba(58,48,42,0.15),
    0 48px 0 rgba(58,48,42,0.15), 0 64px 0 rgba(58,48,42,0.15),
    0 80px 0 rgba(58,48,42,0.15), 0 96px 0 rgba(58,48,42,0.15),
    0 112px 0 rgba(58,48,42,0.15), 0 128px 0 rgba(58,48,42,0.15),
    0 144px 0 rgba(58,48,42,0.15);
}
.ill-forms-sheet h5 {
  font-size: 11px; margin: 0 0 4px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--pain-ink-2);
  font-weight: 600;
}
.ill-forms-sheet h4 { font-size: 16px; margin: 0 0 14px; font-weight: 800; }
.ill-forms-sheet--1 { transform: rotate(-6deg) translate(-14px, 10px); }
.ill-forms-sheet--2 { transform: rotate(3deg) translate(14px, -6px); }
.ill-forms-sheet--3 { transform: rotate(-2deg); z-index: 2; }

.ill-forms-clock {
  position: absolute;
  top: -20px; right: -10px;
  padding: 8px 14px 8px 30px;
  background: rgba(200,111,90,0.18);
  border: 1px solid rgba(200,111,90,0.35);
  color: #e5a894;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--sd-display);
  letter-spacing: 0.06em;
  z-index: 5;
}
.ill-forms-clock::before {
  content: '';
  position: absolute;
  left: 10px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px;
  border: 2px solid #e5a894;
  border-radius: 50%;
}
.ill-forms-clock::after {
  content: '';
  position: absolute;
  left: 16px; top: 10px;
  width: 2px; height: 6px;
  background: #e5a894;
  transform-origin: bottom;
}

/* Scene 4A relief — generated form */
.ill-generated {
  width: min(420px, 100%);
  background: var(--sd-bg);
  border: 1px solid var(--sd-rule-2);
  border-radius: 14px;
  padding: 22px;
}
.ill-generated-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sd-rule);
  margin-bottom: 14px;
}
.ill-generated-head .badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sd-gradient);
  color: var(--sd-bg);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--sd-display);
}
.ill-generated-head span:last-child {
  font-size: 11.5px; color: var(--sd-ink-3);
  margin-left: auto;
  font-family: var(--sd-display);
}
.ill-generated-row {
  display: flex; justify-content: space-between;
  padding: 9px 0;
  font-size: 12.5px;
  color: var(--sd-ink-2);
  border-bottom: 1px dashed var(--sd-rule);
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.4s var(--sd-ease);
  transition-delay: calc(var(--i) * 120ms + 200ms);
}
.tour-scene.is-visible .ill-generated-row { opacity: 1; transform: none; }
.ill-generated-row:last-child { border-bottom: none; }
.ill-generated-row span:last-child { color: var(--sd-ink); font-weight: 600; font-family: var(--sd-display); }
.ill-generated-footer {
  margin-top: 14px;
  display: flex; gap: 8px;
}
.ill-generated-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  background: rgba(167,139,250,0.12);
  border: 1px solid rgba(167,139,250,0.28);
  color: var(--sd-violet-2);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.ill-generated-btn.is-primary {
  background: var(--sd-ink); color: var(--sd-bg); border: none;
}

/* ==== Scene 4B — No PTA / general association ==== */
.ill-flex {
  width: min(440px, 100%);
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.ill-flex-card {
  padding: 18px 16px;
  background: var(--sd-bg);
  border: 1px solid var(--sd-rule-2);
  border-radius: 12px;
  transition: all 0.4s var(--sd-ease);
  transition-delay: calc(var(--i) * 120ms);
  opacity: 0;
  transform: translateY(6px);
}
.tour-scene.is-visible .ill-flex-card { opacity: 1; transform: none; }
.ill-flex-card h5 {
  font-size: 12px;
  color: var(--sd-ink-3);
  margin: 0 0 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.ill-flex-card p { margin: 0; font-size: 13px; color: var(--sd-ink); font-weight: 500; }
.ill-flex-card .accent {
  display: inline-block;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--sd-violet-2);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============================================================
   OPENING GATE (PTA question)
   ============================================================ */
.tour-gate {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: auto;
  padding: 8px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.5s var(--sd-ease);
}
.tour-gate.is-visible { opacity: 1; transform: none; }
.tour-gate-kicker {
  font-family: var(--sd-display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sd-violet-2);
  margin-bottom: 20px;
}
.tour-gate-title {
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.12;
  margin: 0 0 14px;
}
.tour-gate-sub {
  color: var(--sd-ink-2);
  max-width: 40ch;
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 32px;
  font-weight: 300;
}
.tour-gate-choice {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.tour-gate-btn {
  min-width: 180px;
  padding: 16px 28px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--sd-rule-2);
  text-align: center;
  transition: all 0.25s var(--sd-ease);
}
.tour-gate-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(167,139,250,0.4);
  transform: translateY(-2px);
}
.tour-gate-btn strong {
  display: block;
  font-family: var(--sd-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--sd-ink);
  margin-bottom: 3px;
}
.tour-gate-btn span {
  display: block;
  font-size: 12px;
  color: var(--sd-ink-3);
  font-weight: 300;
}

/* ============================================================
   CLOSING CARD
   ============================================================ */
.tour-closing {
  text-align: center;
  max-width: 560px;
  margin: auto;
  padding: 24px;
}
.tour-closing-mark {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: var(--sd-gradient);
  display: grid; place-items: center;
  color: var(--sd-bg);
  box-shadow: 0 20px 50px rgba(167,139,250,0.3);
}
.tour-closing-mark svg { width: 28px; height: 28px; stroke-width: 2.5; }
.tour-closing h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.12;
  margin: 0 0 16px;
}
.tour-closing p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--sd-ink-2);
  margin: 0 0 28px;
  font-weight: 300;
}
.tour-closing-actions {
  display: flex; flex-direction: column; gap: 18px; align-items: center;
}
.tour-closing-row {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}
.tour-closing-subrow {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.tour-closing-restart {
  font-size: 13px;
  color: var(--sd-ink-3);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--sd-rule-2);
  background: none;
  padding: 4px 8px;
  transition: color 0.2s var(--sd-ease);
}
.tour-closing-restart:hover {
  color: var(--sd-ink);
  text-decoration-color: currentColor;
}
.tour-closing-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--sd-body);
  transition: all 0.25s var(--sd-ease);
}
.tour-closing-btn--primary {
  background: var(--sd-gradient);
  color: #fff;
}
.tour-closing-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.3);
}
.tour-closing-btn--ghost {
  background: rgba(255,255,255,0.04);
  color: var(--sd-ink-2);
  border: 1px solid var(--sd-rule);
}
.tour-closing-btn--ghost:hover {
  background: rgba(255,255,255,0.08);
  color: var(--sd-ink);
}
.tour-closing-btn svg { width: 14px; height: 14px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  /* Allow the tour to scroll on mobile so nav buttons never get cut off.
     Chrome (progress + close) is pinned so it stays reachable while scrolling. */
  .tour-root {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .tour-chrome {
    position: fixed;
    background: rgba(9, 9, 11, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .tour-stage {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: start center;
    padding-bottom: 32px;
  }
  .tour-scene-visual { min-height: 240px; padding: 18px; }
  .tour-scene-caption { padding: 4px 4px 0; }
  .tour-scene-body { font-size: 14.5px; margin-bottom: 18px; }
  .tour-scene-nav { margin-top: 18px; flex-wrap: wrap; }
  .ill-calendar-note { position: static; transform: none; margin-top: 10px; }
  .ill-calendar-note::before { display: none; }
}
@media (max-width: 640px) {
  .tour-chrome { padding: 10px 14px; }
  .tour-chapter-badge { font-size: 10.5px; padding: 6px 10px 6px 8px; }
  .tour-chrome-right { gap: 8px; }
  .tour-progress { display: none; }
  .tour-scene-headline { font-size: 24px; }
  .tour-gate-btn { min-width: 0; width: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tour-root, .tour-root *, .tour-root *::before, .tour-root *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
