/* Expanding stock-record story. Uses the showcase's existing colors and type. */
.history-steps { align-items: stretch; }
.history-steps > li { display: flex; flex-direction: column; transition: border-color .18s, background .18s; }
.history-trigger { padding: 0; border: 0; background: none; text-align: left; font: inherit; }
.history-trigger::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
.history-trigger:focus-visible { outline: none; }
.history-trigger:focus-visible::after { outline: 2px solid var(--lime); outline-offset: 4px; }
.history-steps > li:has(.history-trigger:hover), .history-steps > li.is-expanded { border-color: var(--lime); background: var(--surface-2); }
.history-more { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 24px; color: var(--lime); font-size: 13px; font-weight: 600; }
.history-plus { position: relative; width: 24px; height: 24px; flex: none; border: 1px solid var(--line-strong); border-radius: 50%; }
.history-plus::before, .history-plus::after { content: ""; position: absolute; background: currentColor; inset: 10px 6px; height: 2px; }
.history-plus::after { transform: rotate(90deg); transition: transform .18s var(--ease); }
.is-expanded .history-plus::after { transform: rotate(0); }
.history-details { position: relative; margin-top: 16px; }
.history-details[hidden], .history-detail[hidden] { display: none; }
.history-detail { position: relative; padding: 32px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); animation: history-open .22s var(--ease); }
.history-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.history-detail .history-stage { margin: 0 0 6px; color: var(--lime); font-size: 13px; font-weight: 600; }
.history-detail h3 { margin: 0; max-width: 26ch; font-size: clamp(24px, 3vw, 32px); line-height: 1.2; letter-spacing: -.025em; text-wrap: balance; }
.history-close { position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: none; }
.history-close::before, .history-close::after { content: ""; position: absolute; width: 15px; height: 1.5px; background: var(--ink-2); transform: rotate(45deg); }
.history-close::after { transform: rotate(-45deg); }
.history-close:hover { background: var(--surface-2); border-color: var(--lime); }
.history-detail-body { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: center; gap: 48px; }
.history-detail .history-explanation p { margin: 0; max-width: 60ch; font-size: 15px; line-height: 1.75; }
.history-facts { margin: 22px 0 0; }
.history-facts > div { padding: 12px 0; border-top: 1px solid var(--line); }
.history-facts dt { color: var(--ink-3); font-size: 12px; font-weight: 550; }
.history-facts dd { margin: 3px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.history-diagram { min-width: 0; padding: 28px 22px 20px; background: var(--bg); border-radius: 12px; }
.history-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.history-flow-node { position: relative; display: flex; align-items: center; flex-direction: column; text-align: center; min-width: 0; }
.history-flow-node + .history-flow-node::before { content: "\2192"; position: absolute; top: 29px; right: calc(100% + 4px); width: 18px; color: var(--lime); font-size: 22px; }
.history-flow svg { width: 80px; height: 80px; margin-bottom: 12px; fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.history-flow-node:nth-child(2) svg { stroke: var(--lime); }
.history-flow strong { font-size: 14px; line-height: 1.4; color: var(--ink); }
.history-flow span { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.history-diagram figcaption { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.history-source { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 16px; color: var(--ink-3); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.history-source:hover { color: var(--lime); }
@keyframes history-open { from { opacity: .3; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 1000px) and (min-width: 761px) {
  .history-detail-body { gap: 28px; grid-template-columns: 1fr 1fr; }
  .history-flow { gap: 20px; }
  .history-diagram { padding-inline: 16px; }
}
@media (max-width: 760px) {
  .history-steps > li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0 16px; padding: 20px; }
  .history-steps > li > .vignette { width: 64px; height: 48px; grid-row: span 3; }
  .history-steps > li > .history-more { grid-column: 2; margin-top: 16px; padding-top: 0; }
  .history-steps > li > .history-details { grid-column: 1 / -1; margin-top: 24px; }
  .history-detail { padding: 24px 0 0; border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; background: none; }
  .history-detail-head { gap: 16px; margin-bottom: 20px; }
  .history-detail h3 { font-size: 24px; }
  .history-detail-body { grid-template-columns: 1fr; gap: 24px; }
  .history-detail .history-explanation p { font-size: 14px; }
  .history-diagram { padding: 20px 16px; }
  .history-flow { grid-template-columns: 1fr; gap: 26px; }
  .history-flow-node { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 0 16px; text-align: left; }
  .history-flow svg { grid-row: span 2; width: 60px; height: 60px; margin: 0; }
  .history-flow strong { align-self: end; }
  .history-flow span { align-self: start; }
  .history-flow-node + .history-flow-node::before { content: "\2193"; top: -29px; left: 21px; right: auto; }
  .history-source { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .history-detail { animation: none; } .history-plus::after { transition: none; } }
