/* One consistent navy canvas; all wording remains live, selectable text. */
.visual { min-width: 0; }
.story-window { position: relative; overflow: hidden; border-radius: 12px; background: #0b111b; }
.story-canvas { position: relative; height: 470px; isolation: isolate; overflow: hidden; background: radial-gradient(circle at 78% 48%,#1c293c,#11192a 40%,#0b111b 80%); }
.story-stage { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; padding: 30px 36px; color: #f5f7fa; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .45s ease,transform .45s ease,visibility .45s; pointer-events: none; }
.story-stage[hidden] { display: none; }
.story-window .story-stage[data-visible="true"] { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.story-stage[data-story-stage="0"]::before,.story-stage[data-story-stage="2"]::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg,rgba(11,17,27,.97),rgba(11,17,27,.82) 39%,rgba(11,17,27,.15) 85%); }
.story-kicker { color: var(--lime); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 11px; }
.story-title { max-width: 570px; font-size: clamp(24px,3vw,34px); font-weight: 600; letter-spacing: -.035em; line-height: 1.15; margin: 0 0 20px; text-wrap: balance; }
.story-film { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s ease; }
.story-window[data-active-stage="0"] .story-film-open,.story-window[data-active-stage="2"] .story-film-close { opacity: 1; }
.story-film-close { object-position: 58% center; }
.story-mail,.story-source,.story-assembly,.story-workspace-mini,.story-stat,.story-time-back,.story-reply,.story-workspace,.story-build-row { border: 1px solid rgba(185,202,219,.22); background: rgba(17,25,42,.88); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.story-mail { width: min(520px,60%); padding: 20px 22px; }
.story-mail-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; color: #aab7c6; font-size: 11px; margin-bottom: 12px; }
.story-mail strong { color: #e9eef4; }
.story-mail p { color: #e0e7ef; font-size: 14px; line-height: 1.6; margin: 0; overflow-wrap: anywhere; }
.story-signature { margin-top: 12px; color: #aab7c6; font-size: 12px; }
.story-build-flow { display: grid; grid-template-columns: 1fr 64px 1.1fr; gap: 18px; align-items: center; width: min(760px,100%); margin-top: 8px; }
.story-sources { display: grid; gap: 12px; }
.story-source { display: flex; align-items: center; gap: 12px; padding: 13px 15px; color: #e4eaf1; font-weight: 600; font-size: 14px; min-width: 0; }
.story-source > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.story-source small { display: block; font-size: 11px; font-weight: 400; color: #aab7c6; }
.source-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 1px solid rgba(214,255,87,.3); border-radius: 8px; color: var(--lime); font-size: 21px; }
.story-beam { position: relative; height: 58px; overflow: hidden; }
.story-beam::before { content: ""; position: absolute; top: 27px; left: 0; width: 100%; height: 1px; background: rgba(214,255,87,.3); }
.story-beam i { position: absolute; top: 24px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); animation: beam-travel 2.6s ease-in-out infinite; }
.story-beam i:nth-child(2) { animation-delay: .85s; }
.story-beam i:nth-child(3) { animation-delay: 1.7s; }
.story-assembly { min-height: 160px; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 20px 24px; }
.assembly-mark,.mini-tool-icon { display: grid; place-items: center; width: 35px; height: 35px; flex: none; border-radius: 8px; background: var(--lime); color: #0b111b; font-size: 23px; }
.assembly-mark { margin-bottom: 10px; }
.story-assembly strong { font-size: 19px; font-weight: 600; letter-spacing: -.025em; line-height: 1.25; }
.story-assembly small { color: #b7c2cc; font-size: 12px; line-height: 1.5; margin-top: 4px; }
.assembly-lines { display: grid; grid-template-columns: 1fr .55fr .8fr; gap: 5px; margin-top: 18px; }
.assembly-lines i { display: block; height: 4px; border-radius: 10px; background: var(--lime); opacity: .6; transform-origin: left; animation: line-draw 3.2s ease-in-out infinite alternate; }
.assembly-lines i:nth-child(2) { animation-delay: .5s; }
.assembly-lines i:nth-child(3) { animation-delay: 1s; }
.story-build-footer { display: flex; gap: 7px; margin-top: 20px; flex-wrap: wrap; }
.story-build-footer span { font-size: 10px; font-weight: 600; color: #bac5d0; padding: 5px 9px; border: 1px solid #2d3948; border-radius: 30px; background: #11192a; }
.story-build-footer span::before { content: "✓ "; color: var(--lime); }
.story-workspace-mini { display: flex; align-items: center; gap: 12px; width: min(760px,100%); margin-top: 16px; padding: 14px; }
.story-workspace-mini > div { min-width: 0; flex: 1; }
.story-workspace-mini strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.4; }
.story-workspace-mini small { display: block; color: #aab7c6; font-size: 11px; line-height: 1.5; margin-top: 3px; }
.mini-ready { margin-left: auto; color: var(--lime); border: 1px solid rgba(214,255,87,.3); border-radius: 20px; padding: 4px 9px; font-size: 10px; flex: none; }
.story-result { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: min(570px,62%); gap: 9px; margin-bottom: 14px; }
.story-stat { padding: 16px 10px; text-align: center; }
.story-stat strong { display: block; color: var(--lime); font-size: 24px; line-height: 1.2; font-weight: 600; }
.story-stat span { display: block; font-size: 11px; line-height: 1.45; color: #bac5d0; margin-top: 5px; }
.story-time-back { display: flex; align-items: center; gap: 15px; width: min(570px,62%); padding: 18px; }
.story-time-back > div { min-width: 0; }
.time-clock { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border: 1px solid var(--lime); border-radius: 50%; color: var(--lime); font-size: 31px; line-height: 1; }
.story-time-back strong { display: block; font-size: 16px; font-weight: 600; line-height: 1.35; color: #f5f7fa; }
.story-time-back span:not(.time-clock) { display: block; color: #bac5d0; font-size: 12px; line-height: 1.6; margin-top: 5px; }
.story-result-note { width: min(570px,62%); font-size: 11px; color: #aab7c6; margin: 12px 0 0; line-height: 1.5; }
.story-controls { position: relative; z-index: 6; display: flex; align-items: center; gap: 12px; background: #11192a; border-top: 1px solid #2d3948; padding: 16px 18px; }
.story-step { flex: 1; min-width: 0; display: flex; flex-direction: column; align-self: stretch; border: 0; background: transparent; padding: 0 0 12px; position: relative; text-align: left; cursor: pointer; color: #aab7c6; font: inherit; }
.story-step b { display: block; padding-bottom: 9px; font-size: 11px; font-weight: 600; line-height: 1.4; white-space: normal; }
.story-step.active b,.story-step.done b { color: var(--lime); }
.story-step::before,.story-step span { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: #334052; }
.story-step span { background: var(--lime); transform: scaleX(0); transform-origin: left; }
.story-step.active span { animation: step-fill var(--stage-duration,7.6s) linear forwards; }
.story-step.done span { transform: scaleX(1); }
.story-step:focus-visible,.story-toggle:focus-visible { outline: 2px solid var(--lime); outline-offset: 5px; }
.story-toggle { flex: none; border: 1px solid #334052; border-radius: 6px; background: transparent; color: #e0e7ef; font: inherit; font-size: 11px; font-weight: 600; padding: 8px 10px; cursor: pointer; }
.story-caption { text-align: center; color: #aab7c6; font-size: 12px; margin: 12px 0 0; }
.story-window.story-paused .story-step.active span,.story-window.story-paused .story-beam i,.story-window.story-paused .assembly-lines i { animation-play-state: paused; }
@keyframes step-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes beam-travel { 0% { transform: translateX(-7px); opacity: 0; } 15%,85% { opacity: 1; } 100% { transform: translateX(64px); opacity: 0; } }
@keyframes line-draw { from { transform: scaleX(.35); opacity: .35; } to { transform: scaleX(1); opacity: .8; } }
@media (max-width: 700px) {
  .story-canvas { height: 510px; }
  .story-stage { padding: 24px; }
  .story-mail,.story-result,.story-time-back,.story-result-note { width: 100%; }
  .story-stage[data-story-stage="0"]::before,.story-stage[data-story-stage="2"]::before { background: linear-gradient(180deg,rgba(11,17,27,.4),rgba(11,17,27,.85) 35%,rgba(11,17,27,.96)); }
  .story-build-flow { grid-template-columns: 1fr; gap: 8px; margin-top: 0; }
  .story-sources { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .story-source { padding: 10px 8px; font-size: 11px; gap: 7px; flex-direction: column; text-align: center; }
  .story-source small { font-size: 9px; line-height: 1.4; }
  .source-icon { width: 27px; height: 27px; font-size: 15px; }
  .story-assembly { padding: 14px 16px; min-height: 100px; }
  .story-assembly strong { font-size: 16px; }
  .assembly-mark { display: none; }
  .assembly-lines { margin-top: 12px; }
  .story-beam { width: 2px; height: 22px; justify-self: center; overflow: visible; }
  .story-beam::before { top: 0; left: 0; width: 1px; height: 100%; }
  .story-beam i { top: 0; left: -3px; }
  .story-workspace-mini { margin-top: 12px; padding: 12px; gap: 9px; }
  .story-workspace-mini strong { font-size: 12px; }
  .story-workspace-mini small { font-size: 10px; }
  .mini-ready { font-size: 9px; padding: 4px 7px; }
  .story-film-close { object-position: 72% center; }
  .story-controls { gap: 9px; padding: 14px 12px; }
  .story-step b { font-size: 10px; }
  @keyframes beam-travel { 0% { transform: translateY(-5px); opacity: 0; } 15%,85% { opacity: 1; } 100% { transform: translateY(22px); opacity: 0; } }
}
@media (max-width: 390px) {
  .story-canvas { height: 540px; }
  .story-stage { padding: 20px; }
  .story-title { font-size: 25px; }
  .story-mail { padding: 17px; }
  .story-time-back { padding: 14px; gap: 11px; }
  .story-time-back strong { font-size: 14px; }
  .story-controls { gap: 8px; }
  .story-toggle { padding: 8px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .story-stage,.story-film { transition: none; }
  .story-beam i,.assembly-lines i,.story-step.active span { animation: none; }
  .story-step.active span { transform: scaleX(1); }
}
