/* One workspace, one current decision; existing brand palette is retained. */
.journey-shell{min-height:100vh;background:var(--ds-color-surface-canvas);color:var(--ds-color-text-primary)}
.journey-header{border-bottom:var(--ds-border-thin) solid var(--ds-color-border-default);background:var(--ds-color-surface-panel)}
.journey-header-inner{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,var(--ds-layout-form-wide)) minmax(0,1fr);align-items:center;gap:var(--ds-space-6);min-height:calc(var(--ds-layout-header-journey) - var(--ds-border-thin));max-width:var(--ds-layout-journey);margin:0 auto;padding:var(--ds-space-4) var(--ds-space-8)}
.journey-account{display:flex;align-items:center;justify-content:flex-end;gap:var(--ds-space-6);flex-wrap:wrap;min-width:0;max-width:100%}
.journey-account .account-controls{min-width:0;max-width:100%}
.journey-account .account-controls>span{min-width:0;overflow-wrap:anywhere}
.journey-header .brand{font-size:var(--ds-font-size-title-sm);flex:none;justify-self:start;max-width:100%;min-width:0;white-space:normal}.journey-header .brand-mark{width:var(--ds-size-logo);height:var(--ds-size-logo)}
.journey-project{display:grid;gap:var(--ds-space-1);margin:0;max-width:var(--ds-layout-form-wide);min-width:0;font-size:var(--ds-font-size-title-sm);font-weight:var(--ds-font-weight-semibold);text-align:center}
.journey-project-title{display:block;min-width:0;overflow-wrap:anywhere;line-height:var(--ds-font-line-heading)}
.journey-header .account-controls{font-size:var(--ds-font-size-small)}
.journey-layout{display:grid;grid-template-columns:var(--ds-layout-journey-nav) minmax(0,var(--ds-layout-content-wide)) var(--ds-layout-journey-rail);gap:var(--ds-space-10);max-width:var(--ds-layout-journey);margin:auto;padding:var(--ds-space-10) var(--ds-space-8) var(--ds-space-20);align-items:start}
.journey-map{position:sticky;top:var(--ds-space-6)}.journey-map>p{font-size:var(--ds-font-size-caption);font-weight:var(--ds-font-weight-semibold);color:var(--ds-color-text-secondary);margin:0 0 var(--ds-space-4) var(--ds-space-3)}
.journey-map ol{list-style:none;padding:0;margin:0}.journey-map :is(button,a){display:flex;gap:var(--ds-space-3);align-items:center;width:100%;min-height:var(--ds-size-control);padding:var(--ds-space-2-5) var(--ds-space-3);border:0;border-radius:var(--ds-radius-md);background:none;text-align:left;color:var(--ds-color-text-secondary);font-size:var(--ds-font-size-body-sm);text-decoration:none}
.journey-map :is(button,a):hover{background:var(--ds-color-surface-hover)}.journey-map :is(button,a)[aria-current=step]{background:var(--ds-color-action-soft);color:var(--ds-color-action-text);font-weight:var(--ds-font-weight-bold)}
.journey-map .step-number{display:grid;place-items:center;width:var(--ds-size-step);height:var(--ds-size-step);border:var(--ds-border-thin) solid var(--ds-color-border-input);border-radius:var(--ds-radius-round);font-size:var(--ds-font-size-caption);flex:none}
.journey-map :is(button,a)[aria-current=step] .step-number{border-color:var(--ds-color-action-text);background:var(--ds-color-surface-panel)}
.journey-map .step-done{color:var(--ds-color-action-text);border-color:transparent;background:var(--ds-color-action-soft)}
.journey-map .text-btn{margin-top:var(--ds-space-6);font-size:var(--ds-font-size-small)}.journey-main{min-width:0;display:flex;flex-direction:column;gap:var(--ds-space-6)}
.journey-main>#cloud-status:empty{display:none}
.journey-main>#storage-error,.journey-main>.notice,.journey-main>#cloud-status>.notice{margin:0}
.journey-card{background:var(--ds-color-surface-panel);border:var(--ds-border-thin) solid var(--ds-color-border-default);border-radius:var(--ds-radius-card);padding:var(--ds-space-6);box-shadow:var(--ds-shadow-card)}
.journey-card h1{overflow-wrap:anywhere;font-size:var(--ds-font-fluid-journey);letter-spacing:var(--ds-font-tracking-heading);line-height:var(--ds-font-line-heading);margin:0 0 var(--ds-space-3-5);outline:none}
.journey-card>.lead{font-size:var(--ds-font-size-input);line-height:var(--ds-font-line-body);margin:0 0 var(--ds-space-5);color:var(--ds-color-text-secondary)}
.journey-card .field{font-size:var(--ds-font-size-body)}.journey-card .field small{font-weight:var(--ds-font-weight-regular)}.journey-card input,.journey-card textarea,.journey-card select{font-size:var(--ds-font-size-input)}
.journey-card textarea{min-height:var(--ds-layout-textarea)}.journey-card .chips{margin:var(--ds-space-3) 0}.journey-card .custom-interest-row{margin-bottom:var(--ds-space-6)}
.journey-card .profile-age{max-width:var(--ds-layout-field-compact);margin-bottom:var(--ds-space-6)}.journey-card details{margin-top:var(--ds-space-5)}
.journey-card .card-grid{grid-template-columns:1fr}.journey-card .item-card{padding:var(--ds-space-5);box-shadow:none}.journey-card .item-card h3{font-size:var(--ds-font-size-title-sm)}
.journey-actions{display:flex;align-items:center;justify-content:space-between;gap:var(--ds-space-4);margin-top:var(--ds-space-7);padding-top:var(--ds-space-6);border-top:var(--ds-border-thin) solid var(--ds-color-border-default)}
.journey-actions .btn{min-height:var(--ds-size-control)}.journey-actions .text-btn{min-height:var(--ds-size-touch)}
.journey-passport{position:sticky;top:var(--ds-space-6);background:var(--ds-color-surface-panel);border:var(--ds-border-thin) solid var(--ds-color-border-default);border-radius:var(--ds-radius-lg);padding:var(--ds-space-6);min-width:0}
.journey-passport h2{font-size:var(--ds-font-size-input);margin:0 0 var(--ds-space-6)}.journey-passport dl{margin:0}.journey-passport dt{font-size:var(--ds-font-size-caption);color:var(--ds-color-text-secondary);margin-top:var(--ds-space-5)}.journey-passport dd{font-size:var(--ds-font-size-body-sm);line-height:var(--ds-font-line-body);margin:var(--ds-space-1-5) 0 0;overflow-wrap:anywhere}
.journey-passport .passport-idea{font-size:var(--ds-font-size-input);font-weight:var(--ds-font-weight-semibold);line-height:var(--ds-font-line-body);white-space:pre-wrap;max-height:var(--ds-size-media-md);overflow:auto}
.journey-save{display:flex;gap:var(--ds-space-2);align-items:center;font-size:var(--ds-font-size-caption);color:var(--ds-color-text-secondary);margin-top:var(--ds-space-6);line-height:var(--ds-font-line-body)}
.journey-optional{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--ds-space-3);margin-top:var(--ds-space-6)}
.journey-optional :is(button,a){display:block;text-decoration:none;background:var(--ds-color-surface-panel);text-align:left;border:var(--ds-border-thin) solid var(--ds-color-border-default);border-radius:var(--ds-radius-card);padding:var(--ds-space-5);color:var(--ds-color-text-primary);min-height:var(--ds-space-24)}
.journey-optional :is(button,a):hover{border-color:var(--ds-color-action-text);background:var(--ds-color-action-soft)}
.journey-optional strong{display:flex;align-items:center;gap:var(--ds-space-2-5);font-size:var(--ds-font-size-body)}.journey-optional small{display:block;margin-top:var(--ds-space-2);font-size:var(--ds-font-size-small);color:var(--ds-color-text-secondary)}
.journey-detail .right-rail,.journey-detail .step-footer,.journey-detail .eyebrow{display:none}.journey-detail .content-grid{display:block}.journey-detail .panel{padding:var(--ds-space-5);box-shadow:none}.journey-detail .lead{font-size:var(--ds-font-size-body)}
.journey-progress{padding:var(--ds-space-6);background:var(--ds-color-action-soft);border-radius:var(--ds-radius-card);margin:var(--ds-space-5) 0}.journey-progress p{font-size:var(--ds-font-size-body-sm);margin:var(--ds-space-2) 0 0;line-height:var(--ds-font-line-lead)}.journey-progress strong{font-size:var(--ds-font-size-lead);color:var(--ds-color-action-text)}
.journey-result{white-space:pre-wrap;overflow-wrap:anywhere;font-size:var(--ds-font-size-input);line-height:var(--ds-font-line-reading)}.journey-result details{border-top:var(--ds-border-thin) solid var(--ds-color-border-default);padding-top:var(--ds-space-5);white-space:normal}.journey-result summary{font-weight:var(--ds-font-weight-semibold);font-size:var(--ds-font-size-input)}.journey-result .screenplay-output{font-size:var(--ds-font-size-input);white-space:pre-wrap}
.journey-error{margin-top:var(--ds-space-5)}.journey-error:empty{display:none}
@media(max-width:1200px){.journey-layout{grid-template-columns:var(--ds-layout-journey-nav-compact) minmax(0,1fr);max-width:var(--ds-layout-journey-compact);gap:var(--ds-space-7)}.journey-passport{grid-column:2;position:static}.journey-passport dl{display:grid;grid-template-columns:1fr 1fr;gap:0 var(--ds-space-6)}.journey-passport .passport-idea{max-height:var(--ds-space-24)}.journey-header-inner{max-width:var(--ds-layout-journey-compact);grid-template-columns:repeat(3,minmax(0,1fr))}.journey-account{gap:var(--ds-space-3)}}
@media(max-width:760px){.journey-header-inner{display:flex;min-height:var(--ds-space-18);padding:var(--ds-space-3-5) var(--ds-space-4);gap:var(--ds-space-3);flex-wrap:wrap}.journey-account{margin-left:auto;gap:var(--ds-space-3)}.journey-header .brand{font-size:var(--ds-font-size-lead)}.journey-header .account-controls span,.journey-header .account-controls>.icon{display:none}.journey-header .account-controls{margin-left:auto}.journey-project{order:3;flex:0 0 100%;margin:0;max-width:100%;width:100%;font-size:var(--ds-font-size-lead);text-align:left}.journey-layout{display:flex;flex-direction:column;padding:var(--ds-space-4) var(--ds-space-4) var(--ds-space-12);gap:var(--ds-space-5)}.journey-map{position:static;width:100%}.journey-map>p,.journey-map>.text-btn{display:none}.journey-map ol{display:flex;overflow-x:auto;gap:var(--ds-space-1-5);padding-bottom:var(--ds-space-1-5)}.journey-map li{flex:none}.journey-map :is(button,a){font-size:var(--ds-font-size-small);min-height:var(--ds-size-touch)}.journey-map .step-number{width:var(--ds-size-icon-lg);height:var(--ds-size-icon-lg)}.journey-main{width:100%;gap:var(--ds-space-5)}.journey-card{padding:var(--ds-space-6) var(--ds-space-5);border-radius:var(--ds-radius-lg)}.journey-card h1{font-size:var(--ds-font-size-heading-sm)}.journey-card>.lead{font-size:var(--ds-font-size-body)}.journey-passport{width:100%;padding:var(--ds-space-5)}.journey-passport dl{display:block}.journey-optional{grid-template-columns:minmax(0,1fr)}.journey-optional :is(button,a){padding:var(--ds-space-4)}.journey-optional strong{font-size:var(--ds-font-size-body-sm)}.journey-actions{flex-wrap:wrap}.journey-actions .btn{flex:1 1 100%}.journey-header .project-menu-button{margin-left:auto;font-size:var(--ds-font-size-small)}.journey-result .screenplay-output{font-size:var(--ds-font-size-body)}}
@media(prefers-reduced-motion:reduce){.journey-shell *{scroll-behavior:auto;transition:none}}

