:root{font-family:Inter,ui-sans-serif,system-ui;color:#292620;background:#f4f1ea;--ink:#292620;--muted:#746f65;--paper:#fffdf8;--line:#ded8cc;--accent:#805d3e}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer}.shell{min-height:100vh;display:grid;grid-template-rows:56px 1fr}.top{display:flex;align-items:center;gap:6px;padding:0 12px;background:#27241f;color:#fff}.top button{padding:7px 8px;font-size:12px;white-space:nowrap}.brand{font-family:Georgia,serif;font-size:18px;white-space:nowrap;margin-right:4px}.top select{background:#3c3831;color:#fff;border:1px solid #575147;border-radius:7px;padding:7px;max-width:210px}.spacer{flex:1}.status{font-size:11px;color:#d2c7b6;white-space:nowrap}.workspace{display:grid;grid-template-columns:230px minmax(360px,1fr) 350px;min-height:0;height:calc(100vh - 56px)}.sidebar,.chat{background:#ede9e0;padding:18px;border-right:1px solid var(--line);overflow:auto}.chat{border-right:0;border-left:1px solid var(--line);display:flex;flex-direction:column}.sidebar h3,.chat h3{font:600 12px system-ui;text-transform:uppercase;letter-spacing:.1em;color:var(--muted)}.doc{display:block;width:100%;text-align:left;padding:9px;border:0;border-radius:7px;background:transparent;color:var(--ink)}.doc.active{background:var(--paper);box-shadow:0 1px 4px #00000012}.editor{display:flex;flex-direction:column;min-width:0;background:var(--paper)}.editorbar{height:54px;padding:10px 20px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px}.editorbar h2{font:20px Georgia,serif;margin:0}.save{margin-left:auto;color:var(--muted);font-size:12px}.manuscript{flex:1;border:0;resize:none;outline:0;padding:42px max(30px,10%);font:18px/1.75 Georgia,serif;color:var(--ink);background:var(--paper)}.messages{flex:1;overflow:auto}.bubble{padding:10px 12px;margin:8px 0;border-radius:10px;background:var(--paper);white-space:pre-wrap;font-size:14px;line-height:1.45}.bubble.user{background:#ddd5c7}.composer textarea{width:100%;height:82px;padding:10px;border:1px solid var(--line);border-radius:8px;resize:none}.row{display:flex;gap:8px;margin-top:8px}.row select,.row input{min-width:0;flex:1;padding:8px;border:1px solid var(--line);border-radius:7px;background:white}.primary{background:var(--accent);color:white;border:0;border-radius:7px;padding:8px 13px}.secondary{border:1px solid var(--line);background:var(--paper);border-radius:7px;padding:8px}.danger{border:0;background:#8c2f2f;color:white;border-radius:7px;padding:8px}.modal{position:fixed;inset:0;background:#0007;display:grid;place-items:center}.card{width:min(440px,92vw);background:var(--paper);border-radius:12px;padding:24px;box-shadow:0 20px 80px #0005}.card h2{font-family:Georgia,serif;margin-top:0}.field{display:block;margin:14px 0}.field span{display:block;font-size:13px;margin-bottom:5px}.field input,.field select{width:100%;padding:10px;border:1px solid var(--line);border-radius:7px}.hidden{display:none!important}.empty{color:var(--muted);font-size:13px}@media(max-width:900px){.workspace{grid-template-columns:180px 1fr}.chat{position:fixed;right:0;top:56px;bottom:0;width:min(360px,92vw);box-shadow:-10px 0 40px #0003}.chat.closed{display:none}}
.login{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at top,#fffdf8 0,#ede8dd 65%,#ddd5c7 100%)}.login-card{width:min(400px,94vw);padding:38px;background:var(--paper);border:1px solid var(--line);border-radius:16px;box-shadow:0 24px 80px #29262024}.login-mark{width:60px;height:60px;display:grid;place-items:center;margin:0 auto 18px;border-radius:14px;background:var(--accent);color:white;font:700 24px Georgia,serif}.login-card h1{margin:0;text-align:center;font:30px Georgia,serif}.login-card>p{text-align:center;color:var(--muted);margin:8px 0 24px}.login-button{width:100%;padding:11px;margin-top:8px}.login-button:disabled{opacity:.65;cursor:wait}.login-error{padding:10px 12px;border-radius:7px;background:#f5dddd;color:#7a2727;font-size:13px}
.form-note{color:var(--muted);font-size:14px}.card .login-error{margin-bottom:12px}
.text-button{display:block;margin:16px auto 0;padding:4px;border:0;background:transparent;color:var(--accent);text-decoration:underline}.check-field{display:flex;align-items:center;gap:8px;margin-top:18px}.check-field input{width:auto}.recovery-display{padding:14px;margin:16px 0 22px;border:1px dashed var(--accent);border-radius:8px;background:#f4f1ea;font:600 17px ui-monospace,monospace;letter-spacing:.04em;overflow-wrap:anywhere}
.history-card{width:min(720px,94vw);max-height:82vh;display:flex;flex-direction:column}.history-list{overflow:auto;margin:12px 0 18px}.revision{display:grid;grid-template-columns:1fr auto;gap:16px;padding:14px 0;border-top:1px solid var(--line)}.revision:first-child{border-top:0}.revision strong,.revision span{display:block}.revision span{margin-top:3px;color:var(--muted);font-size:12px}.revision p{margin:8px 0 0;color:#524d44;font-size:13px;white-space:pre-wrap;max-height:5.4em;overflow:hidden}
.password-field{position:relative}.password-field input{padding-right:44px}.password-eye{position:absolute;right:7px;bottom:6px;width:34px;height:34px;border:0;border-radius:6px;background:transparent;color:var(--accent);font-size:20px}.password-eye:hover{background:#ede9e0}
.binder-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:14px}.binder-actions button{font-size:12px}.chapter{padding:7px;margin:7px 0;border:1px solid transparent;border-radius:8px}.chapter:hover{border-color:var(--line)}.chapter-title{padding:3px 4px 7px;font-weight:700;font-size:13px;cursor:grab}.scene-list{min-height:8px}.doc.scene{padding-left:16px;font-size:13px}.reference-heading{margin-top:24px!important}.scene-meta{display:grid;grid-template-columns:minmax(180px,2fr) repeat(4,minmax(90px,1fr)) auto;gap:8px;padding:9px 20px;border-bottom:1px solid var(--line);background:#f8f5ef;align-items:end}.scene-meta label{font-size:11px;color:var(--muted)}.scene-meta input,.scene-meta select{display:block;width:100%;margin-top:3px;padding:6px;border:1px solid var(--line);border-radius:6px;background:white;color:var(--ink)}.word-progress{padding:7px 0;color:var(--muted);font-size:12px;white-space:nowrap}
@media(max-width:1200px){.scene-meta{grid-template-columns:repeat(3,1fr)}.word-progress{align-self:end}}
.plan-card{width:min(840px,94vw);max-height:90vh;overflow:auto}.plan-card .field{display:inline-block;width:calc(50% - 10px);vertical-align:top;margin-right:6px}.plan-card .field:first-of-type{width:100%}.plan-card textarea{width:100%;min-height:84px;padding:9px;border:1px solid var(--line);border-radius:7px;resize:vertical}.matrix-card{width:min(1200px,96vw);max-height:88vh}.matrix-wrap{overflow:auto;max-height:65vh;margin:14px 0}.matrix-wrap table{width:100%;border-collapse:collapse;font-size:12px}.matrix-wrap th,.matrix-wrap td{text-align:left;vertical-align:top;padding:9px;border-bottom:1px solid var(--line);max-width:220px}.matrix-wrap tbody tr{cursor:pointer}.matrix-wrap tbody tr:hover{background:#f4f1ea}.search-card{width:min(720px,94vw);max-height:84vh}.search-results{overflow:auto;max-height:55vh}.search-result{display:block;width:100%;padding:12px;text-align:left;border:0;border-top:1px solid var(--line);background:transparent}.search-result:hover{background:#f4f1ea}.search-result strong,.search-result span{display:block}.search-result span{margin-top:5px;color:var(--muted);font-size:12px;white-space:pre-wrap}
.foundation-card{width:min(1180px,96vw);max-height:92vh;overflow:auto}.foundation-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:0 16px}.foundation-grid textarea,.beat-row textarea,.directed-card textarea{width:100%;padding:8px;border:1px solid var(--line);border-radius:7px;resize:vertical}.foundation-grid textarea{min-height:70px}.lock{display:flex!important;align-items:center;gap:5px;margin-top:4px;color:var(--muted);font-size:11px!important}.lock input{width:auto!important}.framework-head{display:flex;align-items:center;justify-content:space-between;margin-top:20px}.framework-head h2{margin:0}.beat-row{display:grid;grid-template-columns:28px minmax(130px,1fr) minmax(180px,2fr) 100px 100px 150px 75px auto;gap:6px;align-items:center;padding:8px 0;border-top:1px solid var(--line)}.beat-row input,.beat-row select{width:100%;padding:7px;border:1px solid var(--line);border-radius:6px;background:white}.beat-row textarea{min-height:54px}.beat-number{font-weight:700;text-align:center}.beat-row>div{display:flex;gap:3px}.beat-row>div button{padding:5px}.directed-card{width:min(850px,94vw);max-height:88vh;overflow:auto}.directed-card textarea{min-height:150px}.directed-card #runDraft{min-height:280px}.workflow-status{display:inline-block;padding:5px 9px;border-radius:99px;background:#ede9e0;color:var(--accent);font-size:12px;text-transform:capitalize}.next-action{padding:16px;border-left:4px solid var(--accent);background:#f4f1ea}.next-action strong{font:20px Georgia,serif}.next-action p{margin-bottom:0}
@media(max-width:1000px){.foundation-grid{grid-template-columns:1fr}.beat-row{grid-template-columns:28px 1fr}.beat-row>*{grid-column:2}.beat-number{grid-column:1;grid-row:1/8}}
.canon-card,.issues-card{width:min(1100px,96vw);max-height:90vh;overflow:auto}.workspace-head{display:flex;justify-content:space-between;align-items:start;gap:16px}.workspace-head h2{margin-bottom:4px}.canon-list,.issue-list{margin:14px 0}.canon-record,.issue{padding:14px;margin:9px 0;border:1px solid var(--line);border-radius:9px;background:white}.canon-record header,.issue header{display:flex;gap:10px;align-items:center}.canon-record header strong,.issue header strong{flex:1}.canon-category,.canon-status,.issue header span{font-size:11px;text-transform:capitalize;color:var(--muted)}.canon-record blockquote,.issue blockquote{margin:10px 0;padding:8px 12px;border-left:3px solid var(--line);background:#f8f5ef;color:#575147;font-size:13px}.canon-record.approved{border-left:4px solid #4b7c55}.canon-record.locked{border-left:4px solid #344f78}.canon-record.rejected{opacity:.6}.record-warning{display:inline-block;margin-right:6px;padding:4px 7px;border-radius:5px;background:#f5e3c4;color:#764d12;font-size:11px}.ledger{margin:8px 0 16px}.ledger>div{display:grid;grid-template-columns:160px 170px 1fr;gap:8px;padding:6px;border-top:1px solid var(--line);font-size:11px}.issue.high{border-left:4px solid #a33}.issue.medium{border-left:4px solid #b7791f}.issue.low{border-left:4px solid #4b7c55}.issues-card .empty,.canon-card .empty{padding:30px;text-align:center;border:1px dashed var(--line);border-radius:8px}
.import-preview{width:min(760px,94vw);max-height:86vh;overflow:auto}.preview-outline>div{padding:9px;border-top:1px solid var(--line)}.preview-outline span{display:block;margin:4px 0 0 18px;color:var(--muted);font-size:12px}.lifecycle-card{width:min(760px,94vw);max-height:86vh;overflow:auto}.lifecycle-card article{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-top:1px solid var(--line)}.lifecycle-card article>div:first-child span{display:block;color:var(--muted);font-size:12px;text-transform:capitalize}.progress-card{width:min(680px,94vw)}.progress-total strong{font:32px Georgia,serif}.progress-track{height:10px;background:#ddd5c7;border-radius:99px;overflow:hidden}.progress-track span{display:block;height:100%;background:var(--accent)}.progress-list{margin:16px 0}.progress-list>div{display:flex;justify-content:space-between;padding:10px 0;border-top:1px solid var(--line)}.progress-list span{color:var(--muted);font-size:12px}
.template-card{width:min(980px,94vw);max-height:90vh;overflow:auto}.template-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px;margin:18px 0}.template-option{display:flex;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--line);border-radius:12px;background:#fff}.template-option h3,.template-option p{margin:0}.template-option span,.template-summary span{color:var(--muted);font-size:12px}.template-option button{margin-top:auto}.template-summary{display:flex;gap:12px;align-items:center;margin:12px 0}.file-button{display:inline-flex;align-items:center;cursor:pointer}

/* Responsive literary workspace */
:root{--ink:#26332d;--muted:#66736c;--paper:#fffefa;--surface:#f7faf5;--surface-2:#edf5ed;--line:#d9e3da;--accent:#286149;--accent-strong:#174b37;--berry:#a5485d;--gold:#d7a946;--shadow:0 16px 44px #23403118;color:var(--ink);background:var(--surface)}
:root[data-theme="dark"]{--ink:#e9f1eb;--muted:#a9b7ae;--paper:#18231e;--surface:#111a16;--surface-2:#202f27;--line:#34463b;--accent:#73ba92;--accent-strong:#91d0aa;--berry:#df8298;--gold:#e1bc68;--shadow:0 18px 48px #0008;color-scheme:dark}
body{background:var(--surface);color:var(--ink);overflow:hidden}.shell{height:100vh;min-height:0;grid-template-rows:64px minmax(0,1fr);background:var(--surface)}
.top{position:relative;z-index:20;gap:10px;padding:0 14px;background:var(--paper);color:var(--ink);border-bottom:1px solid var(--line);box-shadow:0 2px 12px #2340310d}.brand{display:flex;align-items:center;gap:8px;font-size:17px;color:var(--accent-strong)}.brand-mark{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:linear-gradient(145deg,var(--accent),var(--accent-strong));color:white;font:700 14px Georgia,serif;box-shadow:0 5px 14px #28614935}.book-picker{display:flex;flex-direction:column;gap:1px;min-width:180px}.book-picker>span{padding-left:2px;color:var(--muted);font-size:9px;letter-spacing:.08em;text-transform:uppercase}.top .book-picker select{width:clamp(160px,21vw,310px);max-width:none;padding:5px 28px 5px 8px;background:transparent;color:var(--ink);border-color:transparent;font-weight:650}.top .book-picker select:hover{background:var(--surface-2);border-color:var(--line)}
.icon-button,.top-action,.nav-direct,.quiet-action,.primary-action{min-height:36px;border:0;border-radius:9px;padding:7px 10px;background:transparent;color:var(--ink)}.icon-button:hover,.top-action:hover,.nav-direct:hover,.quiet-action:hover{background:var(--surface-2)}.primary-action{background:var(--accent);color:white}.main-nav{display:flex;align-items:center;gap:3px}.nav-menu{position:relative}.nav-menu>summary,.editor-more>summary{display:flex;align-items:center;min-height:36px;padding:7px 10px;border-radius:9px;cursor:pointer;list-style:none;font-size:13px;font-weight:600}.nav-menu>summary::-webkit-details-marker,.editor-more>summary::-webkit-details-marker{display:none}.nav-menu>summary:hover,.nav-menu[open]>summary,.editor-more>summary:hover,.editor-more[open]>summary{background:var(--surface-2)}.menu-panel{position:absolute;z-index:40;top:calc(100% + 8px);left:0;display:grid;min-width:210px;padding:7px;background:var(--paper);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}.menu-panel.menu-right{right:0;left:auto}.menu-panel button{border:0;border-radius:7px;padding:10px 12px;background:transparent;color:var(--ink);text-align:left}.menu-panel button:hover{background:var(--surface-2);color:var(--accent-strong)}.account-menu>summary{font-size:18px}.status{display:flex;align-items:center;gap:5px;color:var(--muted)}.status i{width:7px;height:7px;border-radius:50%;background:#4eaa72}.top-action{white-space:nowrap;font-size:12px}
.workspace{position:relative;grid-template-columns:260px minmax(0,1fr);height:auto;min-height:0;overflow:hidden}.sidebar,.chat{padding:16px;background:var(--surface-2);border-color:var(--line)}.sidebar{min-width:0;transition:transform .2s ease}.binder-hidden .workspace{grid-template-columns:0 minmax(0,1fr)}.binder-hidden .sidebar{visibility:hidden;transform:translateX(-100%)}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}.panel-heading span,.document-heading span{display:block;color:var(--muted);font-size:10px;letter-spacing:.1em;text-transform:uppercase}.panel-heading strong{display:block;max-width:185px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.panel-heading .icon-button{font-size:20px}.sidebar h3{margin:20px 8px 8px;font-size:10px}.doc{margin:2px 0;padding:8px 10px}.doc:hover{background:#ffffff80}.doc.active{background:var(--paper);color:var(--accent-strong);box-shadow:0 4px 14px #23403112}.chapter{padding:5px}.chapter-title{color:var(--ink)}
.editor{min-width:0;background:var(--surface)}.editorbar{height:66px;min-height:66px;padding:9px clamp(14px,3vw,30px);gap:12px;background:var(--paper);border-color:var(--line)}.document-heading{min-width:0;flex:1}.document-heading h2{margin:2px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:21px}.editor-actions{display:flex;align-items:center;gap:5px}.editor-more{position:relative}.save{flex:0 0 auto;margin-left:0;padding:5px 8px;border-radius:99px;background:var(--surface-2);font-size:11px}.writing-surface{display:flex;justify-content:center;min-height:0;flex:1;overflow:auto;padding:30px clamp(16px,5vw,64px);background:var(--surface)}.manuscript{flex:none;width:min(100%,860px);min-height:100%;height:auto;padding:clamp(30px,6vw,68px);background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:4px;box-shadow:0 10px 34px #2340310c;font:18px/1.78 Georgia,serif;resize:none}.scene-meta{grid-template-columns:minmax(160px,2fr) repeat(4,minmax(85px,1fr)) auto;padding:8px clamp(14px,3vw,30px);background:var(--paper);border-color:var(--line)}.scene-meta input,.scene-meta select,.row select,.row input,.composer textarea{background:var(--paper);color:var(--ink);border-color:var(--line)}
.chat{position:fixed;z-index:30;top:64px;right:0;bottom:0;display:flex;width:min(390px,92vw);border-left:1px solid var(--line);box-shadow:-14px 0 45px #172a201f;transition:transform .2s ease}.chat.closed{display:flex;visibility:hidden;transform:translateX(100%)}.messages{padding:4px}.bubble{background:var(--paper);color:var(--ink)}.bubble.user{background:#dcecdf}.composer{padding-top:10px}.composer textarea{height:110px}.modal{z-index:60;background:#10241a80;backdrop-filter:blur(4px)}.card,.template-option,.canon-record,.issue{background:var(--paper);color:var(--ink);border-color:var(--line)}.secondary{background:var(--paper);color:var(--ink);border-color:var(--line)}.primary{background:var(--accent)}
.focus-mode{grid-template-rows:0 minmax(0,1fr)}.focus-mode .sidebar,.focus-mode .chat,.focus-mode .scene-meta{display:none}.focus-mode .top{position:fixed;top:12px;right:12px;display:flex;width:auto;height:auto;padding:0;background:transparent;border:0;box-shadow:none}.focus-mode .top>*{display:none}.focus-mode .top #focusMode{display:block;background:var(--paper);border:1px solid var(--line);box-shadow:var(--shadow)}.focus-mode .workspace{height:100vh;grid-template-columns:1fr}.focus-mode .editorbar{position:absolute;z-index:4;top:10px;left:50%;width:min(860px,calc(100% - 24px));transform:translateX(-50%);border:0;border-radius:12px;background:color-mix(in srgb,var(--paper) 88%,transparent);box-shadow:0 6px 24px #23403112}.focus-mode .editor-actions>*:not(#scenePlan),.focus-mode .save{display:none}.focus-mode .writing-surface{padding-top:92px}
:root[data-theme="dark"] .doc:hover{background:#ffffff0a}:root[data-theme="dark"] .doc.active{background:var(--paper)}:root[data-theme="dark"] .manuscript{box-shadow:0 14px 40px #0004}:root[data-theme="dark"] .login{background:radial-gradient(circle at top,#263a30 0,#111a16 70%)}:root[data-theme="dark"] .next-action,:root[data-theme="dark"] .canon-record blockquote,:root[data-theme="dark"] .issue blockquote{background:var(--surface-2)}
@media(min-width:1500px){.workspace:has(.chat:not(.closed)){grid-template-columns:260px minmax(0,1fr) 360px}.workspace:has(.chat:not(.closed)) .chat{position:static;width:auto;box-shadow:none}.binder-hidden .workspace:has(.chat:not(.closed)){grid-template-columns:0 minmax(0,1fr) 360px}}
@media(max-width:1100px){.status{display:none}.main-nav .nav-menu>summary{padding-inline:8px}.workspace{grid-template-columns:minmax(0,1fr)}.sidebar{position:fixed;z-index:25;top:64px;bottom:0;left:0;width:min(280px,88vw);box-shadow:14px 0 40px #172a2026}.binder-hidden .workspace{grid-template-columns:minmax(0,1fr)}.scene-meta{grid-template-columns:repeat(3,minmax(0,1fr))}.writing-surface{padding:22px}.manuscript{padding:42px}}
@media(max-width:780px){.shell{grid-template-rows:58px minmax(0,1fr)}.top{padding:0 8px;gap:3px}.brand>span:last-child,.book-picker>span,.top-action#themeToggle,.top-action#focusMode{display:none}.book-picker{min-width:90px;flex:1}.top .book-picker select{width:100%;font-size:12px}.main-nav{display:flex;gap:0}.main-nav .nav-menu>summary{min-height:34px;padding:6px;font-size:11px}.top-action#chatToggle{padding-inline:6px;font-size:11px}.chat,.sidebar{top:58px}.editorbar{height:auto;min-height:60px;padding:8px 12px}.document-heading h2{font-size:18px}.quiet-action{display:none}.scene-meta{grid-template-columns:repeat(2,minmax(0,1fr));max-height:132px;overflow:auto}.writing-surface{padding:0}.manuscript{width:100%;padding:30px 22px;border:0;box-shadow:none;font-size:17px}.modal{align-items:end}.card{width:100%!important;max-height:92vh!important;border-radius:18px 18px 0 0;padding:20px}.row{flex-wrap:wrap}}
@media(max-width:560px){.brand{display:none}}
.top{z-index:50}
.settings-card{width:min(680px,94vw);max-height:90vh;overflow:auto}.settings-card h3{margin:22px 0 0;font:18px Georgia,serif}.settings-card details{margin:18px 0;padding:12px;border:1px solid var(--line);border-radius:10px}.settings-card details>summary{cursor:pointer;font-weight:650}.usage-card{width:min(780px,94vw);max-height:88vh;overflow:auto}.usage-totals{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:18px 0 24px}.usage-totals article{display:flex;flex-direction:column;gap:5px;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}.usage-totals span{color:var(--muted);font-size:12px}.usage-totals strong{font:28px Georgia,serif;color:var(--accent-strong)}.usage-totals small{color:var(--muted)}.usage-list{max-height:300px;overflow:auto}.usage-list>div{display:grid;grid-template-columns:160px minmax(0,1fr) auto;gap:12px;padding:9px 4px;border-top:1px solid var(--line);font-size:12px}.usage-list time{color:var(--muted)}
.export-card{width:min(820px,95vw);max-height:90vh;overflow:auto}.export-card section{margin:18px 0;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface-1)}.export-card h3{margin:0 0 8px;font:20px Georgia,serif}.export-scopes{display:flex;flex-wrap:wrap;gap:8px 20px;margin:14px 0}.export-scopes label,.export-checks label{display:flex;align-items:flex-start;gap:7px}.export-checks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px;max-height:180px;margin:12px 0 16px;padding:12px;overflow:auto;border:1px solid var(--line);border-radius:9px;background:var(--paper)}
@media(max-width:600px){.export-checks{grid-template-columns:1fr}.export-card section{padding:12px}.export-card .row{align-items:stretch}.export-card .row button{width:100%}}
@media(max-width:780px){.ai-cost{padding-inline:6px}.usage-totals{grid-template-columns:1fr}.usage-list>div{grid-template-columns:1fr auto}.usage-list time{grid-column:1/-1}}
.product-ledger-card{width:min(920px,95vw);max-height:90vh;overflow:auto}.ledger-filters,.ledger-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:18px 0}.ledger-filters label{color:var(--muted);font-size:12px}.ledger-filters select{display:block;width:100%;margin-top:4px;padding:9px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink)}.product-ledger-list{margin:14px 0}.product-ledger-item{margin:10px 0;padding:15px;border:1px solid var(--line);border-left:4px solid var(--line);border-radius:10px;background:var(--paper)}.product-ledger-item.priority-high{border-left-color:#b7791f}.product-ledger-item.priority-critical{border-left-color:#a33}.product-ledger-item header{display:flex;align-items:center;gap:10px}.product-ledger-item header strong{flex:1}.product-ledger-item header span,.product-ledger-item small{color:var(--muted);font-size:11px}.product-ledger-item p{white-space:pre-wrap}.product-ledger-item button{margin-top:12px}.resolution-note{margin-top:10px;padding:10px;border-radius:8px;background:var(--surface-2);white-space:pre-wrap}.resolution-note strong{display:block;margin-bottom:4px}.product-ledger-form{width:min(760px,95vw);max-height:90vh;overflow:auto}.product-ledger-form textarea{min-height:110px}.ledger-history{margin:10px 0}.ledger-history>div{display:grid;grid-template-columns:170px 1fr;gap:10px;padding:8px 0;border-top:1px solid var(--line);font-size:12px}.ledger-history time{color:var(--muted)}
@media(max-width:600px){.ledger-filters,.ledger-form-grid{grid-template-columns:1fr}.product-ledger-item header{align-items:flex-start;flex-direction:column;gap:4px}.ledger-history>div{grid-template-columns:1fr}}
.navigator-tools{display:grid;gap:7px;margin:0 0 12px}.navigator-tools input,.navigator-tools select{width:100%;padding:8px 9px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);font-size:12px}.chapter-title{display:flex;align-items:center;gap:5px}.chapter-chevron{display:inline-block;width:12px;color:var(--muted);transition:transform .15s}.chapter.collapsed .chapter-chevron{transform:rotate(-90deg)}.chapter.collapsed .scene-list{display:none}.reference-drawer{margin-top:20px}.reference-drawer>summary{padding:8px;color:var(--muted);cursor:pointer;font-size:10px;font-weight:700;letter-spacing:.09em;text-transform:uppercase}.reference-list{padding-top:4px}.reference-browser{width:min(1050px,96vw);height:min(760px,90vh);overflow:hidden}.reference-browser-grid{display:grid;grid-template-columns:250px minmax(0,1fr);gap:18px;height:calc(100% - 75px);min-height:0;margin-top:16px}.reference-browser-grid aside{display:flex;min-height:0;flex-direction:column;padding-right:12px;border-right:1px solid var(--line)}.reference-browser-grid aside>input{padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink)}#referenceEntryList{margin-top:9px;overflow:auto}.reference-entry{display:block;width:100%;margin:2px 0;padding:10px;border:0;border-radius:7px;background:transparent;color:var(--ink);text-align:left}.reference-entry:hover,.reference-entry.active{background:var(--surface-2);color:var(--accent-strong)}#referenceEntryForm{display:flex;min-height:0;flex-direction:column}#referenceEntryForm .field:last-of-type{display:flex;min-height:0;flex:1;flex-direction:column}#referenceBody{min-height:300px;flex:1;resize:none;font:15px/1.55 ui-monospace,monospace}
.world-reference-tabs{display:flex;gap:6px;margin:14px 0 4px;padding-bottom:10px;border-bottom:1px solid var(--line);overflow-x:auto}.world-reference-tabs button{display:flex;gap:7px;align-items:center;padding:9px 13px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-weight:700;white-space:nowrap}.world-reference-tabs button:hover,.world-reference-tabs button.active{background:var(--surface-2);color:var(--accent-strong)}.world-reference-tabs span{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:99px;background:var(--paper);font-size:10px}.world-reference-browser .reference-browser-grid{height:calc(100% - 132px)}.reference-empty{display:grid;place-content:center;text-align:center}.reference-empty h3{margin:0}.reference-empty p{max-width:380px;color:var(--muted)}.reference-empty button{justify-self:center}
@media(max-width:720px){.reference-browser{height:92vh}.reference-browser-grid{grid-template-columns:1fr;grid-template-rows:150px minmax(0,1fr)}.reference-browser-grid aside{padding:0 0 10px;border-right:0;border-bottom:1px solid var(--line)}#referenceEntryList{display:flex;gap:5px}.reference-entry{width:auto;min-width:max-content}.reference-browser .workspace-head{display:block}.reference-browser .workspace-head button{margin-top:8px}}
.new-book-card{width:min(780px,95vw);max-height:90vh;overflow:auto}.method-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:12px 0 18px}.method-picker label{display:flex;gap:9px;padding:12px;border:1px solid var(--line);border-radius:10px;cursor:pointer}.method-picker label:has(input:checked){border-color:var(--accent);background:var(--surface-2);box-shadow:inset 0 0 0 1px var(--accent)}.method-picker input{margin-top:3px}.method-picker span{display:flex;flex-direction:column;gap:4px}.method-picker small,.method-picker em{color:var(--muted);font-size:11px}.method-picker em{font-style:normal}.nonfiction-studio{width:min(1080px,96vw);height:min(820px,92vh);overflow:auto}.eyebrow{color:var(--accent);font-size:10px;font-weight:750;letter-spacing:.12em}.studio-tabs{position:sticky;z-index:2;top:-24px;display:flex;gap:4px;margin:18px 0;padding:8px 0;background:var(--paper);border-bottom:1px solid var(--line)}.studio-tabs button{padding:9px 14px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-weight:650}.studio-tabs button:hover,.studio-tabs button.active{background:var(--surface-2);color:var(--accent-strong)}.stage-intro{max-width:720px;color:var(--muted);line-height:1.5}.structure-list,.evidence-list{display:grid;gap:8px;margin:16px 0}.structure-list>button{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);text-align:left}.structure-list>button:hover{border-color:var(--accent);background:var(--surface-2)}.structure-list>button>span{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--surface-2);color:var(--accent);font-weight:700}.structure-list div{display:flex;flex-direction:column;gap:3px}.structure-list small,.structure-list em{color:var(--muted);font-size:11px;font-style:normal}.chapter-brief{width:min(980px,95vw);max-height:90vh;overflow:auto}.brief-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.brief-grid textarea{min-height:90px}.brief-footer{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0}.evidence-list article{display:flex;justify-content:space-between;gap:16px;padding:14px;border:1px solid var(--line);border-radius:10px}.evidence-list article>div{min-width:0}.evidence-list article span{display:block;margin-top:3px;color:var(--muted);font-size:11px}.evidence-list article p{margin:7px 0 0;white-space:pre-wrap}.evidence-list article>em{height:max-content;padding:5px 8px;border-radius:99px;background:var(--surface-2);color:var(--accent-strong);font-size:11px;font-style:normal;white-space:nowrap}.evidence-list .claim-needs-source,.evidence-list .claim-disputed{background:#f5e3c4;color:#764d12}.source-checks{display:flex;flex-wrap:wrap;gap:8px 18px;margin:14px 0;padding:14px;border:1px solid var(--line);border-radius:10px}.source-checks legend{padding:0 6px;color:var(--muted);font-size:12px}.review-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:20px 0}.review-grid article{display:flex;flex-direction:column;padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}.review-grid strong{font:30px Georgia,serif;color:var(--accent-strong)}.review-grid span{color:var(--muted);font-size:11px}.review-grid .attention strong{color:#9a5c13}.readiness-note{padding:18px;border-left:4px solid var(--accent);background:var(--surface-2)}.readiness-note h3{margin:0}.sidebar #binder>.doc{display:flex;align-items:center;gap:8px}.sidebar #binder>.doc>span{flex:0 0 22px;color:var(--muted);font-size:10px;text-align:right}
@media(max-width:720px){.method-picker,.brief-grid,.brief-footer{grid-template-columns:1fr}.nonfiction-studio{height:92vh}.studio-tabs{overflow-x:auto}.review-grid{grid-template-columns:repeat(2,1fr)}}
button,summary,[role="button"]{cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation}
.plan-card{width:min(860px,96vw);height:min(900px,92vh);max-height:92vh;padding:0;overflow-y:auto;scroll-behavior:smooth}.plan-sheet-header{padding:30px 34px 20px;border-bottom:1px solid var(--line);background:var(--paper)}.plan-sheet-header h2{margin:5px 0 8px}.plan-title-field{display:block!important;width:auto!important;margin:22px 34px!important}.plan-sheet-sections{padding:0 34px 24px}.plan-sheet-section{padding:22px 0 24px;border-top:1px solid var(--line)}.plan-sheet-section:first-child{border-top:0}.plan-card .plan-sheet-section .field{display:block;width:100%;margin:0}.plan-card .field>span{margin-bottom:10px;color:var(--ink);font-size:15px;font-weight:750}.plan-card input,.plan-card textarea{width:100%;padding:13px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);color:var(--ink);line-height:1.55}.plan-card input:focus,.plan-card textarea:focus{border-color:var(--accent);background:var(--paper);outline:3px solid color-mix(in srgb,var(--accent) 18%,transparent)}.plan-card textarea{min-height:112px;overflow:hidden;resize:none;font:15px/1.6 ui-sans-serif,system-ui}.plan-sheet-footer{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:10px;padding:16px 34px;border-top:1px solid var(--line);background:color-mix(in srgb,var(--paper) 94%,transparent);backdrop-filter:blur(10px)}@media(max-width:780px){.plan-sheet-header{padding:24px 20px 16px}.plan-title-field{margin:18px 20px!important}.plan-sheet-sections{padding:0 20px 20px}.plan-sheet-section{padding:18px 0 20px}.plan-sheet-footer{padding:14px 20px}}
.plan-header-note{display:flex;align-items:center;justify-content:space-between;gap:18px}.plan-header-note .form-note{margin:0}.plan-save-status{flex:0 0 auto;padding:5px 9px;border-radius:999px;color:var(--muted);background:var(--surface-2);font-size:12px;font-weight:700}.plan-save-status[data-state="saving"]{color:var(--accent)}.plan-save-status[data-state="saved"]{color:#26734d;background:#e7f4ec}.plan-save-status[data-state="failed"]{color:#9b2c2c;background:#fdeaea}.plan-autosave-note{align-self:center;margin-right:auto;color:var(--muted);font-size:12px}@media(max-width:780px){.plan-header-note{align-items:flex-start;flex-direction:column;gap:10px}.plan-sheet-footer{flex-wrap:wrap}.plan-autosave-note{width:100%}}
.glossary-card{width:min(1050px,96vw);height:min(860px,92vh);overflow:auto}.glossary-card .workspace-head{position:sticky;z-index:2;top:-24px;padding:24px 0 15px;background:var(--paper);border-bottom:1px solid var(--line)}.glossary-card .workspace-head h2{margin:5px 0 7px}.glossary-principles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0}.glossary-principles article{padding:17px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}.glossary-principles h3{margin:0 0 8px;font:20px Georgia,serif}.glossary-principles strong{display:block;color:var(--accent-strong);line-height:1.45}.glossary-principles p{margin:9px 0 0;color:var(--muted);line-height:1.5}.glossary-search{position:sticky;z-index:1;top:116px;padding:10px 0;background:var(--paper)}.glossary-entries{display:grid;gap:12px;padding-bottom:10px}.glossary-entry{padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}.glossary-entry h3{margin:0 0 12px;font:22px Georgia,serif;color:var(--accent-strong)}.glossary-entry dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 20px;margin:0}.glossary-entry dl>div{padding-top:9px;border-top:1px solid var(--line)}.glossary-entry dt{color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.glossary-entry dd{margin:4px 0 0;line-height:1.5}.glossary-entry .glossary-example{grid-column:1/-1;padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--paper)}@media(max-width:720px){.glossary-principles,.glossary-entry dl{grid-template-columns:1fr}.glossary-search{position:static}.glossary-card .workspace-head{position:static}}
.glossary-entry>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.glossary-entry>header h3{margin:0}.glossary-entry>header>div{display:flex;align-items:center;gap:8px}.glossary-badge{padding:4px 7px;border-radius:99px;background:var(--paper);color:var(--accent-strong);font-size:10px;font-weight:800;text-transform:uppercase}.glossary-form{width:min(820px,95vw);max-height:92vh;overflow:auto}.glossary-form .field{margin:16px 0}.glossary-form textarea{width:100%;min-height:105px;padding:11px;border:1px solid var(--line);border-radius:9px;background:var(--paper);color:var(--ink);resize:vertical}.glossary-form .field:nth-of-type(2) textarea{min-height:135px}.glossary-form .row{position:sticky;bottom:-24px;padding:14px 0 24px;background:var(--paper);border-top:1px solid var(--line)}@media(max-width:600px){.glossary-entry>header{align-items:flex-start}.glossary-entry>header>div{align-items:flex-end;flex-direction:column}.glossary-form .row button{width:100%}}
.development-modal{padding:18px}.development-card{width:min(1180px,98vw);height:min(920px,96vh);padding:0;overflow:auto}.development-head{position:sticky;z-index:4;top:0;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 26px 14px;background:var(--paper);border-bottom:1px solid var(--line)}.development-head h2{margin:3px 0}.development-head p{margin:0;color:var(--muted)}.development-head>div:last-child{display:flex;gap:8px}.development-tabs{position:sticky;z-index:3;top:91px;display:flex;gap:4px;padding:8px 26px;background:var(--paper);border-bottom:1px solid var(--line);overflow-x:auto}.development-tabs button{padding:9px 12px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-weight:700;white-space:nowrap}.development-tabs button.active,.development-tabs button:hover{background:var(--surface-2);color:var(--accent-strong)}.development-context{display:flex;flex-wrap:wrap;gap:8px 22px;padding:10px 26px;background:var(--surface-2);color:var(--muted);font-size:11px}.development-context em{margin-left:auto;color:var(--accent-strong);font-style:normal;font-weight:800}#developmentBody{padding:8px 26px 32px}.development-sheet{max-width:900px;margin:auto}.development-intro{margin:14px 0 20px}.development-intro h3{margin:0;font:26px Georgia,serif}.development-intro p{color:var(--muted);line-height:1.5}.development-sheet>.field{margin:20px 0}.development-sheet textarea{width:100%;min-height:110px;padding:13px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);line-height:1.55;resize:vertical}.development-sheet details,.parent-context{margin:22px 0;padding:16px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2)}.outline-document{display:grid;gap:12px}.outline-document section{padding:15px;border:1px solid var(--line);border-radius:11px;background:var(--surface-2)}.outline-document header{display:grid;grid-template-columns:30px 1fr auto;gap:10px;align-items:center}.outline-document header>span{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--paper);font-weight:800}.outline-document input,.chapter-plan-picker select{width:100%;padding:9px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);font-weight:700}.outline-document textarea{margin-top:10px;min-height:90px}.parent-context span{color:var(--accent-strong);font-size:10px;font-weight:800;letter-spacing:.1em}.parent-context p{white-space:pre-wrap}.chapter-plan-picker{position:sticky;z-index:2;top:151px;padding:10px 0;background:var(--paper)}.chapter-scenes{margin-top:28px;border-top:2px solid var(--line)}.chapter-scenes>header{display:flex;align-items:center;justify-content:space-between}.chapter-scenes article,.development-list>article{display:flex;align-items:center;gap:12px;padding:13px 0;border-top:1px solid var(--line)}.chapter-scenes article>div,.development-list article>div{flex:1;min-width:0}.chapter-scenes p,.development-list p{margin:4px 0;white-space:pre-wrap}.chapter-scenes small,.development-list small,.development-list article span{color:var(--muted);font-size:11px}.development-list{max-width:950px;margin:auto}.development-list>.primary{margin-bottom:14px}.capture-card{width:min(680px,94vw)}.capture-card textarea{width:100%;min-height:180px;padding:12px;border:1px solid var(--line);border-radius:9px;background:var(--paper);color:var(--ink)}.level-checks{display:flex;flex-wrap:wrap;gap:9px 18px;margin:16px 0;padding:14px;border:1px solid var(--line);border-radius:10px}.level-checks legend{color:var(--muted);font-size:12px}.capture-action{color:var(--accent-strong)!important;background:var(--paper)!important}@media(max-width:780px){.development-modal{padding:0}.development-card{height:100vh!important;max-height:100vh!important;border-radius:0!important}.development-head{align-items:flex-start;flex-direction:column}.development-head>div:last-child{width:100%}.development-head button{flex:1}.development-tabs{top:139px;padding-inline:14px}.development-context{padding-inline:14px}.development-context span:nth-child(2){display:none}#developmentBody{padding-inline:14px}.outline-document header{grid-template-columns:26px 1fr}.outline-document header button{grid-column:2}.chapter-scenes article,.development-list>article{align-items:flex-start;flex-wrap:wrap}.chapter-scenes article>div,.development-list article>div{min-width:calc(100% - 50px)}}
.development-sheet details>.field{display:block;margin:20px 0}.legacy-structure-note{margin-top:24px;padding:15px;border:1px solid var(--line);border-radius:10px;background:var(--paper)}.legacy-structure-note p{color:var(--muted);line-height:1.5}.legacy-structure-note textarea{min-height:140px;background:var(--surface-2)}.glossary-exact-match{border-color:var(--accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}
.print-export-card{width:min(720px,94vw)}.print-export-card .field{margin:24px 0}.print-export-card select{width:100%;padding:12px;border:1px solid var(--line);border-radius:9px;background:var(--paper);color:var(--ink);font-size:15px}.print-format-actions{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0}.print-view-modal{padding:14px}.print-view-card{width:min(1120px,98vw);height:min(940px,96vh);padding:0;overflow:hidden}.print-view-card>header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 18px;border-bottom:1px solid var(--line);background:var(--paper)}.print-view-card>header h2{margin:3px 0}.print-view-card iframe{display:block;width:100%;height:calc(100% - 82px);border:0;background:white}@media(max-width:700px){.print-view-card>header{align-items:flex-start;flex-direction:column}.print-view-card>header .row{width:100%;overflow-x:auto}.print-view-card iframe{height:calc(100% - 132px)}}
.auto-grow-content{display:block;height:auto;max-height:none!important;overflow-y:hidden!important;resize:none!important;flex:none!important}.reference-browser:has(.auto-grow-content){height:min(900px,92vh);overflow:auto}.reference-browser:has(.auto-grow-content) .reference-browser-grid{height:auto;min-height:420px;align-items:start}.reference-browser:has(.auto-grow-content) #referenceEntryForm,.reference-browser:has(.auto-grow-content) #referenceEntryForm .field:last-of-type{display:block;min-height:0;flex:none}.reference-browser:has(.auto-grow-content) #referenceEntryList{max-height:560px}
.plan-field-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;color:var(--ink);font-size:15px;font-weight:750}.plan-help-button{display:inline-grid;place-items:center;flex:0 0 28px;width:28px;height:28px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--paper);color:var(--accent-strong);font-size:16px;line-height:1}.plan-help-button:hover,.plan-help-button:focus{border-color:var(--accent);background:var(--surface-2);outline:2px solid color-mix(in srgb,var(--accent) 18%,transparent)}.context-help-overlay{position:fixed;z-index:90;inset:0;display:grid;place-items:center;padding:20px;background:#10241a80;backdrop-filter:blur(4px)}.context-help-panel{width:min(680px,94vw);max-height:86vh;padding:26px;border-radius:16px;background:var(--paper);box-shadow:var(--shadow);overflow:auto}.context-help-panel>header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.context-help-panel h3{margin:5px 0 10px;font:28px Georgia,serif}.context-help-panel dl{display:grid;gap:0;margin:12px 0 20px}.context-help-panel dl>div{padding:14px 0;border-top:1px solid var(--line)}.context-help-panel dt{margin-bottom:5px;color:var(--accent-strong);font-size:12px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}.context-help-panel dd{margin:0;color:var(--ink);font-size:15px;line-height:1.55}.context-help-example{margin-top:4px;padding:15px!important;border:1px solid var(--line)!important;border-radius:10px;background:var(--surface-2)}
.current-book-visual{display:grid;place-items:center;flex:0 0 34px;width:34px;height:46px;border:1px solid var(--line);border-radius:5px;background:var(--surface-2);color:var(--accent-strong);font:700 11px Georgia,serif;overflow:hidden}.current-book-visual img,.media-preview img,.library-cover img,.reference-entry img{width:100%;height:100%;object-fit:cover}.media-manager{display:grid;grid-template-columns:minmax(180px,260px) minmax(260px,1fr);gap:28px;align-items:center;width:min(760px,94vw)}.media-manager-copy h2{margin:5px 0 10px}.media-preview{display:grid;place-items:center;border:1px solid var(--line);background:var(--surface-2);color:var(--accent-strong);font:700 38px Georgia,serif;overflow:hidden}.book-cover-preview{aspect-ratio:2/3;border-radius:10px}.character-portrait-preview{width:150px;aspect-ratio:1;border-radius:50%}.library-media article{display:grid;grid-template-columns:54px minmax(150px,1fr) auto;gap:14px;align-items:center}.library-cover{display:grid;place-items:center;width:48px;aspect-ratio:2/3;border:1px solid var(--line);border-radius:5px;background:var(--surface-2);color:var(--accent-strong);font:700 12px Georgia,serif;overflow:hidden}.library-book-info{display:flex;min-width:0;flex-direction:column}.character-portrait{display:flex;gap:22px;align-items:center;margin-bottom:22px;padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}.character-portrait strong{display:block;margin:5px 0}.character-browser .reference-entry{display:flex;align-items:center;gap:9px}.character-browser .reference-entry>img,.reference-avatar{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border-radius:50%;background:var(--paper);color:var(--accent-strong);font:700 9px Georgia,serif;object-fit:cover}.character-browser .reference-entry>span:last-child{overflow:hidden;text-overflow:ellipsis}@media(max-width:720px){.current-book-visual{display:none}.media-manager{grid-template-columns:1fr}.book-cover-preview{width:min(220px,60vw);margin:auto}.library-media article{grid-template-columns:48px 1fr}.library-media article>.row{grid-column:1/-1;flex-wrap:wrap}.character-portrait{align-items:flex-start;flex-direction:column}.character-portrait-preview{width:120px}}

/* Release 54: navigation and global interface foundation */
.workspace{grid-template-columns:var(--sidebar-width,260px) minmax(0,1fr)}.sidebar{position:relative;padding:14px 12px}.sidebar-resizer{position:absolute;z-index:5;top:0;right:-4px;bottom:0;width:8px;cursor:col-resize;touch-action:none}.sidebar-resizer::after{content:"";position:absolute;top:0;bottom:0;left:3px;width:1px;background:transparent}.sidebar-resizer:hover::after,.sidebar-resizer:focus::after,.resizing-sidebar .sidebar-resizer::after{background:var(--accent)}.resizing-sidebar{cursor:col-resize;user-select:none}.sidebar-section{margin:8px 0}.sidebar-section-toggle,.reference-category-toggle{display:flex;align-items:center;width:100%;min-height:36px;padding:7px 8px;border:0;border-radius:8px;background:transparent;color:var(--ink);text-align:left}.sidebar-section-toggle:hover,.reference-category-toggle:hover{background:color-mix(in srgb,var(--paper) 72%,transparent)}.sidebar-section-toggle strong{font-size:12px;letter-spacing:.08em;text-transform:uppercase}.sidebar-disclosure{display:inline-grid;place-items:center;flex:0 0 18px;color:var(--muted);font-size:15px}.sidebar-section-body[hidden],.reference-records[hidden]{display:none!important}.chapters-section .binder-actions{margin:5px 4px 8px}.chapters-section .chapter{margin:2px 0;padding:3px}.chapters-section .chapter-title{padding:5px 4px;font-size:12px}.references-section .sidebar-section-body{padding-left:2px}.reference-category{margin:1px 0}.reference-category-toggle{min-height:34px}.reference-category-toggle strong{font-size:13px;font-weight:600}.reference-category-toggle.current{color:var(--accent-strong)}.reference-records{padding:1px 0 4px 18px}.sidebar-record{display:flex;align-items:center;gap:8px;width:100%;min-height:34px;padding:5px 7px;border:0;border-radius:7px;background:transparent;color:var(--ink);text-align:left}.sidebar-record:hover{background:#ffffff80}.sidebar-record.active{background:var(--paper);color:var(--accent-strong);box-shadow:0 2px 10px #23403110}.sidebar-record img,.sidebar-record .reference-avatar{flex:0 0 26px;width:26px;height:26px}.sidebar-record>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.sidebar-empty{display:block;padding:5px 8px}.reference-link{padding-left:28px!important;font-size:13px}.navigator-tools{margin-bottom:8px}.navigator-tools input,.navigator-tools select{padding:7px 9px}.binder-hidden .workspace{grid-template-columns:0 minmax(0,1fr)}
.modal{padding:18px}.modal>.card{position:relative;width:min(760px,94vw);max-width:94vw;max-height:92vh;overflow:auto;padding:28px 30px}.modal-close-button{position:sticky;z-index:12;top:0;float:right;display:grid;place-items:center;width:36px;height:36px;margin:-14px -16px 8px 14px;padding:0;border:1px solid var(--line);border-radius:50%;background:color-mix(in srgb,var(--paper) 94%,transparent);color:var(--ink);box-shadow:0 3px 12px #172a2018;font-size:24px;line-height:1}.modal-close-button:hover,.modal-close-button:focus{border-color:var(--accent);background:var(--surface-2);outline:3px solid color-mix(in srgb,var(--accent) 16%,transparent)}.card .field{width:100%;max-width:none}.card .field input,.card .field select,.card .field textarea,.card textarea{width:100%;max-width:none}.card textarea{min-height:110px;line-height:1.55}.ledger-form-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.product-ledger-form>.field,.product-ledger-form>.field textarea{width:100%}.workspace-head{clear:both}.card:focus-within{scroll-padding-top:58px}
@media(max-width:1100px){.workspace{grid-template-columns:minmax(0,1fr)}.sidebar{width:min(var(--sidebar-width,280px),88vw)}.sidebar-resizer{display:none}}
@media(max-width:780px){.modal{padding:0}.modal>.card{width:100%!important;max-width:100%!important;padding:22px 20px}.modal-close-button{margin:-8px -7px 8px 12px}.ledger-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sidebar-record>span:last-child{white-space:normal}}
.modal>.matrix-card,.modal>.foundation-card,.modal>.development-card,.modal>.bible-review-card,.modal>.canon-card,.modal>.issues-card,.modal>.print-view-card{width:min(1180px,96vw)}.modal>.reference-browser,.modal>.nonfiction-studio{width:min(1050px,96vw)}.modal>.plan-card,.modal>.directed-card,.modal>.chapter-brief,.modal>.product-ledger-card,.modal>.product-ledger-form{width:min(900px,95vw)}.modal>.print-view-card{width:min(1120px,98vw)}
.reference-sheet-surface{flex:1;overflow:auto;padding:28px clamp(18px,5vw,64px);background:var(--surface)}.reference-sheet-form{width:min(860px,100%);margin:auto;padding:clamp(24px,4vw,44px);border:1px solid var(--line);border-radius:12px;background:var(--paper);box-shadow:0 10px 34px #2340310c}.reference-sheet-form>.field{display:block;width:100%;margin:20px 0}.reference-sheet-form input,.reference-sheet-form textarea{width:100%;padding:13px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);color:var(--ink)}.reference-sheet-form textarea{min-height:320px;line-height:1.6}.reference-sheet-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}.reference-sheet-bar .document-heading h2{white-space:normal}@media(max-width:780px){.reference-sheet-surface{padding:0}.reference-sheet-form{padding:22px;border:0;border-radius:0}.reference-sheet-actions{flex-wrap:wrap}.reference-sheet-actions button{flex:1}}
.sidebar-record:focus{background:var(--paper);color:var(--accent-strong);outline:2px solid color-mix(in srgb,var(--accent) 22%,transparent);box-shadow:0 2px 10px #23403110}
.reference-document{width:min(900px,100%);margin:auto;padding:clamp(22px,4vw,42px);border:1px solid var(--line);border-radius:16px;background:var(--paper);box-shadow:0 12px 38px #2340310b}.reference-hero{display:grid;grid-template-columns:auto minmax(0,1fr);gap:24px;align-items:center;padding-bottom:24px;border-bottom:1px solid var(--line)}.reference-hero .character-portrait-preview{width:132px}.reference-hero-copy h1{margin:4px 0 8px;font-size:clamp(28px,4vw,42px)}.reference-meta{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.reference-meta span{padding:5px 9px;border-radius:99px;background:var(--surface-2);color:var(--muted);font-size:12px}.reference-tagline{margin:10px 0;color:var(--accent-strong);font:italic 17px/1.45 Georgia,serif}.reference-hero-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}.reference-sections{margin-top:18px}.reference-section{border-bottom:1px solid var(--line)}.reference-section summary{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:13px 4px;cursor:pointer;font-weight:700;list-style:none}.reference-section summary::-webkit-details-marker{display:none}.reference-section summary::before{content:'›';flex:0 0 16px;color:var(--muted);font-size:18px;transition:transform .15s}.reference-section[open] summary::before{transform:rotate(90deg)}.reference-section summary span{flex:1}.reference-section summary small{color:var(--muted);font-weight:400}.reference-section-body{padding:0 4px 16px 20px}.reference-section-value p{margin:0 0 8px;line-height:1.65;white-space:normal}.empty-note{color:var(--muted);font-style:italic}.reference-appearances{margin-top:22px;padding:17px;border-radius:12px;background:var(--surface-2)}.reference-appearances h3{margin:0 0 7px}.reference-section-editor{width:min(720px,94vw)}.reference-section-editor textarea,.full-reference-editor textarea{min-height:220px}.full-reference-editor{width:min(850px,95vw)}.full-reference-editor textarea{min-height:55vh}.compact-reference-editor{width:min(560px,94vw)}.character-gallery{width:min(1040px,96vw);height:auto;max-height:90vh;overflow:auto}.character-gallery>#referenceSearch{width:100%;margin:14px 0;padding:11px 12px;border:1px solid var(--line);border-radius:9px;background:var(--paper);color:var(--ink)}.character-gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:9px;margin:8px 0 18px}.character-gallery-item{display:grid;grid-template-columns:48px minmax(0,1fr);gap:11px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:11px;background:var(--paper);color:var(--ink);text-align:left}.character-gallery-item:hover,.character-gallery-item.active{border-color:var(--accent);background:var(--surface-2)}.character-gallery-item>img,.character-gallery-item>.reference-avatar{width:48px;height:48px;border-radius:50%;object-fit:cover}.character-gallery-item strong,.character-gallery-item small{display:block}.character-gallery-item small{margin-top:3px;color:var(--muted);line-height:1.35}@media(max-width:720px){.reference-document{padding:20px;border:0;border-radius:0}.reference-hero{grid-template-columns:1fr}.reference-hero .character-portrait-preview{width:108px}.character-gallery-grid{grid-template-columns:1fr}}
.formatted-content{line-height:1.6;overflow-wrap:anywhere}.formatted-content>:first-child{margin-top:0}.formatted-content>:last-child{margin-bottom:0}.formatted-content h2,.formatted-content h3,.formatted-content h4,.formatted-content h5,.formatted-content h6{margin:1em 0 .35em;color:var(--ink);font-family:Georgia,serif;line-height:1.25}.formatted-content p{margin:.5em 0;white-space:normal}.formatted-content ul,.formatted-content ol{margin:.55em 0;padding-left:1.5em}.formatted-content li{margin:.2em 0}.formatted-content blockquote{margin:.65em 0;padding:.55em .85em;border-left:3px solid var(--accent);background:var(--surface-2);color:var(--muted)}.formatted-content code{padding:.08em .28em;border-radius:4px;background:var(--surface-2);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.bubble .formatted-content{white-space:normal}.bubble .copy-clean{margin-top:7px;font-size:11px}.formatted-record{margin:14px 0;padding:16px;border:1px solid var(--line);border-radius:10px;background:var(--paper)}.formatted-record-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.beat-sheet-view{padding:4px 2px}.source-editor{margin-top:14px;border-top:1px solid var(--line);padding-top:10px}.source-editor summary{cursor:pointer;color:var(--muted);font-size:12px}.source-editor textarea{margin-top:9px}.draft-preview{max-height:48vh;overflow:auto;margin:10px 0}.revision-preview{max-height:7em;overflow:hidden;color:#524d44;font-size:13px}

/* Release 56 candidate: mode-aware shell and application menus */
.shell[data-mode-shell-ready="true"]{grid-template-rows:56px 34px minmax(0,1fr)}.shell[data-mode-shell-ready="true"] .workspace{height:calc(100vh - 90px)}.project-type-badge{flex:0 0 auto;padding:4px 8px;border:1px solid var(--line);border-radius:999px;background:var(--surface-2);color:var(--ink);font-size:10px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}.project-type-badge::before{content:'•';margin-right:5px;color:var(--accent)}.application-menu-bar{position:relative;z-index:45;display:flex;align-items:center;gap:2px;min-width:0;padding:2px 12px;border-bottom:1px solid var(--line);background:var(--paper)}.application-menu-bar>details{position:relative}.application-menu-bar>details>summary{display:flex;align-items:center;min-height:28px;padding:4px 9px;border-radius:7px;color:var(--ink);cursor:pointer;font-size:12px;font-weight:650;list-style:none}.application-menu-bar>details>summary::-webkit-details-marker{display:none}.application-menu-bar>details[open]>summary,.application-menu-bar>details>summary:hover{background:var(--surface-2)}.application-menu-bar .menu-panel{top:calc(100% + 3px)}.application-menu-bar .menu-overflow{margin-left:auto}.application-menu-bar .menu-overflow+.menu-overflow{margin-left:0}.context-mode-label{margin-bottom:2px;color:var(--accent-strong);font-size:9px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}.compact-help-card{width:min(560px,94vw)!important}.shortcut-list{display:grid;gap:0}.shortcut-list>div{display:grid;grid-template-columns:90px 1fr;gap:14px;padding:11px 0;border-top:1px solid var(--line)}.shortcut-list dt{font-weight:800}.shortcut-list dd{margin:0;color:var(--muted)}
@media(max-width:1180px){.brand>span:last-child{display:none}.book-picker{min-width:140px}.top .book-picker select{width:clamp(140px,18vw,220px)}.top .status{display:none}.application-menu-bar>details:nth-child(2),.application-menu-bar>details:nth-child(3),.application-menu-bar>details:nth-child(4){display:none}}
@media(max-width:820px){.shell[data-mode-shell-ready="true"]{grid-template-rows:58px 34px minmax(0,1fr)}.shell[data-mode-shell-ready="true"] .workspace{height:calc(100vh - 92px)}.project-type-badge{padding-inline:6px;font-size:9px}.application-menu-bar{padding-inline:7px;overflow:visible}.application-menu-bar>details:nth-child(1)>summary,.application-menu-bar>details:nth-child(5)>summary,.application-menu-bar>details:nth-child(6)>summary,.application-menu-bar>details:nth-child(7)>summary{padding-inline:6px}.application-menu-bar .menu-overflow{display:block}.application-menu-bar .menu-overflow>summary{font-size:0}.application-menu-bar .menu-overflow>summary::after{content:'More';font-size:12px}.application-menu-bar .menu-overflow+.menu-overflow{display:none}.sidebar,.chat{top:92px}}

/* Release 57 — Review / Integrity / Advanced Workflow */
.review-workspace-card{width:min(1180px,96vw)!important;max-height:92vh;overflow:auto}.review-summary{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.review-summary span{padding:7px 10px;border:1px solid var(--line);border-radius:999px;background:var(--surface-2);font-size:12px}.review-summary strong{margin-right:4px}.review-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px}.review-layout{display:grid;grid-template-columns:minmax(280px,.85fr) minmax(360px,1.3fr);gap:14px;min-height:430px}.review-queue{display:flex;flex-direction:column;gap:7px;max-height:58vh;overflow:auto}.review-finding{display:grid;grid-template-columns:auto 1fr;gap:5px 8px;text-align:left;padding:11px;border:1px solid var(--line);border-radius:10px;background:var(--paper)}.review-finding:hover,.review-finding:focus{border-color:var(--accent)}.review-finding small{grid-column:2;color:var(--muted)}.attention-chip{display:inline-flex;align-items:center;width:max-content;padding:3px 7px;border-radius:999px;background:#edf2ee;color:var(--ink);font-size:10px;font-weight:800;text-transform:uppercase}.attention-chip.important{background:#f7e8df;color:#7b3f27}.attention-chip.review{background:#f4efd9;color:#6e5a18}.attention-chip.note{background:#e8f0f3;color:#315866}.review-inspector{padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--surface-1);overflow:auto}.review-inspector h3{margin:.5rem 0}.review-inspector h4{margin:1.1rem 0 .35rem}.review-inspector blockquote{margin:8px 0;padding:10px 12px;border-left:3px solid var(--accent);background:var(--paper)}.finding-links{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0}.command-palette{width:min(620px,92vw)!important;padding:12px!important}.command-palette>input{width:100%;padding:14px;border:1px solid var(--line);border-radius:9px;font-size:17px}.command-palette #commandList{display:grid;gap:4px;margin-top:8px}.command-palette #commandList button{text-align:left;padding:10px;border:0;border-radius:7px;background:transparent}.command-palette #commandList button:hover{background:var(--surface-2)}
@media(max-width:760px){.review-filters,.review-layout{grid-template-columns:1fr}.review-layout{min-height:0}.review-queue{max-height:34vh}}
/* Keep the real labels and File actions accessible on compact screens. */
@media(max-width:590px){.project-type-badge{display:none}.application-menu-bar{justify-content:center}.top .current-book-visual{display:none}.shell[data-mode-shell-ready="true"]{grid-template-rows:144px 34px minmax(0,1fr)}.shell[data-mode-shell-ready="true"] .workspace{height:calc(100vh - 178px)}.shell[data-mode-shell-ready="true"] .top{flex-wrap:wrap;align-content:center;row-gap:0}.shell[data-mode-shell-ready="true"] .book-picker{min-width:0;flex:1 0 calc(100% - 50px)}.shell[data-mode-shell-ready="true"] .book-picker select{width:100%;min-width:0}.shell[data-mode-shell-ready="true"] .main-nav{order:2;flex:1 0 100%;justify-content:center}.shell[data-mode-shell-ready="true"] .main-nav .menu-panel{left:50%;right:auto;transform:translateX(-50%)}.application-menu-bar>details{position:static}.application-menu-bar .menu-panel,.application-menu-bar .menu-panel.menu-right{top:100%;left:7px;right:7px;min-width:0}.shell[data-mode-shell-ready="true"] .sidebar,.shell[data-mode-shell-ready="true"] .chat{top:178px}}

/* RC4: intrinsic toolbar rows; no essential control is clipped or hidden. */
:root{--myaos-safe-top:env(safe-area-inset-top,0px);--myaos-safe-right:env(safe-area-inset-right,0px);--myaos-safe-bottom:env(safe-area-inset-bottom,0px);--myaos-safe-left:env(safe-area-inset-left,0px)}
.shell[data-mode-shell-ready="true"]{height:100dvh;grid-template-rows:auto auto minmax(0,1fr)}
.shell[data-mode-shell-ready="true"] .workspace{height:auto;min-height:0}
.shell[data-mode-shell-ready="true"] .top{min-width:0;min-height:56px;flex-wrap:wrap;gap:6px 10px;padding:max(7px,var(--myaos-safe-top)) max(12px,var(--myaos-safe-right)) 7px max(12px,var(--myaos-safe-left))}
.shell[data-mode-shell-ready="true"] .top>.brand,.shell[data-mode-shell-ready="true"] .top>.main-nav{flex-shrink:0}
.shell[data-mode-shell-ready="true"] .book-picker{min-width:0;flex:1 1 220px;max-width:360px}
.shell[data-mode-shell-ready="true"] .book-picker select{width:100%;min-width:0;max-width:100%}
.top-utilities{display:flex;flex:1 1 100%;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:5px;min-width:0}
.top-utilities>*{flex-shrink:0}
.shell[data-mode-shell-ready="true"] .top .status{display:flex}
.shell[data-mode-shell-ready="true"] .top #themeToggle,.shell[data-mode-shell-ready="true"] .top #focusMode{display:block}
.shell[data-mode-shell-ready="true"] .workspace>.chat{position:absolute;top:0;bottom:0}
.shell[data-mode-shell-ready="true"] .application-menu-bar{flex-wrap:wrap;min-height:34px}
@media(min-width:1700px){.top-utilities{flex:1 1 auto}}
@media(min-width:591px){.shell[data-mode-shell-ready="true"] .main-nav .menu-panel{left:auto;right:0}}
@media(min-width:1500px){.shell[data-mode-shell-ready="true"] .workspace:has(.chat:not(.closed))>.chat{position:static}}
@media(max-width:1100px){.shell[data-mode-shell-ready="true"] .workspace>.sidebar{position:absolute;top:0;bottom:0}}
@media(max-width:820px){.shell[data-mode-shell-ready="true"] .top{gap:4px 6px}.shell[data-mode-shell-ready="true"] .book-picker{flex-basis:180px}.top-utilities{justify-content:center}}
@media(max-width:590px){.shell[data-mode-shell-ready="true"] .book-picker{flex:1 1 calc(100% - 48px);max-width:none}.shell[data-mode-shell-ready="true"] .main-nav{order:2;flex:1 1 100%;justify-content:center}.shell[data-mode-shell-ready="true"] .top-utilities{order:3}.shell[data-mode-shell-ready="true"] .top .book-picker>span{display:block}}
/* Focus mode still has a single, reachable Exit Focus control. */
/* RC6: the fixed Focus header leaves only menu + workspace in grid flow. */
.shell[data-mode-shell-ready="true"].focus-mode{grid-template-rows:auto minmax(0,1fr)}
.shell[data-mode-shell-ready="true"].focus-mode .top{width:auto;min-height:0;padding:0}
.shell[data-mode-shell-ready="true"].focus-mode .top>.top-utilities{display:flex;flex:0 0 auto}
.focus-mode .top-utilities>*{display:none!important}
.shell[data-mode-shell-ready="true"].focus-mode .top-utilities>#focusMode{display:block!important}
/* Separate scrolling content and action row: the footer never covers author fields. */
.modal:has(>#planForm){padding:var(--myaos-safe-top) var(--myaos-safe-right) var(--myaos-safe-bottom) var(--myaos-safe-left)}
.modal>#planForm.plan-card{position:relative;display:grid;grid-template-rows:44px minmax(0,1fr) auto;overflow:hidden;padding:0!important;height:min(900px,calc(100dvh - 32px - var(--myaos-safe-top) - var(--myaos-safe-bottom)));max-height:calc(100dvh - 32px - var(--myaos-safe-top) - var(--myaos-safe-bottom))!important;max-width:100%!important}
#planForm>.plan-sheet-scroll{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scroll-padding-block:16px}
#planForm>.plan-sheet-footer{position:relative;bottom:auto;min-width:0;flex-wrap:wrap;margin:0;padding:12px 24px;background:var(--paper);backdrop-filter:none}
#planForm>.modal-close-button{position:relative;top:auto;right:auto;justify-self:end;align-self:center;margin:0 10px;float:none}
#planForm .plan-sheet-header{padding-right:64px}
#planForm .thread-progression-editor{margin:0 34px 24px}
#planForm .plan-progression-anchor{height:16px}
#planForm input,#planForm textarea,#planForm button{scroll-margin-block:16px}
#planForm .plan-sheet-footer button{white-space:normal}
/* RC5: explicit grid placement, and a single painted/accessible panel state.
   Hidden panels retain their DOM/content, but never an offscreen transformed layer. */
.shell[data-mode-shell-ready="true"] .workspace{min-width:0;grid-template-rows:minmax(0,1fr)}
.shell[data-mode-shell-ready="true"] .workspace>.editor{grid-column:2;grid-row:1;min-width:0;min-height:0}
.shell[data-mode-shell-ready="true"] .workspace>.sidebar{grid-column:1;grid-row:1;transform:none;transition:none;visibility:visible;overflow-x:hidden}
.shell[data-mode-shell-ready="true"].binder-hidden .workspace>.sidebar{display:none;visibility:hidden}
.shell[data-mode-shell-ready="true"] .workspace>.chat{grid-column:auto;grid-row:auto;transform:none;transition:none;visibility:visible;min-height:0;max-width:100%;overflow-x:hidden}
@media(min-width:1500px){.shell[data-mode-shell-ready="true"] .workspace:has(.chat:not(.closed))>.chat{grid-column:3;grid-row:1}}
.shell[data-mode-shell-ready="true"] .workspace>.chat.closed{display:none!important;visibility:hidden}
.shell[data-mode-shell-ready="true"] .workspace>.chat:not(.closed){display:flex}
.chat .messages{min-height:0;overflow-wrap:anywhere}
.chat .panel-heading,.chat .composer{flex-shrink:0}
.editorbar{height:auto;flex-wrap:wrap}
.document-heading{flex:1 1 160px}
.editor-actions{min-width:0;flex-wrap:wrap}
.scene-meta>*{min-width:0}
.scene-meta input,.scene-meta select{min-width:0;max-width:100%;width:100%}
.shell[data-mode-shell-ready="true"].focus-mode .workspace>.editor{grid-column:1;grid-row:1}
.shell[data-mode-shell-ready="true"].focus-mode .workspace{grid-template-columns:minmax(0,1fr)}
.shell[data-mode-shell-ready="true"].focus-mode .workspace>.sidebar,.shell[data-mode-shell-ready="true"].focus-mode .workspace>.chat{display:none!important}
.craft-finding-navigator{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:9px 18px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--surface-2) 82%,var(--paper));box-shadow:0 4px 14px #2340310d}.craft-finding-label{display:flex;min-width:0;flex-direction:column;gap:2px}.craft-finding-label strong{overflow:hidden;color:var(--accent-strong);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.craft-finding-label small{color:var(--muted);font-size:11px}.craft-finding-actions{display:flex;align-items:center;gap:7px;flex-shrink:0}.craft-finding-actions button{min-height:32px;padding:5px 10px}.craft-finding-actions .icon-button{width:32px;padding:0}.craft-finding-actions button:disabled{opacity:.45;cursor:default}.manuscript.craft-focus-highlight{box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--accent) 32%,transparent)}
@media(max-width:780px){.craft-finding-navigator{align-items:flex-start;padding:9px 12px;flex-direction:column}.craft-finding-actions{width:100%;flex-wrap:wrap}.craft-finding-actions button{flex:1}.craft-finding-actions .icon-button{flex:0 0 32px}}
@media(max-width:1100px){.shell[data-mode-shell-ready="true"] .workspace,.shell[data-mode-shell-ready="true"].binder-hidden .workspace{grid-template-columns:minmax(0,1fr)}.shell[data-mode-shell-ready="true"] .workspace>.editor{grid-column:1}.shell[data-mode-shell-ready="true"] .workspace>.sidebar{grid-column:auto;grid-row:auto}}
/* Position is measured from each actual invoker, including wrapped toolbar rows. */
.menu-panel[data-viewport-menu]{position:fixed!important;left:var(--menu-x)!important;right:auto!important;top:var(--menu-y)!important;bottom:auto!important;transform:none!important;width:var(--menu-width);min-width:0;max-width:var(--menu-width);max-height:var(--menu-height);overflow:auto;overscroll-behavior:contain;scroll-padding-block:6px}
.menu-panel[data-viewport-menu] button{min-width:0;overflow-wrap:anywhere;white-space:normal;flex-shrink:0}
.application-menu-bar:has(>details[open]),.workspace:has(.editor-more[open]){z-index:55}
@media(max-width:780px){.modal>#planForm.plan-card{height:calc(100dvh - 12px - var(--myaos-safe-top) - var(--myaos-safe-bottom));max-height:calc(100dvh - 12px - var(--myaos-safe-top) - var(--myaos-safe-bottom))!important}#planForm>.plan-sheet-footer{padding-inline:12px;gap:8px}#planForm .thread-progression-editor{margin-inline:20px}#planForm .plan-autosave-note{flex-basis:100%}#planForm .plan-sheet-footer button{flex:1 1 auto}}

/* Assistant Send: native activation and visible acknowledgement, including reduced motion. */
#send{min-width:78px;min-height:40px;cursor:pointer;touch-action:manipulation;transition:background-color .12s ease,box-shadow .12s ease,transform .08s ease}
#send:not(:disabled):hover{background:var(--accent-strong,var(--accent));box-shadow:0 0 0 3px var(--line),0 3px 8px #0002;filter:brightness(1.12)}
#send:not(:disabled):active{transform:translateY(2px) scale(.97);box-shadow:inset 0 2px 5px #0005;filter:brightness(.9)}
#send:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
#send[aria-busy="true"]{cursor:wait;opacity:.8;box-shadow:inset 0 0 0 2px var(--line)}
#send[aria-busy="true"]::before{content:'';display:inline-block;width:.75em;height:.75em;margin-right:.4em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:assistant-send-spin .8s linear infinite}
#assistantContext{line-height:1.4;overflow-wrap:anywhere;margin:8px 0}
#assistantContext[data-state="error"],#assistantContext[data-state="validation"]{padding:9px;border:1px solid var(--accent);border-radius:7px;background:var(--paper);color:var(--ink)}
#assistantContext[data-state="working"]{color:var(--ink);font-weight:600}
@keyframes assistant-send-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#send{transition:none}#send[aria-busy="true"]::before{animation:none}}

/* Assistant sizing is presentation-only: no rerender, manuscript or conversation mutation. */
.shell[data-mode-shell-ready="true"] .workspace>.chat[data-assistant-sizing]{width:var(--assistant-width,390px);max-width:100%;overflow:hidden;padding-left:20px}
.chat[data-assistant-sizing]>.panel-heading{gap:8px;flex-wrap:wrap}
.assistant-window-actions{display:flex;align-items:center;gap:6px;margin-left:auto}
#expandAssistant{min-height:34px;cursor:pointer;font-size:12px}
#expandAssistant:hover{background:var(--paper);box-shadow:0 0 0 2px var(--line)}
#expandAssistant:active{transform:translateY(1px)}
#expandAssistant:focus-visible,.assistant-resizer:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.assistant-resizer{position:absolute;z-index:2;left:0;top:0;bottom:0;width:12px;cursor:col-resize;touch-action:none}
.assistant-resizer::after{content:'';position:absolute;left:3px;top:calc(50% - 24px);height:48px;width:4px;border-radius:4px;background:var(--muted);opacity:.45}
.assistant-resizer:hover,.assistant-resizer:focus-visible,.assistant-resizing .assistant-resizer{background:var(--line)}
.assistant-resizer:hover::after,.assistant-resizer:focus-visible::after,.assistant-resizing .assistant-resizer::after{background:var(--accent);opacity:1}
.assistant-resizer[hidden]{display:none}
.assistant-resizing{user-select:none;cursor:col-resize}
@media(min-width:1500px){
 .shell[data-mode-shell-ready="true"] .workspace[data-assistant-sizing]:has(>.chat:not(.closed)){grid-template-columns:var(--sidebar-width,260px) minmax(0,1fr) var(--assistant-width,390px)}
 .shell[data-mode-shell-ready="true"].binder-hidden .workspace[data-assistant-sizing]:has(>.chat:not(.closed)){grid-template-columns:0 minmax(0,1fr) var(--assistant-width,390px)}
 .shell[data-mode-shell-ready="true"] .workspace[data-assistant-sizing]:has(>.chat:not(.closed))>.chat{position:relative;width:100%;right:auto}
 .shell[data-mode-shell-ready="true"] .workspace[data-assistant-expanded="true"]:has(>.chat:not(.closed)){grid-template-columns:var(--sidebar-width,260px) minmax(0,1fr)}
 .shell[data-mode-shell-ready="true"].binder-hidden .workspace[data-assistant-expanded="true"]:has(>.chat:not(.closed)){grid-template-columns:0 minmax(0,1fr)}
 .shell[data-mode-shell-ready="true"] .workspace[data-assistant-expanded="true"]:has(>.chat:not(.closed))>.chat{position:absolute;grid-column:auto;grid-row:auto;right:0;width:var(--assistant-width);box-shadow:-14px 0 45px #172a2033}
}
.shell[data-mode-shell-ready="true"].focus-mode .workspace[data-assistant-sizing],.shell[data-mode-shell-ready="true"].focus-mode .workspace[data-assistant-sizing]:has(>.chat:not(.closed)){grid-template-columns:minmax(0,1fr)}

/* Shared feedback for native buttons, menu disclosures, and button-like controls. */
:is(button,[role="button"],summary):not(:disabled):not([aria-disabled="true"]){cursor:pointer;touch-action:manipulation;transition:box-shadow .12s ease,filter .12s ease,outline-color .12s ease}
@media(hover:hover){
 :is(button,[role="button"],summary):not(:disabled):not([aria-disabled="true"]):hover{box-shadow:0 0 0 2px var(--accent),0 3px 8px #0002;filter:brightness(1.06)}
}
:is(button,[role="button"],summary):not(:disabled):not([aria-disabled="true"]):is(:active,.control-pressed){box-shadow:inset 0 0 0 2px var(--accent),inset 0 3px 8px #0004;filter:brightness(.88)}
:is(button,[role="button"],summary):focus-visible{outline:3px solid var(--accent);outline-offset:3px}
:is(button,[role="button"]):is(:disabled,[aria-disabled="true"]){cursor:not-allowed;opacity:.55}
button[aria-busy="true"]{cursor:wait}
.assistant-cif-control{display:flex;flex-direction:column;gap:5px;margin:6px 0 10px}
#assistantCif{display:inline-flex;align-items:center;gap:10px;align-self:flex-start;min-height:42px;padding:7px 11px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:8px;font-size:inherit}
.assistant-cif-track{display:inline-flex;align-items:center;width:36px;height:22px;padding:3px;box-sizing:border-box;border:1px solid var(--ink);border-radius:12px;background:var(--line)}
.assistant-cif-track::after{content:'';width:14px;height:14px;flex-shrink:0;border-radius:50%;background:var(--ink)}
#assistantCif[aria-checked="true"] .assistant-cif-track{background:var(--accent);border-color:var(--accent)}
#assistantCif[aria-checked="true"] .assistant-cif-track::after{margin-left:auto;background:#fff}
#assistantCifHelp{line-height:1.35;color:var(--muted);font-size:12px}
@media(prefers-reduced-motion:reduce){:is(button,[role="button"],summary):not(:disabled):not([aria-disabled="true"]){transition:none}}

.usage-totals article{min-width:0;overflow-wrap:anywhere}
.usage-totals small{display:block;line-height:1.4}
.usage-totals .cost-unavailable{margin-top:6px;color:var(--ink)}
.usage-interactions{display:flex;flex-direction:column;gap:10px;margin:12px 0 20px}
.ai-cost-interaction{border:1px solid var(--line);border-radius:10px;background:var(--paper)}
.ai-cost-interaction>summary{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px;border-radius:9px;list-style:none}
.ai-cost-interaction>summary::-webkit-details-marker{display:none}
.ai-cost-interaction>summary::before{content:'▸';color:var(--accent)}
.ai-cost-interaction[open]>summary::before{content:'▾'}
.ai-cost-interaction>summary>span:first-of-type{flex:1;min-width:0}
.ai-cost-interaction time,.ai-cost-interaction small,.ai-request-cost span{display:block;font-size:12px;line-height:1.45;color:var(--muted)}
.interaction-amount,.request-amount{text-align:right;max-width:50%;overflow-wrap:anywhere}
.interaction-breakdown{padding:0 14px 10px}
.ai-request-cost{display:flex;justify-content:space-between;gap:16px;border-top:1px solid var(--line);padding:10px 0;overflow-wrap:anywhere}
.ai-request-cost>div{min-width:0}
@media(max-width:600px){.usage-totals{grid-template-columns:1fr}.ai-cost-interaction>summary{gap:8px}.ai-request-cost{flex-direction:column;gap:6px}.request-amount{text-align:left;max-width:100%}.interaction-amount{max-width:45%;font-size:14px}}

/* Read-only continuous chapter view. */
.chapter-reader-modal{align-items:flex-start;padding:0;overflow:auto}
.chapter-reader-card{width:min(760px,calc(100vw - 28px));max-height:none;margin:0 auto 28px;padding:0;overflow:visible}
.chapter-reader-head{position:sticky;top:0;z-index:62;display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;min-height:64px;padding:9px 12px 9px 18px;background:var(--paper);border-bottom:1px solid var(--line);border-radius:12px 12px 0 0;box-shadow:0 4px 12px #172a200d}
.chapter-reader-head>div:first-child{min-width:0}
.chapter-reader-head .eyebrow{display:none}
.chapter-reader-head h2{margin:0 0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 20px/1.15 Georgia,serif}
.chapter-reader-head p{margin:0;color:var(--muted);font-size:11px;line-height:1.2}
.chapter-reader-head-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto;margin-right:0}
.chapter-reader-head-actions .chapter-reader-close{position:static;float:none;display:grid;width:32px;height:32px;margin:0 0 0 2px;padding:0;flex:0 0 auto;font-size:20px;box-shadow:none}
.chapter-reader-collapse{flex:0 0 auto;transition:transform .16s ease}
.chapter-reader-card.reader-header-collapsed .chapter-reader-head{padding:5px 8px 5px 14px;min-height:42px}
.chapter-reader-card.reader-header-collapsed{padding-top:0}
.chapter-reader-card.reader-header-collapsed .chapter-reader-head>div{min-width:0;display:flex;align-items:center;gap:10px}
.chapter-reader-card.reader-header-collapsed .chapter-reader-head .eyebrow,.chapter-reader-card.reader-header-collapsed .chapter-reader-head p{display:none}
.chapter-reader-card.reader-header-collapsed .chapter-reader-head h2{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 14px/1.2 system-ui,sans-serif}
.chapter-reader-collapse{width:28px;height:28px;min-height:28px;padding:0;border:1px solid transparent;border-radius:7px;color:var(--muted);font-size:20px;line-height:1}
.chapter-reader-collapse:hover{border-color:var(--line);color:var(--accent-strong)}
.chapter-reader-card.reader-header-collapsed .chapter-reader-collapse{width:26px;height:26px;min-height:26px;font-size:18px}
.chapter-reader-card.reader-header-collapsed .chapter-reader-picker{display:none}
.chapter-reader-picker{display:flex;align-items:center;gap:12px;padding:14px 28px;background:var(--panel);border-bottom:1px solid var(--line)}
.chapter-reader-picker span{font-weight:700}
.chapter-reader-picker select{flex:1;max-width:520px}
.chapter-reader-floating-edit{min-height:30px;padding:5px 10px;border-radius:8px;font-size:12px;line-height:1.2;box-shadow:none}
.chapter-reader-card.reader-header-collapsed .chapter-reader-head-actions{gap:5px;margin-right:0}
.chapter-reader-card.reader-header-collapsed .chapter-reader-close{width:28px;height:28px;margin-left:2px;font-size:18px}
.chapter-reader-card.reader-header-collapsed .chapter-reader-floating-edit{min-height:24px;padding:3px 7px;border-radius:6px;font-size:10px;box-shadow:none}
.chapter-reader-document{max-width:760px;margin:auto;padding:36px 56px 56px}
.chapter-reader-scene+ .chapter-reader-scene{margin-top:54px;padding-top:40px;border-top:1px solid var(--line)}
.chapter-reader-scene-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0 0 24px}
.chapter-reader-scene h3{margin:0;color:var(--muted);font:700 14px/1.3 system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase}
.chapter-reader-edit{flex:0 0 auto}
.chapter-reader-prose{color:var(--ink);font:clamp(17px,1.35vw,20px)/1.75 Georgia,'Times New Roman',serif}
.chapter-reader-prose p{margin:0 0 1.15em;white-space:normal}
.chapter-reader-break{margin:2.1em 0;text-align:center;letter-spacing:.65em;color:var(--muted)}
.chapter-reader-footer{display:flex;justify-content:flex-end;padding:16px 28px;background:var(--panel);border-top:1px solid var(--line)}
@media(max-width:640px){.chapter-reader-head{min-height:62px;padding:8px 10px 8px 14px}.chapter-reader-head h2{font-size:17px}.chapter-reader-card.reader-header-collapsed .chapter-reader-head{padding-block:5px}.chapter-reader-picker{align-items:stretch;flex-direction:column;padding:12px 18px}.chapter-reader-document{padding:28px 20px 42px}.chapter-reader-scene-head{align-items:flex-start;flex-direction:column}.chapter-reader-footer{padding:14px 18px}}
.prose-voice-modal{align-items:flex-start;overflow:auto;padding:clamp(10px,2.5vh,28px)}
.prose-voice-card{width:min(1220px,calc(100vw - 24px));max-height:none;margin:auto}
.craft-mode-switch{display:inline-flex;gap:3px;margin:18px 0 4px;padding:4px;border:1px solid var(--line);border-radius:13px;background:var(--panel)}
.craft-mode-switch button{min-width:150px;padding:10px 16px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-weight:750;cursor:pointer;transition:background .12s ease,color .12s ease,transform .12s ease}
.craft-mode-switch button:hover{background:var(--paper);color:var(--ink)}
.craft-mode-switch button:active{transform:translateY(1px)}
.craft-mode-switch button.active{background:var(--accent);color:#fff;box-shadow:0 1px 4px #0002}
.craft-mode-pane[hidden]{display:none!important}
.assistant-critique-pane{display:grid;gap:18px;max-width:800px;margin:24px auto;padding:24px;border:1px solid var(--line);border-radius:16px;background:var(--panel)}
.assistant-critique-intro h3,.assistant-critique-intro p{margin:0}
.assistant-critique-intro p{margin-top:8px;color:var(--muted);line-height:1.5}
.assistant-charge-note{display:grid;gap:4px;padding:14px 16px;border-left:4px solid var(--accent);background:var(--paper)}
.assistant-charge-note span{color:var(--muted)}
.assistant-critique-result{margin-top:6px;padding-top:18px;border-top:1px solid var(--line)}
.prose-voice-toolbar{display:grid;grid-template-columns:minmax(150px,.7fr) minmax(180px,.9fr) minmax(280px,1.5fr) auto;gap:12px;align-items:end;margin:18px 0}
.prose-voice-toolbar label{display:grid;gap:6px;font-weight:700}
.watchlist-field input{min-width:0}
.voice-fingerprint{padding:16px 18px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.voice-fingerprint h3{margin:0 0 8px}
.voice-fingerprint p{margin:5px 0;color:var(--muted)}
.prose-voice-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:9px;margin:16px 0}
.prose-voice-summary button{min-height:74px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);text-align:left;cursor:pointer;transition:transform .12s ease,border-color .12s ease,background .12s ease}
.prose-voice-summary button:hover{transform:translateY(-1px);border-color:var(--accent);background:var(--panel)}
.prose-voice-summary button:active{transform:translateY(1px)}
.prose-voice-summary strong,.prose-voice-summary span{display:block}
.prose-voice-summary strong{font-size:22px;color:var(--accent)}
.prose-voice-summary span{margin-top:3px;font-size:12px}
.prose-voice-layout{min-height:410px}
.prose-voice-layout blockquote{white-space:pre-wrap}
.finding-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}
.ai-consent{margin-top:18px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.prose-voice-footer{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.prose-voice-footer p{margin:0;color:var(--muted)}
@media(max-width:850px){.craft-mode-switch{display:grid;grid-template-columns:1fr 1fr;width:100%}.craft-mode-switch button{min-width:0}.prose-voice-toolbar{grid-template-columns:1fr}.prose-voice-layout{grid-template-columns:1fr}.prose-voice-footer{align-items:flex-start;flex-direction:column}}
.review-home-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:22px}.review-home-action{display:grid;gap:6px;padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);text-align:left}.review-home-action:hover,.review-home-action:focus{border-color:var(--accent);background:var(--surface-2);outline:3px solid color-mix(in srgb,var(--accent) 14%,transparent)}.review-home-action strong{font-size:16px}.review-home-action span{color:var(--muted);line-height:1.45}@media(max-width:700px){.review-home-grid{grid-template-columns:1fr}}
.craft-focus-highlight{outline:3px solid color-mix(in srgb,var(--accent) 55%,transparent);outline-offset:3px;transition:outline-color .2s ease}
.brand{width:148px;height:42px;flex:0 0 148px;background:url("myaos-primary-logo.png?v=official-1") center/contain no-repeat}.brand span{display:none}.login-mark{width:100%;max-width:310px;height:auto;aspect-ratio:3.6/1;margin:0 auto 12px;border-radius:0;background:transparent url("myaos-primary-logo.png?v=official-1") center/contain no-repeat;box-shadow:none;color:transparent;text-indent:-9999px}.login-card h1{display:none}

.draft-recovery{padding:12px;background:var(--surface,#f0f5ef);border:1px solid var(--line,#cbd7ca);border-radius:8px;font-size:.9rem}.draft-recovery button{margin:4px}.draft-comparison{max-width:900px;width:min(900px,95vw)}.draft-comparison textarea{min-height:180px}#sessionDialog{z-index:10000}#reauthError{color:#a13428}
