/* Shared component modifiers; values belong to the token source. */
.avatar{display:inline-grid;place-items:center;width:var(--ds-size-control-sm);height:var(--ds-size-control-sm);flex:none;border-radius:var(--ds-radius-round);overflow:hidden;background:var(--ds-color-surface-subtle);color:var(--ds-color-text-secondary);font-size:var(--ds-font-size-body-sm);font-weight:var(--ds-font-weight-semibold);line-height:var(--ds-font-line-tight);text-align:center}
.avatar-initial{display:block;line-height:inherit}
.avatar[data-avatar-tone=coral]{background:var(--ds-color-section-heroes-soft);color:var(--ds-color-section-heroes)}
.avatar[data-avatar-tone=teal]{background:var(--ds-color-section-world-soft);color:var(--ds-color-format-story)}
.avatar[data-avatar-tone=violet]{background:var(--ds-color-format-comic-soft);color:var(--ds-color-format-comic)}
.avatar[data-avatar-tone=amber]{background:var(--ds-color-section-references-soft);color:var(--ds-color-section-references)}
.avatar img{display:block;width:100%;height:100%;object-fit:cover}
.avatar--compact{width:var(--ds-size-step);height:var(--ds-size-step);font-size:var(--ds-font-size-caption)}
.avatar-stack{display:flex;gap:0;margin-top:var(--ds-space-7)}
.avatar-stack .avatar{width:var(--ds-size-logo-sm);height:var(--ds-size-logo-sm);border:var(--ds-border-strong) solid var(--ds-color-surface-preview)}
.avatar-stack .avatar+.avatar{margin-inline-start:calc(var(--ds-space-1) * -1)}
.passport-hero-row{display:flex;align-items:center;gap:var(--ds-space-2)}
.passport-hero-row+.passport-hero-row{margin-top:var(--ds-space-1)}
.passport-hero-row>span:last-child{min-width:0;overflow-wrap:anywhere}
.support-copy{margin:var(--ds-space-4) 0 0}
.upload-caption{margin:var(--ds-space-4) 0 var(--ds-space-6)}
.card-description{margin-top:var(--ds-space-4)}
.section-start{margin-top:var(--ds-space-8)}
.upload-link{margin-left:var(--ds-space-4)}
.dialog-project-actions{margin-top:var(--ds-space-6)}
.preview-media{width:100%;height:100%;object-fit:contain}
.brand-mark img{display:block;width:100%;height:100%;object-fit:contain}
.fork-lines .fork-story{stroke:var(--ds-color-format-story)}
.fork-lines .fork-comic{stroke:var(--ds-color-format-comic)}
.fork-lines .fork-film{stroke:var(--ds-color-action-primary)}
.field [aria-invalid=true]{border-color:var(--ds-color-status-danger)}
.field>small.error{color:var(--ds-color-status-danger)}
.field [aria-invalid=true]:focus-visible{outline-color:var(--ds-color-action-focus)}
.field input:disabled,.field textarea:disabled,.field select:disabled,.search-input:disabled{background:var(--ds-color-surface-subtle);color:var(--ds-color-text-secondary);cursor:not-allowed}
.chip:disabled{cursor:not-allowed;opacity:var(--ds-opacity-disabled)}
.chip,.text-btn{min-height:var(--ds-size-touch)}
.btn,.text-btn,.chip{overflow-wrap:anywhere}
.text-btn{min-width:var(--ds-size-touch)}
.home-footer .text-btn{min-height:var(--ds-size-touch)}
.idea-reminder .text-btn{min-height:var(--ds-size-touch)}
.brand{min-height:var(--ds-size-touch)}
a.btn,.project-open,.nav-item,.add-card,.new-project-tile{text-decoration:none}
summary{min-height:var(--ds-size-touch);padding:var(--ds-space-2) 0}
dialog{border-radius:var(--ds-radius-dialog)}
.custom-interest-row{align-items:stretch}
.custom-interest-row .btn{flex:none}
/* Preserve native select semantics; the decorative arrow shares the icon system. */
.select-control{display:block;position:relative;min-width:0}
.field .select-control select{appearance:none;padding-inline-end:calc(var(--ds-space-4) + var(--ds-size-icon-lg) + var(--ds-space-2));min-height:var(--ds-size-touch)}
.select-control>.icon{position:absolute;inset-inline-end:var(--ds-space-4);top:50%;transform:translateY(-50%);width:var(--ds-size-icon-lg);height:var(--ds-size-icon-lg);color:var(--ds-color-text-secondary);pointer-events:none}
.icon-btn{width:var(--ds-size-touch);height:var(--ds-size-touch);padding:0;line-height:var(--ds-font-line-tight)}
.icon-btn>.icon{display:block}
button:disabled:active{transform:none}
@media(forced-colors:active){
 .field .select-control select{appearance:auto;padding-inline-end:var(--ds-space-3-5)}
 .select-control>.icon{display:none}
 .btn,.chip,.option,.icon-btn,.field input,.field textarea,.field select{border:var(--ds-border-thin) solid ButtonText}
 .chip[aria-pressed=true],.option:has(input:checked){outline:var(--ds-border-strong) solid Highlight}
 .idea-input-wrap:focus-within{outline:var(--ds-border-focus) solid Highlight}
 .progress-line{forced-color-adjust:auto}
}
/* Catalogue uses the production classes above and the same stylesheet order. */
.ds-catalogue{background:var(--ds-color-surface-canvas);overflow-wrap:anywhere}
.ds-catalogue-header,.ds-catalogue-main{max-width:var(--ds-layout-workspace);margin:0 auto;padding:var(--ds-space-8)}
.ds-catalogue-header{display:flex;align-items:center;justify-content:space-between;gap:var(--ds-space-4);flex-wrap:wrap}
.ds-catalogue-main>.lead{max-width:var(--ds-layout-content)}
.ds-swatch-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr));gap:var(--ds-space-6);font-size:var(--ds-font-size-body)}
.ds-swatch{display:block;width:100%;height:var(--ds-size-control-lg);border-radius:var(--ds-radius-md);margin-bottom:var(--ds-space-2)}
.ds-swatch-ink{background:var(--ds-color-text-primary)}
.ds-swatch-muted{background:var(--ds-color-text-secondary)}
.ds-swatch-placeholder{background:var(--ds-color-text-placeholder)}
.ds-swatch-action{background:var(--ds-color-action-primary)}
.ds-swatch-success{background:var(--ds-color-status-success)}
.ds-swatch-danger{background:var(--ds-color-status-danger)}
.ds-catalogue .panel .fields{max-width:var(--ds-layout-content)}
.ds-catalogue .card-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr))}
.ds-catalogue .progress-line{width:100%}
.ds-catalogue .storage-pill{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.ds-catalogue [data-catalogue-project-actions]{justify-content:flex-end}
@media(max-width:760px){.ds-catalogue-header,.ds-catalogue-main{padding:var(--ds-space-5)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
/* Document reader: navigation is quieter than the manuscript. */
.journey-shell--reading .journey-layout{grid-template-columns:var(--ds-layout-journey-nav) minmax(0,var(--ds-layout-dialog-screenplay));max-width:var(--ds-layout-workspace)}
.reader-page{min-width:0}
.reader-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:var(--ds-space-3);padding-bottom:var(--ds-space-4);margin-bottom:var(--ds-space-8);border-bottom:var(--ds-border-thin) solid var(--ds-color-border-default)}
.reader-toolbar .reader-menu{margin:0;max-width:100%;border:0;padding:0}
.reader-menu{position:relative;flex:none;min-width:0}
.reader-menu>summary{display:flex;align-items:center;gap:var(--ds-space-2);list-style:none;min-height:var(--ds-size-touch);padding:var(--ds-space-2) var(--ds-space-3);border-radius:var(--ds-radius-sm);font-size:var(--ds-font-size-body-sm);font-weight:var(--ds-font-weight-semibold);color:var(--ds-color-text-secondary);cursor:pointer}
.reader-menu>summary::-webkit-details-marker{display:none}
.reader-menu[open]>summary{margin-bottom:0}
.reader-menu>summary:hover,.reader-menu[open]>summary{background:var(--ds-color-surface-subtle);color:var(--ds-color-text-primary)}
.reader-menu>summary>.icon{width:var(--ds-size-icon-sm);height:var(--ds-size-icon-sm);flex:none}
.reader-menu[open]>summary>.icon{transform:rotate(180deg)}
.reader-menu-panel{position:absolute;top:calc(100% + var(--ds-space-2));inset-inline-start:0;z-index:var(--ds-layer-navigation);width:min(var(--ds-layout-form),calc(100vw - var(--ds-space-8)));max-height:var(--ds-layout-scroll-panel);overflow:auto;background:var(--ds-color-surface-panel);border:var(--ds-border-thin) solid var(--ds-color-border-default);border-radius:var(--ds-radius-md);padding:var(--ds-space-2);box-shadow:var(--ds-shadow-card-hover)}
.reader-menu-link{display:flex;align-items:center;justify-content:space-between;gap:var(--ds-space-3);min-height:var(--ds-size-touch);padding:var(--ds-space-2-5) var(--ds-space-3);border-radius:var(--ds-radius-sm);text-decoration:none;color:var(--ds-color-text-primary);font-size:var(--ds-font-size-body-sm);line-height:var(--ds-font-line-body);overflow-wrap:anywhere}
.reader-menu-link>span{min-width:0}
.reader-menu-link>small{color:var(--ds-color-text-secondary);font-size:var(--ds-font-size-caption);flex:none}
.reader-stories .reader-menu-link{display:block}
.reader-stories .reader-menu-link>small{display:block;margin-top:var(--ds-space-micro)}
.reader-menu-link:hover{background:var(--ds-color-surface-hover)}
.reader-menu-link[aria-current=page]{background:var(--ds-color-action-soft);color:var(--ds-color-action-text)}
.reader-menu-note{padding:var(--ds-space-2) var(--ds-space-3);font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);margin:var(--ds-space-1) 0}
.reader-menu-panel>.text-btn{margin-inline:var(--ds-space-3)}
.reader-download{margin-inline-start:auto;font-size:var(--ds-font-size-body-sm);flex:none}
.reader-heading h1{margin-bottom:var(--ds-space-4)}
.reader-heading>h3{font-size:var(--ds-font-fluid-journey);line-height:var(--ds-font-line-heading);letter-spacing:var(--ds-font-tracking-heading)}
.reader-logline{margin:0 0 var(--ds-space-5);font-size:var(--ds-font-size-input);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);overflow-wrap:anywhere}
.reader-archive{font-size:var(--ds-font-size-body-sm);color:var(--ds-color-text-secondary);line-height:var(--ds-font-line-body);margin:var(--ds-space-3) 0}
.reader-inline-link{display:inline-block;color:var(--ds-color-action-text);text-underline-offset:var(--ds-space-1);min-height:var(--ds-size-touch);padding:var(--ds-space-2) 0}
.reader-heading .reader-status{display:flex;align-items:baseline;gap:var(--ds-space-3);flex-wrap:wrap;padding:0;margin:0;background:none;border-radius:0}
.reader-status strong{font-size:var(--ds-font-size-body-sm);font-weight:var(--ds-font-weight-semibold);color:var(--ds-color-text-secondary)}
.reader-status[data-state=ready] strong{color:var(--ds-color-status-success)}
.reader-status[data-state=needs_revision] strong{color:var(--ds-color-status-warning)}
.reader-status strong::before{content:"";display:inline-block;width:var(--ds-size-dot);height:var(--ds-size-dot);border-radius:var(--ds-radius-round);background:currentColor;margin-inline-end:var(--ds-space-2);vertical-align:middle}
.reader-status p{font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);margin:0}
.reader-next-action{margin-top:var(--ds-space-5)}
.reader-manuscript{margin-top:var(--ds-space-10);white-space:normal}
.reader-document{max-width:var(--ds-layout-content);font-size:var(--ds-font-size-input);line-height:var(--ds-font-line-reading);color:var(--ds-color-text-primary);overflow-wrap:anywhere;white-space:normal}
.reader-document p{margin:0 0 var(--ds-space-5)}
.reader-document :is(h3,h4,h5,h6){letter-spacing:var(--ds-font-tracking-normal);line-height:var(--ds-font-line-title);margin:var(--ds-space-10) 0 var(--ds-space-4);color:var(--ds-color-text-primary);font-weight:var(--ds-font-weight-bold)}
.reader-document h3{font-size:var(--ds-font-size-section)}
.reader-document h4{font-size:var(--ds-font-size-lead)}
.reader-document :is(h5,h6){font-size:var(--ds-font-size-input)}
.reader-document .reader-scene-heading{font-size:var(--ds-font-size-title);line-height:var(--ds-font-line-heading);letter-spacing:var(--ds-font-tracking-title);margin:var(--ds-space-14) 0 var(--ds-space-5);scroll-margin-top:var(--ds-space-6)}
.reader-document>:first-child{margin-top:0}
.reader-document :is(ul,ol){padding-inline-start:var(--ds-space-6);margin:0 0 var(--ds-space-5)}
.reader-document li+li{margin-top:var(--ds-space-2)}
.reader-document blockquote{margin:var(--ds-space-5) 0;padding-inline-start:var(--ds-space-5);border-inline-start:var(--ds-border-strong) solid var(--ds-color-border-input);color:var(--ds-color-text-secondary)}
.reader-document hr{border:0;border-top:var(--ds-border-thin) solid var(--ds-color-border-default);margin:var(--ds-space-8) 0}
.reader-document code{font-family:var(--ds-font-family-mono);font-size:var(--ds-font-size-body-sm);overflow-wrap:anywhere}
.reader-code{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--ds-color-surface-subtle);padding:var(--ds-space-4);border-radius:var(--ds-radius-sm);font-size:var(--ds-font-size-body-sm);line-height:var(--ds-font-line-body);margin:var(--ds-space-5) 0}
.reader-document .reader-code-label{font-size:var(--ds-font-size-caption);color:var(--ds-color-text-secondary);margin-bottom:var(--ds-space-2)}
.reader-table{max-width:100%;overflow:auto;margin:var(--ds-space-5) 0}
.reader-table table{width:100%;border-collapse:collapse;font-size:var(--ds-font-size-body-sm)}
.reader-table :is(th,td){text-align:left;border-bottom:var(--ds-border-thin) solid var(--ds-color-border-default);padding:var(--ds-space-3);vertical-align:top}
.reader-table [data-align=center]{text-align:center}.reader-table [data-align=right]{text-align:right}
.reader-materials{margin-top:var(--ds-space-10)}
.reader-page .reader-disclosure,.work-materials .reader-disclosure{margin-top:0;border-top:var(--ds-border-thin) solid var(--ds-color-border-default);padding:var(--ds-space-2) 0}
.reader-disclosure>summary{min-height:var(--ds-size-touch);font-size:var(--ds-font-size-input);font-weight:var(--ds-font-weight-semibold);color:var(--ds-color-text-secondary);cursor:pointer}
.reader-disclosure[open]>summary{color:var(--ds-color-text-primary)}
.reader-disclosure>.reader-content{padding:var(--ds-space-5) 0}
.reader-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--ds-space-4);margin-top:var(--ds-space-8);padding-top:var(--ds-space-5);border-top:var(--ds-border-thin) solid var(--ds-color-border-default)}
.reader-footer .text-btn{font-size:var(--ds-font-size-body-sm)}
@media(max-width:1200px){.journey-shell--reading .journey-layout{grid-template-columns:var(--ds-layout-journey-nav-compact) minmax(0,1fr);max-width:var(--ds-layout-journey-compact)}}
@media(max-width:760px){.reader-menu>summary{padding-inline:var(--ds-space-1);gap:var(--ds-space-1)}.reader-toolbar{gap:var(--ds-space-1);margin-bottom:var(--ds-space-6)}.reader-download{margin-inline-start:0}.reader-menu[open]{flex-basis:100%;width:100%}.reader-menu-panel{position:static;width:100%;margin-top:var(--ds-space-2);box-shadow:none}.reader-menu-link>small{flex:initial;text-align:right}.reader-manuscript{margin-top:var(--ds-space-8)}.reader-document{max-width:var(--ds-layout-content);font-size:var(--ds-font-size-body);line-height:var(--ds-font-line-reading)}.reader-document h3{font-size:var(--ds-font-size-title-sm)}}
@media(forced-colors:active){.reader-menu-panel{border-color:CanvasText}.reader-menu-link[aria-current=page]{outline:var(--ds-border-thin) solid Highlight}.reader-status strong::before{background:CanvasText}}

