/* Independent writer workspace: public catalog styles are untouched. */
body.writer-mode>.header,body.writer-mode>.site-footer{display:none}body.writer-mode #app{max-width:none;width:100%;padding:0;min-height:100dvh;margin:0}body.writer-mode{background:#181a23}.writer-shell{--w-bg:#181a23;--w-side:#20222e;--w-panel:#21232f;--w-line:#363947;--w-text:#f1f1f5;--w-muted:#a8aabb;--w-accent:#b59af9;--w-primary:#7551cf;--ink:var(--w-text);--muted:var(--w-muted);--line:var(--w-line);--violet:var(--w-accent);display:grid;grid-template-columns:240px minmax(0,1fr);min-height:100dvh;background:var(--w-bg);color:var(--w-text);font-size:14px}.writer-shell[data-theme=light]{--w-bg:#f7f7fa;--w-side:#fff;--w-panel:#fff;--w-line:#dedde7;--w-text:#26232f;--w-muted:#696577;--w-accent:#6440b8;--w-primary:#6842c1}.writer-shell *{box-sizing:border-box}.writer-shell [hidden]{display:none!important}.writer-shell a{color:inherit}.writer-shell .muted,.writer-shell small{color:var(--w-muted)}.writer-sidebar{position:sticky;top:0;height:100dvh;display:flex;flex-direction:column;gap:12px;padding:22px 15px;background:var(--w-side);border-right:1px solid var(--w-line);overflow:auto}.writer-brand{display:flex;align-items:center;gap:10px;padding:0 8px 20px;font-size:14px;font-weight:700;letter-spacing:.5px}.writer-brand img{width:35px;height:35px;border-radius:5px;object-fit:contain}.writer-brand b{color:var(--w-accent)}.writer-brand small{display:block;font-size:9px;font-weight:500;letter-spacing:1.5px}.writer-nav-label,.writer-kicker{font-size:10px;font-weight:700;letter-spacing:1.4px;color:var(--w-muted);margin:8px 10px 0}.writer-sidebar nav{display:grid;gap:4px}.studio-nav-item{display:flex;align-items:center;gap:12px;padding:11px 10px;border-radius:5px;color:var(--w-muted)!important;transition:background .16s,color .16s}.studio-nav-item span{font-size:18px;width:22px;text-align:center}.studio-nav-item:hover,.studio-nav-item.selected{background:color-mix(in srgb,var(--w-accent) 13%,transparent);color:var(--w-accent)!important}.studio-nav-item.selected{box-shadow:inset 3px 0 var(--w-accent)}.writer-side-bottom{margin-top:auto;display:grid;gap:14px;padding:12px 8px;border-top:1px solid var(--w-line)}.writer-exit{font-size:13px}.writer-main{min-width:0}.writer-topbar{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:12px;min-height:68px;padding:12px 26px;background:var(--w-side);border-bottom:1px solid var(--w-line)}.writer-breadcrumb{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.writer-breadcrumb span{margin:0 6px;color:var(--w-muted)}.writer-top-actions{margin-left:auto;display:flex;gap:8px;flex-shrink:0}.writer-menu{display:none!important}.writer-content{padding:28px;max-width:1450px;margin:auto}.writer-page-heading{margin:0 0 24px}.writer-kicker{margin:0 0 9px}.writer-shell h1{font-size:clamp(24px,3vw,32px);letter-spacing:-.6px;line-height:1.2;margin:0 0 8px;color:var(--w-text)}.writer-shell h2{font-size:18px;color:var(--w-text);margin:0}.writer-shell p{margin-top:5px}.writer-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:26px}.writer-stats>div{border:1px solid var(--w-line);background:var(--w-panel);border-radius:7px;padding:20px;display:grid;gap:8px}.writer-stats strong{font-size:27px}.writer-table-panel,.writer-shell .panel,.writer-settings{background:var(--w-panel);border:1px solid var(--w-line);border-radius:7px;box-shadow:none;margin:0 0 20px;padding:0}.writer-shell .panel{padding:20px}.writer-shell .panel h2{margin-bottom:18px}.writer-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 20px}.writer-story-row{display:grid;grid-template-columns:54px minmax(0,1fr) auto;gap:14px;align-items:center;padding:13px 20px;border-top:1px solid var(--w-line)}.writer-story-row .cover{width:54px;aspect-ratio:2/3;padding:4px;overflow:hidden}.writer-story-row .cover strong,.writer-book-head .cover strong{font-size:10px}.writer-story-row .cover small{display:none}.writer-book-head{display:grid;grid-template-columns:100px 1fr;gap:21px;align-items:center;margin-bottom:25px}.writer-book-head .cover{width:100px;aspect-ratio:2/3}.writer-tabs{display:flex;gap:20px;padding:0 20px;border-bottom:1px solid var(--w-line)}.writer-shell .writer-tabs button{background:none!important;border:0;border-radius:0;color:var(--w-muted);padding:12px 0;box-shadow:none}.writer-shell .writer-tabs button.selected{color:var(--w-accent);box-shadow:inset 0 -2px var(--w-accent)}.writer-filters{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 20px}.writer-filters label{display:flex;align-items:center;gap:8px}.writer-search{max-width:240px}.writer-shell input,.writer-shell textarea,.writer-shell select{background:var(--w-bg);border:1px solid var(--w-line);color:var(--w-text);border-radius:5px;box-shadow:none}.writer-shell button:not(.secondary):not(.writer-tabs button),.writer-shell .button:not(.secondary){background:var(--w-primary);color:white;border:1px solid transparent;border-radius:5px;box-shadow:none}.writer-shell .secondary,.writer-shell .button.secondary{background:transparent;color:var(--w-text);border:1px solid var(--w-line);border-radius:5px;box-shadow:none}.writer-shell button,.writer-shell .button{transition:background .15s,transform .15s}.writer-shell button:active,.writer-shell .button:active{transform:scale(.97)}.writer-shell .empty,.writer-shell .notice,.writer-shell .metrics>div{background:var(--w-bg);border-color:var(--w-line);color:var(--w-muted)}.writer-table-head,.writer-chapter-row{display:grid;grid-template-columns:minmax(0,1fr) 110px 120px 75px;align-items:center;gap:14px;padding:12px 20px;border-top:1px solid var(--w-line)}.writer-table-head{color:var(--w-muted);font-size:12px;background:var(--w-bg)}.writer-chapter-row:hover{background:color-mix(in srgb,var(--w-accent) 5%,transparent)}.writer-chapter-row>a{overflow-wrap:anywhere}.chapter-index{color:var(--w-muted);font-variant-numeric:tabular-nums;margin-right:6px}.writer-state{font-size:12px;color:var(--w-muted)}.writer-state.live{color:#79b99a}.writer-shell[data-theme=light] .writer-state.live{color:#287249}.writer-date{color:var(--w-muted);font-size:12px}.writer-pagination,.writer-no-results{padding:10px 20px}.writer-settings>summary{padding:15px 20px;cursor:pointer;font-weight:600}.writer-settings>.panel{margin:0 12px 12px}.manuscript-layout{display:grid;grid-template-columns:205px minmax(0,1fr);gap:22px;align-items:start}.manuscript-outline{background:var(--w-panel);border:1px solid var(--w-line);border-radius:6px;padding:14px;position:sticky;top:90px;max-height:calc(100dvh - 108px);overflow:auto;display:grid;gap:5px}.manuscript-outline>a{padding:10px;border-radius:4px;font-size:13px;overflow-wrap:anywhere}.manuscript-outline a small{display:block;font-size:10px;margin-bottom:4px}.manuscript-outline a.selected,.manuscript-outline a:hover{background:color-mix(in srgb,var(--w-accent) 13%,transparent);color:var(--w-accent)}.outline-new{color:var(--w-accent)!important}.manuscript-workspace{min-width:0;max-width:950px;width:100%;margin:auto}.manuscript-workspace .form{gap:15px}.manuscript-workspace .chapter-number-label{max-width:160px}.writer-shell .chapter-body{font-family:Georgia,serif;font-size:19px;line-height:1.85;min-height:55vh;padding:24px;background:var(--w-panel)!important;color:var(--w-text);resize:vertical}.writer-shell .chapter-preview,.writer-shell .revision{background:var(--w-panel);color:var(--w-text);border:1px solid var(--w-line);overflow-wrap:anywhere;white-space:pre-wrap}.writer-shell .editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.writer-shell .editor-toolbar .muted{margin-left:auto;font-size:12px}.writer-shell.focus-writing{grid-template-columns:1fr}.focus-writing .writer-sidebar,.focus-writing .manuscript-outline{display:none}.focus-writing .manuscript-layout{display:block}.writer-shell .form-error{color:#f18d8d}.writer-shell :focus-visible{outline:2px solid var(--w-accent);outline-offset:3px}.writer-shell .image-upload-control{--upload-line:var(--w-line);--upload-bg:var(--w-bg);--upload-text:var(--w-muted)}
@media(max-width:1000px){.writer-shell{grid-template-columns:195px minmax(0,1fr)}.writer-content{padding:20px}.manuscript-layout{grid-template-columns:1fr}.manuscript-outline{position:static;max-height:180px}.writer-table-head,.writer-chapter-row{grid-template-columns:minmax(0,1fr) 90px 90px 60px;gap:9px;padding:12px 14px}}@media(max-width:720px){.writer-shell{display:block}.writer-sidebar{display:none;position:fixed;inset:62px auto 0 0;height:auto;width:min(280px,85vw);z-index:20;box-shadow:8px 0 24px #0004}.writer-shell.nav-open .writer-sidebar{display:flex}.writer-menu{display:inline-flex!important}.writer-topbar{min-height:62px;padding:10px;gap:8px}.writer-top-actions .button,.writer-top-actions button{font-size:12px;padding:8px}.writer-breadcrumb{font-size:12px}.writer-content{padding:16px 12px}.writer-stats{gap:7px}.writer-stats>div{padding:12px}.writer-stats strong{font-size:21px}.writer-book-head{grid-template-columns:74px 1fr;gap:12px}.writer-book-head .cover{width:74px}.writer-table-head,.writer-chapter-row{grid-template-columns:minmax(0,1fr) 73px 49px;font-size:12px}.writer-table-head span:nth-child(3),.writer-date{display:none}.writer-filters,.writer-section-head{padding:12px;flex-wrap:wrap}.writer-tabs{gap:15px;padding:0 12px}.writer-tabs button{font-size:12px}.writer-search{max-width:100%}.writer-story-row{padding:12px;gap:10px}.writer-shell .chapter-body{padding:15px;font-size:17px}.writer-shell .editor-toolbar .muted{width:100%}.writer-top-actions{gap:4px}.writer-shell.focus-writing .writer-menu{display:none!important}}
@media(prefers-reduced-motion:reduce){.writer-shell *{transition:none!important;animation:none!important}}
.writer-sidebar nav{flex:none;order:initial;width:auto;overflow:visible;font-weight:500}.writer-sidebar .writer-side-bottom{flex-shrink:0}.writer-shell .writer-content .form label{color:var(--w-text)}.writer-shell .writer-book-head .cover.uploaded{padding:0}.writer-shell .writer-story-row .cover.uploaded{padding:0}.writer-shell .writer-topbar .button{white-space:nowrap}.writer-shell .writer-topbar .button:hover,.writer-shell .writer-topbar button:hover{filter:brightness(1.07)}

/* RC4 sidebar correction: match studioShell() markup in app.js. */
.writer-sidebar{padding:24px 16px;gap:10px;scrollbar-width:thin}
.writer-sidebar .writer-brand{padding:0 8px 22px;flex-shrink:0}
.writer-sidebar .writer-nav-label{margin:12px 12px 2px;line-height:1.4}
.writer-sidebar nav{display:flex;flex-direction:column;align-items:stretch;gap:5px;margin:0;padding:0;width:100%;min-width:0;flex-shrink:0}
.writer-sidebar .studio-nav-item{display:flex;align-items:center;gap:12px;min-height:44px;padding:11px 12px;border:1px solid transparent;border-radius:7px;text-decoration:none;font-size:14px;font-weight:550;line-height:1.4;transition:background .18s ease,color .18s ease,border-color .18s ease}
.writer-sidebar .studio-nav-item span{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;flex:0 0 22px;font-size:18px;line-height:1}
.writer-sidebar .studio-nav-item:hover{background:color-mix(in srgb,var(--w-accent) 9%,transparent);color:var(--w-text)!important}
.writer-sidebar .studio-nav-item.selected,.writer-sidebar .studio-nav-item[aria-current="page"]{background:color-mix(in srgb,var(--w-accent) 14%,transparent);border-color:color-mix(in srgb,var(--w-accent) 18%,transparent);color:var(--w-accent)!important;box-shadow:inset 3px 0 var(--w-accent);font-weight:650}
.writer-sidebar .writer-side-bottom{padding:14px 4px 4px;gap:10px}
.writer-sidebar .studio-theme{min-height:44px;width:100%}
.writer-sidebar .writer-exit{display:flex;align-items:center;min-height:40px;padding:8px;border-radius:7px;color:var(--w-muted);transition:background .18s ease,color .18s ease}
.writer-sidebar .writer-exit:hover{background:color-mix(in srgb,var(--w-accent) 9%,transparent);color:var(--w-text)}
.writer-sidebar .writer-side-bottom>small{padding:0 8px;overflow-wrap:anywhere}
@media(max-width:1000px) and (min-width:721px){.writer-sidebar{padding:20px 10px}.writer-sidebar .studio-nav-item{padding:10px 8px;gap:8px;font-size:13px}}
@media(prefers-reduced-motion:reduce){.writer-sidebar .studio-nav-item,.writer-sidebar .writer-exit{transition:none}}
