/**
 * How It Works — MediaSnap storybook (playbook layout).
 * Scoped under .ms-playbook on /how-it-works
 */

.ms-playbook {
  --pb-max: 1100px;
  --pb-pad-x: clamp(1.25rem, 4vw, 2.5rem);
  --pb-violet: #8b5cf6;
  --pb-text: #f6f3ff;
  --pb-muted: #ded9ee;
  --pb-accent: #d8ccff;
  color: var(--pb-text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
}

.ms-playbook__book {
  width: 100%;
  max-width: var(--pb-max);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) var(--pb-pad-x) clamp(3rem, 6vw, 4rem);
}

.ms-playbook__page {
  position: relative;
  overflow: hidden;
  min-height: min(1120px, auto);
  margin: 0 auto clamp(2rem, 5vw, 3rem);
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.75rem, 5vw, 4.5rem);
  background:
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.22), transparent 34%),
    linear-gradient(145deg, #12121f 0%, #090912 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.ms-playbook__page::after {
  content: attr(data-page);
  position: absolute;
  right: clamp(1.5rem, 4vw, 2.625rem);
  bottom: clamp(1.25rem, 3vw, 1.75rem);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.ms-playbook__title,
.ms-playbook__heading {
  line-height: 1.08;
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

.ms-playbook__title {
  font-size: clamp(2.5rem, 8vw, 4rem);
  letter-spacing: -2px;
}

.ms-playbook__heading {
  font-size: clamp(1.75rem, 4.5vw, 2.625rem);
  letter-spacing: -1px;
}

.ms-playbook p {
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  color: var(--pb-muted);
  margin: 0 0 1.125rem;
}

.ms-playbook__eyebrow {
  margin: 0 0 1.125rem;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  font-size: 13px;
}

.ms-playbook__subtitle {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: 1.35;
  color: var(--pb-accent);
  max-width: 47.5rem;
  margin: 0 0 1.25rem;
}

.ms-playbook__big-line {
  font-size: clamp(1.35rem, 3vw, 2.25rem);
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
  margin: 2rem 0;
}

.ms-playbook__flow {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 2.25rem 0;
}

.ms-playbook__flow span {
  padding: 14px 20px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.35);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.ms-playbook__card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 2rem;
}

.ms-playbook__card {
  padding: 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 1rem;
  color: var(--pb-muted);
}

.ms-playbook__card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.25rem;
  color: #fff;
}

.ms-playbook__screenshot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
  min-height: 200px;
  max-height: min(420px, 52vh);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  overflow: hidden;
}

.ms-playbook__screenshot img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(420px, 52vh);
  object-fit: contain;
  object-position: center;
}

.ms-playbook__chat {
  margin: 1.625rem 0;
}

.ms-playbook__bubble {
  max-width: 82%;
  padding: 18px 22px;
  border-radius: 22px;
  margin: 14px 0;
  font-size: 17px;
  line-height: 1.55;
}

.ms-playbook__bubble--user {
  margin-left: auto;
  background: #7c3aed;
  color: #fff;
  border-bottom-right-radius: 6px;
}

.ms-playbook__bubble--snap {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #eee9ff;
  border-bottom-left-radius: 6px;
}

.ms-playbook__list {
  margin: 1.125rem 0 0;
  padding-left: 1.375rem;
}

.ms-playbook__list li {
  font-size: 1.125rem;
  margin-bottom: 10px;
  color: var(--pb-muted);
}

.ms-playbook__quote {
  margin: 2.125rem 0;
  padding: 28px;
  border: none;
  border-left: 4px solid var(--pb-violet);
  background: rgba(139, 92, 246, 0.12);
  border-radius: 0 20px 20px 0;
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 700;
  font-style: normal;
  color: #fff;
  line-height: 1.35;
}

.ms-playbook__footer-note {
  position: absolute;
  left: clamp(1.75rem, 5vw, 4.5rem);
  bottom: clamp(1.25rem, 3vw, 1.75rem);
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.32);
}

.ms-playbook__page--finale .ms-playbook__footer-note {
  position: static;
  margin-top: 2rem;
}

.ms-playbook__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2rem;
}

.ms-playbook__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ms-playbook__btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  box-shadow: 0 12px 40px rgba(109, 40, 217, 0.35);
}

.ms-playbook__btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(109, 40, 217, 0.45);
  color: #fff;
}

/* Marketing shell: full-width storybook on How It Works route */
.ms-page-how-it-works .ms-playbook {
  width: 100%;
}