/* Scene outline shares the renderer's scene identity, independent of project navigation. */
.journey-shell--reading .journey-layout.reader-layout--scenes{grid-template-columns:var(--ds-layout-journey-nav) minmax(0,1fr) var(--ds-layout-journey-nav)}
.reader-scenes-host{min-width:0;position:sticky;top:var(--ds-space-6);max-height:calc(100dvh - var(--ds-layout-header-journey) - var(--ds-space-10) - var(--ds-space-6));overflow:auto;overscroll-behavior:contain}
.reader-scenes-heading{font-size:var(--ds-font-size-body-sm);font-weight:var(--ds-font-weight-semibold);margin:0 0 var(--ds-space-3);color:var(--ds-color-text-primary)}
.reader-scenes,.reader-page .reader-scenes{margin:0;border:0;padding:0}
.reader-scenes-summary{display:none;min-height:var(--ds-size-touch);font-size:var(--ds-font-size-body-sm);font-weight:var(--ds-font-weight-semibold);color:var(--ds-color-text-primary);cursor:pointer}
.reader-scenes-count{margin-inline-start:var(--ds-space-2);font-size:var(--ds-font-size-caption);font-weight:var(--ds-font-weight-regular);color:var(--ds-color-text-secondary)}
.reader-scenes-list{list-style:none;padding:0;margin:0}
.reader-scene-link{display:block;min-height:var(--ds-size-touch);padding:var(--ds-space-2-5) var(--ds-space-3);border-radius:var(--ds-radius-sm);font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);text-decoration:none;overflow-wrap:anywhere}
.reader-scene-link:hover{background:var(--ds-color-surface-hover);color:var(--ds-color-text-primary)}
.reader-scene-link[aria-current=location]{color:var(--ds-color-action-text);background:var(--ds-color-action-soft);font-weight:var(--ds-font-weight-semibold)}
.reader-scene-link:focus-visible,.reader-scenes-summary:focus-visible{outline:var(--ds-border-focus) solid var(--ds-color-action-text);outline-offset:calc(-1 * var(--ds-border-focus))}
.reader-scene-heading:focus{outline:none}
.reader-scene-heading:focus-visible{outline:var(--ds-border-thin) solid var(--ds-color-action-text);outline-offset:var(--ds-space-2)}
.reader-catalogue-layout{display:grid;grid-template-columns:minmax(0,1fr) var(--ds-layout-journey-nav);gap:var(--ds-space-10);align-items:start}
@media(max-width:1200px){.journey-shell--reading .journey-layout.reader-layout--scenes{grid-template-columns:var(--ds-layout-journey-nav-compact) minmax(0,1fr)}.reader-scenes-host{position:static;max-height:none;overflow:visible;margin:var(--ds-space-6) 0;border-block:var(--ds-border-thin) solid var(--ds-color-border-default);padding:var(--ds-space-2) 0}.reader-scenes-heading{display:none}.reader-scenes-summary{display:list-item;padding:var(--ds-space-2) var(--ds-space-1)}.reader-scenes-nav{max-height:var(--ds-layout-scroll-panel);overflow:auto;overscroll-behavior:contain}.reader-catalogue-layout{display:block}}
@media(max-width:760px){.reader-document .reader-scene-heading{font-size:var(--ds-font-size-section)}.journey-shell--reading .journey-layout.reader-layout--scenes{display:block}}
@media(forced-colors:active){.reader-scene-link[aria-current=location]{outline:var(--ds-border-thin) solid Highlight}.reader-scene-link:focus-visible,.reader-scenes-summary:focus-visible,.reader-scene-heading:focus-visible{outline-color:Highlight}}
/* Durable resources: one shared profile/editor composition, no overlay forms. */
.journey-shell--resource .journey-layout{grid-template-columns:var(--ds-layout-journey-nav) minmax(0,1fr);max-width:var(--ds-layout-workspace)}
.resource-page{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);gap:var(--ds-space-6);min-width:0}
.resource-header{grid-column:1/-1;min-width:0;border-bottom:var(--ds-border-thin) solid var(--ds-color-border-default);padding-bottom:var(--ds-space-6)}
.resource-back .icon{transform:rotate(180deg)}
.resource-header-main{display:flex;justify-content:space-between;align-items:start;gap:var(--ds-space-4);margin-top:var(--ds-space-3)}
.resource-identity{display:flex;align-items:start;gap:var(--ds-space-5);min-width:0;flex:1}
.resource-identity>div{min-width:0}
.resource-page h1{font-size:var(--ds-font-size-heading-md);line-height:var(--ds-font-line-heading);margin:0 0 var(--ds-space-2);overflow-wrap:anywhere}
.resource-kicker{margin:0}
.resource-header-action{display:flex;flex-direction:column;align-items:start;gap:var(--ds-space-2);flex:none;max-width:100%}
.resource-header-action :is(a,button){white-space:normal;text-align:center}
.resource-portrait{flex:none}
.resource-portrait .avatar{width:var(--ds-size-avatar-lg);height:var(--ds-size-avatar-lg);font-size:var(--ds-font-size-heading-sm)}
.resource-facts{display:flex;flex-wrap:wrap;gap:var(--ds-space-4) var(--ds-space-7);margin:0}
.resource-facts>div{min-width:0}
.resource-facts dt{font-size:var(--ds-font-size-caption);color:var(--ds-color-text-secondary);margin-bottom:var(--ds-space-1)}
.resource-facts dd{margin:0;font-size:var(--ds-font-size-body-sm);overflow-wrap:anywhere}
.resource-save{margin:var(--ds-space-3) 0 0}
.resource-save:has([data-save-status]:empty){display:none}
.resource-content{min-width:0;display:flex;flex-direction:column;gap:var(--ds-space-6)}
.resource-section{min-width:0}
.resource-section+.resource-section{border-top:var(--ds-border-thin) solid var(--ds-color-border-default);padding-top:var(--ds-space-6)}
.resource-section h2{font-size:var(--ds-font-size-title-sm);line-height:var(--ds-font-line-heading);margin:0 0 var(--ds-space-4);overflow-wrap:anywhere}
.resource-section>.field+.field,.resource-section>.two-col+.field{margin-top:var(--ds-space-5)}
.resource-section .two-col{margin-top:var(--ds-space-5)}
.resource-copy{font-size:var(--ds-font-size-body);line-height:var(--ds-font-line-body);margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.resource-copy.help{font-size:var(--ds-font-size-body-sm)}
.resource-page>[data-resource-gallery]{border:0;padding-top:0}
.resource-gallery{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--ds-space-5)}
.resource-refcard{border:var(--ds-border-thin) solid var(--ds-color-border-default);border-radius:var(--ds-radius-md);overflow:hidden;min-width:0}
.resource-refcard-copy{padding:var(--ds-space-4)}
.resource-refcard h3{font-size:var(--ds-font-size-body-sm);margin:0;overflow-wrap:anywhere}
.resource-refcard h3 a{display:inline-flex;align-items:center;min-height:var(--ds-size-touch);color:var(--ds-color-action-text);text-decoration:none}
.resource-refcard h3 a:hover{text-decoration:underline}
.resource-refcard p{margin:var(--ds-space-1) 0}
.resource-media{min-width:0;overflow:hidden}
.resource-media .file-preview{height:var(--ds-size-media-lg);margin:0;border-radius:0}
.resource-refcard .resource-media .file-preview{height:var(--ds-size-media-sm)}
.resource-media :is(audio,video){max-width:100%;max-height:100%}
.resource-media-empty{padding:var(--ds-space-5);margin:0}
.resource-gallery-empty{padding:var(--ds-space-6);border:var(--ds-border-thin) dashed var(--ds-color-border-dashed);border-radius:var(--ds-radius-md);margin:0}
.resource-upload{margin-top:var(--ds-space-5)}
.resource-upload .btn{position:relative;max-width:100%;white-space:normal}
.resource-upload .btn:focus-within{outline:var(--ds-border-focus) solid var(--ds-color-action-focus);outline-offset:var(--ds-space-1)}
.resource-upload input[type=file]{position:absolute;width:100%;height:100%;inset:0;opacity:0;clip:auto;clip-path:none;cursor:pointer}
.resource-upload .btn.disabled{opacity:var(--ds-opacity-disabled);cursor:default}
.resource-upload .btn.disabled input{cursor:default}
.resource-upload .help{font-size:var(--ds-font-size-caption)}
.resource-danger-zone{grid-column:1/-1;border-top:var(--ds-border-thin) solid var(--ds-color-border-default);padding-top:var(--ds-space-5)}
.resource-file-details{margin-top:var(--ds-space-6)}
.resource-file-hash{overflow-wrap:anywhere}
.resource-list-identity{display:flex;align-items:center;gap:var(--ds-space-4);min-width:0}
.resource-list-identity .avatar{width:var(--ds-size-avatar-lg);height:var(--ds-size-avatar-lg);font-size:var(--ds-font-size-section)}
.resource-list-identity>div{min-width:0}
.resource-list-identity h3{margin:0;overflow-wrap:anywhere}
.resource-list-identity .help{margin:var(--ds-space-1) 0 0}
.resource-list-copy{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;overflow-wrap:anywhere}
@media(max-width:1200px){.journey-shell--resource .journey-layout{grid-template-columns:var(--ds-layout-journey-nav-compact) minmax(0,1fr);max-width:var(--ds-layout-journey-compact)}.resource-page{grid-template-columns:minmax(0,1fr)}.resource-header-main{flex-wrap:wrap}.resource-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.resource-page{gap:var(--ds-space-7)}.resource-header-main{gap:var(--ds-space-4)}.resource-identity{gap:var(--ds-space-4)}.resource-page h1{font-size:var(--ds-font-size-heading-sm)}.resource-identity .resource-facts{gap:var(--ds-space-3) var(--ds-space-5)}.resource-header-action{width:100%}.resource-header-action .btn{width:100%}.resource-content{gap:var(--ds-space-7)}.resource-section+.resource-section{padding-top:var(--ds-space-7)}.resource-gallery{grid-template-columns:minmax(0,1fr)}}
@media(forced-colors:active){.resource-upload .btn:focus-within{outline-color:Highlight}}

