/* The guide's only moving illustration: one Canvas, two lasting records. */
.canvas-story {
  --story-blue: #2358d8;
  --story-teal: #27b8c8;
  --story-orange: #f0803c;
  --story-ink: #192840;
  --story-paper: #edf3fa;
  --story-line: #dce4ef;
  margin: 8px 0 48px;
  scroll-margin-top: 94px;
}
.story-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.story-heading .eyebrow { color: var(--story-blue); margin-top: 0; }
.public-ui .story-heading h2 { font-size: clamp(25px, 3.1vw, 36px); margin: 0; }
.story-heading > p { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 1.6; }
.story-player { overflow: hidden; border: 1px solid var(--story-line); border-radius: 16px; background: white; box-shadow: 0 12px 36px #19284006; }
.story-demo { display: grid; grid-template-columns: minmax(0, 1fr) 288px; padding: 24px; gap: 24px; background: #f8fafd; }
.story-canvas-panel { min-width: 0; overflow: hidden; border: 1px solid var(--story-line); border-radius: 10px; background: white; }
.story-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; font-size: 12px; font-weight: 650; color: var(--story-ink); }
.story-canvas-panel .story-panel-heading { padding: 0 16px; }
.story-panel-heading > span:first-child { display: flex; align-items: center; gap: 8px; }
.story-canvas-panel .story-panel-heading > span:last-child { color: var(--ink-muted); font-size: 11px; font-weight: 400; }
.story-dot { display: inline-block; width: 6px; height: 6px; background: var(--story-teal); border-radius: 50%; }
.story-canvas { display: block; width: 100%; aspect-ratio: 5 / 3; }
.story-canvas-footer { display: flex; justify-content: space-between; gap: 8px; padding: 11px 16px; font-size: 11px; color: var(--ink-muted); }
.story-scene-label { color: var(--story-blue); font-weight: 600; }
.story-records { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.story-records > .story-panel-heading { border-bottom: 1px solid var(--story-line); }
.story-record { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 14px; align-items: center; border: 1px solid var(--story-line); padding: 12px; border-radius: 10px; background: white; transition: opacity 550ms ease, transform 650ms cubic-bezier(.2,.7,.2,1), border-color 550ms ease, box-shadow 550ms ease; }
.story-record > svg { display: block; width: 100%; height: auto; border-radius: 4px; }
.story-record > div { display: flex; flex-direction: column; align-items: start; gap: 5px; min-width: 0; }
.story-record strong { font: 750 14px/1.3 var(--display); }
.story-record span { font-size: 11px; color: var(--ink-muted); }
.story-record .story-record-link { color: var(--story-blue); margin-top: 5px; font-weight: 600; }
.story-record-note { margin: auto 0 4px; font-size: 13px; color: #286c66; opacity: 0; transform: translateY(6px); transition: opacity 500ms ease, transform 500ms ease; }
.story-record-note > span { display: inline-grid; place-items: center; width: 21px; height: 21px; margin-right: 5px; border-radius: 50%; background: #e3f2f0; }
.story-record-placeholder { position: absolute; top: 58px; inset-inline: 0; height: 120px; display: grid; place-items: center; border: 1px dashed #cbd8e9; border-radius: 10px; text-align: center; font-size: 13px; color: var(--ink-muted); opacity: 0; transition: opacity 300ms ease; }
.story-caption { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 22px 28px 26px; border-top: 1px solid var(--story-line); min-height: 148px; }
.story-chapter { color: var(--story-blue); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.public-ui .story-caption h3 { font-size: 23px; margin: 5px 0 6px; }
.story-caption-copy { max-width: 700px; margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-muted); }
.story-play { flex: 0 0 auto; display: flex; gap: 8px; justify-content: center; align-items: center; min-height: 44px; min-width: 104px; padding: 10px 14px; border: 1px solid var(--story-line); border-radius: 8px; background: white; font-size: 13px; font-weight: 600; }
.story-play:hover { background: var(--story-paper); border-color: #aebfdb; }
.story-play-icon { width: 14px; font-size: 14px; }
.story-chapters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--story-line); }
.story-chapters button { position: relative; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 15px 20px; border: 0; border-right: 1px solid var(--story-line); background: white; text-align: left; font-size: 13px; font-weight: 600; }
.story-chapters button:last-child { border-right: 0; }
.story-chapters button > span { color: var(--ink-muted); font-size: 11px; }
.story-chapters button:hover { background: #f1f5fc; }
.story-chapters button[aria-current] { background: #edf2ff; color: var(--story-blue); }
.story-chapters button[aria-current] > span { color: var(--story-blue); }
.story-chapters button > i { position: absolute; height: 3px; inset: auto 0 0; background: var(--story-blue); transform: scaleX(0); transform-origin: left; }
.story-chapters button[aria-current] > i { transform: scaleX(var(--story-progress, 0)); }
.story-chapters button:focus-visible { outline-offset: -4px; }
.story-explanation { margin: 22px 0 0; max-width: 880px; font-size: 14px; line-height: 1.8; color: var(--ink-muted); }
.story-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.story-first, .story-second, .story-selection, .story-overlap { transition: opacity 600ms ease, transform 750ms cubic-bezier(.2,.7,.2,1); }
.story-first { transform-origin: 240px 200px; }
.story-second { transform-origin: 400px 300px; }
.story-selection, .story-overlap { opacity: 0; }
.story-cursor { opacity: 0; transform: translate(358px, 316px); transition: opacity 250ms ease, transform 900ms cubic-bezier(.2,.7,.2,1); }
.canvas-story[data-scene="0"] .story-first { opacity: 0; transform: scale(.96); }
.canvas-story[data-scene="0"] .story-selection, .canvas-story[data-scene="0"] .story-cursor { opacity: 1; }
.canvas-story[data-scene="0"][data-manual-frame="false"] .story-selection > rect:first-child { transform-origin: 120px 80px; transform: scale(clamp(.02, calc(var(--story-progress, 0) * 5), 1)); }
.canvas-story[data-scene="0"][data-manual-frame="false"] .story-cursor { transition: none; transform: translate(calc(120px + 238px * clamp(0, calc(var(--story-progress, 0) * 5), 1)), calc(80px + 236px * clamp(0, calc(var(--story-progress, 0) * 5), 1))); }
.canvas-story[data-scene="0"] .story-record-placeholder { opacity: 1; }
.canvas-story[data-scene="0"] .story-record-a { opacity: 0; transform: translateY(12px); }
.canvas-story[data-scene="0"] .story-second, .canvas-story[data-scene="1"] .story-second { opacity: 0; transform: scale(.96); }
.canvas-story[data-scene="0"] .story-record-b, .canvas-story[data-scene="1"] .story-record-b { opacity: 0; transform: translateY(12px); }
.canvas-story[data-scene="2"] .story-overlap { opacity: 1; }
.canvas-story[data-scene="2"] .story-cursor { opacity: 1; transform: translate(518px, 396px); }
.canvas-story[data-scene="3"] .story-record { border-color: #8cb6c2; box-shadow: 0 4px 16px #2358d80a; }
.canvas-story[data-scene="3"] .story-record-note { opacity: 1; transform: none; }
@media (max-width: 900px) {
  .story-demo { grid-template-columns: minmax(0, 1fr) 240px; padding: 18px; gap: 18px; }
  .story-record { grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .story-chapters button { padding-inline: 13px; gap: 7px; }
}
@media (max-width: 640px) {
  .story-heading { display: block; }
  .story-heading > p { margin-top: 12px; }
  .story-heading br { display: none; }
  .story-demo { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 12px; }
  .story-records { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .story-records > .story-panel-heading { grid-column: 1 / -1; min-height: 32px; }
  .story-record { grid-template-columns: 44px minmax(0, 1fr); padding: 8px; gap: 8px; }
  .story-record strong { font-size: 12px; }
  .story-record span { font-size: 10px; }
  .story-record span:not(.story-record-link) { display: none; }
  .story-record .story-record-link { margin-top: 0; font-size: 9px; }
  .story-record-note { grid-column: 1 / -1; margin: 0; font-size: 12px; min-height: 21px; }
  .story-record-placeholder { top: 43px; height: 62px; font-size: 12px; }
  .story-record-placeholder br { display: none; }
  .story-caption { align-items: start; position: relative; gap: 12px; min-height: 200px; padding: 18px; }
  .public-ui .story-caption h3 { font-size: 21px; margin-top: 14px; }
  .story-caption-copy { font-size: 14px; }
  .story-play { position: absolute; right: 12px; top: 8px; min-width: 92px; padding: 8px; font-size: 12px; }
  .story-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-chapters button { min-height: 52px; padding: 12px; font-size: 12px; }
  .story-chapters button:nth-child(2) { border-right: 0; }
  .story-chapters button:nth-child(-n+2) { border-bottom: 1px solid var(--story-line); }
  .story-explanation { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .canvas-story *, .canvas-story *::before, .canvas-story *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 480px) {
  .guide-page .guide-topbar { padding-inline: 12px; gap: 8px; }
  .guide-page .guide-topbar .brand { gap: 6px; }
  .guide-page .guide-topbar .brand strong { font-size: 18px; }
  .guide-page .guide-topbar .brand-mark { width: 22px; height: 22px; }
  .guide-page .guide-topbar .mode-button { min-width: 0; padding-inline: 6px; font-size: 12px; }
}
@media (max-width: 360px) {
  .story-caption { min-height: 225px; }
}