.ms-page-how-it-works .index-wrap {
  overflow-x: hidden;
}

body.light-mode .ms-playbook__page {
  background:
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.12), transparent 34%),
    linear-gradient(145deg, #faf9fc 0%, #f0edf8 100%);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  color: #1a1628;
}

body.light-mode .ms-playbook p,
body.light-mode .ms-playbook__list li,
body.light-mode .ms-playbook__card {
  color: #4a4560;
}

body.light-mode .ms-playbook__subtitle,
body.light-mode .ms-playbook__eyebrow {
  color: #6d28d9;
}

body.light-mode .ms-playbook__big-line,
body.light-mode .ms-playbook__title,
body.light-mode .ms-playbook__heading,
body.light-mode .ms-playbook__quote,
body.light-mode .ms-playbook__card strong {
  color: #1a1628;
}

body.light-mode .ms-playbook__card {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(15, 23, 42, 0.08);
}

body.light-mode .ms-playbook__bubble--snap {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.15);
  color: #2d2640;
}

body.light-mode .ms-playbook__screenshot {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.1);
}

body.light-mode .ms-playbook__page::after,
body.light-mode .ms-playbook__footer-note {
  color: rgba(15, 23, 42, 0.4);
}

@media (max-width: 720px) {
  .ms-playbook__card-grid {
    grid-template-columns: 1fr;
  }

  .ms-playbook__page {
    min-height: 0;
    padding: 2rem 1.25rem 3.5rem;
  }

  .ms-playbook__bubble {
    max-width: 94%;
    font-size: 15px;
  }

  .ms-playbook__footer-note {
    position: static;
    margin-top: 1.5rem;
  }

  .ms-playbook__page::after {
    right: 1.25rem;
    bottom: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ms-playbook__btn--primary:hover {
    transform: none;
  }
}

/* ----- How It Works redesign: pipeline spine, hierarchy, frames ----- */

body.ms-page-how-it-works-guide {
  --hiw-nav-offset: 64px;
  scroll-padding-top: calc(var(--hiw-nav-offset) + 72px);
  background: #0b0b14;
}

body.ms-page-how-it-works-guide .index-main-inner {
  max-width: none;
  padding: 0;
}

#section-plan,
#section-generate,
#section-combine,
#section-export {
  scroll-margin-top: calc(var(--hiw-nav-offset) + 80px);
}

/* Pipeline strip */
.ms-pipeline-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 16px 40px;
  flex-wrap: wrap;
  position: sticky;
  top: var(--hiw-nav-offset);
  z-index: 99;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(11, 11, 20, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.ms-pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 130px;
  padding: 13px 28px 16px;
  border-radius: 16px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-top: 3px solid transparent;
  background: rgba(139, 92, 246, 0.1);
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

.ms-pipeline-step:hover:not(.active) {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(139, 92, 246, 0.18);
  opacity: 0.65;
}

.ms-pipeline-step.active {
  opacity: 1;
  border-color: rgba(167, 139, 250, 0.65);
  border-top-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.2);
}

.ms-pipeline-step.active .ms-pipeline-label {
  color: #ffffff;
}

.ms-pipeline-step.active .ms-pipeline-num {
  color: #a78bfa;
}

.ms-pipeline-step.completed {
  opacity: 0.7;
  border-top-color: rgba(139, 92, 246, 0.3);
}

.ms-pipeline-step.completed .ms-pipeline-bar-fill {
  width: 100%;
  background: rgba(139, 92, 246, 0.5);
}

.ms-pipeline-bar {
  display: block;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  margin-top: 10px;
  overflow: hidden;
}

.ms-pipeline-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #8b5cf6;
  border-radius: 99px;
  transition: width 0.1s linear;
}

.ms-pipeline-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(167, 139, 250, 0.6);
}

.ms-pipeline-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #f6f3ff;
}

.ms-pipeline-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.ms-pipeline-arrow {
  font-size: 18px;
  color: rgba(167, 139, 250, 0.4);
  flex-shrink: 0;
}

.ms-pipeline-sentinel {
  height: 0;
}

/* Type hierarchy */
.ms-hiw-content .ms-stage-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a78bfa;
  margin-bottom: 12px;
  display: block;
}

.ms-hiw-content h2,
.ms-hiw-content .ms-playbook__heading {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 1.1;
  margin: 0 0 20px;
}

.ms-hiw-content p,
.ms-hiw-content .ms-playbook p {
  font-size: 18px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.68);
  margin: 0 0 18px;
  max-width: 680px;
}