.resource-page[data-resource-page=references]{grid-template-columns:minmax(0,1fr)}

/* Contextual conversation and unified composer, shared by app and catalogue. */
.assistant-panel{position:fixed;inset-block-start:var(--ds-space-4);inset-block-end:var(--ds-space-4);inset-inline-start:auto;inset-inline-end:var(--ds-space-4);margin:0;width:min(var(--ds-layout-form-wide),calc(100vw - var(--ds-space-8)));height:calc(100dvh - var(--ds-space-8));max-height:calc(100dvh - var(--ds-space-8));display:flex;flex-direction:column;padding:0;overflow:hidden;background:var(--ds-color-surface-panel);border:var(--ds-border-thin) solid var(--ds-color-border-default);border-radius:var(--ds-radius-dialog);box-shadow:var(--ds-shadow-dialog);z-index:var(--ds-layer-navigation);min-width:0}
.assistant-panel:not([open]){display:none}
.assistant-panel [hidden]{display:none}
.assistant-heading{display:flex;align-items:center;gap:var(--ds-space-3);padding:var(--ds-space-4);border-block-end:var(--ds-border-thin) solid var(--ds-color-border-default);flex:none;min-width:0;max-height:30%;overflow:auto;overscroll-behavior:contain}
.assistant-heading>div{min-width:0;flex:1}
.assistant-heading h2{font-size:var(--ds-font-size-body);font-weight:var(--ds-font-weight-bold);line-height:var(--ds-font-line-heading);margin:0 0 var(--ds-space-1);overflow-wrap:anywhere}
.assistant-identity{display:inline-grid;place-items:center;flex:none;width:var(--ds-size-logo-sm);height:var(--ds-size-logo-sm);border-radius:var(--ds-radius-control);color:var(--ds-color-action-text);background:var(--ds-color-action-soft)}
.assistant-heading>.icon-btn{flex:none}
.assistant-close{background:transparent}
.assistant-context{font-size:var(--ds-font-size-caption);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);margin:0;overflow-wrap:anywhere}
.assistant-notice{flex:none;padding:var(--ds-space-3) var(--ds-space-4);font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);color:var(--ds-color-status-warning);background:var(--ds-color-status-warning-soft);border-block-end:var(--ds-border-thin) solid var(--ds-color-status-warning-border);overflow-wrap:anywhere}
.assistant-conversation{min-height:0;min-width:0;flex:1;overflow:auto;overflow-anchor:none;overscroll-behavior:contain;padding:var(--ds-space-5);background:var(--ds-color-surface-panel)}
.assistant-conversation:focus-visible{outline:var(--ds-border-focus) solid var(--ds-color-action-focus);outline-offset:calc(-1 * var(--ds-border-focus))}
.assistant-transcript{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--ds-space-7)}
.assistant-empty{display:flex;flex-direction:column;align-items:flex-start;gap:var(--ds-space-3);margin:0;padding:var(--ds-space-8) 0;font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);overflow-wrap:anywhere}
.assistant-empty h3{margin:0;font-size:var(--ds-font-size-lead);font-weight:var(--ds-font-weight-semibold);line-height:var(--ds-font-line-title);color:var(--ds-color-text-primary)}
.assistant-empty p{margin:0;max-width:var(--ds-layout-card-copy);font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body)}
.assistant-turn{display:flex;flex-direction:column;gap:var(--ds-space-4);min-width:0}
.assistant-message{min-width:0;font-size:var(--ds-font-size-body);line-height:var(--ds-font-line-body);overflow-wrap:anywhere}
.assistant-message--user{align-self:flex-end;max-width:calc(100% - var(--ds-space-6));background:var(--ds-color-surface-subtle);padding:var(--ds-space-3) var(--ds-space-4);border-radius:var(--ds-radius-card)}
.assistant-message--agent{padding:0}
.assistant-message-meta{display:flex;flex-wrap:wrap;gap:var(--ds-space-1) var(--ds-space-2);font-size:var(--ds-font-size-caption);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);margin:0 0 var(--ds-space-2)}
.assistant-message-meta strong{font-weight:var(--ds-font-weight-semibold);color:var(--ds-color-text-primary)}
.assistant-message-copy{white-space:pre-wrap;margin:0 0 var(--ds-space-2);font-size:var(--ds-font-size-body);line-height:var(--ds-font-line-body);overflow-wrap:anywhere}
.assistant-message-copy:last-child{margin-block-end:0}
.assistant-message-files{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--ds-space-2);font-size:var(--ds-font-size-small);color:var(--ds-color-text-primary)}
.assistant-message-files small,.assistant-attachments small{display:block;font-size:var(--ds-font-size-caption);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);margin-block-start:var(--ds-space-1)}
.assistant-turn-status,.assistant-turn-error,.assistant-history-error{font-size:var(--ds-font-size-caption);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);margin:0 0 var(--ds-space-2);overflow-wrap:anywhere}
.assistant-turn-status--attention{font-size:var(--ds-font-size-small);color:var(--ds-color-status-warning)}
.assistant-turn-error,.assistant-history-error{font-size:var(--ds-font-size-small);color:var(--ds-color-status-danger)}
.assistant-warnings{font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);color:var(--ds-color-status-warning);margin:var(--ds-space-3) 0;padding-inline-start:var(--ds-space-5);overflow-wrap:anywhere}
.assistant-changes{margin:var(--ds-space-3) 0 0;padding:0;border:0;font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body)}
.assistant-changes summary{cursor:pointer;min-height:var(--ds-size-touch);padding-block:var(--ds-space-2);font-weight:var(--ds-font-weight-semibold);color:var(--ds-color-text-primary)}
.assistant-changes ul{margin:0;padding-inline-start:var(--ds-space-5)}
.assistant-changes li{padding-block:var(--ds-space-1)}
.assistant-changes .text-btn{font-size:var(--ds-font-size-small);font-weight:var(--ds-font-weight-medium);padding:0;white-space:normal}
.assistant-message>.text-btn,.assistant-older{font-size:var(--ds-font-size-small);white-space:normal;text-align:start}
.assistant-composer{display:flex;flex-direction:column;flex:0 1 auto;min-width:0;min-height:calc(var(--ds-size-touch) * 2);padding:var(--ds-space-3) var(--ds-space-5) var(--ds-space-5);background:var(--ds-color-surface-panel);max-height:50%;border-block-start:var(--ds-border-thin) solid var(--ds-color-border-default);overflow:visible}
.assistant-compose-box{display:flex;flex-direction:column;flex:1;min-height:0;border:var(--ds-border-thin) solid var(--ds-color-border-input);border-radius:var(--ds-radius-card);background:var(--ds-color-surface-panel);padding:var(--ds-space-2);min-width:0}
.assistant-compose-box:focus-within{border-color:var(--ds-color-action-focus);outline:var(--ds-border-strong) solid var(--ds-color-action-focus);outline-offset:calc(-1 * var(--ds-border-strong))}
.assistant-compose-box textarea{display:block;width:100%;min-height:var(--ds-size-control-lg);max-height:var(--ds-layout-text-area-max);field-sizing:content;flex:1;flex-shrink:1;padding:var(--ds-space-2);margin:0;border:0;border-radius:0;background:transparent;color:var(--ds-color-text-primary);font-family:var(--ds-font-family-sans);font-size:var(--ds-font-size-body);line-height:var(--ds-font-line-body);resize:none;overflow:auto;box-shadow:none}
.assistant-compose-box textarea::placeholder{color:var(--ds-color-text-placeholder);opacity:1}
.assistant-compose-box textarea:focus-visible{outline:none;box-shadow:none}
.assistant-compose-box:has(textarea[readonly]){background:var(--ds-color-surface-canvas)}
.assistant-composer-actions,.assistant-outbox-actions{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--ds-space-2);min-width:0}
.assistant-composer-actions{align-items:center;flex:none}
.assistant-material-tools{display:flex;align-items:center;gap:var(--ds-space-2);flex:1;flex-wrap:wrap;min-width:0}
.assistant-attach{display:inline-flex;align-items:center;justify-content:center;width:var(--ds-size-touch);height:var(--ds-size-touch);padding:0;color:var(--ds-color-text-secondary)}
.assistant-attach:hover{color:var(--ds-color-action-text)}
.assistant-attach>.icon{width:var(--ds-size-icon);height:var(--ds-size-icon)}
.assistant-send{width:var(--ds-size-touch);height:var(--ds-size-touch);background:var(--ds-color-action-primary);color:var(--ds-color-text-inverse);border-radius:var(--ds-radius-control)}
.assistant-send:hover{background:var(--ds-color-action-hover)}
.assistant-send:disabled{background:var(--ds-color-surface-subtle);color:var(--ds-color-text-secondary);opacity:1;cursor:not-allowed}
.assistant-send[aria-busy=true]>.icon{opacity:var(--ds-opacity-disabled)}
.assistant-outbox-actions{justify-content:flex-start;flex-wrap:wrap;margin-block-start:var(--ds-space-2)}
.assistant-outbox-actions>.text-btn{font-size:var(--ds-font-size-small);white-space:normal;text-align:start}
.assistant-attachments{list-style:none;margin:0;padding:0 var(--ds-space-2);min-width:0;flex:none;max-height:var(--ds-size-control-lg);overflow:auto;overscroll-behavior:contain}
.assistant-attachments:empty{display:none}
.assistant-attachments li{display:flex;align-items:center;gap:var(--ds-space-2);margin-block-start:0;padding:0 var(--ds-space-2);background:var(--ds-color-surface-canvas);border-radius:var(--ds-radius-sm);font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);min-width:0}
.assistant-attachments li>span{flex:1;min-width:0;overflow-wrap:anywhere}
.assistant-attachments .icon-btn{flex:none}
.assistant-input-error{font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);margin:var(--ds-space-2) 0;color:var(--ds-color-status-danger);overflow-wrap:anywhere}
.assistant-live{flex:none;font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);padding:var(--ds-space-3) var(--ds-space-4);margin:0;color:var(--ds-color-text-secondary);background:var(--ds-color-surface-panel);overflow-wrap:anywhere}
.assistant-live:empty{display:none}
.assistant-new-messages{flex:none;align-self:center;font-size:var(--ds-font-size-small);white-space:normal}
.assistant-panel--drop{outline:var(--ds-border-focus) solid var(--ds-color-action-focus);outline-offset:calc(-1 * var(--ds-border-focus))}
.assistant-launcher,.assistant-trigger{font-size:var(--ds-font-size-small);white-space:normal;min-height:var(--ds-size-touch);max-width:100%;gap:var(--ds-space-2)}
@media(max-width:760px){.assistant-panel{inset:0;width:100%;height:100dvh;max-width:100%;max-height:100dvh;margin:0;border:0;border-radius:0}.assistant-conversation{padding:var(--ds-space-4)}.assistant-composer{padding:0 var(--ds-space-4) var(--ds-space-4)}.assistant-live,.assistant-notice{padding:var(--ds-space-3) var(--ds-space-4)}.assistant-empty{margin:auto 0}}
@media(prefers-reduced-motion:reduce){.assistant-panel *{scroll-behavior:auto;transition:none}}
@media(forced-colors:active){.assistant-panel,.assistant-message--user,.assistant-attachments li,.assistant-compose-box{border:var(--ds-border-thin) solid CanvasText}.assistant-panel--drop,.assistant-conversation:focus-visible,.assistant-compose-box:focus-within{outline-color:Highlight}.assistant-compose-box textarea{border:0}.assistant-send,.assistant-send:disabled{background:ButtonFace;color:ButtonText;border:var(--ds-border-thin) solid ButtonText}.assistant-identity{color:CanvasText;background:Canvas}}

