/* Three complete leads travel one at a time. Only the document scrolls. */
.lead-story {
  --story-ink: #171817; --story-muted: #666c62; --story-line: #e5e7e0;
  width: 100%; max-width: none; padding: 0 clamp(16px,2.5vw,48px) 110px;
  color: var(--story-ink); scroll-margin-top: 112px;
}
.lead-story :is(h2,h3,h4,p) { margin: 0; }
.lead-story :is(h2,h3,h4,button) { font-family: inherit; }
.story-intro, .story-disclosure { width: 100%; max-width: 1320px; margin-inline: auto; }
.story-intro h2 { max-width: 1050px; font-size: clamp(36px,4.5vw,64px); font-weight: 500; line-height: 1.08; letter-spacing: -.055em; }
.story-intro > p { max-width: 880px; margin-top: 24px; color: var(--story-muted); font-size: clamp(21px,2vw,26px); line-height: 1.45; letter-spacing: -.025em; }
.lead-story .story-disclosure { margin-block: 22px 28px; color: var(--story-muted); font-size: 17px; line-height: 1.5; }
.story-demo { min-width: 0; border: 1px solid var(--story-line); border-radius: 18px; background: #fff; }
.story-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 14px 24px; border-bottom: 1px solid var(--story-line); }
.story-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; counter-reset: story-step; }
.story-step { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 0 8px; border-bottom: 2px solid transparent; color: #7c8276; background: transparent; font-size: 16px; font-weight: 500; line-height: 1.35; }
.story-step::before { counter-increment: story-step; content: counter(story-step); color: #8b9185; font-size: 15px; font-variant-numeric: tabular-nums; }
.story-step.is-active { border-bottom-color: #171817; color: #171817; }
.story-step.is-active::before { color: #171817; }
.story-step.is-complete { color: #4a5541; }
.story-controls { display: none; flex: none; align-items: center; gap: 8px; }
.story-play, .story-replay { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 10px 14px; border: 1px solid #dfe3d8; border-radius: 8px; color: #343d2d; background: #fff; font-size: 16px; font-weight: 500; line-height: 1.35; }
.story-play { border-color: #171817; color: #fff; background: #171817; }
.story-play:disabled { cursor: default; opacity: .55; }
.story-workspace { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: 40px; padding: 24px; background: #fbfbf9; border-radius: 0 0 17px 17px; }
.story-pane { position: relative; min-width: 0; }
.story-pane + .story-pane::before { content: ""; position: absolute; top: 0; bottom: 0; left: -20px; width: 1px; background: var(--story-line); }
.story-pane-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-height: 44px; margin-bottom: 18px; }
.story-pane-head h3 { font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -.035em; }
.story-pane-status { display: block; flex-basis: 100%; width: 100%; margin: 0; color: #65705a; font-size: 16px; line-height: 1.4; letter-spacing: -.01em; }
.story-pane-label { color: #777e6e; font-size: 16px; line-height: 1.4; }
/* These three selectors deliberately share all card geometry and type metrics. */
.story-source-card, .story-crm-card, .story-transfer { box-sizing: border-box; min-width: 0; min-height: var(--story-card-min-height,0px); margin: 0; padding: 20px; border: 1px solid #dde2d4; border-radius: 12px; background: #fff; box-shadow: 0 2px 4px rgba(35,44,24,.025); }
/* The controller measures this viewport; clip never creates a scroll container. */
.story-source-window { position: relative; min-width: 0; overflow: clip; overflow-clip-margin: 4px; }
.story-source-track { display: flex; flex-direction: column; gap: 16px; min-width: 0; transform: translateY(0); }
.story-source-track > .story-source-card { flex: none; width: 100%; }
.story-carousel-next { pointer-events: none; }
.story-person { display: flex; align-items: center; gap: 12px; }
.story-person > div { min-width: 0; }
.story-avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; color: #65503d; background: #f1dfca; font-family: inherit; font-size: 16px; font-weight: 500; line-height: 1; }
.story-person h4, .story-chat-head h4 { margin: 0; font-family: inherit; font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -.025em; overflow-wrap: anywhere; }
.story-person p { margin: 4px 0 0; color: #666c62; font-family: inherit; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
:is(.story-source-card,.story-crm-card,.story-transfer) .story-request { margin: 22px 0 0; color: #252b20; font-family: inherit; font-size: 18px; line-height: 1.5; letter-spacing: -.02em; overflow-wrap: anywhere; }
:is(.story-source-card,.story-crm-card,.story-transfer) .story-source-name { margin: 22px 0 0; color: #666c62; font-family: inherit; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.story-source-footer { display: flex; margin-top: 18px; padding-top: 16px; border-top: 1px solid #e9ece3; }
.story-source-state { display: inline-flex; align-items: center; min-height: 24px; margin: 0; padding: 0; color: #59644c; background: transparent; font-size: 16px; line-height: 1.4; }
.story-crm-target { position: relative; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.story-crm-await { position: absolute; inset: 22px; display: none; align-items: center; justify-content: center; color: #525b48; text-align: center; font-size: 20px; line-height: 1.45; letter-spacing: -.025em; }
.story-campaign { margin-top: 18px; padding: 18px 0 0; border-top: 1px solid var(--story-line); background: transparent; }
.story-campaign-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.story-campaign-head h4 { font-size: 18px; font-weight: 500; line-height: 1.35; letter-spacing: -.025em; }
.story-campaign-state { display: inline-flex; align-items: center; gap: 7px; color: #5b6c4e; font-size: 16px; line-height: 1.4; }
.story-campaign-state::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: #92a57b; }
.story-campaign .story-rule { margin-top: 10px; color: #66705d; font-size: 16px; line-height: 1.45; }
.story-chat { min-width: 0; border: 1px solid #dfe2dc; border-radius: 12px; background: #f5f4ef; }
.story-chat-head { display: flex; align-items: center; gap: 12px; padding: 18px; border-bottom: 1px solid #e4e5de; border-radius: 11px 11px 0 0; background: #fff; }
.story-chat-head > div { min-width: 0; }
.story-chat-head p { margin-top: 4px; color: #6c7463; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.story-messages { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; padding: 18px; }
.story-sender { max-width: 100%; color: #72796a; font-size: 16px; line-height: 1.4; }
.story-message { position: relative; align-self: flex-end; max-width: 100%; padding: 18px; border: 1px solid #dcd1e8; border-radius: 12px 12px 4px 12px; background: #e8dff2; }
.story-message > p { color: #332c3b; font-size: 18px; line-height: 1.5; letter-spacing: -.02em; overflow-wrap: anywhere; }
.story-message-reserve, [data-story-message-reserve] { display: block; margin: 0; font-family: inherit; font-size: 18px; line-height: 1.5; letter-spacing: -.02em; overflow-wrap: anywhere; }
.lead-story.story-ready :is(.story-message-reserve,[data-story-message-reserve]) { visibility: hidden; pointer-events: none; user-select: none; }
.story-message-text, [data-story-message-text] { display: none; position: absolute; top: 18px; right: 18px; left: 18px; margin: 0; color: #332c3b; font-family: inherit; font-size: 18px; line-height: 1.5; letter-spacing: -.02em; overflow-wrap: anywhere; }
.lead-story.story-ready :is(.story-message-text,[data-story-message-text]) { display: block; }
.lead-story[data-story-phase="typing"] [data-story-message-text]::after { content: ""; display: inline-block; width: 1px; height: 1em; margin-left: 3px; vertical-align: -.12em; background: #756582; animation: story-type-caret 1000ms steps(1,end) infinite; }
@keyframes story-type-caret { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
.story-delivery { display: block; margin-top: 14px; color: #756780; font-size: 16px; line-height: 1.4; }
.story-typing { display: none !important; }
.story-status { padding: 18px 24px; border-top: 1px solid var(--story-line); color: #59674d; font-size: 17px; line-height: 1.45; }
.story-status:empty { display: none; }
.lead-story.story-ready .story-controls { display: flex; }
.lead-story.story-ready .story-pane { transition: opacity 340ms ease, filter 340ms ease; }
.lead-story .story-pane[data-story-pane-state="waiting"] { opacity: .26; filter: grayscale(1); }
.lead-story.story-ready .story-pane:is([data-story-pane-state="active"],[data-story-pane-state="done"]) { opacity: 1; filter: grayscale(0); }
.lead-story.story-ready :is(.story-source-pane,.story-crm-pane)[data-story-pane-state="done"] { opacity: .4; filter: grayscale(.35); }
.lead-story.story-ready .story-crm-card, .lead-story.story-ready .story-campaign, .lead-story.story-ready .story-message { transition: opacity 280ms ease; }
.lead-story.story-ready:is([data-story-phase="idle"],[data-story-phase="scan"],[data-story-phase="found"],[data-story-phase="transfer"]) [data-story-crm-card] { opacity: 1; }

.lead-story.story-ready:is([data-story-phase="idle"],[data-story-phase="scan"],[data-story-phase="found"],[data-story-phase="transfer"],[data-story-phase="crm"]) .story-campaign { visibility: hidden; opacity: 0; }
.lead-story.story-ready:not(:is([data-story-phase="typing"],[data-story-phase="sent"])) .story-message { visibility: hidden; opacity: 0; }
.lead-story.story-ready[data-story-moving="true"] [data-story-source] { opacity: 0; }
.lead-story :is(button,[tabindex]):focus-visible { outline: 2px solid #171817; outline-offset: 4px; }
/* The actual complete source card is cloned: same box, same content, translation only. */
.story-transfer { position: fixed; z-index: 100; pointer-events: none; user-select: none; transform-origin: left top; will-change: transform; box-shadow: 0 14px 32px rgba(38,45,28,.12); }
@media (hover:hover) and (pointer:fine) { .story-play:not(:disabled):hover { background: #343c2c; } .story-replay:hover { background: #f3f4ef; } }
@media (max-width: 1200px) {
  .story-workspace { gap: 28px; padding: 20px; }
  .story-pane + .story-pane::before { left: -14px; }
  .story-toolbar { padding-inline: 20px; }
  .story-steps { gap: 8px 18px; }
}
@media (max-width: 1000px) {
  .story-workspace { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .story-pane + .story-pane::before { display: none; }
  .story-pane + .story-pane { padding-top: 24px; border-top: 1px solid var(--story-line); }
  .story-pane-head { margin-bottom: 16px; }
  .story-message { max-width: 90%; }
}
@media (max-width: 600px) {
  .lead-story { padding-bottom: 72px; }
  .story-intro h2 { font-size: 36px; }
  .story-intro > p { margin-top: 20px; font-size: 21px; }
  .lead-story .story-disclosure { margin-block: 20px 24px; }
  .story-demo { border-radius: 14px; }
  .story-toolbar { padding: 14px 16px; gap: 14px; }
  .story-steps { display: grid; grid-template-columns: minmax(0,1fr); width: 100%; gap: 0; }
  .story-step { font-size: 16px; }
  .story-workspace { padding: 16px; border-radius: 0 0 13px 13px; }
  .story-source-card, .story-crm-card, .story-transfer { padding: 18px; }
  .story-person { align-items: flex-start; }
  .story-pane-head h3 { font-size: 22px; }
  .story-chat-head { padding: 16px; align-items: flex-start; }
  .story-messages { padding: 16px; }
  .story-message { max-width: 100%; padding: 16px; }
  .story-message-text, [data-story-message-text] { top: 16px; right: 16px; left: 16px; }
  .story-status { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .lead-story *, .story-transfer { transition: none !important; animation: none !important; scroll-behavior: auto !important; } .lead-story [data-story-message-text]::after { display: none; animation: none; } }
@media (forced-colors: active) { .story-step.is-active { color: Highlight; border-bottom-color: Highlight; } .story-play, .story-transfer { border: 1px solid CanvasText; } .lead-story.story-ready .story-pane[data-story-pane-state="waiting"] { filter: none; } }
/* The pane headings carry the journey without a duplicate row of labels. */
.story-auto { color: #666c62; font-size: 17px; font-weight: 500; line-height: 1.4; }
.story-workspace { counter-reset: story-pane; }
.story-pane { counter-increment: story-pane; }
.story-pane-head h3::before { content: counter(story-pane, decimal-leading-zero); margin-right: 10px; color: #8b9185; font-size: 16px; font-weight: 400; letter-spacing: 0; font-variant-numeric: tabular-nums; }
/* The opaque flight hands off to the same fully painted card in one frame. */
.lead-story.story-ready .story-crm-card { transition: none; }
.lead-story.story-ready .story-crm-pane[data-story-pane-state="active"] { transition: none; }
/* Delivery is confirmed only after the last character is visible. */
.lead-story.story-ready:not([data-story-phase="sent"]) .story-delivery { visibility: hidden; }
.lead-story[data-story-state="paused"] [data-story-message-text]::after { animation-play-state: paused; }