@media(max-width:760px){.journey-header>.storage-pill{display:none}.journey-header .brand{margin-right:auto}.journey-header .project-menu-button{margin-left:0}.journey-project{padding-top:var(--ds-space-micro)}.journey-card .add-card{min-height:calc(var(--ds-size-control-lg) * 2)}.journey-card{scroll-margin-top:var(--ds-space-4)}}


.journey-scope+.journey-scope{margin-top:var(--ds-space-7)}
.journey-scope-title{font-size:var(--ds-font-size-caption);font-weight:var(--ds-font-weight-semibold);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);margin:0 0 var(--ds-space-3) var(--ds-space-3)}
.journey-map .step-number>.icon{width:var(--ds-size-icon-sm);height:var(--ds-size-icon-sm)}
.story-idea-copy{white-space:pre-wrap;overflow-wrap:anywhere;font-size:var(--ds-font-size-input);line-height:var(--ds-font-line-reading);margin:0 0 var(--ds-space-6)}
@media(max-width:760px){.journey-scope+.journey-scope{margin-top:var(--ds-space-3)}.journey-scope-title{margin-bottom:var(--ds-space-1);margin-inline-start:var(--ds-space-2)}.story-idea-copy{font-size:var(--ds-font-size-body)}}

@media(max-width:760px){.journey-actions--story{flex-direction:column-reverse;align-items:stretch}.journey-actions--story>.btn{flex:none}.journey-actions--story>.text-btn{align-self:center}}