/* A single companion lives beside native controls, never over the wide editor. */
.journey-layout.journey-layout--assistant,.journey-shell--reading .journey-layout.journey-layout--assistant,.journey-shell--resource .journey-layout.journey-layout--assistant{grid-template-columns:var(--ds-layout-journey-nav) minmax(0,1fr) var(--ds-layout-assistant);max-width:var(--ds-layout-journey);gap:var(--ds-space-7)}
.journey-layout--assistant>.journey-main{grid-column:2;grid-row:1}
.workspace-assistant-slot{grid-column:3;grid-row:1;position:sticky;top:var(--ds-space-6);min-width:0;border-inline-start:var(--ds-border-thin) solid var(--ds-color-border-default);padding-inline-start:var(--ds-space-6)}
.assistant-host--docked{min-width:0;width:100%}
.assistant-host--docked[hidden]{display:none}
.assistant-panel.assistant-panel--inline{--assistant-available-height:calc(100dvh - var(--ds-layout-header-journey) - var(--ds-space-10));position:relative;inset:auto;margin:0;width:100%;max-width:100%;height:var(--assistant-available-height);max-height:var(--assistant-available-height);border:var(--ds-border-thin) solid var(--ds-color-border-default);border-radius:var(--ds-radius-card);background:var(--ds-color-surface-panel);box-shadow:var(--ds-shadow-card);z-index:auto}
.assistant-panel .assistant-heading,.assistant-panel .assistant-composer{flex:0 1 auto;min-height:var(--ds-size-touch)}
.assistant-panel .assistant-conversation{min-height:var(--ds-size-touch)}
.assistant-panel .assistant-notice,.assistant-panel .assistant-live{flex:0 1 auto;min-height:0;max-height:20%;overflow:auto;overscroll-behavior:contain}
.assistant-inline-launcher{display:flex;flex-direction:column;align-items:stretch;gap:var(--ds-space-2);width:100%;min-height:var(--ds-size-touch);border:var(--ds-border-thin) solid var(--ds-color-border-default);border-radius:var(--ds-radius-card);padding:var(--ds-space-4);background:var(--ds-color-surface-panel);color:var(--ds-color-text-primary);font-family:var(--ds-font-family-sans);font-size:var(--ds-font-size-body);line-height:var(--ds-font-line-body);text-align:start;cursor:pointer;min-width:0}
.assistant-inline-launcher[hidden]{display:none}
.assistant-inline-launcher:hover{border-color:var(--ds-color-action-primary);background:var(--ds-color-action-soft)}
.assistant-inline-launcher:focus-visible{outline:var(--ds-border-focus) solid var(--ds-color-action-focus);outline-offset:var(--ds-space-1)}
.assistant-launcher-heading{display:flex;align-items:center;flex-wrap:wrap;gap:var(--ds-space-2);min-width:0;color:var(--ds-color-action-text)}
.assistant-launcher-heading>strong{flex:1 0 auto;max-width:100%;font-size:var(--ds-font-size-body);font-weight:var(--ds-font-weight-semibold);overflow-wrap:normal}
.assistant-launcher-open{display:inline-flex;align-items:center;flex:none;gap:var(--ds-space-1);font-size:var(--ds-font-size-small);font-weight:var(--ds-font-weight-semibold)}
.assistant-launcher-open>.icon{width:var(--ds-size-icon-sm);height:var(--ds-size-icon-sm)}
.assistant-launcher-context{font-size:var(--ds-font-size-caption);font-weight:var(--ds-font-weight-regular);color:var(--ds-color-text-secondary);overflow-wrap:anywhere}
.assistant-launcher-preview{font-size:var(--ds-font-size-small);color:var(--ds-color-text-secondary);overflow-wrap:anywhere}
.reader-scenes-host.reader-scenes-host--inline{position:static;max-height:none;overflow:visible;margin:0 0 var(--ds-space-6);border-block:var(--ds-border-thin) solid var(--ds-color-border-default);padding:var(--ds-space-2) 0;grid-column:auto;grid-row:auto}
.reader-scenes-host--inline .reader-scenes-heading{display:none}
.reader-scenes-host--inline .reader-scenes-summary{display:list-item;padding:var(--ds-space-2) var(--ds-space-1)}
.reader-scenes-host--inline .reader-scenes-nav{max-height:var(--ds-layout-scroll-panel);overflow:auto;overscroll-behavior:contain}
.assistant-catalogue-workspace{display:grid;grid-template-columns:minmax(0,1fr) var(--ds-layout-assistant);gap:var(--ds-space-7);margin-block-start:var(--ds-space-6);align-items:start;min-width:0}
.assistant-catalogue-workspace>.workspace-assistant-slot{grid-column:2}
.assistant-catalogue-editor{min-width:0}
.assistant-catalogue-editor>h3{display:flex;align-items:center;min-height:var(--ds-size-control);margin:0 0 var(--ds-space-6)}
.task-parameters{margin:var(--ds-space-6) 0 0;border-block-start:var(--ds-border-thin) solid var(--ds-color-border-default);padding-block-start:var(--ds-space-2)}
.task-parameters>summary{font-size:var(--ds-font-size-small);font-weight:var(--ds-font-weight-semibold);color:var(--ds-color-text-secondary);cursor:pointer}
.task-parameters-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--ds-space-4) var(--ds-space-6);margin:var(--ds-space-4) 0 0;min-width:0}
.task-parameters-grid>div{min-width:0}
.task-parameters-grid dt{font-size:var(--ds-font-size-caption);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary)}
.task-parameters-grid dd{font-size:var(--ds-font-size-body);line-height:var(--ds-font-line-body);color:var(--ds-color-text-primary);margin:var(--ds-space-1) 0 0;overflow-wrap:anywhere}
.workspace-save-status{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);margin:0;overflow-wrap:anywhere}
.journey-shell--workspace .resource-save{display:none}
/* A library is a canvas of saved works, not a form wrapped around more cards. */
.journey-card.journey-card--collection{padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;min-width:0}
.work-collection{min-width:0}
.work-collection-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--ds-space-5);min-height:var(--ds-size-control);margin:0 0 var(--ds-space-6);min-width:0}
.work-collection-heading>div{min-width:0}
.work-collection-kind{margin:0 0 var(--ds-space-2);color:var(--ds-color-text-secondary);font-size:var(--ds-font-size-caption);font-weight:var(--ds-font-weight-medium);line-height:var(--ds-font-line-body);overflow-wrap:anywhere}
.work-collection-title{display:flex;align-items:center;gap:var(--ds-space-3);min-width:0}
.work-collection .work-collection-title h1{font-size:var(--ds-font-fluid-journey);font-weight:var(--ds-font-weight-bold);line-height:var(--ds-font-line-heading);letter-spacing:var(--ds-font-tracking-heading);margin:0;min-width:0;overflow-wrap:anywhere;outline:none}
.work-collection-count{display:inline-grid;place-items:center;min-width:var(--ds-size-step);min-height:var(--ds-size-step);padding:var(--ds-space-1);background:var(--ds-color-surface-subtle);border-radius:var(--ds-radius-sm);color:var(--ds-color-text-secondary);font-size:var(--ds-font-size-small);font-weight:var(--ds-font-weight-medium);line-height:var(--ds-font-line-solid)}
.work-collection-new{max-width:100%;white-space:normal;min-height:var(--ds-size-control);padding-block:var(--ds-space-2-5);text-align:start}
.work-collection-list{display:flex;flex-direction:column;gap:var(--ds-space-4);list-style:none;margin:0;padding:0;min-width:0}
.work-collection-item{min-width:0}
.work-card{display:block;padding: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-card);color:var(--ds-color-text-primary);text-decoration:none;min-width:0;min-height:var(--ds-size-touch);overflow-wrap:anywhere}
a.work-card:hover{border-color:var(--ds-color-border-strong);box-shadow:var(--ds-shadow-card-hover)}
a.work-card:hover .work-card-title{color:var(--ds-color-action-text)}
a.work-card:focus-visible{outline:var(--ds-border-focus) solid var(--ds-color-action-focus);outline-offset:var(--ds-space-1)}
.work-card-meta{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--ds-space-2) var(--ds-space-4);flex-wrap:wrap;font-size:var(--ds-font-size-caption);font-weight:var(--ds-font-weight-medium);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);margin:0 0 var(--ds-space-3)}
.work-card-meta>span{min-width:0;overflow-wrap:anywhere}
.work-card-status{display:inline-flex;align-items:baseline;gap:var(--ds-space-2);color:var(--ds-color-text-secondary)}
.work-card-status::before{content:"";display:inline-block;flex:none;width:var(--ds-size-dot);height:var(--ds-size-dot);border-radius:var(--ds-radius-round);background:currentColor}
.work-card[data-state=ready] .work-card-status{color:var(--ds-color-status-success)}
.work-card[data-state=failed] .work-card-status{color:var(--ds-color-status-danger)}
.work-card[data-state=needs_revision] .work-card-status{color:var(--ds-color-status-warning)}
.work-card[data-state=running] .work-card-status,.work-card[data-state=queued] .work-card-status{color:var(--ds-color-action-text)}
.work-card-title{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--ds-space-5);font-size:var(--ds-font-size-section);font-weight:var(--ds-font-weight-bold);line-height:var(--ds-font-line-title);letter-spacing:var(--ds-font-tracking-title);margin:0;min-width:0}
.work-card-title>span{min-width:0;overflow-wrap:anywhere}
.work-card-title>.icon{flex:none;width:var(--ds-size-icon);height:var(--ds-size-icon);margin-block-start:var(--ds-space-1);color:var(--ds-color-action-text)}
.work-card-excerpt{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;overflow-wrap:anywhere;font-size:var(--ds-font-size-body-sm);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);margin:var(--ds-space-2) 0 0}
.work-collection-empty{padding:var(--ds-space-8) var(--ds-space-6);background:var(--ds-color-surface-panel);border:var(--ds-border-thin) dashed var(--ds-color-border-dashed);border-radius:var(--ds-radius-card)}
.work-collection-empty h2{font-size:var(--ds-font-size-section);font-weight:var(--ds-font-weight-semibold);line-height:var(--ds-font-line-title);margin:0 0 var(--ds-space-3)}
.work-collection-empty p{font-size:var(--ds-font-size-body);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);margin:0;max-width:var(--ds-layout-lead)}
@media(max-width:760px){.work-collection-heading{align-items:flex-start;gap:var(--ds-space-4)}.work-card{padding:var(--ds-space-5)}.work-card-title{gap:var(--ds-space-3)}.work-card-meta{gap:var(--ds-space-2);margin-block-end:var(--ds-space-3)}.work-collection-empty{padding:var(--ds-space-6) var(--ds-space-5)}}
@media(forced-colors:active){.work-card,.work-collection-empty{border-color:CanvasText}.work-collection-count{border:var(--ds-border-thin) solid CanvasText}.work-card-status::before{background:CanvasText}a.work-card:focus-visible{outline-color:Highlight}.workspace-assistant-slot{border-color:CanvasText}}
@media(max-width:1200px){.journey-layout.journey-layout--assistant,.journey-shell--reading .journey-layout.journey-layout--assistant,.journey-shell--resource .journey-layout.journey-layout--assistant{grid-template-columns:var(--ds-layout-journey-nav-compact) minmax(0,1fr);max-width:var(--ds-layout-journey-compact)}.workspace-assistant-slot{grid-column:2;grid-row:1;position:static;width:100%;border:0;padding:0}.journey-layout--assistant>.journey-main{grid-column:2;grid-row:2}.journey-layout--assistant>.workspace-navigation{grid-row:1/3}.assistant-catalogue-workspace{display:flex;flex-direction:column}.assistant-catalogue-editor{width:100%}}
@media(max-width:760px){.journey-layout.journey-layout--assistant,.journey-shell--reading .journey-layout.journey-layout--assistant,.journey-shell--resource .journey-layout.journey-layout--assistant{display:flex}.journey-layout--assistant>.workspace-assistant-slot{order:1}.journey-layout--assistant>.journey-main{order:2}.assistant-inline-launcher{padding:var(--ds-space-3) var(--ds-space-4)}}
@media(max-width:760px){.task-parameters-grid{grid-template-columns:minmax(0,1fr)}}
@media(forced-colors:active){.assistant-inline-launcher{border-color:CanvasText}.assistant-inline-launcher:focus-visible{outline-color:Highlight}}
.text-btn.danger{color:var(--ds-color-status-danger)}
.text-btn.danger:hover{color:var(--ds-color-status-danger-hover)}