.ms-stage-marker {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-top: 72px;
}

.ms-stage-marker:first-child {
  padding-top: 32px;
}

.ms-stage-rule {
  flex: 1;
  height: 1px;
  background: rgba(167, 139, 250, 0.2);
  max-width: 120px;
}

.ms-stage-section {
  padding-bottom: 96px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0;
}

.ms-stage-section:last-of-type {
  border-bottom: none;
}

/* Screenshots */
.ms-screenshot-frame {
  margin: 40px 0;
  width: 100%;
}

.ms-screenshot-caption {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.7);
  margin: 0 0 10px;
  display: block;
}

.ms-screenshot-frame img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  display: block;
  max-height: none;
  height: auto;
  object-fit: cover;
}

/* Pull quotes */
.ms-pullquote,
.ms-hiw-content .ms-pullquote {
  margin: 44px 0;
  padding: 28px 32px;
  border-left: 4px solid #8b5cf6;
  border-radius: 0 16px 16px 0;
  background: rgba(139, 92, 246, 0.1);
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  max-width: 780px;
}

.ms-pullquote p {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  line-height: inherit;
  margin: 0 0 0.35em;
  max-width: none;
}

.ms-pullquote p:last-child {
  margin-bottom: 0;
}

.ms-hiw-content .ms-playbook__quote.ms-pullquote {
  font-size: 24px;
  font-style: normal;
}

.ms-hiw-content .ms-playbook__big-line.ms-pullquote {
  font-size: clamp(1.35rem, 2.5vw, 24px);
  margin: 44px 0;
  max-width: 780px;
}

/* Chat bubbles */
.ms-chat {
  margin: 36px 0;
  max-width: 700px;
}

.ms-bubble-user,
.ms-playbook__bubble--user.ms-bubble-user {
  max-width: 80%;
  margin-left: auto;
  margin-bottom: 12px;
  padding: 16px 20px;
  border-radius: 20px 20px 4px 20px;
  background: #7c3aed;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.5;
}

.ms-bubble-snap-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: rgba(167, 139, 250, 0.65);
  text-transform: uppercase;
  margin: 0 0 6px;
}

.ms-bubble-snap,
.ms-playbook__bubble--snap.ms-bubble-snap {
  max-width: 80%;
  margin-bottom: 12px;
  padding: 18px 22px;
  border-radius: 4px 20px 20px 20px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #eee9ff;
  font-size: 16px;
  line-height: 1.65;
}

/* Inline stage CTAs */
.ms-inline-cta {
  margin: 40px 0 0;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.ms-inline-cta a {
  font-size: 15px;
  font-weight: 600;
  color: rgba(167, 139, 250, 0.85);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}

.ms-inline-cta a:hover {
  color: #a78bfa;
}

/* Legacy inline flow hidden where strip replaces it */
.ms-playbook__flow--legacy-hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .ms-pipeline-strip {
    padding: 12px 16px;
    gap: 6px;
  }

  .ms-pipeline-step {
    min-width: 108px;
    padding: 10px 14px 12px;
  }

  .ms-pipeline-arrow {
    display: none;
  }

  .ms-hiw-content h2,
  .ms-hiw-content .ms-playbook__heading {
    font-size: clamp(1.65rem, 6vw, 2rem);
  }

  .ms-hiw-content p,
  .ms-hiw-content .ms-playbook p {
    font-size: 17px;
  }

  .ms-pullquote,
  .ms-hiw-content .ms-pullquote {
    font-size: 20px;
    padding: 22px 20px;
  }
}

/* Fixed vertical scroll rail (wide viewports only) */
.ms-scroll-rail {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  z-index: 200;
  height: min(500px, 60vh);
  background: rgba(11, 11, 20, 0.55);
  padding: 12px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.ms-scroll-track {
  width: 3px;
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  position: relative;
  overflow: visible;
}

.ms-scroll-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: #8b5cf6;
  border-radius: 99px;
  transition: height 0.1s linear, top 0.1s linear;
  min-height: 24px;
}

.ms-scroll-stage-markers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ms-scroll-stage-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.35);
  transition: background 0.2s, border-color 0.2s;
  cursor: default;
}

