/* The manuscript owns the screen. Panels are optional, not permanent columns.
   Wide grid: optional 236px directory OR 320px AI panel + remaining manuscript.
   Manuscript measure: 720px with equal flexible gutters. Mobile: 20px each side. */
:root{--ink:#464261;--muted:#746c80;--line:#e9dfd8;--control:#d7c8c8;--surface:#fffaf3;--ground:#faf4ed;--selected:#eadde2;--negative:#a23e36;--sans:"PingFang SC","Microsoft YaHei",sans-serif;--prose:"Noto Serif SC","Songti SC","SimSun",serif;--radius:5px;--space:8px}
*{box-sizing:border-box}body{margin:0;height:100dvh;overflow:hidden;color:var(--ink);background:var(--surface);font:14px/1.65 var(--sans);-webkit-font-smoothing:antialiased}h1,h2,h3,p{margin:0}h1,h2,h3{font-family:var(--sans)}a{color:inherit;text-underline-offset:3px}button,input,textarea,select{font:inherit;color:inherit}button{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--control);border-radius:var(--radius);padding:7px 12px;line-height:1.5;background:var(--surface);cursor:pointer;transition:background-color .15s}button:hover{background:var(--selected)}button:active{background:#eadde2}button:disabled{color:#8e938d;opacity:.6;cursor:default}.quiet,.icon-button{border-color:transparent;background:transparent}.quiet:hover,.icon-button:hover{background:var(--selected)}.primary{background:var(--ink);border-color:var(--ink);color:var(--surface)}.primary:hover{background:#804359}.primary:disabled{color:#c5c9c3;background:#575b56}.icon-button{padding:7px;min-width:34px;min-height:34px}button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #795c72;outline-offset:3px}.ui-icon{height:17px;width:17px;flex-shrink:0;vertical-align:middle}input,textarea,select{max-width:100%;border:1px solid var(--control);border-radius:var(--radius);padding:9px 10px;background:var(--surface);caret-color:var(--ink)}textarea{resize:vertical;line-height:1.85}input::placeholder,textarea::placeholder{color:#746c80}::selection{background:#eadde2;color:#464261}.topbar{height:52px;background:var(--ground);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 20px;border-bottom:1px solid var(--line)}.brand-group,.top-actions{display:flex;align-items:center;gap:10px}.brand{font-size:14px;font-weight:600;white-space:nowrap;text-decoration:none}.top-actions button{font-size:12px;padding:6px 10px}.mode{font-size:11px;color:var(--muted);margin-right:6px}.top-actions #assistant-toggle{margin-left:6px}.top-actions #assistant-toggle[aria-expanded=true],#directory-toggle[aria-expanded=true]{background:var(--selected);border-color:var(--control)}.layout{height:calc(100dvh - 52px);display:grid;grid-template-columns:minmax(0,1fr);min-height:0}.library,.inspector{display:none;overflow-y:auto;min-height:0;background:var(--ground);scrollbar-width:thin;scrollbar-color:#b7a9b4 transparent}.directory-open .layout{grid-template-columns:236px minmax(0,1fr)}.directory-open .library{display:flex}.assistant-open .layout{grid-template-columns:minmax(0,1fr) 320px}.assistant-open .inspector{display:block}.library{border-right:1px solid var(--line);padding:24px 16px 16px;flex-direction:column}.library-top label{display:block;font-size:12px;color:var(--muted);margin-bottom:8px}.library-top select{width:100%;font-size:13px;background:transparent;padding:8px}.book-meta{display:flex;justify-content:space-between;gap:8px;margin-top:10px;font-size:11px;color:var(--muted)}.library-tools{display:flex;justify-content:space-between;gap:3px;margin:16px -4px 26px}.library-tools button{padding:6px;font-size:12px;white-space:nowrap}.chapter-heading{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--muted);margin-bottom:5px}.volume-title{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin:16px 4px 8px;font-size:12px;color:var(--muted)}.volume-title small{font-size:11px;margin-left:2px}.chapter-item{width:100%;display:flex;justify-content:flex-start;gap:9px;text-align:left;border:0;background:transparent;padding:10px 8px;margin:2px 0;font-size:12px}.chapter-item.active{background:var(--selected);font-weight:500}.chapter-name{flex:1;overflow-wrap:anywhere}.num{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}.done{display:grid;place-items:center}.done svg{height:12px;width:12px;color:var(--muted)}.empty-dot{width:4px;height:4px;background:#b7a9b4;border-radius:50%}.outline-button{margin-top:20px;font-size:12px;background:transparent}.library-bottom{margin-top:auto;padding-top:32px;font-size:11px;color:var(--muted);display:flex;flex-direction:column;align-items:flex-start;gap:7px}.library-bottom button{padding:4px 0;font-size:11px}.backup-warning{color:var(--negative)}.workspace{min-width:0;overflow-y:auto;padding:0 32px 40px;scrollbar-width:thin;scrollbar-color:#b7a9b4 transparent;scrollbar-gutter:stable}.workspace-heading,.tabs,#content{max-width:720px;margin-left:auto;margin-right:auto}.workspace-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-top:25px}.workspace-heading h1{font-size:14px;font-weight:500;overflow-wrap:anywhere}.breadcrumb{font-size:11px;color:var(--muted);text-align:right}.tabs{display:flex;align-items:center;gap:24px;margin-top:18px;margin-bottom:18px;border-bottom:1px solid var(--line)}.tabs button{border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;padding:8px 0 10px;font-size:12px;color:var(--muted);white-space:nowrap}.tabs button.active{border-bottom-color:var(--ink);color:var(--ink)}.tabs button span{font-size:11px;margin-left:2px;color:var(--muted)}.editor-tools{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.type-controls,.paper-tools{display:flex;align-items:center;gap:3px}.type-controls button{border:0;background:transparent;font-family:Georgia,serif;padding:6px;font-size:13px}.type-controls span{font-size:11px;color:var(--muted);min-width:16px;text-align:center;font-variant-numeric:tabular-nums}.paper-tools button{font-size:12px;padding:6px 8px;color:var(--muted)}.plan-strip{font-size:12px;color:var(--muted);margin-bottom:28px;border-bottom:1px solid var(--line);padding-bottom:12px}.plan-strip summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:9px;width:fit-content}.plan-strip summary:before{content:"";width:6px;height:6px;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:rotate(-45deg);margin-right:3px}.plan-strip[open] summary:before{transform:rotate(45deg)}.plan-strip summary span{font-size:11px;color:var(--muted)}.plan-strip>div{padding:12px 0 0;line-height:1.9}.plan-strip button{padding:4px 0;margin-top:7px;font-size:12px;text-decoration:underline;text-underline-offset:3px}.editor-paper{background:var(--surface)}.manuscript{padding:8px 0 20px}.chapter-title-input{display:block;width:100%;border:0;border-radius:0;background:transparent;padding:0 0 12px;font:500 28px/1.7 var(--prose);margin-bottom:20px}.chapter-text{display:block;width:100%;border:0;border-radius:0;resize:none;overflow:hidden;padding:0;min-height:440px;font:18px/2.1 var(--prose);background:transparent;color:#464261;letter-spacing:.1px}.chapter-title-input:focus-visible,.chapter-text:focus-visible{outline:0;box-shadow:-1px 0 0 #b7a9b4}.chapter-title-input:focus-visible{box-shadow:0 1px 0 #b7a9b4}.paper-footer{display:flex;justify-content:space-between;gap:12px;font-size:11px;color:var(--muted);padding:14px 0;border-top:1px solid var(--line);font-variant-numeric:tabular-nums}.chapter-navigation{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:12px;color:var(--muted);font-size:11px}.chapter-navigation button{font-size:12px;padding:8px 0}.chapter-navigation .ui-icon{height:14px;width:14px}.inspector{padding:22px 22px 30px;border-left:1px solid var(--line)}.assistant-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.assistant-heading h2{font-size:15px;font-weight:600}.assistant-chapter{font-size:12px;color:var(--muted);margin:7px 0 26px;overflow-wrap:anywhere}.assistant-section{padding-bottom:24px;margin-bottom:24px;border-bottom:1px solid var(--line)}.section-caption{display:block;font-size:12px;margin:0 0 7px}.optional{font-size:11px;color:var(--muted);margin-left:7px}.assistant-section select{display:block;width:100%;font-size:13px;margin-bottom:20px}.assistant-section textarea{display:block;width:100%;min-height:116px;font-size:13px;margin-bottom:12px}.assistant-section>.primary{width:100%;font-size:13px;padding:10px}.helper{font-size:12px;color:var(--muted);line-height:1.8;margin:10px 0}.generation-status{font-size:12px;margin-top:12px;color:var(--muted)}.section-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.section-row h3{font-size:13px;font-weight:500}.section-row>span{font-size:11px;color:var(--muted)}.context-item{display:flex;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);cursor:pointer}.context-item:last-child{border:0}.context-item input{width:14px;height:14px;accent-color:var(--ink);flex-shrink:0;margin:0}.context-label{min-width:0;display:flex;justify-content:space-between;gap:8px;align-items:center;flex:1}.context-label b{font-weight:400;font-size:12px;overflow-wrap:anywhere}.context-label small{font-size:11px;color:var(--muted);white-space:nowrap}.context-details{font-size:12px;color:var(--muted)}.context-details summary{cursor:pointer}.sample-note{font-size:12px;color:var(--muted);line-height:1.85;margin-top:22px}.view-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:30px 0 24px}.view-heading h2{font-size:20px;font-weight:500}.view-heading p{font-size:12px;color:var(--muted);line-height:1.9;margin-top:8px}.view-heading button{font-size:12px;white-space:nowrap}.view-heading .ui-icon{height:14px;width:14px}.card-filter{display:flex;gap:12px;margin-bottom:12px}.card-filter input{flex:1;min-width:0;font-size:13px}.card-filter select{font-size:13px;width:100px}.filter-count{font-size:11px;color:var(--muted);margin-bottom:16px}.card-grid{display:block}.setting-card{display:flex;flex-direction:column;padding:22px 0;border-top:1px solid var(--line)}.card-type{display:flex;justify-content:space-between;gap:8px;font-size:11px;color:var(--muted);margin-bottom:6px}.card-ref-status{font-size:11px}.setting-card h3{font-size:16px;font-weight:500;margin-bottom:8px}.setting-card p{font-size:13px;line-height:1.9;color:#625971;white-space:pre-wrap;overflow-wrap:anywhere}.card-buttons{display:flex;gap:12px;align-items:center;margin-top:13px}.card-buttons button{font-size:12px;padding:4px 0;border:0;background:transparent;text-decoration:underline;text-underline-offset:3px}.card-buttons svg{display:none}.card-buttons .danger{margin-left:auto}.danger{color:var(--negative)}.outline-block{margin:24px 0 30px}.outline-block label{display:block;font-size:13px;margin-bottom:8px}.outline-block textarea,.outline-block input{width:100%;font-size:14px}.outline-block h3{font-size:14px;font-weight:500}.outline-chapter{border-bottom:1px solid var(--line);padding:20px 0}.outline-chapter b{font-size:14px;font-weight:500}.outline-chapter p{font-size:12px;color:var(--muted);line-height:1.9;margin-top:7px}.outline-chapter button{font-size:12px;padding:5px 0;margin-top:6px}.flow-item{display:flex;gap:20px;border-top:1px solid var(--line);padding:24px 0}.flow-number{font-size:12px;color:var(--muted);min-width:15px;padding-top:2px}.flow-item h3{font-size:15px;font-weight:500}.flow-item p{font-size:12px;color:var(--muted);margin:8px 0 12px}.flow-item button{font-size:12px}.empty{padding:32px 0;color:var(--muted);font-size:13px}.empty h3{font-size:15px;font-weight:500;margin-bottom:10px}.empty p{margin-bottom:16px}.empty button{font-size:12px}dialog{width:min(620px,calc(100% - 32px));max-height:85dvh;padding:26px;border:1px solid var(--control);border-radius:12px;background:var(--surface);color:var(--ink);box-shadow:0 16px 48px #4642611a}dialog::backdrop{background:#34304166}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:22px}.dialog-head h2{font-size:20px;font-weight:500}.dialog-head button{border:0;background:transparent;font-size:24px;padding:0 7px}.form-field{display:block;font-size:13px;margin:18px 0}.form-field input,.form-field select,.form-field textarea{display:block;width:100%;margin-top:7px;font-size:14px}.dialog-note{font-size:13px;color:var(--muted);line-height:1.9;margin:16px 0;overflow-wrap:anywhere}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:18px;margin-top:24px}.dialog-actions button{font-size:13px}.candidate-text{font:16px/2 var(--prose);white-space:pre-wrap;max-height:40dvh;overflow:auto;padding:18px;background:var(--ground);border-radius:5px}.history-item{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:16px 0;border-bottom:1px solid var(--line);font-size:12px}.history-item button{font-size:12px}.model-rows{font-size:13px;line-height:2.2;border-bottom:1px solid var(--line);padding-bottom:16px;overflow-wrap:anywhere}.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,10px);opacity:0;pointer-events:none;max-width:90vw;padding:11px 18px;background:var(--ink);color:var(--surface);border-radius:6px;font-size:12px;z-index:10;transition:opacity .15s,transform .15s}.toast.visible{opacity:1;transform:translate(-50%,0)}body.focus-mode .workspace-heading,body.focus-mode .tabs,body.focus-mode .plan-strip{display:none}body.focus-mode .editor-tools{margin-top:22px}body.focus-mode .manuscript{padding-top:28px}body.focus-mode .library,body.focus-mode .inspector{display:none}body.focus-mode .layout{grid-template-columns:minmax(0,1fr)}[hidden]{display:none!important}
@media(min-width:1500px){.workspace-heading,.tabs,#content{max-width:740px}.manuscript{padding-top:14px}.chapter-text{line-height:2.2}}
@media(max-width:1000px){body{height:auto;min-height:100dvh;overflow:auto}.topbar{position:sticky;top:0;z-index:4;height:52px;padding:0 16px}.layout{height:auto;min-height:calc(100dvh - 52px);display:block!important}.workspace{padding:0 28px 35px;overflow:visible;scrollbar-gutter:auto}.directory-open .workspace,.assistant-open .workspace{display:none}.directory-open .library{display:flex;min-height:calc(100dvh - 52px);border:0;padding:24px max(24px,calc((100vw - 600px)/2))}.assistant-open .inspector{display:block;min-height:calc(100dvh - 52px);border:0;padding:24px max(24px,calc((100vw - 600px)/2))}.library-top select{font-size:15px}.chapter-item{font-size:14px;min-height:44px}.library-tools{justify-content:flex-start;gap:16px}.library-tools button{font-size:13px}.library-bottom{padding-top:32px}.assistant-section textarea,.assistant-section select{font-size:16px}.assistant-section>.primary{min-height:44px}.context-item{min-height:46px}.context-label b{font-size:14px}.context-label small{font-size:12px}.top-actions #export{display:none}.workspace-heading{margin-top:22px}.directory-open .library-bottom{margin-top:32px}.top-actions .mode{display:none}}
@media(max-width:650px){.topbar{padding:0 12px;gap:8px}.brand-group{gap:6px}.brand{font-size:13px}.top-actions{gap:3px}.top-actions #new-project,.top-actions #settings{display:none}.top-actions #assistant-toggle{font-size:12px;margin-left:0;padding:7px 11px}.workspace{padding:0 20px 28px}.workspace-heading{margin-top:22px;align-items:flex-start}.workspace-heading h1{font-size:13px}.breadcrumb{font-size:11px;max-width:52%}.tabs{gap:26px;margin-top:14px;margin-bottom:16px}.tabs button{font-size:13px}.tabs button span{font-size:11px}.editor-tools{margin-bottom:12px}.paper-tools button{min-height:36px}.plan-strip{margin-bottom:24px}.plan-strip summary{min-height:32px}.chapter-title-input{font-size:25px;line-height:1.7;margin-bottom:22px}.chapter-text{font-size:18px;line-height:2}.paper-footer{font-size:11px;flex-wrap:wrap}.chapter-navigation{font-size:11px;gap:6px}.chapter-navigation button{min-height:44px;font-size:12px}.view-heading{align-items:flex-start;gap:12px}.view-heading h2{font-size:20px}.view-heading p{font-size:12px}.view-heading button{padding:8px 10px;min-height:40px;font-size:12px}.view-heading .ui-icon{display:none}.card-filter{gap:8px}.card-filter input{font-size:16px;width:100%}.card-filter select{width:86px;font-size:14px;padding:8px}.setting-card p{font-size:14px}.card-buttons{gap:16px}.card-buttons button{min-height:40px}.form-field input,.form-field select,.form-field textarea{font-size:16px}.outline-block textarea{font-size:16px}.history-item{flex-wrap:wrap}.history-item button{min-height:40px}dialog{padding:22px;max-height:88dvh}.dialog-head h2{font-size:19px}.dialog-actions button{min-height:42px}.toast{bottom:18px;font-size:12px}.assistant-section select{min-height:44px}.helper,.sample-note{font-size:12px}.library .book-meta{font-size:12px}.chapter-heading{font-size:13px}.volume-title{font-size:13px}.volume-title small{font-size:12px}.outline-button{min-height:44px}.library-tools button{min-height:40px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
.mobile-only{display:none}.panel-settings{font-size:12px;margin-top:10px;padding-left:0}
@media(max-width:650px){.mobile-only{display:inline-flex;align-self:flex-start;font-size:13px;margin-bottom:20px;min-height:40px}}
/* Application navigation remains visible until the writer chooses focus mode. */
.topbar{height:68px;background:#fffaf3;padding:0 28px;gap:28px}.brand-group{gap:9px}.brand{font-size:16px;letter-spacing:.4px}.primary-nav{display:flex;align-self:stretch;align-items:stretch;gap:28px;margin-right:auto;margin-left:24px}.primary-nav button{position:relative;white-space:nowrap;border:0;border-radius:0;background:transparent;color:var(--muted);padding:0 2px;font-size:14px}.primary-nav button[aria-current=page]{color:#98536c;font-weight:600}.primary-nav button[aria-current=page]:after{content:"";position:absolute;height:3px;background:#98536c;bottom:0;left:0;right:0}.primary-nav button:hover{color:var(--ink)}.layout{height:calc(100dvh - 68px)}.top-actions #assistant-toggle{color:#98536c;border-color:#ddc5cf;background:#f7eeef}.mode{display:flex;align-items:center;gap:6px}.mode:before{content:"";width:5px;height:5px;border-radius:50%;background:#668679}.books-screen .layout{display:none!important}.books-screen #directory-toggle{display:none}.books-view{height:calc(100dvh - 68px);overflow-y:auto;padding:52px max(32px,calc((100vw - 1100px)/2));background:#faf4ed}.books-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:32px}.books-heading h1{font-size:28px;font-weight:600}.books-heading p{font-size:13px;color:var(--muted);margin-top:8px}.books-heading .primary{background:#98536c;border-color:#98536c;padding:10px 16px}.books-list{background:#fffaf3;border:1px solid var(--line);border-radius:8px;padding:0 28px}.book-row{display:flex;align-items:center;gap:26px;padding:30px 0;border-bottom:1px solid var(--line)}.book-row:last-child{border:0}.book-spine{width:64px;height:88px;display:grid;place-items:center;flex-shrink:0;background:#f7eeef;border-left:4px solid #ac8996;border-radius:2px 5px 5px 2px;color:#625971}.book-spine svg{width:27px;height:27px}.book-description{flex:1;min-width:0}.book-kicker{font-size:11px;color:var(--muted);display:flex;align-items:center;gap:12px}.book-kicker span{color:#8b6275}.book-description h2{font-size:20px;font-weight:600;margin:5px 0 7px}.book-description>p{font-size:13px;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-width:650px}.book-progress{display:flex;gap:18px;font-size:12px;color:var(--muted);margin-top:14px}.book-row>button{font-size:13px;flex-shrink:0}.books-storage{margin-top:20px;font-size:12px;color:var(--muted)}body.focus-mode .topbar{display:none}body.focus-mode .layout{height:100dvh}
@media(max-width:1150px){.topbar{gap:16px;padding:0 20px}.primary-nav{margin-left:8px;gap:20px}.top-actions .mode{display:none}.top-actions #new-project{display:none}}
@media(max-width:1000px){.topbar{height:68px}.layout{height:auto;min-height:calc(100dvh - 68px)}.directory-open .library,.assistant-open .inspector{min-height:calc(100dvh - 68px)}.books-view{height:auto;min-height:calc(100dvh - 68px)}body.focus-mode .layout{height:auto;min-height:100dvh}}
@media(max-width:700px){.topbar{height:104px;flex-wrap:wrap;gap:0;padding:0 16px;align-content:space-between}.brand-group,.top-actions{height:55px}.primary-nav{order:3;flex-basis:100%;height:49px;margin:0;gap:30px;justify-content:flex-start}.primary-nav button{font-size:13px}.top-actions{margin-left:auto}.layout{min-height:calc(100dvh - 104px)}.directory-open .library,.assistant-open .inspector{min-height:calc(100dvh - 104px)}.books-view{padding:28px 20px;min-height:calc(100dvh - 104px)}.books-heading{gap:12px;margin-bottom:22px}.books-heading h1{font-size:24px}.books-heading .primary{font-size:12px;padding:9px 12px}.books-list{padding:0 18px}.book-row{gap:16px;padding:24px 0;flex-wrap:wrap}.book-spine{width:44px;height:66px;align-self:flex-start;margin-top:4px}.book-description h2{font-size:18px}.book-description{flex-basis:calc(100% - 60px)}.book-row>button{margin-left:60px;min-height:40px}.book-description>p{font-size:12px}.books-storage{line-height:1.9}.top-actions #settings{display:none}}
.pending-draft{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:18px 0;padding:12px 14px;background:#f7eeef;border:1px solid #ddc5cf;border-radius:5px;font-size:12px;color:#98536c}.pending-draft button{font-size:12px;flex-shrink:0}.assistant-section #review-candidate{width:100%;margin:10px 0 0}.generation-status{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:650px){.pending-draft{align-items:flex-start;flex-direction:column;gap:8px}.pending-draft button{min-height:40px}}
.chapter-review-tools h3{font-size:13px;font-weight:500}.chapter-review-tools>button{font-size:12px;margin:4px 6px 0 0}.review-summary{font-size:14px;line-height:1.9;margin:18px 0;overflow-wrap:anywhere}.review-verdicts{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:18px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.review-verdicts h3,.review-issue h3{font-size:13px;font-weight:600}.review-verdicts p,.review-issue>p{font-size:13px;line-height:1.85;margin-top:8px;overflow-wrap:anywhere}.review-warning{background:#fff7e8;color:#785714;font-size:13px;padding:12px 14px;border:1px solid #e5d2a7;border-radius:5px}.review-issue{padding:20px 0;border-top:1px solid var(--line)}.review-issue-heading{display:flex;align-items:center;gap:12px}.review-severity{font-size:11px;border:1px solid var(--control);border-radius:4px;padding:2px 7px;color:var(--muted)}.review-issue blockquote{margin:12px 0;padding:10px 14px;border-left:2px solid #ac8996;background:var(--ground);font-size:13px;line-height:1.9;overflow-wrap:anywhere}.review-issue blockquote small{font-size:11px;color:var(--muted)}.review-issue blockquote p{white-space:pre-wrap;margin-top:5px}.review-suggestion{color:#98536c}
@media(max-width:650px){.review-verdicts{grid-template-columns:1fr;gap:14px}.paper-tools{gap:0}.paper-tools button{padding:6px}.dialog-actions{gap:8px}}
.view-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.development-item{padding:18px 0;border-top:1px solid var(--line)}.development-item label{display:flex;align-items:center;gap:9px;font-size:13px;font-weight:500;line-height:1.8}.development-item input{accent-color:#98536c;flex-shrink:0}.development-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.95;margin-top:12px;color:#625971}
@media(max-width:650px){.view-heading:has(.view-actions){flex-wrap:wrap}.view-actions{justify-content:flex-start}.view-actions button{min-height:40px}.development-item label{align-items:flex-start}.development-item input{margin-top:5px}}
/* Writer workspace: visible left navigation and a readable application scale.
   Slate ink #464261, blue accent #98536c, rail #f2e9e1, ground #faf4ed, white paper. */
:root{--ink:#464261;--muted:#746c80;--ground:#f2e9e1;--line:#e9dfd8;--control:#d7c8c8;--selected:#eadde2;--sidebar-width:236px;--accent:#98536c}
body{font-size:15px;background:#faf4ed}.app-sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-width);display:flex;flex-direction:column;padding:28px 18px 20px;background:#f2e9e1;border-right:1px solid var(--line);z-index:6;overflow-y:auto}.app-sidebar .brand{display:block;font-size:23px;font-weight:700;letter-spacing:1px;margin:0 14px;color:#72465e}.sidebar-caption{font-size:13px;color:var(--muted);margin:5px 14px 25px}.sidebar-create{font-size:15px;font-weight:600;width:100%;min-height:44px;margin-bottom:27px;background:var(--accent);color:white;border-color:var(--accent)}.sidebar-create:hover{background:#804359}.primary-nav{display:flex;flex-direction:column;align-self:stretch;align-items:stretch;gap:7px;margin:0;height:auto;flex-basis:auto}.primary-nav button{display:flex;align-items:center;justify-content:flex-start;gap:13px;width:100%;min-height:48px;text-align:left;font-size:16px;line-height:1.5;padding:11px 15px;border:1px solid transparent;border-radius:8px;color:#625971;background:transparent;white-space:normal}.primary-nav button .ui-icon{width:20px;height:20px}.primary-nav button[aria-current=page]{background:#eadde2;color:#72465e;border-color:#ddc5cf;font-weight:600}.primary-nav button[aria-current=page]:after{content:none}.primary-nav button:hover{background:#eadde2}.sidebar-tools{display:flex;flex-direction:column;gap:5px;border-top:1px solid var(--line);margin-top:26px;padding-top:20px}.sidebar-tools>p{font-size:12px;color:var(--muted);margin:0 15px 7px}.sidebar-tools button,.sidebar-footer button{justify-content:flex-start;text-align:left;font-size:15px;padding:10px 15px;background:transparent;border-color:transparent;min-height:42px}.sidebar-tools button:hover,.sidebar-footer button:hover{background:#eadde2}.sidebar-footer{margin-top:auto;padding-top:30px;display:flex;flex-direction:column;gap:3px}.sidebar-footer>span{font-size:12px;line-height:1.7;color:var(--muted);margin:10px 15px 0}.topbar{margin-left:var(--sidebar-width);width:calc(100% - var(--sidebar-width));height:76px;padding:0 32px;background:#fffaf3;gap:16px;flex-wrap:nowrap;align-content:normal;position:relative;z-index:4}.topbar-heading{display:flex;align-items:center;gap:12px;min-width:0}#section-title{font-size:20px;font-weight:600;white-space:nowrap}#global-nav-toggle{display:none}.top-actions{gap:12px;margin:0;height:auto}.top-actions button,.top-actions #assistant-toggle{font-size:15px;padding:9px 15px;min-height:42px;margin:0}.top-actions #assistant-toggle{background:#98536c;border-color:#98536c;color:white}.top-actions #assistant-toggle:hover{background:#804359}.top-actions #assistant-toggle[aria-expanded=true]{background:#804359;border-color:#804359}.top-actions #directory-toggle[aria-expanded=true]{background:#eadde2;border-color:#ddc5cf}.top-actions .mode{display:flex;font-size:13px;margin:0 6px 0 0;white-space:nowrap}.layout{width:calc(100% - var(--sidebar-width));height:calc(100dvh - 76px);margin-left:var(--sidebar-width)}.workspace{padding:0 32px 40px;background:#faf4ed}.workspace-heading,.tabs,#content{max-width:920px}.workspace-heading{margin-top:27px;align-items:center}.workspace-heading h1{font-size:22px;font-weight:600}.breadcrumb{font-size:13px}.tabs{gap:30px;margin-top:15px;margin-bottom:22px}.tabs button{font-size:16px;padding:11px 0 13px}.tabs button span{font-size:13px}#content{background:white;border:1px solid var(--line);border-radius:10px;padding:26px 32px;min-height:320px}.manuscript{max-width:740px;margin:0 auto;padding-top:18px}.chapter-title-input{font-size:30px}.chapter-text{font-size:18px;line-height:2.1}.editor-tools,.plan-strip,.paper-footer,.chapter-navigation{max-width:740px;margin-left:auto;margin-right:auto}.paper-tools button{font-size:14px;padding:7px 10px}.type-controls button{font-size:15px}.type-controls span{font-size:13px}.plan-strip{font-size:14px;padding-bottom:17px}.plan-strip summary span{font-size:13px}.plan-strip button{font-size:14px}.paper-footer,.chapter-navigation{font-size:13px}.chapter-navigation button{font-size:14px}.library{padding:25px 18px;background:#fffaf3}.library-top label,.chapter-heading{font-size:14px}.library-top select{font-size:15px}.book-meta,.library .book-meta{font-size:12px}.library-tools{gap:4px;margin-bottom:20px}.library-tools button{font-size:13px}.chapter-item{font-size:14px;min-height:44px;padding:11px 8px}.volume-title{font-size:13px}.outline-button{font-size:14px}.library-bottom,.library-bottom button{font-size:12px}.inspector{padding:24px;background:white}.assistant-heading h2{font-size:19px}.assistant-chapter{font-size:14px}.section-caption,.assistant-section select,.assistant-section textarea,.assistant-section>.primary{font-size:15px}.helper,.sample-note,.context-details,.generation-status{font-size:13px}.assistant-section h3,.section-row h3{font-size:15px;font-weight:600}.assistant-section button,.chapter-review-tools>button{font-size:14px;min-height:40px}.context-label b{font-size:14px}.context-label small{font-size:12px}.view-heading{margin-top:5px}.view-heading h2{font-size:24px;font-weight:600}.view-heading p{font-size:14px}.view-heading button,.view-actions button{font-size:14px;min-height:40px}.outline-block label,.outline-block h3{font-size:16px}.outline-block textarea,.outline-block input{font-size:15px}.outline-chapter b{font-size:16px}.outline-chapter p,.outline-chapter button{font-size:14px}.setting-card h3{font-size:19px}.setting-card p{font-size:15px}.card-type,.card-ref-status,.filter-count{font-size:13px}.card-filter input,.card-filter select,.card-buttons button{font-size:14px}.flow-item h3{font-size:18px}.flow-item p,.flow-item button{font-size:14px}.books-view{width:calc(100% - var(--sidebar-width));margin-left:var(--sidebar-width);height:calc(100dvh - 76px);padding:38px max(32px,calc((100vw - var(--sidebar-width) - 1040px)/2));background:#faf4ed}.books-heading h1{font-size:30px}.books-heading p,.books-heading .primary{font-size:15px}.book-kicker,.book-progress{font-size:13px}.book-description h2{font-size:23px}.book-description>p,.book-row>button,.books-storage{font-size:14px}.books-screen #directory-toggle{display:inline-flex}dialog{width:min(760px,calc(100% - 32px));padding:28px;max-height:88dvh}.dialog-head h2{font-size:23px;font-weight:600}.dialog-note,.form-field{font-size:15px}.form-field input,.form-field select,.form-field textarea{font-size:15px}.dialog-actions button{font-size:15px;min-height:42px}.review-summary,.review-verdicts p,.review-issue>p,.review-issue blockquote,.development-text{font-size:15px}.review-verdicts h3,.review-issue h3,.development-item label{font-size:15px}.pending-draft{font-size:14px}.pending-draft button{font-size:14px}.nav-scrim{display:none}body.focus-mode .app-sidebar{display:none}body.focus-mode .layout{margin-left:0;width:100%;height:100dvh}body.focus-mode #content{border:0;background:#fffaf3}body.focus-mode .workspace{background:white}
@media(max-width:1200px){:root{--sidebar-width:216px}.topbar{padding:0 24px}.top-actions{gap:8px}.top-actions .mode{display:none}.workspace{padding:0 24px 30px}#content{padding:24px}.directory-open .layout{grid-template-columns:224px minmax(0,1fr)}.assistant-open .layout{grid-template-columns:minmax(0,1fr) 310px}}
@media(max-width:1000px){.layout{height:auto;min-height:calc(100dvh - 76px)}.topbar{position:sticky;top:0;height:76px}.directory-open .library,.assistant-open .inspector{min-height:calc(100dvh - 76px);padding:24px}.books-view{height:auto;min-height:calc(100dvh - 76px)}.workspace{overflow:visible}.view-heading{flex-wrap:wrap}.books-list{padding:0 22px}}
@media(max-width:800px){:root{--sidebar-width:248px}.app-sidebar{transform:translateX(-100%);transition:transform .18s;z-index:9;padding-top:24px}.global-nav-open .app-sidebar{transform:translateX(0)}.global-nav-open .nav-scrim{display:block;position:fixed;inset:0;border:0;border-radius:0;background:#34304166;z-index:8;width:100%;height:100dvh;padding:0}.topbar{margin-left:0;width:100%;height:68px;padding:0 16px;position:sticky;top:0;gap:8px}.topbar-heading{gap:6px}#section-title{font-size:17px}#global-nav-toggle{display:inline-flex;font-size:21px;min-width:38px;min-height:40px}.top-actions button,.top-actions #assistant-toggle{font-size:14px;padding:8px 10px;min-height:40px}.top-actions{gap:6px}.top-actions #directory-toggle span{display:none}.layout{margin-left:0;width:100%;min-height:calc(100dvh - 68px)}.books-view{margin-left:0;width:100%;min-height:calc(100dvh - 68px);padding:26px 20px}.workspace{padding:0 18px 28px}.workspace-heading{margin-top:22px}.workspace-heading h1{font-size:20px}.breadcrumb{font-size:12px}.tabs{gap:25px;margin-top:13px;margin-bottom:17px}.tabs button{font-size:15px}#content{padding:20px 18px}.editor-tools{gap:8px;flex-wrap:wrap}.paper-tools button{font-size:13px;padding:6px}.chapter-title-input{font-size:27px}.chapter-text{font-size:18px}.directory-open .library,.assistant-open .inspector{min-height:calc(100dvh - 68px);padding:24px}.view-heading h2{font-size:23px}.view-actions{justify-content:flex-start}.book-row{gap:16px}.books-heading .primary{font-size:14px}.books-heading h1{font-size:27px}.books-list{padding:0 18px}.book-description h2{font-size:21px}.sidebar-footer>span{font-size:12px}.primary-nav button{font-size:16px}.form-field input,.form-field textarea,.form-field select{font-size:16px}dialog{padding:23px}.dialog-head h2{font-size:22px}.pending-draft{font-size:13px}.dialog-note{font-size:14px}body.focus-mode .layout{height:auto;min-height:100dvh}}
/* The primary navigation keeps its document order inside the left rail at every breakpoint. */
.app-sidebar .primary-nav{order:0}

/* Rosé Pine Dawn inspired paper and ink; deeper berry accent for legible controls. */
:root{--ink:#464261;--muted:#746c80;--surface:#fffaf3;--ground:#faf4ed;--line:#e9dfd8;--control:#d7c8c8;--selected:#eadde2;--accent:#98536c}
.app-sidebar{background:#f2e9e1;border-right:1px solid #e5d9d3}.app-sidebar .brand{font-family:var(--prose);font-size:25px;font-weight:600;color:#64445b;letter-spacing:2px}.sidebar-caption{color:#746c80}.topbar{background:#faf4ed;border-bottom:1px solid #e9dfd8}.primary-nav button{border-radius:6px}.primary-nav button[aria-current=page]{background:#e9dce1;border-color:transparent;color:#794a62}.primary-nav button:hover,.sidebar-tools button:hover,.sidebar-footer button:hover{background:#ebe1dc}.sidebar-create{box-shadow:none}.workspace{background:#faf4ed}#content{border:0;border-radius:5px;box-shadow:0 2px 15px #46426105}.books-view{background:#faf4ed}.books-list{background:transparent;border:0;border-radius:0;padding:0}.book-row{padding:32px 0;gap:30px;border-color:#e5d9d3}.book-spine{position:relative;width:96px;height:136px;display:flex;align-items:flex-start;padding:17px 14px 17px 17px;background:#78556b;color:#fffaf3;border-left:5px solid #624257;border-radius:2px 5px 5px 2px;box-shadow:3px 2px 0 #e9dfd8}.book-cover-title{font-family:var(--prose);font-size:18px;line-height:1.65;letter-spacing:2px;overflow:hidden;max-height:100%}.book-description h2{font-family:var(--prose);font-size:25px;font-weight:600;color:#464261}.books-heading h1{font-family:var(--prose);font-weight:600;font-size:32px}.book-row>button{border-color:#d5bdc7;color:#8b4c65;background:transparent}.book-row>button:hover{background:#f0e3e8}.book-kicker span{color:#98536c}.books-heading .primary,.primary{background:#98536c;border-color:#98536c;color:#fffaf3}.primary:hover,.books-heading .primary:hover{background:#804359}.chapter-title-input,.chapter-text{color:#464261}.tabs button.active{color:#794a62;border-bottom-color:#98536c}.mode:before{background:#64866d}.pending-draft{background:#f6eded;border-color:#e6d5dc;color:#794a62}.review-suggestion{color:#79586d}.setting-card p,.development-text{color:#625971}::selection{background:#e5ceda;color:#464261}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible{outline-color:#98536c}body.focus-mode .workspace,body.focus-mode #content{background:#fffaf3}dialog{background:#fffaf3;border-color:#e2d5d0;box-shadow:0 18px 60px #46426126}dialog::backdrop{background:#34304166}
@media(max-width:800px){.books-list{padding:0}.book-row{gap:20px}.book-spine{width:70px;height:104px;padding:12px 9px 12px 12px}.book-cover-title{font-size:15px;letter-spacing:1px}.book-description{flex-basis:calc(100% - 90px)}.book-row>button{margin-left:90px}.books-heading h1{font-size:28px}.book-description h2{font-size:23px}}
.library,.inspector{background:#fffaf3}.book-cover-title{max-width:2.3em;word-break:break-all}
#content{background:var(--surface)}
.revision-option{display:flex;align-items:flex-start;gap:12px;padding:16px 0;border-top:1px solid var(--line);cursor:pointer}.revision-option>input{margin-top:5px;accent-color:var(--accent);flex-shrink:0}.revision-option>span{display:flex;flex-direction:column;gap:6px;font-size:14px;line-height:1.85}.revision-option small{font-size:13px;color:var(--muted)}.revision-dialog{width:min(1120px,calc(100% - 32px))}.revision-comparison{display:grid;grid-template-columns:1fr 1fr;gap:20px}.revision-comparison h3{font-size:15px;margin:0 0 12px;font-weight:600}.revision-comparison .candidate-text{max-height:52dvh;min-height:180px;scrollbar-gutter:stable;overflow-wrap:anywhere}.revision-comparison>section:first-child .candidate-text{background:#f2e9e1}.revision-comparison>section:last-child .candidate-text{background:#f8eff1;border:1px solid #e6d4dc}
@media(max-width:700px){.revision-comparison{grid-template-columns:1fr}.revision-comparison .candidate-text{max-height:34dvh}.revision-option>span{font-size:14px}}
.task-loading{display:flex;flex-direction:column;align-items:center;text-align:center;padding:24px 16px 28px;gap:16px}.loading-spinner{display:inline-block;width:44px;height:44px;border:3px solid #e6d4dc;border-top-color:var(--accent);border-radius:50%;animation:task-spin .85s linear infinite}.task-loading h3,.task-error h3{font-size:20px;font-weight:600}.task-loading p,.task-error p{font-size:15px;line-height:1.9;overflow-wrap:anywhere}.task-loading small{font-size:13px;color:var(--muted);line-height:1.8}.task-error{padding:16px 0}.task-error p{margin-top:14px}@keyframes task-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.loading-spinner{animation:none}}

.paper-tools{flex-wrap:wrap}
.book-actions{display:flex;flex-direction:column;align-items:stretch;gap:10px;flex-shrink:0}.book-actions button{font-size:14px}.books-manage{display:flex;gap:12px;margin:20px 0}.books-list .empty{padding:40px 0}.book-actions .danger{color:#98536c}
@media(max-width:800px){.book-actions{margin-left:90px;flex-direction:row;flex-wrap:wrap}.book-actions button{min-height:40px}}