/* Shared choice cards: the native control belongs beside its short title. */
.option--choice{display:grid;grid-template-columns:var(--ds-size-icon-sm) minmax(0,1fr);align-content:start;column-gap:var(--ds-space-3);row-gap:var(--ds-space-2)}
.option--choice>input{grid-column:1;grid-row:1;align-self:center;width:var(--ds-size-icon-sm);height:var(--ds-size-icon-sm)}
.option--choice>strong{grid-column:2;grid-row:1;overflow-wrap:normal}
.option--choice>small{grid-column:2;grid-row:2;overflow-wrap:normal}

/* Document values stay readable; editing reveals the original shared controls. */
.document-field{display:flex;flex-direction:column;gap:0;min-width:0}
.document-field [hidden]{display:none}
.document-field-heading{display:flex;flex-wrap:wrap;gap:var(--ds-space-3);align-items:center;min-height:var(--ds-size-touch)}
.document-field-label{flex:1 1 min-content;min-width:0;max-width:100%;font-size:var(--ds-font-size-small);font-weight:var(--ds-font-weight-semibold);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);overflow-wrap:break-word}
.document-edit{flex:none;margin-inline-start:auto;background:none;color:var(--ds-color-text-secondary);border-radius:var(--ds-radius-control);transition:opacity var(--ds-motion-fast),background var(--ds-motion-fast),color var(--ds-motion-fast)}
.document-edit:hover{background:var(--ds-color-surface-hover);color:var(--ds-color-action-text)}
.document-read{min-width:0}
.document-value{margin:0;font-size:var(--ds-font-size-body);font-weight:var(--ds-font-weight-regular);line-height:var(--ds-font-line-relaxed);color:var(--ds-color-text-primary);white-space:pre-wrap;overflow-wrap:anywhere}
.document-add{color:var(--ds-color-action-text);padding-block:0;justify-content:flex-start}
.document-editor{display:flex;flex-direction:column;gap:var(--ds-space-3);min-width:0}
.document-editor-actions{display:flex;justify-content:flex-end;gap:var(--ds-space-3)}
.document-done{color:var(--ds-color-action-text)}
.document-error{margin:0;font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);font-weight:var(--ds-font-weight-regular);color:var(--ds-color-status-danger);overflow-wrap:anywhere}
.fields.document-fields-stack{gap:var(--ds-space-4)}
.journey-card .document-fields-stack>.profile-age,.journey-card .document-fields-stack>details{margin:0}
.journey-card .document-fields-stack>.profile-age{max-width:none}
.document-fields-stack>.profile-age .document-editor>.select-control{max-width:var(--ds-layout-field-compact)}
@media(hover:hover) and (pointer:fine){.document-edit{opacity:0}.document-field:hover>.document-field-heading>.document-edit,.document-field:focus-within>.document-field-heading>.document-edit{opacity:1}}
@media(max-width:760px){.document-value{font-size:var(--ds-font-size-body)}}
@media(prefers-reduced-motion:reduce){.document-edit{transition:none}}
@media(forced-colors:active){.document-edit{opacity:1;color:ButtonText}.document-edit:focus-visible{outline-color:Highlight}.document-add,.document-done{color:LinkText}.document-error{color:CanvasText}}