/* Permanent hierarchy: project library → shared project resources → format-specific works. */
.workspace-mobile-navigation{display:none}
.workspace-navigation{display:flex;flex-direction:column;gap:var(--ds-space-4);min-width:0}
.workspace-navigation>*{flex-shrink:0}
.journey-layout>.workspace-navigation{max-height:calc(100dvh - var(--ds-layout-header-journey) - var(--ds-space-10) - var(--ds-space-6));overflow-y:auto;overscroll-behavior:contain}
.workspace-navigation .workspace-nav-title{font-size:var(--ds-font-size-body-sm);line-height:var(--ds-font-line-body);font-weight:var(--ds-font-weight-semibold);color:var(--ds-color-text-primary);margin:0 0 var(--ds-space-1)}
.workspace-navigation .workspace-group-label{display:flex;align-items:center;min-height:var(--ds-size-touch);padding:var(--ds-space-2-5) var(--ds-space-3);overflow-wrap:anywhere}
.workspace-navigation a{display:grid;align-items:center;width:100%;min-height:var(--ds-size-touch);padding:var(--ds-space-2-5) var(--ds-space-3);border:0;border-radius:var(--ds-radius-md);background:none;font-size:var(--ds-font-size-body-sm);line-height:var(--ds-font-line-body);text-align:left;text-decoration:none;color:var(--ds-color-text-secondary);overflow-wrap:anywhere}
.workspace-navigation .workspace-nav-row{grid-template-columns:var(--ds-size-icon-sm) minmax(0,1fr);column-gap:var(--ds-space-3)}
.workspace-navigation .workspace-nav-row>span{grid-column:2;min-width:0;overflow-wrap:anywhere}
.workspace-navigation>.workspace-all-projects{min-height:var(--ds-size-control)}
.workspace-navigation a:hover{background:var(--ds-color-surface-hover)}
.workspace-navigation a[aria-current]{background:var(--ds-color-action-soft);color:var(--ds-color-action-text);font-weight:var(--ds-font-weight-semibold)}
.workspace-navigation .workspace-collection-link{grid-template-columns:minmax(0,1fr) auto;column-gap:var(--ds-space-3);color:var(--ds-color-text-primary);font-weight:var(--ds-font-weight-semibold)}
.workspace-collection-link>span{min-width:0;overflow-wrap:anywhere}
.workspace-count{font-size:var(--ds-font-size-caption);font-weight:var(--ds-font-weight-regular);color:var(--ds-color-text-secondary)}
.workspace-story-list{list-style:none;padding:0;margin:0}
.workspace-navigation .workspace-story-link{min-width:0}
.workspace-story-premise{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin-top:var(--ds-space-1);font-size:var(--ds-font-size-caption);font-weight:var(--ds-font-weight-regular);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary)}
.workspace-navigation .workspace-new-story{margin-top:var(--ds-space-2);color:var(--ds-color-action-text)}
.workspace-navigation .workspace-draft-views{margin-top:var(--ds-space-1)}
.workspace-nav-group{padding-top:var(--ds-space-4);border-top:var(--ds-border-thin) solid var(--ds-color-border-default)}
.workspace-navigation .icon{width:var(--ds-size-icon-sm);height:var(--ds-size-icon-sm);flex:none}
.workspace-navigation a:focus-visible{outline:var(--ds-border-focus) solid var(--ds-color-action-text);outline-offset:calc(-1 * var(--ds-border-focus))}
.story-view-tab:focus-visible,.workspace-mobile-navigation:focus-visible{outline:var(--ds-border-focus) solid var(--ds-color-action-text);outline-offset:var(--ds-space-1)}
.story-view-tabs{display:flex;gap:var(--ds-space-2);min-width:0;flex-wrap:wrap;margin-inline-end:auto}
.story-view-tab{display:flex;align-items:center;min-height:var(--ds-size-touch);padding:var(--ds-space-2) var(--ds-space-3);border-radius:var(--ds-radius-sm);text-decoration:none;font-size:var(--ds-font-size-body-sm);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary)}
.story-view-tab:hover{background:var(--ds-color-surface-hover)}
.story-view-tab[aria-current=page]{background:var(--ds-color-action-soft);color:var(--ds-color-action-text);font-weight:var(--ds-font-weight-semibold)}
.workspace-navigation-dialog{max-width:var(--ds-layout-form)}
@media(max-width:760px){
 .journey-shell--workspace .journey-map{display:none}
 .workspace-mobile-navigation{display:flex;align-items:center;gap:var(--ds-space-3);min-height:var(--ds-size-touch);width:100%;padding:var(--ds-space-3) var(--ds-space-4);border:var(--ds-border-thin) solid var(--ds-color-border-default);border-radius:var(--ds-radius-md);background:var(--ds-color-surface-panel);color:var(--ds-color-text-primary);font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);text-align:left}
 .workspace-mobile-navigation>span{flex:1;min-width:0;overflow-wrap:anywhere}
 .workspace-mobile-navigation>.icon{flex:none;width:var(--ds-size-icon-sm);height:var(--ds-size-icon-sm)}
 .story-view-tabs{flex-basis:100%}
 .reader-footer>.help{margin:0}
}
@media(forced-colors:active){
 .workspace-navigation a[aria-current],.story-view-tab[aria-current]{outline:var(--ds-border-thin) solid Highlight}
 .workspace-mobile-navigation,.workspace-project-resources{border-color:CanvasText}
}

