/* B2B-verkkokaupat 3/6: esimerkki, jossa sama tilaus kulkee sähköpostilla tai B2B-kaupassa.
   Valitsin vaihtaa data-story-arvoa; ilman JavaScriptiä (.story--js puuttuu) paneelit näkyvät allekkain. */
  .story { max-width: 1080px; margin: 0 auto; }

  /* ---------- Valitsin ---------- */
  .story-switch {
    position: relative;
    display: flex;
    width: fit-content;
    margin: 0 auto 40px;
    padding: 6px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--sh-md);
  }
  .story-switch::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 6px;
    width: calc(50% - 6px);
    border-radius: 999px;
    background: var(--navy-dark);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), background 0.45s;
  }
  .story[data-story="kauppa"] .story-switch::before {
    transform: translateX(100%);
    background: var(--grad);
  }
  .story-switch button {
    position: relative;
    z-index: 1;
    min-width: 210px;
    padding: 13px 26px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    color: var(--navy-dark);
    transition: color 0.3s;
  }
  .story-switch button[aria-selected="true"] { color: #fff; }
  .story-switch button:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
  .story:not(.story--js) .story-switch { display: none; }

  /* ---------- Näyttämö: kuva ja aikajana ---------- */
  .story-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: stretch;
  }
  .story-media {
    position: relative;
    margin: 0;
    min-height: 420px;
    border-radius: 24px;
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: var(--sh-lg);
  }
  .story-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.6s ease, transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .story-img--kauppa { opacity: 0; transform: scale(1.04); }
  .story[data-story="kauppa"] .story-img--nyt { opacity: 0; transform: scale(1.04); }
  .story[data-story="kauppa"] .story-img--kauppa { opacity: 1; transform: none; }

  .story-panel {
    display: flex;
    flex-direction: column;
    padding: 30px 30px 26px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--sh-md);
  }
  .story-panel[hidden] { display: none; }
  .story:not(.story--js) .story-stage { grid-template-columns: 1fr; }
  .story:not(.story--js) .story-media { display: none; }

  /* Aikajana: pystyviiva ja tekijän värinen piste */
  .story-steps {
    list-style: none;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
  }
  .story-steps::before {
    content: '';
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 70px;
    width: 2px;
    background: var(--border);
  }
  .story-steps li {
    position: relative;
    display: grid;
    grid-template-columns: 56px 1fr;
    column-gap: 30px;
    row-gap: 4px;
    padding: 10px 0;
    animation: storyIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .story-steps li:nth-child(2) { animation-delay: 0.08s; }
  .story-steps li:nth-child(3) { animation-delay: 0.16s; }
  .story-steps li:nth-child(4) { animation-delay: 0.24s; }
  .story-steps li:nth-child(5) { animation-delay: 0.32s; }
  .story-steps li::before {
    content: '';
    position: absolute;
    left: 65px;
    top: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--navy);
    box-shadow: 0 0 0 1px var(--border);
  }
  .story-steps li:has(.manual)::before { background: var(--orange); }
  .story-steps li:has(.auto)::before { background: #1d8a4a; }
  .story-steps time {
    grid-row: span 2;
    padding-top: 2px;
    font-size: 13px;
    font-weight: 800;
    color: var(--navy-dark);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .story-who {
    justify-self: start;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
  }
  .story-who.customer { background: var(--navy-50); color: var(--navy); }
  .story-who.manual { background: var(--orange-50); color: #c25a0c; }
  .story-who.auto { background: #e8f7ee; color: #1d8a4a; }
  .story-what { font-size: 15.5px; line-height: 1.45; color: var(--text); }

  @keyframes storyIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }


  /* Lopputulos yhtenä virkkeenä paneelin alareunassa */
  .story-verdict {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--navy-dark);
    letter-spacing: -0.01em;
  }

  .story-note {
    margin: 24px auto 0;
    max-width: 720px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
  }

  @media (prefers-reduced-motion: reduce) {
    .story-steps li { animation: none; }
    .story-img, .story-switch::before { transition: none; }
  }