/* One local navigation owns material destinations and the scene picker. */
.work-navigation{position:sticky;top:0;z-index:var(--ds-layer-navigation);background:var(--ds-color-surface-panel);border-bottom:var(--ds-border-thin) solid var(--ds-color-border-default);padding-block:var(--ds-space-2);margin-bottom:var(--ds-space-6)}
.work-navigation>.reader-toolbar{border:0;padding:0;margin:0}
.reader-tools{display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:var(--ds-space-3);margin-bottom:var(--ds-space-6)}
.reader-tools>.reader-menu{margin:0;border:0;padding:0}
.work-context{font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);overflow-wrap:anywhere;margin:0 0 var(--ds-space-3)}
.work-materials{margin-top:var(--ds-space-6)}
.reader-scenes-host.reader-scenes-host--sticky{position:relative;top:auto;max-height:none;margin:var(--ds-space-2) 0 0;padding:0;border:0;overflow:visible}
.reader-scenes-host--sticky .reader-scenes-summary{display:flex;align-items:center;gap:var(--ds-space-3);padding:var(--ds-space-2) var(--ds-space-3);list-style:none;font-size:var(--ds-font-size-small);border-radius:var(--ds-radius-sm);color:var(--ds-color-text-secondary)}
.reader-scenes-host--sticky .reader-scenes-summary::-webkit-details-marker{display:none}
.reader-scenes-title{flex:none}
.reader-scenes-current-name{min-width:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:var(--ds-font-weight-regular)}
.reader-scenes-chevron{display:flex;align-items:center;justify-content:center;flex:none;margin-inline-start:auto}
.reader-scenes-host--sticky .reader-scenes-summary:hover,.reader-scenes-host--sticky details[open]>.reader-scenes-summary{background:var(--ds-color-surface-hover);color:var(--ds-color-text-primary)}
.reader-scenes-host--sticky details[open]>.reader-scenes-summary{margin-bottom:0}
.reader-scenes-host--sticky .reader-scenes-nav{position:absolute;inset-inline:0;top:calc(100% + var(--ds-space-2));z-index:var(--ds-layer-navigation);--reader-available-height:50dvh;max-height:min(var(--ds-layout-scroll-panel),calc(var(--reader-available-height) - var(--ds-space-2)));overflow:auto;overscroll-behavior:contain;background:var(--ds-color-surface-panel);border:var(--ds-border-thin) solid var(--ds-color-border-default);border-radius:var(--ds-radius-md);padding:var(--ds-space-2);box-shadow:var(--ds-shadow-card-hover)}
.reader-scenes-host--sticky .reader-scenes[open]>.reader-scenes-summary>.reader-scenes-chevron{transform:rotate(180deg)}
@media(max-width:760px){.reader-tools{justify-content:flex-start;gap:var(--ds-space-2)}.reader-scenes-host--sticky .reader-scenes-summary{gap:var(--ds-space-2);padding-inline:var(--ds-space-1);flex-wrap:wrap}.reader-scenes-host--sticky .reader-scenes-current-name{display:none}.reader-scenes-host--sticky .reader-scenes-title{flex:1;min-width:0;overflow-wrap:anywhere}.work-navigation .story-view-tabs{gap:var(--ds-space-1)}.work-navigation .story-view-tab{font-size:var(--ds-font-size-small);padding-inline:var(--ds-space-1)}}
@media(forced-colors:active){.work-navigation{border-color:CanvasText}.reader-scenes-host--sticky .reader-scenes-nav{border-color:CanvasText}}

.reader-catalogue-layout--local{display:block}

.reader-tools>.reader-download{min-width:0;max-width:100%;white-space:normal;text-align:start;overflow-wrap:anywhere}
.reader-tools>.reader-download>.icon{flex:none}

.work-materials .reader-disclosure[open]>summary{margin-bottom:0}
.work-materials .reader-content .reader-document>:last-child{margin-bottom:0}

/* v057: project resources or work materials in the same contextual sidebar.
   The document and its single composer share the available viewport. */
.journey-shell--workspace{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.journey-shell--workspace>.journey-header{flex:none}
.journey-shell--workspace>.journey-layout.journey-layout--assistant{flex:1;min-height:0;width:100%;grid-template-columns:var(--ds-layout-journey-nav) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;max-width:var(--ds-layout-workspace);padding:var(--ds-space-6) var(--ds-space-8);gap:var(--ds-space-4) var(--ds-space-7)}
.journey-layout--assistant>.workspace-navigation{grid-column:1;grid-row:1/3;max-height:100%;min-height:0}
.journey-shell--workspace .journey-layout--assistant>.journey-main{grid-column:2;grid-row:1;align-self:stretch;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-block-end:0}
.journey-shell--workspace .workspace-assistant-slot{grid-column:2;grid-row:2;position:static;min-width:0;border:0;padding:0}
.journey-shell--workspace .journey-card{box-shadow:none}
.workspace-navigation .story-view-tabs{display:flex;flex-direction:column;gap:var(--ds-space-1);margin:0}
.workspace-navigation .story-view-tab{display:block;min-height:var(--ds-size-touch);padding:var(--ds-space-2-5) var(--ds-space-3);border-radius:var(--ds-radius-md);font-size:var(--ds-font-size-body-sm)}
.workspace-work-scope{margin:0 var(--ds-space-3) var(--ds-space-1);font-size:var(--ds-font-size-caption);color:var(--ds-color-text-secondary)}
.workspace-work-title{font-size:var(--ds-font-size-body);line-height:var(--ds-font-line-body);padding:var(--ds-space-2) var(--ds-space-3);margin:0 0 var(--ds-space-4);overflow-wrap:anywhere}
.workspace-work-switcher{margin:0 0 var(--ds-space-4)}
.workspace-work-switcher>summary{display:flex;justify-content:space-between;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-body);font-weight:var(--ds-font-weight-semibold);line-height:var(--ds-font-line-body);cursor:pointer;overflow-wrap:anywhere}
.workspace-work-switcher>summary>.icon{flex:none}
.workspace-work-switcher>summary:focus-visible{outline:var(--ds-border-focus) solid var(--ds-color-action-text);outline-offset:calc(-1 * var(--ds-border-focus))}
.assistant-panel.assistant-panel--compact{height:auto;max-height:none;min-height:0;background:transparent;border:0;border-radius:0;box-shadow:none}
.assistant-panel--compact .assistant-composer{padding:0;max-height:var(--ds-layout-scroll-panel);border:0;background:transparent}
.assistant-panel--compact .assistant-live,.assistant-panel--compact .assistant-notice{margin:0;padding:var(--ds-space-2);font-size:var(--ds-font-size-caption)}
.assistant-panel--compact .assistant-live:empty{display:none}
.assistant-panel--compact .assistant-compose-box textarea{min-height:var(--ds-size-touch);max-height:var(--ds-layout-textarea);font-size:var(--ds-font-size-body)}
.assistant-history-toggle{font-size:var(--ds-font-size-small);color:var(--ds-color-action-text);min-height:var(--ds-size-touch);margin:0;padding:0 var(--ds-space-2)}
.assistant-panel:not(.assistant-panel--compact) .assistant-history-toggle{display:none}
@media(min-width:1200px) and (min-height:701px){
 .journey-shell--workspace>.journey-layout.journey-layout--chat{grid-template-columns:var(--ds-layout-journey-nav-compact) minmax(0,1fr) var(--ds-layout-assistant);max-width:var(--ds-layout-journey)}
 .journey-layout--chat>.workspace-navigation{grid-row:1/3}
 .journey-shell--workspace .journey-layout--chat>.journey-main{grid-row:1/3}
 .journey-shell--workspace .journey-layout--chat>.workspace-assistant-slot{grid-column:3;grid-row:1/3;align-self:stretch;border:0;padding:0}
 .journey-layout--chat .assistant-host--docked{height:100%}
 .journey-layout--chat .assistant-panel.assistant-panel--inline{height:100%;max-height:100%}
}
@media(max-width:1199px){.journey-shell--workspace>.journey-layout.journey-layout--assistant{grid-template-columns:var(--ds-layout-journey-nav-compact) minmax(0,1fr);max-width:var(--ds-layout-journey-compact)}}
@media(max-width:760px){
 .journey-shell--workspace>.journey-layout.journey-layout--assistant{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;padding:var(--ds-space-3) var(--ds-space-4);gap:var(--ds-space-3)}
 .journey-shell--workspace .workspace-mobile-navigation{grid-column:1;grid-row:1}
 .journey-shell--workspace .journey-layout--assistant>.journey-main{grid-column:1;grid-row:2}
 .journey-shell--workspace .workspace-assistant-slot{grid-column:1;grid-row:3}
 .assistant-panel.assistant-panel--compact{inset:auto;width:100%;height:auto;margin:0;border:0;border-radius:0}
 .assistant-panel--compact .assistant-compose-box textarea{font-size:var(--ds-font-size-body)}
}
.journey-shell--workspace .journey-header-inner{max-width:var(--ds-layout-workspace)}
@media(min-width:1200px){.journey-shell--workspace:has(.journey-layout--chat) .journey-header-inner{max-width:var(--ds-layout-journey)}}
@media(max-width:1199px){.journey-shell--workspace .journey-header-inner{max-width:var(--ds-layout-journey-compact)}}
.assistant-history-toggle{display:inline-flex;align-items:center;gap:var(--ds-space-2)}
.assistant-history-toggle>.icon{width:var(--ds-size-icon);height:var(--ds-size-icon);flex:none}
/* A short viewport prioritises the document and a usable one-line composer.
   Long header content remains scrollable, including keyboard focus. */