/* First creation is a task sequence inside the stable project workspace. */
.journey-card .journey-first-progress{margin-top:0;margin-bottom:var(--ds-space-5);padding-bottom:var(--ds-space-5);border-bottom:var(--ds-border-thin) solid var(--ds-color-border-default)}
.first-progress-heading{display:flex;align-items:center;gap:var(--ds-space-3);min-height:var(--ds-size-touch);list-style:none;cursor:pointer;font-size:var(--ds-font-size-small);color:var(--ds-color-text-secondary)}
.first-progress-heading::-webkit-details-marker{display:none}
.first-progress-heading>span:nth-child(2){margin-inline-start:auto}
.first-progress-heading>.icon{flex:none;width:var(--ds-size-icon-sm);height:var(--ds-size-icon-sm)}
.journey-first-progress[open] .first-progress-heading>.icon{transform:rotate(180deg)}
.journey-first-progress[open] .first-progress-heading{margin-bottom:var(--ds-space-3)}
.first-progress-heading:focus-visible{outline:var(--ds-border-focus) solid var(--ds-color-action-text);outline-offset:var(--ds-space-1)}
.journey-first-progress ol{list-style:none;display:flex;flex-wrap:wrap;gap:var(--ds-space-2);margin:0;padding:0}
.first-progress-step{display:flex;align-items:center;gap:var(--ds-space-2);min-height:var(--ds-size-touch);padding:var(--ds-space-2) var(--ds-space-3);font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);border-radius:var(--ds-radius-md);color:var(--ds-color-text-secondary);text-decoration:none}
.first-progress-step:hover{background:var(--ds-color-surface-hover)}
.first-progress-step[aria-current=step]{color:var(--ds-color-action-text);background:var(--ds-color-action-soft);font-weight:var(--ds-font-weight-semibold)}
.first-progress-step .step-number{display:grid;place-items:center;flex:none;min-width:var(--ds-size-icon-lg);font-size:var(--ds-font-size-caption)}
.first-progress-step .step-done{color:var(--ds-color-action-text)}
.first-progress-step:focus-visible{outline:var(--ds-border-focus) solid var(--ds-color-action-text);outline-offset:var(--ds-space-1)}
.workspace-resource-tools{display:flex;justify-content:flex-start;margin-top:var(--ds-space-6)}
.workspace-resource-tools>.text-btn,.first-story-return{display:inline-flex;align-items:center;gap:var(--ds-space-2);min-height:var(--ds-size-touch);text-decoration:none}
.project-about>section{padding-top:var(--ds-space-6);margin-top:var(--ds-space-6);border-top:var(--ds-border-thin) solid var(--ds-color-border-default)}
.project-about>section h2{font-size:var(--ds-font-size-title-sm);margin:0 0 var(--ds-space-5)}
.project-about-settings>.help{display:flex;align-items:center;gap:var(--ds-space-2);flex-wrap:wrap}
.first-story-return{margin-top:var(--ds-space-6)}
@media(max-width:760px){.journey-first-progress{margin-bottom:var(--ds-space-6)}.journey-first-progress li{flex-basis:calc(50% - var(--ds-space-1))}.first-progress-step{padding:var(--ds-space-2);gap:var(--ds-space-1-5)}.first-progress-heading{font-size:var(--ds-font-size-caption)}}
@media(forced-colors:active){.first-progress-step[aria-current=step]{outline:var(--ds-border-thin) solid Highlight}}

/* Resource names use the full card width before their status on narrow screens. */
@media(max-width:760px){.journey-card .item-head{flex-wrap:wrap;gap:var(--ds-space-2)}.journey-card .item-head>h3{flex-basis:100%;margin-bottom:0}}

/* The editor owns its bottom breathing room. The sticky companion track
   includes that space, so the chat can stay at the viewport edge at page end. */
.journey-layout--assistant{padding-block-end:0}
.journey-layout--assistant>.journey-main{padding-block-end:var(--ds-space-20)}
@media(max-width:1200px){.journey-layout--assistant{padding-block-end:var(--ds-space-20)}.journey-layout--assistant>.journey-main{padding-block-end:0}}
@media(max-width:760px){.journey-layout--assistant{padding-block-end:var(--ds-space-12)}}
