.workflow-story {
  --story-blue: #1a73e8;
  --story-green: #188038;
  --route-progress: 1;
  --entry: 1;
  --transfer: 1;
  --recorded: 1;
  --processed: 1;
  --mail: 1;
  --chat: 1;
  --human: 1;
  padding: 80px 0 56px;
  border-top: 1px solid var(--line);
  background: #f6f8fc;
}

.story-heading { margin-bottom: 48px; }
.story-heading h2 { margin: 16px 0; font-size: clamp(30px, 3.1vw, 44px); line-height: 1.45; letter-spacing: -.045em; }
.story-heading > p:last-child { margin: 0; color: var(--muted); font-size: 16px; }
.story-mobile-break { display: none; }
.story-pin { --pin-top: 24px; }
.story-steps { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #d9e1ed; margin-bottom: 38px; }
.story-steps a { position: relative; display: flex; gap: 12px; align-items: center; padding: 16px 0 20px; color: #596579; font-size: 16px; font-weight: 600; text-decoration: none; }
.story-steps a span { color: #7b8798; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.story-steps a::after { position: absolute; right: 22px; bottom: -1px; left: 0; height: 3px; background: var(--story-blue); content: ''; transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.story-steps a:hover, .story-steps a[aria-current] { color: var(--story-blue); }
.story-steps a[aria-current]::after { transform: scaleX(1); }
.story-steps a:focus-visible { outline: 3px solid var(--story-blue); outline-offset: 4px; border-radius: 4px; }
.story-body { display: grid; grid-template-columns: minmax(240px, .78fr) minmax(0, 1.8fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.story-copy { padding-top: 98px; }
.story-chapter { scroll-margin-top: 32px; margin-bottom: 48px; }
.story-kicker { margin: 0 0 20px; color: var(--story-blue); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.story-chapter h3 { margin: 0 0 22px; font-size: clamp(26px, 2.65vw, 36px); line-height: 1.5; letter-spacing: -.04em; }
.story-chapter > p:not(.story-kicker) { max-width: 340px; margin: 0; color: #5d687a; font-size: 16px; line-height: 1.95; }
.story-outcome { display: flex; gap: 8px; margin-top: 28px; color: #265c42; font-size: 13px; font-weight: 600; line-height: 1.7; }
.story-outcome > span { color: var(--story-green); }
.story-visual { min-width: 0; }
.story-route { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); padding: 0 0 24px; }
.story-route-line { position: absolute; top: 25px; right: 10%; left: 10%; height: 2px; background: #dce3ed; }
.story-route-line > span { position: absolute; inset: 0; background: var(--story-blue); transform: scaleX(var(--route-progress)); transform-origin: left; }
.story-route-line > i { position: absolute; top: -3px; left: calc(var(--route-progress) * 100%); width: 8px; height: 8px; border-radius: 50%; background: var(--story-blue); box-shadow: 0 0 0 5px #e4edfc; transform: translateX(-50%); }
.story-node { z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.story-node > span { display: flex; align-items: center; justify-content: center; gap: 5px; width: 52px; height: 52px; border: 1px solid #dce3ed; border-radius: 15px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.story-node.is-reached > span { border-color: #a7c6f5; box-shadow: 0 3px 12px #1a73e80a; }
.story-node.is-active > span { border-color: var(--story-blue); box-shadow: 0 0 0 4px #e4edfc; }
.story-node small { font-size: 12px; color: #626d7d; white-space: nowrap; }
.story-node-pair > span { width: 70px; }
.story-visual .service { display: inline-flex; margin: 0; gap: 0; }
.story-visual .service img { width: 30px; height: 30px; object-fit: contain; }
.story-node-pair .service img { width: 25px; height: 25px; }
.story-scenes { position: relative; }
.story-scene { position: relative; min-height: 374px; margin-bottom: 24px; }
.story-window { background: #fff; border: 1px solid #dce3ed; border-radius: 16px; box-shadow: 0 12px 32px #29467108; overflow: hidden; }
.story-window-bar { display: flex; align-items: center; gap: 16px; padding: 13px 18px; background: #fbfcfe; border-bottom: 1px solid #edf0f5; color: #68768a; font-size: 11px; }
.story-window-dots { color: #c9d2df; font-size: 8px; letter-spacing: 2px; }
.story-window-status { margin-left: auto; color: #8190a3; font-size: 9px; letter-spacing: .1em; }
.story-portal { position: relative; width: 96%; margin: 0 auto; transform: translateY(calc((1 - var(--entry)) * 16px)); }
.story-portal-content { position: relative; padding: 29px 27px 30px; }
.story-screen-eyebrow { margin: 0 0 12px; color: var(--story-blue); font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.story-portal h4 { margin: 0 0 8px; padding-right: 56px; font-size: clamp(16px, 1.65vw, 23px); letter-spacing: -.03em; line-height: 1.5; }
.story-portal-content > p:not(.story-screen-eyebrow) { margin: 0; color: #7a8799; font-size: 12px; }
.story-portal-icon { position: absolute; top: 26px; right: 28px; transform: translateY(calc((1 - var(--entry)) * -24px)) rotate(calc((1 - var(--entry)) * -6deg)); }
.story-portal-icon .service img { width: 46px; height: 46px; }
.story-portal-tiles { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; margin-top: 28px; }
.story-request-tile { display: flex; gap: 12px; align-items: center; padding: 18px 14px; border: 1px solid #cbdcfa; border-radius: 10px; background: #f5f8ff; box-shadow: 0 0 0 calc(var(--entry) * 4px) #e8effb; }
.story-request-tile strong { display: block; margin-bottom: 6px; font-size: 13px; }
.story-request-tile small { display: block; color: #6c7a90; font-size: 11px; }
.story-request-tile b { margin-left: auto; color: var(--story-blue); font-size: 17px; }
.story-muted-tile { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 14px; border-radius: 10px; background: #f5f7fa; color: #7a8799; font-size: 12px; }
.story-muted-tile small { font-size: 10px; }
.story-entry-note { display: flex; justify-content: center; align-items: center; gap: 9px; margin-top: 26px; color: #4d687a; font-size: 13px; opacity: var(--entry); transform: translateY(calc((1 - var(--entry)) * 12px)); }
.story-check { display: inline-flex; justify-content: center; align-items: center; width: 21px; height: 21px; flex-shrink: 0; color: var(--story-green); background: #e6f4ea; border-radius: 50%; font-size: 12px; font-weight: 700; }
.story-transfer-scene { display: grid; grid-template-columns: 1fr 1.15fr; align-content: start; gap: 26px; padding-top: 5px; }
.story-app-heading { display: flex; align-items: center; gap: 10px; padding: 19px 16px; border-bottom: 1px solid #edf0f5; }
.story-app-heading small { display: block; margin-bottom: 5px; font-size: 8px; letter-spacing: .07em; color: #7a8799; }
.story-app-heading strong { display: block; font-size: 14px; }
.story-fields { display: grid; gap: 13px; margin: 17px 18px; }
.story-fields > div { padding-bottom: 9px; border-bottom: 1px solid #e8edf5; }
.story-fields dt { color: #7a8799; font-size: 10px; }
.story-fields dd { margin: 5px 0 0; font-size: 13px; }
.story-form-complete { margin: 16px 18px; padding: 8px 12px; background: #f0ebfa; border-radius: 5px; color: #6d4bac; font-size: 11px; text-align: center; }
.story-sheet { margin-top: 26px; }
.story-sheet-table { margin: 18px 12px; border: 1px solid #e0e7e4; font-size: 10px; }
.story-sheet-head, .story-sheet-row { display: grid; grid-template-columns: .8fr 1.7fr .5fr; }
.story-sheet-head { color: #397354; background: #edf7f0; }
.story-sheet-head > span, .story-sheet-row > span { padding: 10px 5px; white-space: nowrap; border-right: 1px solid #e0e7e4; }
.story-sheet-row { background: #f4fbf6; border-top: 1px solid #e0e7e4; opacity: var(--recorded); transform: translateY(calc((1 - var(--recorded)) * 8px)); }
.story-sheet-blank { height: 28px; border-top: 1px solid #e0e7e4; background: repeating-linear-gradient(90deg, transparent 0 33%, #e0e7e4 33% calc(33% + 1px)); }
.story-recorded { display: flex; gap: 6px; align-items: center; margin: 12px; color: #438058; font-size: 11px; opacity: var(--recorded); }
.story-data-packet { position: absolute; top: 43%; left: calc(24% + var(--transfer) * 40%); z-index: 2; display: flex; gap: 9px; align-items: center; padding: 14px 18px; border: 1px solid #c4d9f8; border-radius: 12px; background: #fff; box-shadow: 0 12px 30px #1a73e81f; opacity: var(--packet, 0); transform: translate(-50%, calc(-50% - var(--transfer) * 30px)); }
.story-data-packet small { display: block; margin-bottom: 4px; color: #7a8799; font-size: 10px; }
.story-data-packet strong { font-size: 15px; color: var(--story-blue); }
.story-notify-scene { display: grid; grid-template-columns: .75fr 1.5fr; align-content: center; align-items: center; gap: 28px; padding: 0 8px 52px; }
.story-processor { display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; }
.story-processor-ring { position: relative; display: grid; place-items: center; width: 102px; height: 102px; border: 2px solid #dbe7fa; border-radius: 50%; background: #fff; box-shadow: 0 0 0 10px #edf3fc; }
.story-processor-ring::before { position: absolute; inset: -2px; content: ''; border: 2px solid transparent; border-top-color: #4285f4; border-right-color: #4285f4; border-radius: 50%; transform: rotate(calc(var(--processed) * 300deg)); }
.story-processor-ring .service img { width: 50px; height: 50px; }
.story-processor-check { position: absolute; bottom: -1px; right: -1px; display: grid; place-items: center; width: 27px; height: 27px; color: #fff; background: var(--story-green); border: 3px solid #f6f8fc; border-radius: 50%; font-size: 12px; opacity: var(--mail); }
.story-processor > strong { margin-top: 14px; font-size: 15px; }
.story-processor > small { color: #7a8799; font-size: 11px; }
.story-processing-track { width: 80px; height: 3px; margin-top: 7px; background: #dce7f7; border-radius: 3px; overflow: hidden; }
.story-processing-track > span { display: block; height: 100%; background: var(--story-blue); transform: scaleX(var(--processed)); transform-origin: left; }
.story-notifications { display: grid; gap: 16px; }
.story-notification { position: relative; display: flex; align-items: flex-start; gap: 13px; padding: 22px 16px; background: #fff; border: 1px solid #dce3ed; border-radius: 14px; box-shadow: 0 8px 24px #29467108; }
.story-mail { opacity: var(--mail); transform: translateY(calc((1 - var(--mail)) * 25px)) translateX(calc((1 - var(--mail)) * -12px)); }
.story-chat { opacity: var(--chat); transform: translateY(calc((1 - var(--chat)) * 25px)) translateX(calc((1 - var(--chat)) * -12px)); }
.story-notification small { display: block; margin-bottom: 9px; color: #7a8799; font-size: 9px; letter-spacing: .04em; }
.story-notification strong { display: block; font-size: 14px; line-height: 1.6; }
.story-notification p { margin: 7px 0 0; color: #7a8799; font-size: 10px; line-height: 1.7; }
.story-notification-dot { position: absolute; top: 15px; right: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--story-blue); }
.story-human { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 8px; color: #438058; font-size: 13px; opacity: var(--human); transform: translateY(calc((1 - var(--human)) * 8px)); }
.story-visual-caption { display: flex; justify-content: space-between; gap: 8px; padding: 15px 3px 0; border-top: 1px solid #dde4ee; color: #8190a3; font-size: 11px; }
.story-visual-caption > span:last-child { font-size: 9px; letter-spacing: .09em; }
.story-disclaimer { margin: 28px 0 0; text-align: right; color: #7a8799; font-size: 11px; line-height: 1.7; }

/* Only enhance after JavaScript confirms that the complete panel fits. */
.workflow-story.is-enhanced .story-runway { height: calc(var(--pin-height) + 180vh); }
.workflow-story.is-enhanced .story-pin { position: sticky; top: var(--pin-top); }
.workflow-story.is-enhanced .story-chapter { display: none; margin-bottom: 0; }
.workflow-story.is-enhanced .story-chapter.is-active { display: block; }
.workflow-story.is-enhanced .story-scenes { height: 374px; }
.workflow-story.is-enhanced .story-scene { display: none; position: absolute; inset: 0; margin: 0; }
.workflow-story.is-enhanced .story-scene.is-active { display: block; }
.workflow-story.is-enhanced .story-transfer-scene.is-active, .workflow-story.is-enhanced .story-notify-scene.is-active { display: grid; }

@media (max-width: 1100px) and (min-width: 801px) {
  .story-body { grid-template-columns: 240px minmax(0, 1fr); gap: 28px; }
  .story-chapter h3 { font-size: 28px; }
  .story-chapter > p:not(.story-kicker) { font-size: 14px; }
  .story-portal-content { padding: 25px 18px; }
  .story-portal-icon { right: 18px; }
  .story-portal-tiles { grid-template-columns: 1fr; margin-top: 22px; }
  .story-muted-tile { display: none; }
  .story-transfer-scene { gap: 12px; }
  .story-app-heading { gap: 7px; padding: 18px 10px; }
  .story-app-heading strong { font-size: 12px; }
  .story-sheet-table { margin: 18px 7px; font-size: 9px; }
  .story-sheet-head > span, .story-sheet-row > span { padding: 10px 3px; }
  .story-notify-scene { gap: 18px; padding-right: 0; padding-left: 0; }
  .story-notification { gap: 9px; padding: 18px 12px; }
  .story-notification strong { font-size: 12px; }
  .story-notification .service img { width: 25px; height: 25px; }
}

@media (max-width: 800px) {
  .workflow-story { padding: 52px 0 40px; }
  .story-heading { margin-bottom: 24px; }
  .story-heading h2 { font-size: 30px; }
  .story-heading > p:last-child { max-width: 290px; font-size: 14px; line-height: 1.8; }
  .story-mobile-break { display: initial; }
  .story-pin { --pin-top: 12px; }
  .story-steps { margin-bottom: 24px; }
  .story-steps a { flex-direction: column; align-items: flex-start; gap: 7px; padding: 12px 0 14px; font-size: 12px; }
  .story-steps a span { font-size: 11px; }
  .story-steps a::after { right: 14px; }
  .story-body { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .story-copy { padding-top: 0; }
  .story-kicker { margin-bottom: 8px; font-size: 10px; }
  .story-chapter h3 { margin-bottom: 10px; font-size: 25px; line-height: 1.45; }
  .story-chapter > p:not(.story-kicker) { max-width: none; font-size: 13px; line-height: 1.8; }
  .story-outcome { margin-top: 12px; font-size: 11px; }
  .story-route { padding-bottom: 18px; }
  .story-route-line { top: 20px; }
  .story-node { gap: 7px; }
  .story-node > span { width: 42px; height: 42px; border-radius: 12px; }
  .story-node-pair > span { width: 55px; }
  .story-node small { font-size: 10px; }
  .story-node .service img { width: 24px; height: 24px; }
  .story-node-pair .service img { width: 20px; height: 20px; }
  .story-scene { min-height: 304px; }
  .workflow-story.is-enhanced .story-scenes { height: 304px; }
  .story-portal { width: 100%; }
  .story-window-bar { padding: 11px 13px; font-size: 10px; }
  .story-portal-content { padding: 22px 18px; }
  .story-portal-icon { top: 22px; right: 18px; }
  .story-portal-icon .service img { width: 34px; height: 34px; }
  .story-portal h4 { font-size: 17px; padding-right: 35px; }
  .story-portal-content > p:not(.story-screen-eyebrow) { font-size: 10px; }
  .story-portal-tiles { grid-template-columns: 1fr; margin-top: 20px; }
  .story-request-tile { padding: 14px; }
  .story-muted-tile { display: none; }
  .story-entry-note { margin-top: 18px; font-size: 11px; }
  .story-transfer-scene { gap: 12px; padding-top: 0; }
  .story-app-heading { gap: 6px; padding: 14px 10px; }
  .story-app-heading .service img { width: 23px; height: 23px; }
  .story-app-heading small { font-size: 7px; }
  .story-app-heading strong { font-size: 11px; }
  .story-fields { gap: 9px; margin: 12px; }
  .story-fields dd { font-size: 11px; }
  .story-form-complete { margin: 12px; padding: 6px; font-size: 10px; }
  .story-sheet { margin-top: 20px; }
  .story-sheet-table { margin: 15px 6px; font-size: 8px; }
  .story-sheet-head > span, .story-sheet-row > span { padding: 8px 2px; }
  .story-sheet-blank { height: 23px; }
  .story-recorded { gap: 4px; margin: 9px 7px; font-size: 9px; }
  .story-recorded .story-check { width: 16px; height: 16px; font-size: 9px; }
  .story-data-packet { padding: 10px 13px; }
  .story-notify-scene { grid-template-columns: .65fr 1.5fr; gap: 16px; padding: 0 0 40px; }
  .story-processor-ring { width: 68px; height: 68px; box-shadow: 0 0 0 7px #edf3fc; }
  .story-processor-ring .service img { width: 36px; height: 36px; }
  .story-processor > strong { font-size: 12px; }
  .story-processor > small { font-size: 9px; }
  .story-processor-check { width: 23px; height: 23px; }
  .story-notifications { gap: 12px; }
  .story-notification { gap: 8px; padding: 15px 12px; border-radius: 11px; }
  .story-notification .service img { width: 23px; height: 23px; }
  .story-notification small { margin-bottom: 6px; font-size: 7px; }
  .story-notification strong { font-size: 11px; }
  .story-notification p { font-size: 8px; }
  .story-notification-dot { top: 10px; right: 10px; width: 5px; height: 5px; }
  .story-human { font-size: 11px; }
  .story-visual-caption { padding-top: 12px; font-size: 10px; }
  .story-visual-caption > span:last-child { font-size: 8px; }
  .story-disclaimer { margin-top: 16px; text-align: left; font-size: 10px; }
  .workflow-story.is-enhanced .story-copy { min-height: 148px; }
}

@media print {
  .workflow-story { display: none !important; }
}