.ms-scroll-stage-dot.active {
  background: #8b5cf6;
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.ms-scroll-stage-dot.completed {
  background: rgba(139, 92, 246, 0.45);
  border-color: rgba(167, 139, 250, 0.45);
}

.ms-scroll-stage-label {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #a78bfa;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  text-align: right;
}

.ms-scroll-stage-dot.active .ms-scroll-stage-label {
  opacity: 1;
}

.ms-scroll-counter {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(167, 139, 250, 0.8);
  text-align: center;
  margin-top: 12px;
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .ms-scroll-rail {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ms-pipeline-step {
    transition: none;
  }

  .ms-pipeline-bar-fill {
    transition: none;
  }

  .ms-scroll-thumb {
    transition: none;
  }
}

/* HOW IT WORKS — REBUILT (/how-it-works short page) */

body.ms-page-how-it-works-short {
  --hiw-v2-max: 1100px;
  --hiw-v2-accent: #8b5cf6;
  --hiw-v2-bg: #08080f;
  scroll-padding-top: 5.5rem;
  background: var(--hiw-v2-bg);
  color: #f6f3ff;
}

body.ms-page-how-it-works-short .index-main-inner {
  max-width: none;
  padding: 0;
  width: 100%;
}

.ms-hiw-v2 {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
  overflow-x: clip;
}

.ms-hiw-v2__band {
  width: 100%;
}

.ms-hiw-v2__inner {
  max-width: var(--hiw-v2-max);
  margin: 0 auto;
  padding-left: clamp(1.25rem, 4vw, 2rem);
  padding-right: clamp(1.25rem, 4vw, 2rem);
  box-sizing: border-box;
}

/* — Hero — */
.ms-hiw-v2__hero {
  padding: 140px 0 100px;
  background:
    radial-gradient(ellipse 70% 55% at 92% 8%, rgba(139, 92, 246, 0.22), transparent 55%),
    #08080f;
}

.ms-hiw-v2__hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.ms-hiw-v2__eyebrow {
  margin: 0 0 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a78bfa;
}

.ms-hiw-v2__h1 {
  margin: 0;
  max-width: 580px;
  font-size: 56px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -1.5px;
  color: #ffffff;
}

.ms-hiw-v2__lead {
  margin: 20px 0 0;
  max-width: 480px;
  font-size: 19px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.62);
}

.ms-hiw-v2__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 32px;
  padding: 0.8rem 1.65rem;
  border-radius: 10px;
  background: #0e7490;
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #fff;
  font-size: 0.925rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(6,182,212,0.2), 0 2px 8px rgba(0,0,0,0.25);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ms-hiw-v2__btn:hover {
  background: #0891b2;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(6,182,212,0.3), 0 2px 10px rgba(0,0,0,0.3);
}

.ms-hiw-v2__hero-visual {
  margin: 0;
  height: 420px;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: #0d0920;
  overflow: hidden;
}

.ms-hiw-v2__hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* — Pipeline band — */
.ms-hiw-v2__pipeline {
  padding: 0;
  background: rgba(139, 92, 246, 0.06);
  border-top: 1px solid rgba(139, 92, 246, 0.12);
  border-bottom: 1px solid rgba(139, 92, 246, 0.12);
}

.ms-hiw-v2__pipeline-kicker {
  margin: 0;
  padding: 28px clamp(1.25rem, 4vw, 2rem) 0;
  max-width: var(--hiw-v2-max);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: #a78bfa;
}

.ms-hiw-v2__pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.ms-hiw-v2__pipeline-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px clamp(0.75rem, 2vw, 1.5rem);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}

.ms-hiw-v2__pipeline-col:last-child {
  border-right: none;
}

.ms-hiw-v2__pipeline-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(139, 92, 246, 0.55);
  margin-bottom: 8px;
}

.ms-hiw-v2__pipeline-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #ffffff;
}

.ms-hiw-v2__pipeline-desc {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

/* — Stage sections (PLAN / GENERATE) — */
.ms-hiw-v2__stage {
  padding: 120px 0;
  background: #08080f;
}

.ms-hiw-v2__stage--lead {
  padding-top: clamp(6rem, 14vw, 8.5rem);
}

.ms-hiw-v2__stage--alt {
  background: #0c0a18;
}

.ms-hiw-v2__stage--combine {
  padding-bottom: 80px;
}

.ms-hiw-v2__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.ms-hiw-v2__stage-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a78bfa;
}

.ms-hiw-v2__stage-eyebrow span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}



.ms-hiw-v2__stage-eyebrow--center {
  text-align: center;
}

.ms-hiw-v2__stage-eyebrow--center span {
  justify-content: center;
}