@media(max-height:600px){
 .journey-shell--workspace>.journey-header{max-height:20dvh;overflow:auto;overscroll-behavior:contain}
 .journey-shell--workspace>.journey-layout.journey-layout--assistant{padding-block:var(--ds-space-3);row-gap:var(--ds-space-3)}
 .assistant-panel--compact .assistant-compose-box{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:var(--ds-space-2)}
 .assistant-panel--compact .assistant-compose-box textarea{height:var(--ds-size-control-lg);min-height:var(--ds-size-touch);max-height:var(--ds-size-control-lg)}
 .assistant-panel--compact .assistant-composer-actions{grid-column:2;grid-row:1}
 .assistant-panel--compact .assistant-history-toggle{width:var(--ds-size-touch);padding:0;justify-content:center}
 .assistant-panel--compact .assistant-history-name{display:none}
 .assistant-panel--compact .assistant-material-tools{flex-wrap:nowrap}
 .assistant-panel--compact .assistant-attachments{grid-column:1/-1;grid-row:2}
 .assistant-panel--compact .assistant-live{max-height:var(--ds-size-touch);overflow:auto}
}
@media(max-width:600px) and (max-height:600px){
 .assistant-panel--compact .assistant-compose-box{grid-template-columns:minmax(0,1fr)}
 .assistant-panel--compact .assistant-composer-actions{grid-column:1;grid-row:2}
 .assistant-panel--compact .assistant-compose-box textarea{height:var(--ds-size-touch);max-height:var(--ds-size-touch)}
 .assistant-panel--compact .assistant-attachments{grid-row:3}
}
.workspace-work-switcher{border:0;padding:0}
.reader-status .reader-provenance{margin:0;padding:0;border:0;min-width:0;font-size:var(--ds-font-size-small);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary)}
.reader-provenance>summary{min-height:var(--ds-size-touch);display:flex;align-items:center;padding:var(--ds-space-2);font-size:var(--ds-font-size-small);font-weight:var(--ds-font-weight-regular);cursor:pointer}
.reader-provenance[open]{flex-basis:100%}
.reader-provenance[open]>summary{margin-bottom:var(--ds-space-2)}
.assistant-panel--compact .assistant-composer{max-height:40dvh}
.assistant-panel--compact .assistant-notice{max-height:var(--ds-size-control-lg);overflow:auto}
.journey-layout--chat .assistant-panel.assistant-panel--inline[data-view=empty]{height:100%;max-height:100%}
.journey-layout--chat .assistant-panel--inline[data-view=empty] .assistant-conversation{flex:1;min-height:0}
.journey-layout--chat .assistant-panel--inline[data-view=empty] .assistant-heading{max-height:30%}
.journey-layout--chat .assistant-panel--inline[data-view=empty] .assistant-composer{max-height:50%}
html:has(#app > .journey-shell--workspace),body:has(#app > .journey-shell--workspace){height:100%;overflow:clip}
.work-navigation .reader-scenes{margin:0;border:0;padding:0}
@media(max-height:600px){
 .journey-shell--workspace>.journey-header{max-height:20dvh}
 .reader-scenes-host--sticky .reader-scenes-current-name{display:none}
 .reader-scenes-host--sticky .reader-scenes-summary{padding-block:0}
 .work-navigation{padding-block:0;margin-bottom:var(--ds-space-4)}
}

@media(max-height:600px){
 .assistant-panel:not(.assistant-panel--compact) .assistant-compose-box textarea{height:var(--ds-size-control-lg);min-height:var(--ds-size-touch);max-height:var(--ds-size-control-lg)}
}

.workspace-navigation .workspace-collection-link.workspace-nav-row{grid-template-columns:var(--ds-size-icon-sm) minmax(0,1fr)}

/* Replacing the document must not reuse a discarded browser scroll anchor.
   The application restores its explicit reading position after reconciliation. */
.journey-shell--workspace .journey-layout--assistant>.journey-main{overflow-anchor:none}

.assistant-panel .assistant-heading{align-items:flex-start}

/* v058 companion: common surface, quiet transcript and server-owned receipts. */
.assistant-panel .assistant-heading{padding:var(--ds-space-4) var(--ds-space-5);max-height:none;flex:none}
.assistant-heading>div{max-height:none;overflow:visible}
.assistant-heading .assistant-context{max-height:var(--ds-layout-header);overflow:auto}
.assistant-heading h2{font-size:var(--ds-font-size-lead)}
.assistant-conversation{padding:var(--ds-space-5)}
.assistant-request-context{font-size:var(--ds-font-size-caption);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);margin:0;overflow-wrap:anywhere}
.assistant-compose-context{font-size:var(--ds-font-size-caption);line-height:var(--ds-font-line-body);color:var(--ds-color-text-secondary);margin:0 0 var(--ds-space-2);flex:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.assistant-panel--compact .assistant-compose-context{display:none}
.assistant-file-name{display:block;line-height:var(--ds-font-line-heading);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.assistant-input-error,.assistant-outbox-actions{flex:none;max-height:var(--ds-layout-textarea);overflow:auto;overscroll-behavior:contain}
.assistant-receipt{border:var(--ds-border-thin) solid var(--ds-color-border-default);border-radius:var(--ds-radius-md);background:var(--ds-color-surface-idea);padding:var(--ds-space-2) var(--ds-space-3);margin-block-start:var(--ds-space-4)}
.assistant-receipt ul{list-style:none;margin:0;padding:0}
.assistant-receipt .text-btn{color:var(--ds-color-action-text);min-height:var(--ds-size-touch);font-size:var(--ds-font-size-small);white-space:normal;text-align:start;padding:var(--ds-space-2) 0}
.assistant-receipt .assistant-turn-status{margin:0}
.assistant-history-notes{margin-block-start:var(--ds-space-3);font-size:var(--ds-font-size-small)}
.assistant-history-notes>summary{display:flex;align-items:center;min-height:var(--ds-size-touch);cursor:pointer;color:var(--ds-color-text-secondary)}
.assistant-suggestions{display:flex;flex-direction:column;gap:var(--ds-space-2);align-self:stretch;margin-block-start:var(--ds-space-4)}
.assistant-suggestions .text-btn{border:var(--ds-border-thin) solid var(--ds-color-border-default);border-radius:var(--ds-radius-control);padding:var(--ds-space-3);white-space:normal;text-align:start;font-size:var(--ds-font-size-small);color:var(--ds-color-text-primary)}
.assistant-suggestions .text-btn:hover{background:var(--ds-color-surface-canvas)}
@media(min-width:1600px) and (min-height:701px){.journey-shell--workspace>.journey-layout.journey-layout--chat{grid-template-columns:var(--ds-layout-journey-nav) minmax(0,1fr) var(--ds-layout-assistant-wide)}}
@media(max-width:380px){.assistant-heading>.assistant-identity{display:none}}
@media(max-height:600px){
 .assistant-heading{padding-block:var(--ds-space-2)}
 .assistant-heading .assistant-context{display:none}
 .assistant-composer{padding-block:var(--ds-space-2);max-height:60%}
 .assistant-panel .assistant-compose-box textarea{min-height:1lh;max-height:var(--ds-space-18)}
 .assistant-attachments{max-height:var(--ds-size-touch)}
}
@media(forced-colors:active){.assistant-receipt,.assistant-suggestions .text-btn{border-color:CanvasText}.assistant-panel.assistant-panel--inline{border-color:CanvasText}}

@media(max-width:600px) and (max-height:600px){.journey-shell--workspace .journey-header .brand-name{display:none}}

body{font-size:var(--ds-font-size-body)}
.field input,.field textarea,.field select,.search-input,.journey-card input,.journey-card textarea,.journey-card select{font-size:var(--ds-font-size-body)}

/* v063: one density scale for the complete service, with 44px hit targets. */
.btn{font-weight:var(--ds-font-weight-semibold)}
.icon-btn{border-radius:var(--ds-radius-sm);background:none}
.dialog-head h2{font-size:var(--ds-font-size-lead)}
.home-header{padding-block:var(--ds-space-2)}
.home-content{padding-top:var(--ds-space-6)}
.home-content>.panel{max-width:var(--ds-layout-profile);margin-inline:auto;overflow-wrap:anywhere}
.home-content>.panel>h1{font-size:var(--ds-font-size-heading-md);overflow-wrap:anywhere}
.section-heading{margin-bottom:var(--ds-space-5);gap:var(--ds-space-4);flex-wrap:wrap}
.section-heading .actions{margin-inline-start:auto}
.project-shelf{padding-block:var(--ds-space-6)}
.project-list{gap:var(--ds-space-5)}
.project-open{border-radius:var(--ds-radius-md)}
.project-open:hover{transform:none;box-shadow:none}
.project-cover--placeholder{height:var(--ds-space-20);display:flex;align-items:center;justify-content:space-between;gap:var(--ds-space-4);padding:var(--ds-space-4) var(--ds-space-5)}
.project-cover--placeholder .cover-tag{position:static;margin:0;background:none;padding:0;color:var(--ds-color-text-primary);font-size:var(--ds-font-size-small)}
.project-monogram{font-size:var(--ds-font-size-heading-sm);font-weight:var(--ds-font-weight-semibold);line-height:var(--ds-font-line-heading);color:var(--ds-color-text-primary)}
.project-info{padding:var(--ds-space-5)}
.project-info strong{font-size:var(--ds-font-size-title-sm);font-weight:var(--ds-font-weight-bold)}
.project-info small,.project-meta{font-size:var(--ds-font-size-small)}
.journey-header-inner{padding:var(--ds-space-2) var(--ds-space-8);gap:var(--ds-space-4)}
.journey-account{gap:var(--ds-space-3)}
.journey-card .field{font-size:var(--ds-font-size-small)}
.journey-card .lead{font-size:var(--ds-font-size-body);margin-bottom:var(--ds-space-5)}
.journey-card .eyebrow{font-size:var(--ds-font-size-caption);margin-bottom:var(--ds-space-2)}
.journey-card .card-grid{gap:var(--ds-space-4)}
.journey-card .item-card{padding:var(--ds-space-4)}
.resource-list-heading h1{margin-bottom:var(--ds-space-2)}
.resource-list-heading .lead{margin:0}
.resource-list-actions{margin-top:var(--ds-space-3)}
.resource-list-actions .btn{width:auto}
.resource-header{padding-bottom:var(--ds-space-4)}
.resource-page--editing .resource-kicker{display:none}
.resource-page--editing .resource-header-action{width:auto}
.resource-page--editing .resource-header-action .btn{width:auto}
.resource-page--editing .resource-identity{align-items:center}
.resource-page--editing .resource-header-main{align-items:center}
.resource-section .field,.resource-section .document-field{font-size:var(--ds-font-size-small)}
.document-field{position:relative;gap:var(--ds-space-1)}
.document-field:has(.document-editor[hidden]){padding-inline-end:var(--ds-size-control-lg)}
.document-field-heading{gap:var(--ds-space-2);min-height:var(--ds-size-icon-lg)}
.document-field-heading>.document-edit{position:absolute;inset-inline-end:0;top:0}
.journey-card .visual-style-section{padding-block:var(--ds-space-5)}
.work-collection-heading{margin-bottom:var(--ds-space-5)}
.work-card{padding:var(--ds-space-5);border-radius:var(--ds-radius-md)}
.work-card-title{font-size:var(--ds-font-size-title-sm)}
.work-navigation{margin-bottom:var(--ds-space-4)}
.reader-heading h1{margin-bottom:var(--ds-space-3)}
.reader-logline{font-size:var(--ds-font-size-body)}
.reader-document{line-height:var(--ds-font-line-relaxed)}
.reader-document h3{font-size:var(--ds-font-size-heading-sm)}
.project-menu{margin:0;padding:0;border:0}
.journey-header:has(.reader-menu[open]){position:relative;z-index:var(--ds-layer-navigation)}
.journey-shell--workspace .journey-main{isolation:isolate}
.project-menu>summary{justify-content:center;padding:0;width:var(--ds-size-touch);height:var(--ds-size-touch);min-height:var(--ds-size-touch);border:0;list-style:none;color:var(--ds-color-text-secondary)}
.project-menu>summary::-webkit-details-marker{display:none}
.project-menu>summary>.icon{width:var(--ds-size-icon);height:var(--ds-size-icon)}
.project-menu[open]>summary{margin:0;background:var(--ds-color-surface-hover)}
.project-menu .project-menu-panel{box-shadow:var(--ds-shadow-control);inset-inline-start:auto;inset-inline-end:0;top:calc(100% + var(--ds-space-2));width:min(var(--ds-layout-journey-nav),calc(100vw - var(--ds-space-8)));max-height:calc(100dvh - var(--ds-layout-header-journey) - var(--ds-space-8));text-align:start}
.project-menu-panel .reader-menu-link{width:100%;border:0;background:none;text-align:start;font-weight:var(--ds-font-weight-medium);font-size:var(--ds-font-size-small);white-space:normal}
.project-menu-panel .reader-menu-link:hover{background:var(--ds-color-surface-hover)}
.action-menu-separator{height:var(--ds-border-thin);margin:var(--ds-space-2) var(--ds-space-3);background:var(--ds-color-border-default)}
.project-menu-panel .action-menu-danger{color:var(--ds-color-status-danger)}
.project-menu-panel .action-menu-danger:hover{background:var(--ds-color-status-danger-soft)}
.about-copy{max-width:var(--ds-layout-content)}
.about-copy h2{font-size:var(--ds-font-size-title-sm);margin-top:var(--ds-space-7)}
.about-copy p,.about-copy li{font-size:var(--ds-font-size-body);line-height:var(--ds-font-line-body)}
.about-copy details p{margin-block:var(--ds-space-3)}
@media(max-width:760px){
 .journey-header-inner{padding:var(--ds-space-2) var(--ds-space-4);gap:var(--ds-space-2)}
 .journey-card{padding:var(--ds-space-4);border-radius:var(--ds-radius-md)}
 .resource-page{gap:var(--ds-space-5)}
 .resource-content{gap:var(--ds-space-5)}
 .resource-section+.resource-section{padding-top:var(--ds-space-5)}
 .resource-page--editing .resource-portrait{display:none}
 .project-menu[open]{flex-basis:auto;width:auto}
 .project-menu .project-menu-panel{position:absolute;margin:0;box-shadow:var(--ds-shadow-control)}
 .home-content>.panel>h1{font-size:var(--ds-font-size-heading-sm)}
 .home-content>.panel{padding:var(--ds-space-5)}
}
@media(max-height:600px){
 .journey-shell--workspace>.journey-header{overflow:visible;max-height:none}
 .journey-header-inner{display:flex;flex-wrap:nowrap;min-height:var(--ds-size-touch);padding-block:var(--ds-space-1)}
 .journey-header .brand-name{display:none}
 .journey-header .brand{margin:0;flex:none}
 .journey-project{order:0;flex:1;width:auto;text-align:start;font-size:var(--ds-font-size-body);padding:0}
 .journey-account{flex:none;margin:0}
 .journey-shell--workspace .workspace-mobile-navigation{padding-block:0}
 .assistant-panel--compact .assistant-compose-box{grid-template-columns:minmax(0,1fr) auto}
 .assistant-panel--compact .assistant-composer-actions{grid-column:2;grid-row:1}
 .assistant-panel--compact .assistant-compose-box textarea{height:var(--ds-size-control-lg);max-height:var(--ds-size-control-lg)}
 .assistant-panel--compact .assistant-attachments{grid-column:1/-1;grid-row:2}
 .resource-page--editing{gap:var(--ds-space-3)}
 .resource-page--editing .resource-header{display:flex;align-items:center;justify-content:space-between;gap:var(--ds-space-3);padding-bottom:var(--ds-space-2)}
 .resource-page--editing .resource-back{font-size:0;width:var(--ds-size-touch);min-width:var(--ds-size-touch);padding:0;justify-content:center}
 .resource-page--editing .resource-header-main{margin:0;flex:1;justify-content:flex-end}
 .resource-page--editing .resource-identity{position:absolute;width:var(--ds-border-thin);height:var(--ds-border-thin);overflow:hidden;clip-path:inset(50%)}
 .resource-page--editing .resource-section h2{font-size:var(--ds-font-size-body);margin-bottom:var(--ds-space-2)}
 .resource-page--editing .resource-section:first-of-type>h2{display:none}
}
@media(forced-colors:active){
 .project-menu-panel .action-menu-danger{color:LinkText}
 .action-menu-separator{background:CanvasText}
}

@media(max-width:600px) and (max-height:600px){
 .assistant-panel--compact .assistant-compose-box{grid-template-columns:minmax(0,1fr)}
 .assistant-panel--compact .assistant-composer-actions{grid-column:1;grid-row:2}
 .assistant-panel--compact .assistant-attachments{grid-row:3}
}

.project-shelf .section-heading>h1{font-size:var(--ds-font-size-heading-sm)}

/* v064: account identity and project actions have separate, visible owners. */
.journey-project-title{max-height:2lh;overflow:auto}
.journey-project-title:focus-visible{outline:var(--ds-border-focus) solid var(--ds-color-action-focus);outline-offset:var(--ds-space-1)}
.journey-project{grid-template-columns:minmax(0,auto) var(--ds-size-touch);align-items:center;justify-content:center;gap:var(--ds-space-2)}
.account-menu{margin:0;padding:0;border:0;min-width:0;max-width:100%;color:var(--ds-color-text-primary)}
.account-menu>summary{display:flex;align-items:center;gap:var(--ds-space-2);min-width:var(--ds-size-touch);min-height:var(--ds-size-touch);max-width:100%;padding:var(--ds-space-1) var(--ds-space-2);border-radius:var(--ds-radius-sm);font-size:var(--ds-font-size-small);font-weight:var(--ds-font-weight-medium);line-height:var(--ds-font-line-body);list-style:none;cursor:pointer}
.account-menu>summary::-webkit-details-marker{display:none}
.account-menu>summary:hover,.account-menu[open]>summary{background:var(--ds-color-surface-hover)}
.account-avatar{display:flex;align-items:center;justify-content:center;width:var(--ds-space-8);height:var(--ds-space-8);flex:none;border-radius:var(--ds-radius-round);background:var(--ds-color-action-soft);color:var(--ds-color-action-text);font-size:var(--ds-font-size-caption);font-weight:var(--ds-font-weight-semibold)}
.account-name{min-width:0;max-width:var(--ds-layout-journey-nav);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-chevron{flex:none;width:var(--ds-size-icon-sm);height:var(--ds-size-icon-sm)}
.account-menu[open]{flex-basis:auto;width:auto}
.account-menu .account-menu-panel{position:absolute;margin:0;inset-inline-start:auto;inset-inline-end:0;top:calc(100% + var(--ds-space-2));width:min(var(--ds-layout-journey-nav),calc(100vw - var(--ds-space-8)));max-height:min(50dvh,calc(100dvh - var(--ds-layout-header-journey) - var(--ds-space-8)));text-align:start;box-shadow:var(--ds-shadow-control)}
.account-menu-identity{padding:var(--ds-space-2) var(--ds-space-3);font-size:var(--ds-font-size-small);font-weight:var(--ds-font-weight-semibold);line-height:var(--ds-font-line-body);overflow-wrap:anywhere}
.account-menu-panel .reader-menu-link{width:100%;border:0;background:none;text-align:start;font-size:var(--ds-font-size-small);font-weight:var(--ds-font-weight-medium);white-space:normal}
.account-menu-panel .reader-menu-link:hover{background:var(--ds-color-surface-hover)}
.home-header:has(.account-menu[open]){position:relative;z-index:var(--ds-layer-navigation)}
@media(max-width:760px){.account-menu .account-name,.account-menu .account-chevron{display:none}.account-menu>summary{justify-content:center;padding:0}.journey-project{justify-content:start}}
@media(max-width:1200px){
 .journey-header-inner{display:flex;flex-wrap:wrap}
 .journey-project{order:3;flex:0 0 100%;width:100%;max-width:100%;justify-content:start;text-align:start}
 .journey-account{margin-inline-start:auto}
 .journey-account .account-name,.journey-account .account-chevron{display:none}
 .journey-account .account-menu>summary{justify-content:center;padding:0}
}
@media(max-height:600px){.journey-header-inner{flex-wrap:nowrap}.journey-project{order:0;flex:1;width:auto}.journey-project-title{max-height:var(--ds-size-touch);overflow:auto}.journey-project{justify-content:start}.journey-account .account-name,.journey-account .account-chevron{display:none}.journey-account .account-menu>summary{justify-content:center;padding:0}}
@media(forced-colors:active){.account-avatar{border:var(--ds-border-thin) solid CanvasText;color:CanvasText}.account-menu[open]>summary{outline:var(--ds-border-thin) solid CanvasText}}

/* v066: explicit scene picker and one compact document rhythm. */
.reader-page{padding:var(--ds-space-5)}
.reader-page .work-navigation{display:flex;align-items:center;flex-wrap:wrap;gap:var(--ds-space-2) var(--ds-space-3);padding:0 0 var(--ds-space-3);margin-bottom:var(--ds-space-4)}
.reader-page .reader-tools{margin:0 0 var(--ds-space-2);gap:var(--ds-space-3);max-width:100%}
.reader-page .reader-tools .reader-menu>summary{padding-inline:0}
.reader-page .reader-logline{margin-bottom:var(--ds-space-3)}
.reader-page .reader-manuscript{margin-top:var(--ds-space-6)}
.reader-page .reader-document .reader-scene-heading{margin-bottom:var(--ds-space-3)}
.reader-scenes-host.reader-scenes-host--sticky{display:flex;align-items:center;gap:var(--ds-space-3);margin:0;flex:1;min-width:0}
.reader-scenes-host--sticky .reader-scenes{flex:none}
.reader-scenes-host--sticky .reader-scenes-summary{gap:var(--ds-space-2);padding:var(--ds-space-2) var(--ds-space-3);border:var(--ds-border-thin) solid var(--ds-color-action-soft);background:var(--ds-color-action-soft);color:var(--ds-color-action-text)}
.reader-scenes-host--sticky .reader-scenes-summary:hover,.reader-scenes-host--sticky details[open]>.reader-scenes-summary{background:var(--ds-color-surface-hover);border-color:var(--ds-color-action-text);color:var(--ds-color-action-text)}
.reader-scenes-host--sticky .reader-scenes-count{color:inherit;font-weight:var(--ds-font-weight-regular)}
.reader-scenes-host--sticky .reader-scenes-current-name{display:flex;align-items:center;gap:var(--ds-space-2);font-size:var(--ds-font-size-small);color:var(--ds-color-text-secondary)}
.reader-scenes-position{flex:none;white-space:nowrap}
.reader-scenes-name{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reader-scenes-host--sticky .reader-scenes-chevron{margin:0}
.workspace-navigation{gap:var(--ds-space-1)}
.workspace-nav-group{padding-top:var(--ds-space-3);margin-top:var(--ds-space-2)}
.workspace-navigation>.workspace-all-projects{min-height:var(--ds-size-touch)}
.workspace-work-switcher,.workspace-work-title{margin-bottom:var(--ds-space-2)}
@media(max-width:760px){.reader-page{padding:var(--ds-space-4)}.reader-scenes-host.reader-scenes-host--sticky{gap:var(--ds-space-2);flex:1 0 100%;flex-wrap:wrap}.reader-scenes-host--sticky .reader-scenes-current-name{flex:1;min-width:var(--ds-size-touch)}}
@media(forced-colors:active){.reader-scenes-host--sticky .reader-scenes-summary{border-color:ButtonText;color:ButtonText}.reader-scenes-host--sticky .reader-scenes-current-name{color:CanvasText}}

@media(max-width:760px){.reader-download-kind{display:none}}
