:root{
  color-scheme:dark;
  --bg:#07101d;
  --panel:#0a1725;
  --panel2:#0d1d2c;
  --line:rgba(133,188,210,.12);
  --text:#e9f3f7;
  --muted:#8ea6b3;
  --cyan:#68d8ea;
}
*{box-sizing:border-box}
html,body{margin:0;min-width:0;background:var(--bg);color:var(--text);font-family:Arial,sans-serif}
body{font-size:16px;overflow-x:hidden}
a{color:inherit}
button,input,textarea,select{font:inherit}
.story-shell-header{
  min-height:64px;display:flex;align-items:center;justify-content:space-between;
  gap:20px;padding:0 28px;border-bottom:1px solid var(--line);
  background:rgba(5,14,24,.94);position:sticky;top:0;z-index:20
}
.story-brand{text-decoration:none;font-weight:700;letter-spacing:-.02em}
.story-shell-header nav{display:flex;gap:18px}
.story-shell-header nav a{color:var(--muted);text-decoration:none;font-size:14px}
.story-shell{max-width:1500px;margin:0 auto;padding:30px 28px 56px}
.story-page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:22px}
.story-page-head h1,.story-form-shell h1{margin:6px 0 8px;font-size:36px;line-height:1.08}
.story-page-head p,.story-form-shell>p{margin:0;max-width:760px;color:var(--muted);line-height:1.6}
.story-eyebrow{color:var(--cyan);font-size:11px;text-transform:uppercase;letter-spacing:.1em}
.story-primary,.story-secondary{
  display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:0 15px;
  border-radius:9px;text-decoration:none;border:1px solid transparent;cursor:pointer
}
.story-primary{background:#176f90;color:white}
.story-secondary{border-color:var(--line);background:#0a1826;color:#c4d6de}
.story-actions,.story-form-actions,.story-inline-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.story-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:22px}
.story-kpis article{padding:18px;border:1px solid var(--line);border-radius:13px;background:var(--panel)}
.story-kpis small{display:block;color:var(--muted);font-size:11px}
.story-kpis strong{display:block;margin-top:4px;font-size:26px}
.story-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}
.story-card{
  min-width:0;padding:20px;border:1px solid var(--line);border-radius:14px;
  background:linear-gradient(145deg,var(--panel),#07131f);text-decoration:none
}
.story-card span,.story-card small{color:var(--muted);font-size:11px}
.story-card h2{margin:9px 0 8px;font-size:20px}
.story-card p{min-height:48px;color:#9eb2bd;line-height:1.55}
.story-empty{padding:28px;border:1px dashed rgba(133,188,210,.18);border-radius:14px;color:var(--muted)}
.story-empty h2,.story-empty h3{margin:0 0 8px;color:#c9dce3}
.story-empty p{margin:0;line-height:1.6}
.story-empty.compact{padding:20px}
.story-form-shell{max-width:820px;margin:0 auto}
.story-back{display:inline-block;margin-bottom:22px;color:var(--muted);text-decoration:none}
.story-form{display:grid;gap:15px;margin-top:25px;padding:22px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.story-form label>span{display:block;margin-bottom:7px;color:#b8cbd4;font-size:13px}
.story-form input,.story-form textarea,.story-form select{
  width:100%;min-height:44px;border:1px solid rgba(133,188,210,.15);border-radius:9px;
  padding:10px 11px;background:#06121e;color:var(--text);outline:none;font-size:16px
}
.story-form textarea{resize:vertical;line-height:1.55}
.story-form input:focus,.story-form textarea:focus,.story-form select:focus{border-color:rgba(104,216,234,.5)}
.errorlist{margin:6px 0 0;padding-left:18px;color:#e3a8a8;font-size:12px}
.story-composer-grid{display:grid;grid-template-columns:260px minmax(0,1fr) 300px;gap:13px;align-items:start}
.story-composer-panel{min-width:0;border:1px solid var(--line);border-radius:14px;background:var(--panel);padding:18px}
.story-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.story-panel-head small{color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.06em}
.story-panel-head h2{margin:3px 0 0;font-size:17px}
.story-chapters nav{display:grid;gap:7px}
.story-chapters nav>a{display:grid;grid-template-columns:30px 1fr;gap:8px;padding:11px;border:1px solid transparent;border-radius:10px;text-decoration:none;color:#aebfc8}
.story-chapters nav>a small{color:#5f7d8d}
.story-chapters nav>a.active{border-color:rgba(104,216,234,.2);background:rgba(45,127,151,.12);color:#e2f1f5}
.story-chapters nav>p{color:var(--muted);line-height:1.5;font-size:13px}
.story-chapter-narrative{color:#94aab5;line-height:1.65;padding:0 2px 14px;border-bottom:1px solid var(--line)}
.story-scene-list{display:grid;gap:10px}
.story-scene-list article{display:flex;justify-content:space-between;gap:18px;padding:15px;border:1px solid rgba(133,188,210,.09);border-radius:11px;background:#081522}
.story-scene-list article>div:first-child{min-width:0}
.story-scene-list small,.story-scene-list span{color:var(--muted);font-size:10px}
.story-scene-list h3{margin:5px 0 5px;font-size:16px}
.story-scene-list p{margin:0;color:#9aafb9;line-height:1.55;font-size:13px}
.story-inline-actions a,.story-danger-link{color:#8eb6c2;background:none;border:0;padding:0;text-decoration:none;font-size:12px;cursor:pointer}
.story-danger-link{color:#c79292}
.story-add-scene{margin-top:14px}
.story-guidance ol{display:grid;gap:15px;margin:0;padding-left:20px}
.story-guidance li{color:#75909f;padding-left:3px}
.story-guidance li strong,.story-guidance li span{display:block}
.story-guidance li strong{color:#c1d4dc;font-size:13px;margin-bottom:4px}
.story-guidance li span{font-size:12px;line-height:1.5}
@media(max-width:1100px){
  .story-composer-grid{grid-template-columns:220px minmax(0,1fr)}
  .story-guidance{grid-column:1/-1}
  .story-guidance ol{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(max-width:760px){
  .story-shell-header{padding:0 16px}
  .story-shell{padding:22px 16px 42px}
  .story-page-head{flex-direction:column}
  .story-kpis,.story-card-grid{grid-template-columns:1fr}
  .story-composer-grid{grid-template-columns:1fr}
  .story-guidance{grid-column:auto}
  .story-guidance ol{grid-template-columns:1fr}
  .story-scene-list article{flex-direction:column}
}

/* LS1.6 — Private narrative preview */
.story-preview-progress{
  position:fixed;top:64px;left:0;right:0;height:2px;z-index:30;
  background:rgba(104,216,234,.05)
}
.story-preview-progress i{
  display:block;width:100%;height:100%;transform:scaleX(0);transform-origin:left center;
  background:linear-gradient(90deg,#4cb5ca,#77e0ec)
}
.story-preview-toolbar{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  margin-bottom:18px;color:var(--muted);font-size:12px
}
.story-preview-toolbar .story-back{margin:0}
.story-preview-layout{
  display:grid;grid-template-columns:230px minmax(0,1fr);gap:18px;align-items:start
}
.story-preview-nav{
  position:sticky;top:88px;padding:16px;border:1px solid var(--line);
  border-radius:14px;background:rgba(8,21,34,.9);max-height:calc(100vh - 110px);overflow:auto
}
.story-preview-nav nav{display:grid;gap:6px;margin-top:12px}
.story-preview-nav a{
  display:grid;grid-template-columns:28px 1fr;gap:7px;padding:10px;border-radius:9px;
  color:#9eb2bc;text-decoration:none;border:1px solid transparent
}
.story-preview-nav a small{color:#587787}
.story-preview-nav a.active{
  color:#e5f3f6;background:rgba(56,139,163,.13);border-color:rgba(104,216,234,.16)
}
.story-preview-nav p{color:var(--muted);font-size:12px;line-height:1.5}
.story-preview-document{min-width:0}
.story-preview-hero{
  min-height:300px;display:flex;flex-direction:column;justify-content:flex-end;
  padding:42px;border:1px solid var(--line);border-radius:18px;
  background:
    radial-gradient(circle at 75% 5%,rgba(60,153,180,.16),transparent 35%),
    linear-gradient(145deg,#0c1d2b,#07131f)
}
.story-preview-hero h1{max-width:900px;margin:10px 0 12px;font-size:48px;line-height:1.02;letter-spacing:-.035em}
.story-preview-hero p{max-width:780px;margin:0;color:#a7bbc4;line-height:1.7;font-size:18px}
.story-preview-status{display:flex;gap:8px;flex-wrap:wrap;margin-top:20px}
.story-preview-status span,.story-preview-source-badges span{
  padding:6px 9px;border:1px solid rgba(133,188,210,.12);border-radius:999px;
  color:#89a7b3;background:rgba(7,19,31,.7);font-size:10px
}
.story-preview-chapter{scroll-margin-top:88px;padding:56px 8px 20px}
.story-preview-chapter>header{max-width:850px;margin:0 auto 22px}
.story-preview-chapter>header>span{color:var(--cyan);font-size:11px;text-transform:uppercase;letter-spacing:.08em}
.story-preview-chapter h2{margin:7px 0 10px;font-size:34px;letter-spacing:-.025em}
.story-preview-chapter>header p{margin:0;color:#92aab5;line-height:1.75;font-size:16px}
.story-preview-scenes{display:grid;gap:18px}
.story-preview-scene{
  min-width:0;padding:26px;border:1px solid var(--line);border-radius:16px;
  background:linear-gradient(145deg,var(--panel),#07131f)
}
.story-preview-scene-copy{max-width:850px}
.story-scene-mode{color:#64bfd1;font-size:10px;text-transform:uppercase;letter-spacing:.08em}
.story-preview-scene h3{margin:7px 0 9px;font-size:25px}
.story-preview-scene-copy p{margin:0;color:#a6bac3;line-height:1.75}
.story-preview-scene-copy small{display:block;margin-top:10px;color:#6f8998;line-height:1.55}
.story-mode-shell{
  min-height:150px;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:6px;margin-top:20px;padding:22px;border:1px dashed rgba(104,216,234,.16);
  border-radius:13px;background:rgba(4,15,25,.55);text-align:center
}
.story-mode-shell strong{font-size:15px;color:#bfd5dd}
.story-mode-shell span{max-width:520px;color:#7893a0;font-size:12px;line-height:1.55}
.story-preview-source-badges{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}
@media(max-width:900px){
  .story-preview-layout{grid-template-columns:1fr}
  .story-preview-nav{
    position:static;max-height:none;overflow-x:auto;overflow-y:hidden
  }
  .story-preview-nav nav{display:flex;min-width:max-content}
  .story-preview-nav a{min-width:160px}
  .story-preview-hero{padding:30px;min-height:260px}
  .story-preview-hero h1{font-size:40px}
}
@media(max-width:560px){
  .story-preview-toolbar{align-items:flex-start;flex-direction:column}
  .story-preview-hero{padding:24px;min-height:230px}
  .story-preview-hero h1{font-size:34px}
  .story-preview-hero p{font-size:16px}
  .story-preview-chapter{padding-top:40px}
  .story-preview-chapter h2{font-size:28px}
  .story-preview-scene{padding:20px}
}
@media(prefers-reduced-motion:reduce){
  .story-preview-progress i{transition:none}
}

/* LS1.7 — Governed source attachment */
.story-source-list{
  display:grid;gap:8px;margin-top:14px;padding-top:12px;
  border-top:1px solid rgba(133,188,210,.09)
}
.story-source-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:9px 10px;border:1px solid rgba(133,188,210,.08);
  border-radius:9px;background:rgba(5,17,28,.55)
}
.story-source-row>div:first-child{min-width:0}
.story-source-row strong{
  display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:#bcd2da;font-size:12px
}
.story-source-row small,.story-source-empty{
  display:block;margin-top:3px;color:#718d9a;font-size:10px
}
.story-source-add{
  width:max-content;color:#6bc7d9;text-decoration:none;font-size:11px
}
.story-source-action{
  padding:0;border:0;background:none;color:#82adba;font-size:11px;cursor:pointer
}
@media(max-width:560px){
  .story-source-row{align-items:flex-start;flex-direction:column}
}


/* LS1.8 — Map / Timeline / Media presentation */
.story-map-runtime,.story-timeline-runtime,.story-media-runtime{
  width:100%;min-width:0
}
.story-map-stage{
  position:relative;overflow:hidden;width:100%;aspect-ratio:16/8.5;
  border-radius:11px;border:1px solid rgba(133,188,210,.12);background:#06121e
}
.story-map-stage img{display:block;width:100%;height:100%;object-fit:cover}
.story-map-marker{
  position:absolute;left:50%;top:50%;width:18px;height:18px;transform:translate(-50%,-50%);
  border:3px solid #e7fbff;border-radius:50%;background:#1d8fa9;box-shadow:0 0 0 5px rgba(29,143,169,.25)
}
.story-map-controls{
  display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:9px
}
.story-map-controls button,.story-map-controls a{
  min-height:34px;display:inline-flex;align-items:center;justify-content:center;
  padding:0 10px;border:1px solid rgba(133,188,210,.14);border-radius:8px;
  background:#081725;color:#a9c4ce;text-decoration:none;cursor:pointer
}
.story-map-controls a{margin-left:auto}
.story-map-runtime>small{display:block;margin-top:8px;color:#6f8d99;text-align:left}
.story-timeline-runtime{
  list-style:none;margin:0;padding:0;display:grid;gap:0;text-align:left
}
.story-timeline-runtime li{
  position:relative;display:grid;grid-template-columns:170px minmax(0,1fr);gap:18px;
  padding:15px 0 15px 22px;border-left:1px solid rgba(104,216,234,.22)
}
.story-timeline-runtime li::before{
  content:"";position:absolute;left:-5px;top:21px;width:9px;height:9px;border-radius:50%;
  background:#67c8da;box-shadow:0 0 0 4px rgba(103,200,218,.12)
}
.story-timeline-runtime time{color:#79a7b4;font-size:11px;line-height:1.5}
.story-timeline-runtime small{display:block;color:#5f8391;font-size:10px}
.story-timeline-runtime strong{display:block;margin:4px 0;color:#c9dce3;font-size:14px}
.story-timeline-runtime p{margin:0 0 6px;color:#8fa8b3;font-size:12px;line-height:1.55}
.story-timeline-runtime a,.story-media-runtime a{color:#70c8d8;font-size:11px;text-decoration:none}
.story-media-runtime{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}
.story-media-runtime figure{
  min-width:0;margin:0;padding:10px;border:1px solid rgba(133,188,210,.1);
  border-radius:11px;background:#071521;text-align:left
}
.story-media-runtime img,.story-media-runtime video{
  display:block;width:100%;max-height:520px;object-fit:contain;border-radius:8px;background:#040c14
}
.story-media-runtime audio{width:100%}
.story-media-runtime figcaption{display:grid;gap:5px;padding:9px 2px 2px}
.story-media-runtime figcaption strong{font-size:13px}
.story-media-runtime figcaption span{color:#829da9;font-size:11px;line-height:1.5}
@media(max-width:620px){
  .story-timeline-runtime li{grid-template-columns:1fr;gap:5px;padding-left:18px}
  .story-map-controls a{width:100%;margin-left:0}
  .story-map-stage{aspect-ratio:4/3}
}

/* LS1.9 — readiness, review and publication governance */
.story-governance-panel{
  margin:18px 0;
  padding:20px;
  border:1px solid rgba(91,141,164,.24);
  border-radius:16px;
  background:rgba(8,25,34,.7);
}
.story-readiness-ready{color:#a7f3d0}
.story-readiness-blocked{color:#fca5a5}
.story-readiness-summary,.story-lifecycle-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.story-readiness-summary span{
  padding:6px 9px;
  border:1px solid rgba(91,141,164,.2);
  border-radius:999px;
  color:#9eb6c2;
  font-size:12px;
}
.story-readiness-issues{
  margin:14px 0 0;
  padding-left:20px;
  color:#c9d8de;
}
.story-readiness-issues li{margin:7px 0}
.story-readiness-issues strong{
  display:block;
  color:#f2b8b5;
  font-size:12px;
}
.story-readiness-issues span{font-size:13px}
.story-lifecycle-actions form{margin:0}
.story-governance-note{
  margin:12px 0 0;
  color:#87a1ad;
  font-size:13px;
}
.story-governance-events{
  display:grid;
  gap:6px;
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid rgba(91,141,164,.16);
}
.story-governance-events>div{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  color:#86a0ad;
  font-size:12px;
}
.story-governance-events strong{color:#c8d8df}

/* LS1.10 — public immutable Story runtime */
.story-public-body{background:#06131a}
.story-public-shell{max-width:1500px}
.story-public-header{position:sticky;top:0;z-index:30;backdrop-filter:blur(16px)}
.story-public-index-head{margin-top:18px}
.story-public-grid{margin-top:20px}
.story-public-layout{margin-top:18px}
.story-public-hero{min-height:300px}
.story-public-hero .story-preview-status span:first-child{color:#a7f3d0}
.story-preview-source-badges a{color:inherit}
@media (max-width:640px){
  .story-public-header{align-items:flex-start;gap:10px}
  .story-public-header nav{flex-wrap:wrap}
}

/* LS1.11 — public search, sharing, SEO and accessibility */
.story-skip-link{
  position:fixed;
  left:16px;
  top:10px;
  z-index:1000;
  transform:translateY(-180%);
  padding:10px 14px;
  border-radius:8px;
  background:#f5fbff;
  color:#07151c;
  font-weight:700;
}
.story-skip-link:focus{transform:translateY(0)}
.story-public-search{
  display:grid;
  gap:8px;
  max-width:760px;
  margin:18px 0 8px;
}
.story-public-search label{
  color:#c8d8df;
  font-weight:700;
}
.story-public-search>div{
  display:flex;
  gap:10px;
}
.story-public-search input{
  min-width:0;
  flex:1 1 auto;
  border:1px solid rgba(116,159,179,.34);
  border-radius:10px;
  background:#091c25;
  color:#edf6fa;
  padding:11px 12px;
  font:inherit;
}
.story-search-status{
  margin:12px 0 0;
  color:#99b1bc;
}
.story-share-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin-top:16px;
}
.story-share-status{
  min-height:1.3em;
  color:#9cb4bf;
  font-size:13px;
}
.story-public-body :focus-visible{
  outline:3px solid currentColor;
  outline-offset:3px;
}
@media (max-width:540px){
  .story-public-search>div{align-items:stretch;flex-direction:column}
  .story-public-search button{width:100%}
}
@media (prefers-reduced-motion: reduce){
  .story-public-body *,
  .story-public-body *::before,
  .story-public-body *::after{
    scroll-behavior:auto!important;
    transition-duration:.001ms!important;
    animation-duration:.001ms!important;
    animation-iteration-count:1!important;
  }
}