.ms-hiw-v2__h2 {
  margin: 16px 0 0;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.ms-hiw-v2__h2--center {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.ms-hiw-v2__body {
  margin: 20px 0 0;
  max-width: 440px;
  font-size: 18px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.65);
}

.ms-hiw-v2__body + .ms-hiw-v2__body {
  margin-top: 16px;
}

.ms-hiw-v2__split-media {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Chat */
.ms-hiw-v2__chat {
  padding: 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ms-hiw-v2__bubble {
  font-size: 14px;
  line-height: 1.5;
  max-width: 85%;
}

.ms-hiw-v2__bubble--user {
  margin-left: auto;
  padding: 12px 16px;
  border-radius: 12px 12px 4px 12px;
  background: #7c3aed;
  color: #fff;
}

.ms-hiw-v2__snap-label {
  margin: 12px 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.6);
}

.ms-hiw-v2__bubble--snap {
  padding: 12px 16px;
  border-radius: 4px 12px 12px 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #eee9ff;
}

/* Screenshots (PLAN / GENERATE) */
body.ms-page-how-it-works-short .ms-screenshot-frame {
  margin: 0;
  width: 100%;
}

body.ms-page-how-it-works-short .ms-screenshot-caption {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.65);
}

body.ms-page-how-it-works-short .ms-screenshot-frame img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  object-fit: cover;
}

/* — COMBINE & EXPORT — */
.ms-hiw-v2__stage-header {
  text-align: center;
}

.ms-hiw-v2__duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 56px;
}

.ms-hiw-v2__caption {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.65);
}

.ms-hiw-v2__shot-wrap {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.ms-hiw-v2__shot-wrap img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.ms-hiw-v2__duo-body {
  margin: 20px 0 0;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.6);
}

.ms-hiw-v2__body--center {
  max-width: 640px;
  margin: 48px auto 0;
  text-align: center;
  font-size: 16px;
}

/* — Finale — */
.ms-hiw-v2__finale {
  padding: 100px 0 120px;
  background:
    linear-gradient(180deg, #0c0a18 0%, #0c0a18 45%, transparent 45%),
    radial-gradient(ellipse 90% 60% at center bottom, rgba(139, 92, 246, 0.18) 0%, #08080f 70%);
}

.ms-hiw-v2__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 800px;
  margin: 0 auto 72px;
}

.ms-hiw-v2__card {
  padding: 28px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.55);
}

.ms-hiw-v2__card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.ms-hiw-v2__closing {
  text-align: center;
  margin-top: 72px;
}

.ms-hiw-v2__pullquote {
  margin: 0 auto 36px;
  max-width: 680px;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.ms-hiw-v2__closing .ms-hiw-v2__btn {
  margin-top: 0;
}

.ms-hiw-v2__link-secondary {
  display: block;
  margin-top: 16px;
  font-size: 14px;
  color: rgba(167, 139, 250, 0.7);
  text-decoration: none;
  text-align: center;
}

.ms-hiw-v2__link-secondary:hover {
  color: #a78bfa;
}

.ms-hiw-v2__deep-link {
  margin: 0;
  padding: 0 0 3rem;
  text-align: center;
  font-size: 1.05rem;
  background: #08080f;
}

.ms-hiw-v2__deep-link a {
  color: rgba(167, 139, 250, 0.85);
  font-weight: 600;
  text-decoration: none;
}

.ms-hiw-v2__deep-link a:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
  .ms-hiw-v2__hero-grid {
    grid-template-columns: 1fr 0.85fr;
    gap: 2rem;
  }

  .ms-hiw-v2__h1 {
    font-size: clamp(2.25rem, 5vw, 3.25rem);
  }

  .ms-hiw-v2__h2 {
    font-size: clamp(1.75rem, 4vw, 2.375rem);
  }
}

