.story-active { min-height: 0; height: 100vh; height: 100svh; overflow: hidden; }
.story-active #experience { display: flex; align-items: stretch; min-height: 0; }
.story-active .topbar, .story-active .footer { flex: none; }
.story-scene, .story-ending { min-width: 0; min-height: 0; padding-block: clamp(10px, 2.5vh, 26px); }
.story-scene { display: flex; flex-direction: column; }
.story-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  padding: clamp(10px, 1.6vw, 22px);
  overflow: hidden;
  border: 1px solid #383451;
  border-radius: 18px;
  background: radial-gradient(ellipse at 71% 47%, #25204b 0, #12172f 38%, #0c1023 75%);
  box-shadow: 0 25px 75px #05071470, inset 0 0 40px #080a1c85;
}
.story-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-inline: 4px; }
.story-tools > div { display: flex; gap: 6px; flex: none; }
.story-tools .micro { color: #cbc3f6; line-height: 1.45; }
.story-tools .button { padding-inline: 10px; }
.story-tools [aria-pressed="true"] { color: #efeaff; background: #282045; border-color: #71649d; }
.story-layout { display: grid; grid-template-columns: minmax(0, .87fr) minmax(0, 1.13fr); align-items: center; gap: 8px; min-height: 0; }
.story-visual { min-width: 0; min-height: 0; height: 100%; display: grid; place-items: center; }
.story-visual svg { display: block; width: 100%; height: 100%; max-height: 100%; }
.story-copy { order: -1; min-width: 0; padding: clamp(10px, 1.9vw, 28px); }
.story-card { animation: story-enter .45s ease-out both; }
.story-card h2 { font-size: clamp(31px, 3.8vw, 57px); letter-spacing: -.055em; line-height: 1.05; }
.story-phase-0 h2 { font-size: clamp(32px, 4.35vw, 66px); animation: story-title .7s ease-out both; }
.story-card h3 { margin-top: 17px; font-size: clamp(16px, 1.6vw, 22px); }
.story-premise { color: #d2d7ee; margin-top: 12px; font-size: clamp(14px, 1.3vw, 18px); line-height: 1.5; }
.story-assumption { color: #b2bdd9; margin-top: 8px; font-size: 12px; line-height: 1.35; }
.story-choices, .story-indicators { display: grid; gap: 8px; margin: 14px 0 0; }
.story-choice {
  justify-content: space-between;
  text-align: left;
  padding: 10px 14px;
  min-height: 52px;
  white-space: normal;
  border-color: #575183;
  background: linear-gradient(115deg, #252040, #1a1c35);
  font-size: 15px;
  line-height: 1.25;
}
.story-choice-arrow { color: #bcb0ff; flex: none; font-size: 19px; }
.story-choice:hover, .story-choice.was-chosen { background: #332852; border-color: #b2a1fb; }
.story-indicators { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.story-indicator { padding: 10px 12px; border-radius: 9px; border: 1px solid #393e5e; background: #141a31; min-width: 0; }
.story-indicator dt { display: flex; gap: 6px; align-items: center; color: #d6dcf2; font-size: 13px; line-height: 1.15; }
.story-indicator .icon { width: 16px; height: 16px; color: #aaa2ef; }
.story-indicator dd { color: #cdd6ed; margin: 5px 0 0; font-weight: 650; font-size: 16px; line-height: 1; text-transform: capitalize; }
.story-indicator[data-tone="gain"] dd { color: #88ecdf; }
.story-indicator[data-tone="risk"] dd { color: #ffc394; }
.story-indicator.is-changed { border-color: #8b7bbb; animation: indicator-update .8s ease-out both; }
.story-actions { display: flex; gap: 8px; margin-top: 12px; }
.story-actions .button { text-align: center; white-space: normal; line-height: 1.2; }

.story-orbit, .story-spoke, .story-route path { fill: none; }
.story-orbit { stroke: #9b91ed; stroke-opacity: .33; stroke-dasharray: 2 8; }
.story-spoke { stroke: #7d71d5; stroke-opacity: .34; stroke-dasharray: 3 7; }
.route-line { stroke: #8881c0; stroke-opacity: .28; stroke-width: 1.35; }
.route-particles { display: none; stroke: #8cfcef; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: .5 14; }
.story-route.is-active .route-line { stroke: #6ad4dc; stroke-width: 2.5; stroke-opacity: .8; }
.story-route.is-active .route-particles { display: block; animation: story-flow 1.45s var(--flow-delay) linear 3; }
.story-core circle:first-child { fill: #2b2355; stroke: #9176e7; stroke-opacity: .6; }
.story-core circle:nth-child(2) { fill: #1e1b3f; stroke: #baabff; stroke-width: 1.6; }
.story-core text { fill: #eee9ff; letter-spacing: 2px; font: 650 12px var(--mono); }
.story-node .node-tile { fill: #161e39; stroke: #56578a; stroke-width: 1.4; }
.story-node text { fill: #e2e6fb; font-size: 15px; font-weight: 650; }
.story-node use { stroke: #aaa0f0; stroke-width: 1.6; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.story-node .node-pulse { fill: none; stroke: transparent; stroke-width: 2; }
.story-node.is-active .node-tile { fill: #143343; stroke: #79e0de; stroke-width: 2; }
.story-node.is-alert .node-tile { fill: #34273d; stroke: #ffbb91; stroke-width: 2; }
.story-node.is-alert .node-pulse { stroke: #ffbc8d; animation: story-alert .8s ease-out 3; }
.story-motion-off, .story-motion-off *, .story-motion-off *::before, .story-motion-off *::after { animation: none !important; transition: none !important; }
.story-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid #71649e;
  border-radius: 14px;
  background: #191b35;
  color: var(--ink);
}
.story-dialog[open] { animation: story-help-in .28s cubic-bezier(.2, .75, .3, 1) both; }
.story-dialog[open].is-closing { animation: story-help-out .2s ease-in both; }
.story-dialog::backdrop { background: #050817d9; animation: story-help-fade .24s ease-out both; }
.story-dialog.is-closing::backdrop { animation: story-help-fade .2s ease-in reverse both; }
.story-dialog-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(7px, 2vw, 14px); }
.story-dialog-heading h3 { font-size: clamp(18px, 4vw, 24px); }
.story-dialog-heading .button { padding-inline: 10px; }
.story-help-icon {
  display: block;
  width: clamp(44px, 10vw, 72px);
  aspect-ratio: 1;
  overflow: visible;
  filter: drop-shadow(0 0 5px #9b8dff70);
  animation: story-help-icon .72s .05s ease-out both;
}
.story-dialog > p { margin-top: 12px; line-height: 1.6; color: #d4d9ef; animation: story-help-text .28s .17s ease-out both; }
.story-ending { display: grid; place-items: center; text-align: center; }
.story-ending > div { width: 100%; padding: clamp(16px, 6vw, 72px); border: 1px solid #3c3758; border-radius: 18px; background: radial-gradient(ellipse at center, #241d45, #101426 75%); }
.story-ending .eyebrow { justify-content: center; }
.story-ending .lede { margin: 15px auto 24px; max-width: 620px; }

@keyframes story-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes story-title { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes story-flow { to { stroke-dashoffset: -58; } }
@keyframes story-alert { from { opacity: .95; } to { opacity: .2; } }
@keyframes indicator-update { from { background: #352850; } to { background: #141a31; } }
@keyframes story-help-in {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes story-help-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(.97); }
}
@keyframes story-help-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes story-help-icon {
  0% { opacity: .4; transform: perspective(170px) rotateY(-56deg) scale(.88); }
  55% { opacity: 1; transform: perspective(170px) rotateY(16deg) scale(1.04); filter: drop-shadow(0 0 14px #bbacffbc); }
  100% { opacity: 1; transform: perspective(170px) rotateY(0) scale(1); }
}
@keyframes story-help-text { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  .story-active .shell { width: calc(100% - 20px); }
  .story-active .header-inner { min-height: 55px; gap: 8px; }
  .story-active .brand img { width: 35px; height: 35px; }
  .story-active .footer-inner { min-height: 53px; padding-block: 4px; }
  .story-active .motion { display: none; }
  .story-active .step { width: 13px; }
  .story-active .steps { gap: 3px; }
  .story-active .controls .button { padding-inline: 7px; font-size: 12px; gap: 5px; }
  .story-active .controls .icon { width: 16px; height: 16px; }
  .story-scene, .story-ending { padding-block: 7px; }
  .story-stage { padding: 8px; border-radius: 13px; }
  .story-tools { gap: 5px; padding-inline: 2px; }
  .story-tools .micro { font-size: 9px; letter-spacing: .04em; }
  .story-tools .button { font-size: 11px; padding-inline: 7px; white-space: normal; line-height: 1.15; }
  .story-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; align-items: stretch; gap: 1px; }
  .story-node text { font-size: 19px; transform: translateX(-12px); }
  .story-node use { display: none; }
  .story-core text { font-size: 14px; }
  .story-copy { order: 0; padding: 4px 8px 8px; }
  .story-card h2 { font-size: clamp(25px, 6.9vw, 42px); }
  .story-phase-0 h2 { max-width: 560px; }
  .story-card h3 { margin-top: 9px; }
  .story-premise { margin-top: 7px; font-size: 14px; line-height: 1.4; }
  .story-choices, .story-indicators { margin-top: 9px; gap: 6px; }
  .story-choice { min-height: 44px; padding: 7px 10px; font-size: 14px; }
  .story-indicator { padding: 7px 8px; }
  .story-indicator dt { font-size: 12px; }
  .story-indicator dd { font-size: 15px; }
  .story-actions { gap: 5px; margin-top: 8px; }
  .story-actions .button { flex: 1; font-size: 12px; padding-inline: 6px; }
}
@media (max-height: 620px) {
  .story-active .header-inner { min-height: 54px; }
  .story-active .footer-inner { min-height: 53px; }
  .story-card h2 { font-size: clamp(24px, 4.3vw, 43px); }
  .story-copy { padding-block: 4px; }
  .story-indicator { padding-block: 6px; }
  .story-assumption { font-size: 11px; margin-top: 5px; }
}
@media (max-height: 440px) and (orientation: landscape) {
  .story-active .header-inner, .story-active .footer-inner { min-height: 48px; }
  .story-active .footer-inner { padding-block: 2px; }
  .story-scene, .story-ending { padding-block: 3px; }
  .story-stage { position: relative; grid-template-rows: minmax(0, 1fr); padding-block: 5px; }
  .story-tools { position: absolute; z-index: 1; top: 6px; right: 6px; width: calc(30% - 8px); display: grid; gap: 3px; }
  .story-tools .button { font-size: 11px; white-space: normal; padding-inline: 6px; line-height: 1.15; }
  .story-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, .7fr); grid-template-rows: minmax(0, 1fr); }
  .story-visual { padding-top: 72px; }
  .story-copy { order: -1; align-self: center; }
  .story-card h2 { font-size: 24px; }
  .story-premise { font-size: 12px; margin-top: 5px; }
  .story-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-phase-2 .story-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .story-choice { min-height: 44px; font-size: 12px; }
  .story-indicators { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 5px; }
  .story-indicator dt { font-size: 10px; }
  .story-indicator dd { font-size: 12px; }
  .story-indicator .icon { display: none; }
  .story-actions { margin-top: 5px; }
}
@media (max-height: 340px) and (orientation: landscape) {
  .story-copy { padding-block: 0; }
  .story-card h2 { font-size: 21px; }
  .story-assumption { font-size: 10px; line-height: 1.2; margin-top: 3px; }
  .story-indicator { padding-block: 5px; }
}
