/* The live demo page. Flat colours, the website's own tokens; the two screens are the real apps in frames. */
.demo-page { background: #F5F7FA; }
.top-row { gap: 16px; }
/* the header and footer line up with the demo's own width */
.demo-page .wrap { max-width: 1360px; padding: 0 24px; }
.back-link { margin-left: auto; color: var(--navy, #0B2A6B); font-weight: 600; text-decoration: none; padding: 10px 4px; }
.back-link:hover { text-decoration: underline; }
.top-demo-always { display: inline-flex !important; }
.demo { display: flex; flex-direction: column; gap: 16px; max-width: 1360px; margin: 0 auto; padding: 28px 24px 48px; }
/* The steps run across the top so the real screens get the full width (the dashboard's case list needs it). The rail is
   only a wrapper for screen readers: its parts are laid out in this order: intro, steps, the screen, then the note and
   the Ask box under it. */
.rail { display: contents; }
.rail h1 { order: 1; margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; color: #0B2A6B; }
.demo-meta { order: 2; margin: -6px 0 0; font-size: 15px; color: var(--muted, #55657A); }
.tour-steps { order: 3; list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
/* the guide line under the steps: fills to the end of the current step, by each step's share of the time */
.track { order: 3; height: 4px; margin-top: -4px; border-radius: 2px; background: #E4E8EE; overflow: hidden; }
.track span { display: block; height: 100%; background: #E11D74; transform-origin: 0 50%; transform: scaleX(0.17); transition: transform 300ms cubic-bezier(0.77, 0, 0.175, 1); }
.stage-meta { margin: 0 0 2px; font-size: 14px; font-weight: 600; color: var(--muted, #55657A); letter-spacing: 0.01em; }
.stage-tip { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; padding: 10px 14px; max-width: 760px; border: 1px solid var(--line, #E4E8EE); border-radius: 12px; background: var(--surface, #FFFFFF); font-size: 15px; line-height: 1.55; color: var(--ink, #0F172A); }
.stage-tip svg { flex: none; margin-top: 2px; color: var(--navy, #0B2A6B); }
.stage-tip b { color: var(--navy, #0B2A6B); }
.stage-nav.stage-nav-low { display: none; }
.loading-slow { max-width: 44ch; padding: 0 16px; text-align: center; font-weight: 400; color: var(--muted, #55657A); line-height: 1.55; }
.loading-slow[hidden] { display: none; }
.link-btn { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--navy, #0B2A6B); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.loading-slow a { color: var(--navy, #0B2A6B); font-weight: 600; }
.tour-steps .when { font-weight: 400; font-size: 14px; color: #55657A; }
.tour-steps .dur { align-self: start; margin-top: 2px; padding: 2px 8px; border-radius: 999px; background: #EEF3FC; color: #0B2A6B; font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tour-steps button.done .n { background: #E7F4EC; color: #15803D; }
.tour-steps button.done .num { display: none; }
.tour-steps button.done .n::after { content: ""; width: 11px; height: 6px; border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: translateY(-1.5px) rotate(-45deg); }
.done-word { display: none; }
.tour-steps button.done .done-word { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stage { order: 4; }
.rail-note { order: 5; margin: 4px 0 0; max-width: 720px; font-size: 15px; line-height: 1.6; color: #334155; }
.rail-note a { color: #0B2A6B; font-weight: 600; text-underline-offset: 3px; }
.ask { order: 6; max-width: 720px; }
.tour-steps button { width: 100%; min-height: 56px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; padding: 10px 12px 10px 14px; background: #FFFFFF; border: 1px solid #E4E8EE; border-radius: 12px; font: inherit; color: #0F172A; cursor: pointer; transition: border-color 150ms ease-out, background-color 150ms ease-out; }
.tour-steps button:hover { border-color: #C3CAD3; }
.tour-steps button:focus-visible { outline: 2px solid #E11D74; outline-offset: 2px; }
.tour-steps .n { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #EEF3FC; color: #0B2A6B; font-weight: 700; font-size: 15px; }
.tour-steps .t { display: flex; flex-direction: column; font-weight: 700; font-size: 16px; line-height: 1.3; }
.tour-steps button[aria-current="step"] { border-color: #0B2A6B; background: #F4F7FD; }
.tour-steps button[aria-current="step"] .n { background: #0B2A6B; color: #FFFFFF; }
.ask { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: #FFFFFF; border: 1px solid #E4E8EE; border-radius: 14px; }
.ask label { font-weight: 700; font-size: 16px; }
.ask-row { display: flex; gap: 8px; }
.ask-row input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid #C3CAD3; border-radius: 10px; font: inherit; font-size: 16px; }
.ask-row input:focus-visible { outline: 2px solid #E11D74; outline-offset: 1px; }
.ask-answer { margin: 0; min-height: 0; font-size: 16px; line-height: 1.6; color: #0F172A; white-space: pre-wrap; }
.ask-answer:empty { display: none; }
.ask-answer.wait { color: #55657A; }
.ask-foot { margin: 0; font-size: 14px; line-height: 1.5; color: #55657A; }
.stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stage-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 4px 2px; }
.stage-copy { min-width: 0; }
.stage-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: #0B2A6B; }
.stage-text { margin: 4px 0 0; font-size: 16px; line-height: 1.6; color: #334155; }
.screen-wrap { position: relative; display: flex; justify-content: center; min-height: 480px; }
.screen { border: 1px solid #E4E8EE; background: #FFFFFF; border-radius: 14px; }
.screen.desk { width: 100%; height: clamp(520px, calc(100vh - 290px), 780px); }
.screen.phone { width: 390px; max-width: 100%; height: clamp(560px, calc(100vh - 290px), 780px); border-radius: 28px; border: 8px solid #0F172A; }
.loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; margin: 0; font-size: 16px; font-weight: 600; color: #0B2A6B; background: #FFFFFF; border: 1px solid #E4E8EE; border-radius: 14px; z-index: 1; }
.loading p { margin: 0; }
.loading { transition: opacity 200ms ease-out; }
.loading.out { opacity: 0; }
.load-spin { width: 30px; height: 30px; border-radius: 50%; border: 4px solid #E4E8EE; border-top-color: #E11D74; animation: load-spin 0.8s linear infinite; }
@keyframes load-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .load-spin { animation-duration: 2.4s; } }
.loading[hidden] { display: none; }
.stage-nav { display: flex; flex: none; gap: 8px; }
.stage-nav .btn { min-width: 112px; min-height: 44px; }
.stage-nav .btn[disabled] { opacity: 0.45; cursor: default; }
.demo-foot { padding: 0 0 32px; color: #55657A; font-size: 14px; }
.demo-foot p { margin: 0; line-height: 1.6; }
.demo-foot a { color: #0B2A6B; }
@media (max-width: 900px) {
  /* Phones: the steps fold to a row of numbers (their names stay for screen readers). */
  .demo { padding: 20px 16px 32px; gap: 14px; }
  .rail h1 { font-size: 24px; }
  .tour-steps { margin: 0; }
  .tour-steps button { grid-template-columns: 1fr; justify-items: center; min-height: 48px; padding: 6px; }
  .tour-steps .dur { display: none; }
  .tour-steps .t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .demo-page .wrap { padding: 0 16px; }
  .screen.desk { height: 700px; }
  .screen.phone { height: 640px; width: 100%; border: 1px solid #E4E8EE; border-radius: 14px; }
  .stage-nav.stage-nav-low { display: flex; margin-top: 4px; }
  .stage-bar { flex-direction: column; }
  .stage-nav { width: 100%; }
  .stage-nav .btn { flex: 1; }
  .back-link { display: none; }
  .top-demo-always { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .tour-steps button { transition: none; } .track span { transition: none; } }