@media (max-width: 767px) {
  .ms-hiw-v2__hero {
    padding: 100px 0 72px;
  }

  .ms-hiw-v2__hero-grid,
  .ms-hiw-v2__split,
  .ms-hiw-v2__split--reverse,
  .ms-hiw-v2__duo {
    grid-template-columns: 1fr;
  }

  .ms-hiw-v2__split--reverse .ms-hiw-v2__split-media {
    order: -1;
  }

  .ms-hiw-v2__hero-visual {
    height: min(320px, 50vw);
    min-height: 240px;
  }

  .ms-hiw-v2__h1 {
    font-size: 36px;
    letter-spacing: -1px;
  }

  .ms-hiw-v2__h2,
  .ms-hiw-v2__pullquote {
    font-size: 28px;
  }

  .ms-hiw-v2__lead {
    font-size: 17px;
  }

  .ms-hiw-v2__body {
    font-size: 17px;
    max-width: none;
  }

  .ms-hiw-v2__stage {
    padding: 80px 0;
  }

  .ms-hiw-v2__pipeline-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ms-hiw-v2__pipeline-col:nth-child(2) {
    border-right: none;
  }

  .ms-hiw-v2__pipeline-col:nth-child(1),
  .ms-hiw-v2__pipeline-col:nth-child(3) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .ms-hiw-v2__cards {
    grid-template-columns: 1fr;
  }

  .ms-hiw-v2__pullquote {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ms-hiw-v2__btn {
    transition: none;
  }
}

/* Short page — light theme */
html[data-theme="light"] body.ms-page-how-it-works-short,
body.light-mode.ms-page-how-it-works-short {
  background: #f0eef8;
  color: #1a1730;
}

html[data-theme="light"] .ms-hiw-v2__hero,
body.light-mode .ms-hiw-v2__hero {
  background:
    radial-gradient(ellipse 70% 55% at 92% 8%, rgba(109, 40, 217, 0.12), transparent 55%),
    #f0eef8;
}

html[data-theme="light"] .ms-hiw-v2__h1,
html[data-theme="light"] .ms-hiw-v2__h2,
html[data-theme="light"] .ms-hiw-v2__pullquote,
html[data-theme="light"] .ms-hiw-v2__pipeline-label,
html[data-theme="light"] .ms-hiw-v2__card strong,
body.light-mode .ms-hiw-v2__h1,
body.light-mode .ms-hiw-v2__h2,
body.light-mode .ms-hiw-v2__pullquote,
body.light-mode .ms-hiw-v2__pipeline-label,
body.light-mode .ms-hiw-v2__card strong {
  color: #0f0d1f;
}

html[data-theme="light"] .ms-hiw-v2__lead,
html[data-theme="light"] .ms-hiw-v2__body,
html[data-theme="light"] .ms-hiw-v2__duo-body,
body.light-mode .ms-hiw-v2__lead,
body.light-mode .ms-hiw-v2__body,
body.light-mode .ms-hiw-v2__duo-body {
  color: rgba(20, 16, 50, 0.68);
}

html[data-theme="light"] .ms-hiw-v2__eyebrow,
html[data-theme="light"] .ms-hiw-v2__stage-eyebrow,
html[data-theme="light"] .ms-hiw-v2__caption,
html[data-theme="light"] .ms-hiw-v2__pipeline-kicker,
body.light-mode .ms-hiw-v2__eyebrow,
body.light-mode .ms-hiw-v2__stage-eyebrow,
body.light-mode .ms-hiw-v2__caption,
body.light-mode .ms-hiw-v2__pipeline-kicker {
  color: #6d28d9;
}

html[data-theme="light"] .ms-hiw-v2__stage,
html[data-theme="light"] .ms-hiw-v2__deep-link,
body.light-mode .ms-hiw-v2__stage,
body.light-mode .ms-hiw-v2__deep-link {
  background: #f0eef8;
}

html[data-theme="light"] .ms-hiw-v2__stage--alt,
body.light-mode .ms-hiw-v2__stage--alt {
  background: #e8e5f5;
}

html[data-theme="light"] .ms-hiw-v2__pipeline,
body.light-mode .ms-hiw-v2__pipeline {
  background: rgba(109, 40, 217, 0.05);
  border-color: rgba(109, 40, 217, 0.1);
}

html[data-theme="light"] .ms-hiw-v2__pipeline-col,
body.light-mode .ms-hiw-v2__pipeline-col {
  border-right-color: rgba(109, 40, 217, 0.1);
}

html[data-theme="light"] .ms-hiw-v2__pipeline-num,
body.light-mode .ms-hiw-v2__pipeline-num {
  color: rgba(109, 40, 217, 0.55);
}

html[data-theme="light"] .ms-hiw-v2__pipeline-desc,
body.light-mode .ms-hiw-v2__pipeline-desc {
  color: rgba(20, 16, 50, 0.45);
}

html[data-theme="light"] .ms-hiw-v2__card,
body.light-mode .ms-hiw-v2__card {
  background: #ffffff;
  border-color: rgba(109, 40, 217, 0.1);
  color: rgba(20, 16, 50, 0.55);
}

html[data-theme="light"] .ms-hiw-v2__chat,
body.light-mode .ms-hiw-v2__chat {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(109, 40, 217, 0.1);
}

html[data-theme="light"] .ms-hiw-v2__bubble--user,
body.light-mode .ms-hiw-v2__bubble--user {
  background: #7c3aed;
  color: #ffffff;
}

html[data-theme="light"] .ms-hiw-v2__bubble--snap,
body.light-mode .ms-hiw-v2__bubble--snap {
  background: rgba(109, 40, 217, 0.07);
  border-color: rgba(109, 40, 217, 0.14);
  color: #1a1730;
}

html[data-theme="light"] .ms-hiw-v2__snap-label,
body.light-mode .ms-hiw-v2__snap-label {
  color: rgba(109, 40, 217, 0.6);
}

html[data-theme="light"] body.ms-page-how-it-works-short .ms-screenshot-frame img,
html[data-theme="light"] .ms-hiw-v2__shot-wrap,
body.light-mode body.ms-page-how-it-works-short .ms-screenshot-frame img,
body.light-mode .ms-hiw-v2__shot-wrap {
  border-color: rgba(109, 40, 217, 0.12);
}

html[data-theme="light"] .ms-hiw-v2__hero-visual,
body.light-mode .ms-hiw-v2__hero-visual {
  border-color: rgba(109, 40, 217, 0.15);
}

html[data-theme="light"] .ms-hiw-v2__finale,
body.light-mode .ms-hiw-v2__finale {
  background:
    linear-gradient(180deg, #e8e5f5 0%, #e8e5f5 45%, transparent 45%),
    radial-gradient(ellipse 90% 60% at center bottom, rgba(109, 40, 217, 0.12) 0%, #f0eef8 70%);
}

html[data-theme="light"] .ms-hiw-v2__link-secondary,
html[data-theme="light"] .ms-hiw-v2__deep-link a,
body.light-mode .ms-hiw-v2__link-secondary,
body.light-mode .ms-hiw-v2__deep-link a {
  color: #6d28d9;
}

html[data-theme="light"] .ms-hiw-v2__link-secondary:hover,
html[data-theme="light"] .ms-hiw-v2__deep-link a:hover,
body.light-mode .ms-hiw-v2__link-secondary:hover,
body.light-mode .ms-hiw-v2__deep-link a:hover {
  color: #5b21b6;
}

/* LIGHT THEME — guide (/how-it-works/guide) */

html[data-theme="light"] body.ms-page-how-it-works-guide,
body.light-mode.ms-page-how-it-works-guide {
  background: #f0eef8;
  color: #1a1730;
}

html[data-theme="light"] body.ms-page-how-it-works-guide .ms-stage-section,
body.light-mode.ms-page-how-it-works-guide .ms-stage-section {
  background: #ffffff;
  border: 1px solid rgba(100, 80, 200, 0.1);
  border-radius: 20px;
  padding: 48px;
  margin-bottom: 24px;
}

html[data-theme="light"] .ms-hiw-content h1,
html[data-theme="light"] .ms-hiw-content h2,
body.light-mode .ms-hiw-content h1,
body.light-mode .ms-hiw-content h2 {
  color: #0f0d1f;
}

html[data-theme="light"] .ms-hiw-content p,
body.light-mode .ms-hiw-content p {
  color: rgba(20, 16, 50, 0.72);
}

html[data-theme="light"] .ms-stage-eyebrow,
body.light-mode .ms-stage-eyebrow {
  color: #6d28d9;
}

html[data-theme="light"] .ms-pipeline-strip,
body.light-mode .ms-pipeline-strip {
  background: rgba(240, 238, 248, 0.95);
  border-top: 1px solid rgba(109, 40, 217, 0.12);
  border-bottom: 1px solid rgba(109, 40, 217, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-theme="light"] .ms-pipeline-step,
body.light-mode .ms-pipeline-step {
  border-color: rgba(109, 40, 217, 0.18);
  background: rgba(109, 40, 217, 0.05);
}

html[data-theme="light"] .ms-pipeline-step:hover:not(.active),
body.light-mode .ms-pipeline-step:hover:not(.active) {
  border-color: rgba(109, 40, 217, 0.35);
  background: rgba(109, 40, 217, 0.1);
}

html[data-theme="light"] .ms-pipeline-step.active,
body.light-mode .ms-pipeline-step.active {
  border-color: rgba(109, 40, 217, 0.55);
  background: rgba(109, 40, 217, 0.12);
  border-top-color: #7c3aed;
}

html[data-theme="light"] .ms-pipeline-label,
body.light-mode .ms-pipeline-label {
  color: #1a1730;
}

html[data-theme="light"] .ms-pipeline-step.active .ms-pipeline-label,
body.light-mode .ms-pipeline-step.active .ms-pipeline-label {
  color: #0f0d1f;
}

html[data-theme="light"] .ms-pipeline-num,
body.light-mode .ms-pipeline-num {
  color: rgba(109, 40, 217, 0.55);
}

html[data-theme="light"] .ms-pipeline-sub,
body.light-mode .ms-pipeline-sub {
  color: rgba(20, 16, 50, 0.45);
}

html[data-theme="light"] .ms-pipeline-bar,
body.light-mode .ms-pipeline-bar {
  background: rgba(109, 40, 217, 0.1);
}

html[data-theme="light"] .ms-pipeline-bar-fill,
body.light-mode .ms-pipeline-bar-fill {
  background: #7c3aed;
}

html[data-theme="light"] .ms-pipeline-arrow,
body.light-mode .ms-pipeline-arrow {
  color: rgba(109, 40, 217, 0.35);
}

html[data-theme="light"] .ms-pullquote,
body.light-mode .ms-pullquote {
  background: rgba(109, 40, 217, 0.06);
  border-left-color: #7c3aed;
  color: #0f0d1f;
}

html[data-theme="light"] .ms-bubble-user,
body.light-mode .ms-bubble-user {
  background: #7c3aed;
  color: #ffffff;
}

html[data-theme="light"] .ms-bubble-snap,
body.light-mode .ms-bubble-snap {
  background: rgba(109, 40, 217, 0.07);
  border: 1px solid rgba(109, 40, 217, 0.14);
  color: #1a1730;
}

html[data-theme="light"] .ms-bubble-snap-label,
body.light-mode .ms-bubble-snap-label {
  color: rgba(109, 40, 217, 0.6);
}

html[data-theme="light"] .ms-screenshot-frame img,
body.light-mode .ms-screenshot-frame img {
  border-color: rgba(109, 40, 217, 0.12);
  background: rgba(109, 40, 217, 0.03);
}

html[data-theme="light"] .ms-screenshot-caption,
body.light-mode .ms-screenshot-caption {
  color: rgba(109, 40, 217, 0.65);
}

html[data-theme="light"] body.ms-page-how-it-works-guide .ms-stage-section,
body.light-mode.ms-page-how-it-works-guide .ms-stage-section {
  border-bottom: 1px solid rgba(109, 40, 217, 0.08);
}

html[data-theme="light"] .ms-stage-rule,
body.light-mode .ms-stage-rule {
  background: rgba(109, 40, 217, 0.15);
}

html[data-theme="light"] .ms-inline-cta a,
body.light-mode .ms-inline-cta a {
  color: #6d28d9;
}

html[data-theme="light"] .ms-inline-cta,
body.light-mode .ms-inline-cta {
  border-top-color: rgba(109, 40, 217, 0.1);
}

html[data-theme="light"] .ms-scroll-rail,
body.light-mode .ms-scroll-rail {
  background: rgba(240, 238, 248, 0.8);
  border-color: rgba(109, 40, 217, 0.1);
}

html[data-theme="light"] .ms-scroll-track,
body.light-mode .ms-scroll-track {
  background: rgba(109, 40, 217, 0.1);
}

html[data-theme="light"] .ms-scroll-thumb,
body.light-mode .ms-scroll-thumb {
  background: #7c3aed;
}

html[data-theme="light"] .ms-scroll-stage-dot,
body.light-mode .ms-scroll-stage-dot {
  background: rgba(109, 40, 217, 0.15);
  border-color: rgba(109, 40, 217, 0.3);
}

html[data-theme="light"] .ms-scroll-stage-dot.active,
body.light-mode .ms-scroll-stage-dot.active {
  background: #7c3aed;
  border-color: #6d28d9;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

html[data-theme="light"] .ms-scroll-stage-dot.completed,
body.light-mode .ms-scroll-stage-dot.completed {
  background: rgba(124, 58, 237, 0.4);
  border-color: rgba(109, 40, 217, 0.4);
}

html[data-theme="light"] .ms-scroll-stage-label,
body.light-mode .ms-scroll-stage-label {
  color: #6d28d9;
}

html[data-theme="light"] .ms-scroll-counter,
body.light-mode .ms-scroll-counter {
  color: rgba(109, 40, 217, 0.7);
}
