:root{--bg:#f5f7fb;--paper:#faf5e8;--ink:#253146;--muted:#77849a;--stroke:#e1e6ef;--primary:#6157d8;--primary-hover:#4b43b9;--pale:#efedff;--danger:#bf3f53;--shadow:0 7px 27px #28325011}
*{box-sizing:border-box}html,body{height:100%;margin:0;background:var(--bg);color:var(--ink);font-family:Inter,-apple-system,BlinkMacSystemFont,"Yu Gothic","Hiragino Kaku Gothic ProN",Meiryo,sans-serif}button,input,textarea,select{font:inherit}button{cursor:pointer;border:0}button:disabled{opacity:.4;cursor:not-allowed}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #7a71eb;outline-offset:2px}input,textarea,select{color:var(--ink)}[hidden]{display:none!important}#app{display:flex;flex-direction:column;height:100dvh;min-height:500px}.app-header{height:66px;flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 19px;background:#fff;border-bottom:1px solid var(--stroke)}.brand{display:flex;align-items:center;gap:10px;min-width:0}.brand-icon{display:grid;place-items:center;background:linear-gradient(140deg,#8176ef,#574acb);width:39px;height:41px;border-radius:11px;box-shadow:0 5px 12px #8277f15e;color:#fff;font-size:27px;font-family:serif}.brand-copy{display:flex;flex-direction:column;gap:2px;white-space:nowrap}.brand-copy strong{font-size:16px}.brand-copy small{font-size:10px;color:var(--muted)}.version{font-size:9px;font-weight:800;letter-spacing:.35px;background:#f2f0ff;color:#7167c7;padding:5px 7px;border-radius:6px;margin-left:5px;white-space:nowrap}.header-actions{display:flex;align-items:center;gap:7px}.btn{background:#fff;border:1px solid var(--stroke);border-radius:8px;color:var(--ink);display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 13px;font-size:12px;font-weight:700;white-space:nowrap;text-decoration:none}.btn:hover{background:#f4f2ff}.btn.primary{background:var(--primary);color:#fff;border-color:var(--primary)}.btn.primary:hover{background:var(--primary-hover)}.save-status{white-space:nowrap;color:#4a9a71;font-size:11px;margin-right:10px;display:inline-flex;gap:6px;align-items:center}.save-status i,.live-dot{display:inline-block;width:7px;height:7px;border-radius:100%;background:#45ba83}.save-status.pending{color:#c38b41}.save-status.pending i{background:#e6a44b}.tabbar{display:flex;align-items:end;gap:6px;padding:7px 18px 0;background:#f0f2f8;border-bottom:1px solid #dadfe9;min-height:48px;flex:none;overflow:auto hidden}.tab{height:40px;padding:0 16px;border:1px solid transparent;border-radius:10px 10px 0 0;background:transparent;color:#66738c;font-size:12px;font-weight:750;white-space:nowrap;display:flex;gap:9px;align-items:center}.tab span{font-size:18px}.tab:hover{background:#e9eafa}.tab.active{background:#fff;color:#5548bf;border-color:#d9ddec;border-bottom:1px solid #fff}.tab-spacer{flex:1}.work-title{align-self:center;margin:0 5px 7px 16px;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:#8490a4}.toolbar{display:flex;min-height:51px;padding:6px 16px;gap:13px;align-items:center;background:#fff;border-bottom:1px solid var(--stroke);overflow-x:auto;flex:none}.toolbar-set{display:flex;align-items:center;gap:8px;flex:none}.toolbar-label{font-size:10px;color:#919bad;font-weight:800}.toolbar-rule{height:23px;border-left:1px solid var(--stroke);flex:none}.toolbar-spacer{flex:1}.toolbar-help{font-size:10px;color:#9aa4b4;white-space:nowrap}.segmented{background:#f2f3f9;display:flex;padding:3px;border-radius:8px;gap:2px}.segmented button{background:transparent;padding:7px 10px;border-radius:6px;color:#6c7690;font-size:11px}.segmented button.selected{background:#fff;color:#574bd0;box-shadow:0 1px 5px #35406516;font-weight:800}.tool{background:transparent;color:#54627e;border-radius:7px;padding:8px 10px;font-size:11px}.tool:hover{background:#f3f1ff}.workspace{display:flex;flex:1;min-height:0}.navigator,.inspector{background:#fff;display:flex;flex-direction:column;min-height:0;flex:none}.navigator{width:243px;border-right:1px solid var(--stroke)}.inspector{width:260px;border-left:1px solid var(--stroke)}.panel-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:9px;padding:18px 15px 13px}.panel-heading>div{display:flex;flex-direction:column;gap:5px}.panel-heading strong{font-size:13px}.panel-heading small{color:var(--muted);font-size:10px}.icon-action{background:#f0edff;color:var(--primary);width:27px;height:27px;display:grid;place-items:center;border-radius:7px;font-size:20px;line-height:1}.icon-action:hover{background:#dedafa}.nav-list{padding:2px 10px 15px;overflow:auto;flex:1;min-height:0}.nav-item{display:flex;align-items:center;gap:6px;border:1px solid transparent;border-radius:9px;min-height:56px;margin:3px 0;background:transparent;padding:8px 7px 8px 10px;color:#526078}.nav-item:hover{background:#f6f5fd}.nav-item.active{border-color:#dcd7ff;background:#f1efff;color:#5144ba}.nav-item-main{flex:1;min-width:0;cursor:pointer}.nav-kicker{color:#8993a8;font-size:9px;letter-spacing:.7px;font-weight:800}.nav-title{display:block;font-size:12px;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:4px 0}.nav-description{font-size:10px;color:#9aa4b5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-controls{display:flex;flex-direction:column;gap:1px}.nav-controls button{border-radius:5px;background:transparent;color:#8d94a7;width:18px;height:18px;font-size:10px}.nav-controls button:hover:not(:disabled){background:#ddd8ff;color:#5145b9}.nav-footer{flex:none;border-top:1px solid var(--stroke);padding:13px;display:flex;justify-content:space-between;font-size:10px;color:#9da7b4}.nav-footer span:last-child{color:#65bd94}.nav-search{margin:1px 13px 10px}.nav-search input{width:100%;border:1px solid var(--stroke);border-radius:8px;padding:9px 10px;font-size:11px}.nav-empty{padding:24px 13px;color:#9aa3b3;font-size:11px;text-align:center;line-height:1.8}.main-panel{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;background:#f6f7fb}.view-panel{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}.editor-head{background:#fff;padding:12px 20px;border-bottom:1px solid var(--stroke);display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;min-height:73px}.editor-heading{min-width:0;display:flex;flex-direction:column;gap:4px;flex:1}.editor-heading small{font-size:10px;color:#9489ce;font-weight:800;letter-spacing:1px}.chapter-title-input{font-size:19px;font-weight:800;background:transparent;border:1px solid transparent;outline:none;padding:3px 5px;margin-left:-5px;width:min(550px,100%);border-radius:5px}.chapter-title-input:hover,.chapter-title-input:focus{border-color:#ddd8f7;background:#fbfaff}.editor-head-actions{display:flex;gap:5px}.mini-btn{font-size:11px;background:transparent;color:#687791;padding:7px 8px;border-radius:7px;white-space:nowrap}.mini-btn:hover{background:#f0edff;color:var(--primary)}.danger-text{color:var(--danger)!important}.danger-text:hover{background:#ffeff2!important}.writing-split{flex:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);min-height:0;padding:15px;gap:14px}.writing-split.preview-only{grid-template-columns:1fr}.writing-split.preview-only .draft-pane{display:none}.writing-split.editor-only{grid-template-columns:minmax(0,1fr)}.writing-split.editor-only .preview-pane{display:none}.draft-pane,.preview-pane{min-height:0;min-width:0;display:flex;flex-direction:column;background:#fff;border:1px solid var(--stroke);border-radius:12px;overflow:hidden;box-shadow:0 2px 12px #28325009}.pane-heading{height:42px;display:flex;align-items:center;justify-content:space-between;padding:0 14px;gap:10px;font-size:11px;font-weight:800;color:#57637a;flex:none;border-bottom:1px solid #eff1f7}.pane-heading span:last-child{font-weight:500;color:#9aa3b4}.editor-input-wrap>textarea{display:block;flex:1;width:100%;min-height:0;resize:none;border:0;outline:0;padding:26px 27px;background:#fff;color:#26344e;font-family:"Yu Mincho","Hiragino Mincho ProN","Noto Serif CJK JP",serif;font-size:16px;line-height:2;tab-size:2}.editor-input-wrap>textarea.editor-vertical{writing-mode:vertical-rl;text-orientation:mixed;overflow-x:auto;overflow-y:hidden;white-space:pre-wrap}.editor-input-wrap>textarea:focus{outline:0}.draft-footer,.preview-footer{font-size:9px;color:#99a4b4;display:flex;justify-content:space-between;gap:8px;flex:none;border-top:1px solid #eef0f4;padding:10px 13px;white-space:nowrap}.page-scroll{flex:1;min-height:0;overflow:auto;background:#edf0f7;padding:22px 18px 28px}.pages{display:flex;gap:22px;width:max-content;min-width:100%;align-items:flex-start;justify-content:center}.pages.vertical-pages{flex-direction:row-reverse}.paper{flex:none;background:white;box-shadow:0 7px 24px #25355026;border:1px solid #e5e7ee;position:relative;overflow:hidden;color:#26262d}.paper.a5{width:376px;height:532px}.paper.b6{width:339px;height:479px}.paper.a4{width:445px;height:629px}.paper-inner{position:absolute;inset:42px 38px;font-family:"Yu Mincho","Hiragino Mincho ProN","Noto Serif CJK JP",serif;font-size:17px;line-height:1.85;white-space:pre-wrap;overflow:hidden;overflow-wrap:anywhere;line-break:strict}.paper.vertical .paper-inner{writing-mode:vertical-rl;text-orientation:mixed}.paper.horizontal .paper-inner{writing-mode:horizontal-tb}.paper-chapter-title{font-weight:700;letter-spacing:.1em;margin:0 0 1.5em;line-height:1.6;white-space:normal}.paper-body{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.paper-number{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);font-size:10px;font-family:serif;color:#aaa}.paper.vertical .paper-number{left:16px;bottom:24px;transform:none}.paper-empty{color:#aeb3bd;font-size:13px}.statusbar{background:#fff;flex:none;display:flex;justify-content:space-between;gap:10px;padding:9px 15px;border-top:1px solid var(--stroke);font-size:10px;color:#8995a7;min-height:33px}.statusbar>div{display:flex;gap:15px;align-items:center}.status-autosave{color:#539e7a}.inspector-content{padding:0 17px 26px;overflow:auto;flex:1;min-height:0}.inspector-label{font-size:10px;color:#8893a9;font-weight:850;letter-spacing:.5px;margin:12px 0}.field{display:flex;flex-direction:column;gap:7px;color:#66748c;font-size:11px;font-weight:700;margin-bottom:14px}.field input,.field textarea,.field select{border:1px solid #dce1ed;background:#fff;border-radius:8px;padding:10px 11px;font-size:12px;width:100%;font-weight:400;min-width:0}.field textarea{resize:vertical;min-height:82px;line-height:1.7}.inspector-content .field input:focus,.inspector-content .field select:focus,.inspector-content .field textarea:focus{border-color:#9f97df}.inspector-rule{border:0;border-top:1px solid #ebedf3;margin:18px 0}.range-control{display:flex;align-items:center;gap:7px}.range-control input{flex:1;min-width:0;padding:0}.range-control strong{font-size:11px;width:30px;text-align:right}.inspector-card{background:#f6f7fb;border-radius:9px;padding:12px;margin:8px 0 13px}.inspector-card .card-sub{font-size:10px;color:#8290a4}.inspector-statrow{display:flex;justify-content:space-between;align-items:center;gap:7px;padding:8px 0;border-bottom:1px solid #e8eaf2;font-size:11px}.inspector-statrow:last-child{border:0}.inspector-statrow strong{font-size:14px}.hint{font-size:10px;color:#97a1b0;line-height:1.8}.wide-btn{width:100%;border-radius:8px;background:var(--pale);color:var(--primary);padding:10px;font-size:11px;font-weight:800}.wide-btn:hover{background:#e2dfff}.overline{font-size:9px;font-weight:900;letter-spacing:1.5px;color:#7c72c5}.section-top{flex:none;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:23px 25px 19px;background:#fff;border-bottom:1px solid var(--stroke)}.section-top h2{font-size:21px;margin:5px 0 6px}.section-top p{font-size:11px;color:#8e9aab;margin:0;line-height:1.8}.section-actions{display:flex;align-items:center;gap:8px}.map-wrapper{flex:1;min-height:0;min-width:0;overflow:auto;background-color:#f6f7fc;background-image:radial-gradient(#d8dcf1 1px,transparent 1px);background-size:24px 24px}.map-canvas{width:1600px;height:1000px;position:relative}.map-canvas svg{position:absolute;inset:0;width:1600px;height:1000px;pointer-events:none;overflow:visible}.map-node{position:absolute;width:178px;min-height:66px;border-radius:12px;border:2px solid #c8c4ef;background:white;box-shadow:0 6px 16px #23325513;padding:11px 34px 11px 14px;display:flex;align-items:center;cursor:grab;user-select:none;touch-action:none;color:#313a56;font-size:12px;font-weight:800;line-height:1.45;overflow-wrap:anywhere}.map-node:hover{box-shadow:0 7px 20px #443c9729}.map-node.selected{outline:3px solid #a9a2ff;outline-offset:2px}.map-node.color-rose{border-color:#f0bad0;background:#fff3f7}.map-node.color-sky{border-color:#b2d6ee;background:#f1f9ff}.map-node.color-green{border-color:#b9dfce;background:#f1fff8}.map-node.color-violet{border-color:#c8c4ef;background:#f6f4ff}.map-node>span{pointer-events:none}.map-plus{position:absolute;right:7px;top:50%;transform:translateY(-50%);width:23px;height:23px;background:#eceaff;border-radius:7px;color:#5f55bf;font-size:17px;line-height:1}.map-plus:hover{background:#dcd7ff}.map-bottom{flex:none;padding:11px 20px;background:#fff;border-top:1px solid var(--stroke);color:#98a3b3;font-size:10px}.note-layout{flex:1;min-height:0;overflow:auto;padding:25px;display:flex;justify-content:center}.note-sheet{flex:1;max-width:790px;background:#fff;border:1px solid #e2e5ef;border-radius:12px;box-shadow:var(--shadow);padding:25px 28px;display:flex;flex-direction:column;min-height:420px}.note-sheet-top{display:flex;justify-content:space-between;align-items:center;gap:10px}.note-kind{font-size:11px;font-weight:800;padding:6px 11px;color:#6d5bd1;background:#f1eeff;border-radius:7px}.small-muted{font-size:10px;color:#9ca5b4}.note-name{font-size:22px;font-weight:800;border:0;border-bottom:1px solid #e7e9f1;padding:14px 0 13px;margin:9px 0 22px;outline:0;width:100%;background:transparent}.field-row{display:grid;grid-template-columns:160px 1fr;gap:14px}.note-sheet .field.fill{flex:1;min-height:180px}.note-sheet .field.fill textarea{flex:1;resize:vertical;min-height:185px}.note-bottom{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #edf0f5;padding-top:10px;font-size:10px;color:#99a5b5}.plot-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;flex:1;min-height:0;overflow:auto;padding:20px;align-items:start}.plot-column{border:1px solid #e3e7f0;background:#eef0f7;border-radius:12px;min-height:310px;padding:13px;display:flex;flex-direction:column;gap:10px}.plot-column.drag-over{outline:2px dashed #7269de;background:#eeeaff}.plot-column-head{display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:850;padding:4px 4px 10px}.plot-count{font-size:10px;color:#8995a9;background:#fff;border-radius:10px;padding:3px 8px}.plot-card{border:2px solid transparent;border-radius:10px;background:#fff;padding:15px;box-shadow:0 2px 9px #27365410;cursor:pointer;text-align:left;color:#34405a;min-width:0}.plot-card:hover{border-color:#d7d2ff}.plot-card.selected{border-color:#8277e9}.plot-card strong{display:block;font-size:12px;margin-bottom:9px;overflow-wrap:anywhere}.plot-card p{margin:0 0 10px;font-size:10px;line-height:1.75;color:#8692a4;overflow-wrap:anywhere;max-height:70px;overflow:hidden}.plot-chapter{font-size:9px;background:#f1efff;color:#645cc3;border-radius:5px;padding:4px 7px}.plot-empty{padding:22px 10px;text-align:center;color:#a1abbb;font-size:11px;border:1px dashed #cfd5e3;border-radius:9px}.dialog{border:0;padding:0;border-radius:16px;width:min(590px,calc(100% - 30px));max-height:90vh;color:var(--ink);box-shadow:0 20px 70px #0b153b70;overflow:hidden}.dialog::backdrop{background:#1b2646a0}.dialog[open]{display:flex;flex-direction:column}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:22px 25px 16px;border-bottom:1px solid var(--stroke)}.dialog-head h2{margin:4px 0 0;font-size:21px}.close-button{border:0;background:#f1f3f7;color:#78839b;width:31px;height:31px;border-radius:50%;font-size:23px;line-height:1}.close-button:hover{background:#e3e6f0}.dialog-body{padding:23px 25px 27px;overflow:auto;font-size:12px;line-height:1.9}.dialog-lead{color:#667389;margin:0 0 19px}.dialog-body h3{font-size:14px;margin:18px 0 4px;color:#34415a}.dialog-body h3:first-child{margin-top:0}.dialog-body p{color:#68778f}.dialog-body a{color:var(--primary)}.export-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.export-choice{background:#fbfbff;border:1px solid #dfe1ef;border-radius:11px;padding:19px 17px;min-height:107px;text-align:left;display:flex;flex-direction:column;gap:9px}.export-choice:hover{background:#f1efff;border-color:#bfb9f2}.export-choice strong{color:#5145c2;font-size:19px}.export-choice span{font-size:11px;color:#8090a6;line-height:1.65}.dialog-tip{margin-top:20px;background:#f5f6fa;border-radius:9px;font-size:11px;color:#8793a6;padding:12px 14px}.confirm-dialog{max-width:430px}.dialog-actions{display:flex;gap:8px;justify-content:flex-end;padding:14px 25px;border-top:1px solid var(--stroke)}.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,18px);background:#293653;color:#fff;border-radius:10px;box-shadow:0 8px 27px #121c3855;padding:12px 18px;opacity:0;pointer-events:none;transition:.2s;z-index:99;font-size:12px;max-width:80vw}.toast.visible{opacity:1;transform:translate(-50%,0)}
@media(max-width:1300px){.navigator{width:214px}.inspector{width:230px}.app-header{padding:0 13px}.header-actions{gap:5px}.header-actions .btn{padding:8px 9px}.work-title{display:none}.writing-split{gap:9px;padding:10px}.draft-footer span:last-child{display:none}}
@media(max-width:1050px){.save-status{display:none}.version{display:none}.inspector{width:205px}.navigator{width:194px}.tab{padding:0 10px}.toolbar-help{display:none}}
@media(max-width:850px){.inspector{display:none}.navigator{width:180px}.header-actions .author-link{display:none}.writing-split{grid-template-columns:1fr}.draft-pane{min-height:200px}.preview-pane{min-height:285px}.nav-footer{font-size:9px}.section-top{padding:16px}.plot-board{padding:10px;gap:8px}}
@media(max-width:600px){.brand-copy small,.header-actions #saveProjectButton,.header-actions #helpButton,.header-actions #newProjectButton{display:none}.app-header{height:57px}.brand-copy strong{font-size:13px}.brand-icon{width:31px;height:33px;font-size:19px}.header-actions .btn{font-size:10px;padding:7px}.tabbar{padding-left:5px;gap:0}.tab{padding:0 8px;font-size:10px}.tab span{display:none}.toolbar{padding:6px;gap:5px}.toolbar-rule{display:none}.toolbar-set{gap:3px}.toolbar-label{display:none}.tool{font-size:10px}.navigator{width:116px}.panel-heading{padding:10px 8px}.panel-heading small,.nav-description{display:none}.nav-item{padding:6px 4px;min-height:48px}.nav-controls{display:none}.nav-list{padding:0 4px}.nav-title{font-size:10px}.editor-head{padding:8px;min-height:57px}.chapter-title-input{font-size:15px}.editor-head-actions .mini-btn{font-size:10px;padding:4px}.writing-split{padding:6px}.draft-pane>textarea{padding:15px;font-size:14px}.draft-footer,.preview-footer{display:none}.note-layout{padding:8px}.note-sheet{padding:12px}.field-row{grid-template-columns:1fr;gap:0}.plot-board{grid-template-columns:1fr}.plot-column{min-height:150px}.section-top{align-items:flex-start;flex-direction:column;gap:9px}.section-top h2{font-size:17px}.section-top p{font-size:10px}.section-top .btn{font-size:10px;padding:7px}.statusbar{padding:7px}.statusbar #statusChapter,.status-autosave{display:none}.export-grid{grid-template-columns:1fr}}

/* v0.2 — Japanese manuscript layout and formatting */
.formatting-set{display:flex;align-items:center;gap:3px;flex:none;background:#f6f6fc;border:1px solid #e4e3f0;padding:3px;border-radius:9px}
.formatting-set .format-btn{padding:6px 10px;min-width:32px;line-height:1.25;font-size:12px;color:#3b4562}
.formatting-set .format-btn:hover{background:#e4e0ff;color:#5643be}
.formatting-set sup{font-size:8px;vertical-align:super}
.checkbox-field{flex-direction:row;align-items:flex-start;line-height:1.6;gap:9px}
.checkbox-field input{width:16px;margin:1px 0 0;flex:none;accent-color:#6252da}
.layout-capacity{display:block;font-size:17px;margin:7px 0 10px;letter-spacing:.02em;color:#5146b9}
.page-scroll .page-sheet{zoom:.675}
.paper.page-sheet{width:var(--page-w);height:var(--page-h);border:1px solid #e2d5bb;box-sizing:border-box;position:relative;overflow:hidden;background:#faf5e8;box-shadow:0 9px 26px #5a453228}
.paper.page-sheet .paper-inner{position:absolute;top:var(--mt);bottom:var(--mb);left:var(--page-left);right:var(--page-right);font-family:var(--manuscript-font);font-size:var(--manuscript-pt);font-weight:400;letter-spacing:0;line-height:normal;white-space:normal;overflow:hidden;writing-mode:horizontal-tb}
.paper.page-sheet .manuscript-line{position:absolute;overflow:visible;white-space:nowrap;font-family:inherit;font-size:inherit;font-weight:400;letter-spacing:var(--char-spacing);line-height:var(--line-pitch);text-orientation:mixed;line-break:strict;word-break:normal}
.paper.page-sheet.vertical .manuscript-line{writing-mode:vertical-rl;top:0;height:100%;width:var(--line-pitch);text-align:start}
.paper.page-sheet.horizontal .manuscript-line{writing-mode:horizontal-tb;left:0;width:100%;height:var(--line-pitch)}
.paper.page-sheet .manuscript-line.is-chapter-title{font-weight:700}
.paper.page-sheet ruby{ruby-position:over;font-size:1em;letter-spacing:inherit}
.paper.page-sheet rt{font-size:.47em;font-weight:normal;letter-spacing:0;line-height:1}
.style-underline{text-decoration:underline;text-underline-offset:.08em}
.style-emphasis{-webkit-text-emphasis-style:filled sesame;text-emphasis-style:filled sesame;text-emphasis-position:over right}
.paper.page-sheet .paper-number{letter-spacing:0;font-family:serif;font-size:10px;bottom:5mm;left:50%;transform:translateX(-50%)}
.paper.page-sheet.vertical .paper-number{left:5mm;bottom:7mm;transform:none}
.preview-overflow{width:180px;align-self:stretch;display:flex;align-items:center;justify-content:center;padding:22px;color:#7f899e;text-align:center;font-size:11px;line-height:1.8;background:#fff;border:1px dashed #deddeb;border-radius:8px}
.danger-btn{background:#fbe8ea;border-color:#eec4c9;color:#a33846}
.danger-btn:hover{background:#f8dadf}
.new-dialog{width:min(680px,calc(100% - 30px))}
.new-actions{flex-wrap:wrap}
.new-actions button:first-child{margin-right:auto}
.ruby-dialog{width:min(440px,calc(100% - 30px))}
.ruby-dialog .dialog-actions{padding:12px 0 0}
@media(max-width:1300px){.toolbar{gap:7px;padding:6px 9px}.formatting-set .format-btn{padding:6px 7px}}
@media(max-width:600px){.formatting-set{gap:0}.formatting-set .format-btn{font-size:10px;min-width:24px;padding:5px}.page-scroll .page-sheet{zoom:.55}.new-actions button{font-size:10px;padding:8px}}

/* v0.3 — warmer book-paper preview and live typesetting controls */
.page-scroll{background:linear-gradient(145deg,#eae5d9 0%,#e5e1d8 100%)}
.paper.page-sheet{color:#332b24}
.font-slider-header{display:flex;justify-content:flex-end;align-items:center;margin-top:-8px}
.font-slider-header output{font-size:13px;font-weight:850;color:#5145c2;min-width:45px;text-align:right;font-variant-numeric:tabular-nums}
.field input[type=range]{padding:0;border:0;accent-color:var(--primary);cursor:ew-resize;height:26px;background:transparent}
.slider-scale{display:flex;justify-content:space-between;font-size:10px;font-weight:500;color:#98a0b0;margin-top:-5px}
.margin-grid{display:grid;grid-template-columns:1fr 1fr;column-gap:9px;row-gap:0}
.margin-grid .field{min-width:0}
.margin-grid .field input{text-align:right;font-variant-numeric:tabular-nums}
.inspector-content .field input::placeholder{color:#a6aebc;font-size:11px;opacity:1}
@media(max-width:600px){.header-actions .btn{font-size:10px;padding:6px 5px}.header-actions{gap:4px}.save-status{display:none}}

/* v0.3.1: hide note editor until a memo is selected */
.note-sheet[hidden],.note-empty-state[hidden]{display:none !important}
.note-empty-state{align-self:center;max-width:440px;text-align:center;color:#8995a9;padding:45px 25px;line-height:1.85}
.note-empty-state .note-empty-icon{display:block;font-size:36px;color:#c0bce4;margin-bottom:12px}
.note-empty-state p{color:#66718b;font-size:14px;font-weight:800;margin:0 0 7px}
.note-empty-state>span:last-child{font-size:11px}


/* v0.4 — preview-only zoom that does not change paper, font or exports */
.preview-pane{position:relative}
.page-scroll .page-sheet{zoom:var(--preview-zoom,.7)}
.preview-zoom-controls{position:absolute;right:16px;bottom:46px;z-index:5;display:flex;align-items:center;gap:7px;min-height:38px;padding:5px 8px;background:rgba(255,255,255,.94);border:1px solid #cfc6ba;border-radius:10px;box-shadow:0 6px 20px #5143372b;backdrop-filter:blur(5px)}
.preview-zoom-controls input[type=range]{width:112px;min-width:50px;accent-color:#7161cc;cursor:pointer}
.zoom-icon-btn{border-radius:6px;width:27px;height:27px;font-size:18px;line-height:1;background:#f0edf9;color:#5e50aa;font-weight:600}
.zoom-icon-btn:hover:not(:disabled),.zoom-reset-btn:hover{background:#ded8ef}
.preview-zoom-controls output{font-size:11px;color:#635a65;min-width:36px;text-align:center;font-variant-numeric:tabular-nums;font-weight:800}
.zoom-reset-btn{border-radius:6px;padding:6px 7px;background:#f4f1e9;color:#6b6358;font-size:10px;font-weight:750}
@media(max-width:600px){.preview-zoom-controls{bottom:10px;right:8px;gap:4px;padding:5px}.preview-zoom-controls input[type=range]{width:75px}.zoom-reset-btn{padding:6px 5px}}


/* v0.5 — zoom widgets share the existing footer instead of floating above content */
.preview-pane .preview-zoom-controls{position:static;box-shadow:none;backdrop-filter:none;}
.preview-footer,.map-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:48px;padding:6px 12px;background:#fff;white-space:normal}
.preview-footer #layoutInfo,.map-bottom .map-hint{min-width:0;flex:1;font-size:10px;color:#919aaa;line-height:1.45}
.footer-zoom-group{display:flex;gap:9px;align-items:center;justify-content:flex-end;flex:none}
.footer-orientation{font-size:10px;color:#747f92;font-weight:700;white-space:nowrap}
.inline-zoom-controls{display:flex;align-items:center;gap:5px;background:transparent;box-shadow:none;border:0;padding:0;min-height:30px;white-space:nowrap}
.inline-zoom-controls input[type=range]{width:80px;min-width:35px;accent-color:#7161cc;cursor:pointer}
.inline-zoom-controls output{font-size:11px;color:#635a65;min-width:37px;text-align:center;font-variant-numeric:tabular-nums;font-weight:800}
.inline-zoom-controls .zoom-icon-btn{width:25px;height:25px;font-size:17px}
.inline-zoom-controls .zoom-reset-btn{padding:5px 6px}
.map-canvas{zoom:var(--map-zoom,1)}
.map-bottom{border-top:1px solid var(--stroke)}
@media(max-width:1350px){.map-bottom .map-hint{font-size:9px}.footer-zoom-group{gap:6px}.inline-zoom-controls input[type=range]{width:65px}}
@media(max-width:600px){
  .preview-footer{display:flex;padding:5px 7px;min-height:43px}
  .preview-footer #layoutInfo{display:none}
  .footer-zoom-group{width:100%;justify-content:flex-end;gap:5px}
  .inline-zoom-controls{gap:3px}
  .inline-zoom-controls input[type=range]{width:64px}
  .map-bottom{display:flex;min-height:43px;padding:5px 7px}
  .map-bottom .map-hint{display:none}
}


/* v0.5.1 — free 2D visual panning, independent of native scroll range */
.map-pan-layer{width:max-content;height:max-content;position:relative}
.pages,.map-pan-layer{will-change:transform}

/* v0.5.1 — right-button panning on preview and map canvases */
.page-scroll.right-drag-panning,.map-wrapper.right-drag-panning{cursor:grabbing!important;user-select:none!important;-webkit-user-select:none!important}
.page-scroll.right-drag-panning *,.map-wrapper.right-drag-panning *{cursor:grabbing!important;user-select:none!important;-webkit-user-select:none!important}

/* Windows host has its own subtle frameless caption. */
.desktop-host .app-header .brand{display:none !important}
.desktop-host .app-header{height:48px;min-height:48px}
.desktop-host .header-actions{margin-left:auto}

/* v0.6.1: page numbers on alternating outer edges, common to browser and PDF */
.paper.page-sheet .paper-number.page-number-outer-right{left:auto;right:5mm;bottom:7mm;transform:none}
.paper.page-sheet .paper-number.page-number-outer-left{right:auto;left:5mm;bottom:7mm;transform:none}

/* Textarea mirror for memo highlighting; editor keeps native selection, caret and IME. */
.editor-input-wrap{position:relative;display:flex;min-height:0;flex:1;overflow:hidden}
.editor-input-wrap>textarea{position:relative;z-index:1;flex:1;min-width:0;background:transparent}
.memo-highlight-layer{position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none;
 font-family:"Yu Mincho","Hiragino Mincho ProN","Noto Serif CJK JP",serif;font-size:16px;line-height:2;tab-size:2;
 padding:26px 27px;box-sizing:border-box;white-space:pre-wrap;overflow-wrap:break-word;color:transparent}
.memo-highlight-layer #memoHighlightContent{width:100%;white-space:pre-wrap;overflow-wrap:break-word;word-break:normal;transform-origin:top left}
.memo-highlight-layer.editor-vertical{writing-mode:vertical-rl;text-orientation:mixed}
.memo-highlight-layer.disabled{display:none}
.memo-highlight-layer mark.memo-mark{background:#ffda70a1;color:transparent;border-radius:2px;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.memo-popup{position:absolute;right:18px;top:18px;z-index:4;width:min(310px,calc(100% - 32px));max-height:65%;overflow:auto;
 background:#fffffc;border:1px solid #d9c88d;border-radius:11px;box-shadow:0 10px 30px #14274839;padding:16px 19px;color:#303b4f;line-height:1.7}
.memo-popup-kind{font-size:10px;color:#8272be;font-weight:800}.memo-popup strong{display:block;font-size:17px;margin:3px 0 4px}
.memo-popup small{display:block;color:#768397;font-size:10px}.memo-popup-body{white-space:pre-wrap;font-size:12px;max-height:240px;overflow:auto;margin-top:9px}
.memo-popup-close{position:absolute;right:9px;top:8px;background:transparent;font-size:22px;color:#6d7280;border-radius:5px;width:30px;height:30px}
.memo-popup-close:hover{background:#eae8df}
.desktop-settings-btn{font-size:19px;line-height:1;width:37px;padding:8px 4px}
.folder-display{background:#f1f2f8;padding:9px 12px;border-radius:8px;overflow-wrap:anywhere;font-size:11px}

/* Dark edition: app surfaces only; keep the cream manuscript paper unchanged. */
html[data-app-theme="dark"]{--bg:#1b1d26;--ink:#e7e7f2;--stroke:#414452;--muted:#a2a8bc;--primary:#8179e1;--pale:#37334e;--primary-hover:#9a92ff}
html[data-app-theme="dark"] .app-header,html[data-app-theme="dark"] .tabbar,html[data-app-theme="dark"] .toolbar,
html[data-app-theme="dark"] .navigator,html[data-app-theme="dark"] .inspector,html[data-app-theme="dark"] .pane-heading,
html[data-app-theme="dark"] .draft-pane,html[data-app-theme="dark"] .preview-pane,html[data-app-theme="dark"] .editor-head,
html[data-app-theme="dark"] .section-top,html[data-app-theme="dark"] .map-bottom,html[data-app-theme="dark"] .statusbar,
html[data-app-theme="dark"] .note-sheet,html[data-app-theme="dark"] .dialog,html[data-app-theme="dark"] .preview-footer,
html[data-app-theme="dark"] .draft-footer{background:#282b37;color:#e2e4f0;border-color:#414452}
html[data-app-theme="dark"] .main-panel,html[data-app-theme="dark"] .note-layout,html[data-app-theme="dark"] .plot-board{background:#1e202b}
html[data-app-theme="dark"] .btn,html[data-app-theme="dark"] .segmented button.selected,html[data-app-theme="dark"] .field input,
html[data-app-theme="dark"] .field textarea,html[data-app-theme="dark"] .field select,
html[data-app-theme="dark"] .nav-item.active,html[data-app-theme="dark"] .inspector-card,
html[data-app-theme="dark"] .plot-card,html[data-app-theme="dark"] .export-choice{background:#343748;color:#e4e6f2;border-color:#4b4f62}
html[data-app-theme="dark"] .btn.primary{background:#7368d7;color:white}
html[data-app-theme="dark"] input,html[data-app-theme="dark"] textarea,html[data-app-theme="dark"] select{color:#e4e6f1}
html[data-app-theme="dark"] .editor-input-wrap>textarea{color:#f0eced;caret-color:white}
html[data-app-theme="dark"] .chapter-title-input,html[data-app-theme="dark"] .note-name{color:#e4e6f2}
html[data-app-theme="dark"] .note-sheet,.dialog{color:inherit}
html[data-app-theme="dark"] .memo-popup{background:#31333c;color:#f0edf4}
html[data-app-theme="dark"] .page-scroll,html[data-app-theme="dark"] .map-wrapper{background-color:#20222e}
html[data-app-theme="dark"] .paper.page-sheet{background:#faf5e8;color:#332b24}
html[data-app-theme="dark"] .folder-display{background:#343748;color:#e2e5f0}


/* v0.6.3 / v0.5.5 — shared accessible surfaces */
.header-left{display:flex;align-items:center;gap:8px;min-width:0}
.header-left .desktop-settings-btn{height:36px;width:38px;padding:0;font-size:19px;border-radius:9px;flex:none}
.desktop-host .header-left{margin-right:auto}
.note-tag-filters{display:flex;flex-wrap:wrap;gap:5px;max-height:119px;overflow:auto;margin:1px 12px 10px;padding:0 1px 4px}
.note-tag-filters[hidden]{display:none!important}
.note-tag-filter{font-size:10px;line-height:1.4;color:#6554b1;border-radius:99px;background:#efecfc;padding:5px 8px;border:1px solid #d5cef3}
.note-tag-filter small{font-size:9px;opacity:.7}
.note-tag-filter.selected{color:white;background:var(--primary);border-color:var(--primary)}
.note-tag-filter:hover{filter:brightness(.95)}
.field-assist{color:var(--muted);font-size:10px;font-weight:400;line-height:1.5}
.note-sheet{overflow-y:auto}
.character-profile{border:1px solid var(--stroke);background:#f7f8fc;border-radius:12px;margin:7px 0 17px;padding:15px 16px}
.character-profile[hidden]{display:none!important}
.character-profile-heading{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:12px;color:var(--ink)}
.character-profile-heading strong{display:block;font-size:13px}.character-profile-heading small{display:block;font-size:10px;line-height:1.6;color:var(--muted);font-weight:400;margin-top:3px}
.character-profile-heading>span{font-size:10px;letter-spacing:.9px;color:var(--primary);font-weight:800}
.character-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px 12px}
.character-grid .field{margin-bottom:10px}
.character-grid .field input{text-align:left}
@media(max-width:650px){.character-grid{grid-template-columns:1fr}}
/* The map's node field is a continuous surface; no fixed-screen grid. */
.map-wrapper{background-image:none!important;background-color:#f5f6fa}
.map-canvas{background:none!important}
/* Pop-up remains anchored in the editor, independent of the mirrored marks. */
.memo-highlight-layer{border:0!important;white-space:pre-wrap;word-break:normal;overflow-wrap:break-word}
.memo-highlight-layer #memoHighlightContent{overflow-wrap:break-word;word-break:normal}
.editor-input-wrap>textarea{overflow-wrap:break-word;word-break:normal;white-space:pre-wrap;font-kerning:none;font-variant-ligatures:none}
.memo-highlight-layer{font-kerning:none;font-variant-ligatures:none}
/* Settings dialog, grouped by task. */
.desktop-settings-dialog{width:min(660px,calc(100% - 30px))}
.desktop-settings-dialog .dialog-head{background:var(--panel,white)}
.settings-subtitle{margin:4px 0 0;color:var(--muted);font-size:11px;line-height:1.6}
.settings-body{display:flex;flex-direction:column;gap:14px;padding:20px 24px}
.settings-section{display:flex;align-items:flex-start;gap:14px;padding:17px;border:1px solid var(--stroke);border-radius:12px;background:var(--panel,#fafbfe)}
.settings-section-icon{width:36px;height:36px;display:grid;place-items:center;flex:none;border-radius:10px;background:var(--pale);color:var(--primary);font-size:18px;font-weight:700}
.settings-section-main{flex:1;min-width:0}
.settings-section h3,.desktop-settings-dialog .dialog-body h3{margin:0 0 5px;color:var(--ink);font-size:13px;font-weight:750}
.settings-section p{margin:0 0 10px;color:var(--muted);font-size:11px;line-height:1.65}
.settings-section .field{margin:7px 0 0;color:var(--ink)}
.settings-toggle{display:flex;align-items:center;gap:10px;color:var(--ink);font-weight:650;font-size:12px;cursor:pointer}
.settings-toggle input{width:16px;height:16px;accent-color:var(--primary)}
.settings-folder-row{display:flex;gap:9px;align-items:center;min-width:0}
.settings-folder-row .folder-display{flex:1;min-width:0;margin:0}
.settings-folder-row .btn{flex:none}
.settings-section .settings-footnote{font-size:10px;margin-top:10px;line-height:1.6}
.desktop-settings-dialog .dialog-actions{padding:13px 24px 17px;background:var(--panel,#fff)}
/* Dark UI: high-contrast typography and consistently dark inputs, columns and controls.
   The cream preview pages are deliberately excluded. */
html[data-app-theme="dark"]{color-scheme:dark;--panel:#292c39;--surface:#252936;--surface2:#323747;--surface3:#3c4257;--text-strong:#f5f4ff;--ink:#e9eaf5;--muted:#aeb9cd;--stroke:#464b5f;--pale:#3f385a;--primary:#9c91fa;--primary-hover:#b2a9ff}
html[data-app-theme="dark"] body,html[data-app-theme="dark"] #app{background:#1b1e29;color:var(--ink)}
html[data-app-theme="dark"] .app-header,html[data-app-theme="dark"] .toolbar,html[data-app-theme="dark"] .tabbar,html[data-app-theme="dark"] .navigator,html[data-app-theme="dark"] .inspector,html[data-app-theme="dark"] .main-panel,html[data-app-theme="dark"] .pane-heading,html[data-app-theme="dark"] .draft-pane,html[data-app-theme="dark"] .preview-pane,html[data-app-theme="dark"] .editor-head,html[data-app-theme="dark"] .preview-footer,html[data-app-theme="dark"] .draft-footer,html[data-app-theme="dark"] .map-bottom,html[data-app-theme="dark"] .section-top,html[data-app-theme="dark"] .statusbar,html[data-app-theme="dark"] .note-sheet,html[data-app-theme="dark"] .dialog,html[data-app-theme="dark"] .inspector-content{background:var(--panel);color:var(--ink);border-color:var(--stroke)}
html[data-app-theme="dark"] .main-panel,html[data-app-theme="dark"] .note-layout,html[data-app-theme="dark"] .plot-board{background:#20232f}
html[data-app-theme="dark"] .plot-column{background:#2d3241;border-color:#4c5266;color:#eff1fe}
html[data-app-theme="dark"] .plot-column-head,html[data-app-theme="dark"] .plot-column-head span{color:#e6e9fa}
html[data-app-theme="dark"] .plot-column.drag-over{background:#343355;outline-color:#a89cff}
html[data-app-theme="dark"] .plot-card{background:#3a4052;border:2px solid #535a70;color:#f3f2ff;box-shadow:0 2px 8px #070c1840}
html[data-app-theme="dark"] .plot-card:hover{background:#434a61;border-color:#8f85ef}
html[data-app-theme="dark"] .plot-card.selected{border-color:#b0a4ff;outline:1px solid #b0a4ff}
html[data-app-theme="dark"] .plot-card strong{color:#f5f3ff}
html[data-app-theme="dark"] .plot-card p{color:#cbd3e5}
html[data-app-theme="dark"] .plot-chapter{background:#564e7a;color:#f6efff}
html[data-app-theme="dark"] .plot-empty{color:#bfc5d8;border-color:#5d6578;background:#292e3c}
html[data-app-theme="dark"] .plot-count{background:#555d77;color:#fff}
html[data-app-theme="dark"] .section-top h2,html[data-app-theme="dark"] .section-top p,html[data-app-theme="dark"] .inspector-heading,html[data-app-theme="dark"] .panel-heading strong,html[data-app-theme="dark"] .pane-heading span,html[data-app-theme="dark"] .field,html[data-app-theme="dark"] .note-empty-state p,html[data-app-theme="dark"] .inspector-label{color:var(--ink)}
html[data-app-theme="dark"] .inspector-subtitle,html[data-app-theme="dark"] .panel-heading small,html[data-app-theme="dark"] .hint,html[data-app-theme="dark"] .small-muted,html[data-app-theme="dark"] .section-top p,html[data-app-theme="dark"] .note-empty-state,html[data-app-theme="dark"] .nav-kicker,html[data-app-theme="dark"] .nav-description,html[data-app-theme="dark"] .field-assist{color:var(--muted)}
html[data-app-theme="dark"] .tab{color:#bcc7da}
html[data-app-theme="dark"] .tab:hover,html[data-app-theme="dark"] .tool:hover,html[data-app-theme="dark"] .nav-item:hover{background:#3a4056;color:#f1eeff}
html[data-app-theme="dark"] .tab.active{background:#373e52;border-color:#646b84;border-bottom-color:#373e52;color:#d8d2ff}
html[data-app-theme="dark"] .tool,html[data-app-theme="dark"] .mini-btn,html[data-app-theme="dark"] .nav-item,html[data-app-theme="dark"] .nav-title,html[data-app-theme="dark"] .note-name,html[data-app-theme="dark"] .chapter-title-input{color:var(--ink)}
html[data-app-theme="dark"] .nav-item.active{background:#3b3b5d;color:#fff;border-color:#796ed1}
html[data-app-theme="dark"] .nav-item.active .nav-title{color:#fff}
html[data-app-theme="dark"] .segmented{background:#222634}
html[data-app-theme="dark"] .segmented button{color:#b3bfd4}
html[data-app-theme="dark"] .segmented button.selected{background:#554a85;color:#fff}
html[data-app-theme="dark"] .btn,html[data-app-theme="dark"] .export-choice,html[data-app-theme="dark"] .icon-action,html[data-app-theme="dark"] .zoom-icon-btn,html[data-app-theme="dark"] .zoom-reset-btn,html[data-app-theme="dark"] .nav-controls button{background:#393f53;color:#e8e8f7;border-color:#5c6178}
html[data-app-theme="dark"] .btn:hover,html[data-app-theme="dark"] .zoom-icon-btn:hover{background:#454d65}
html[data-app-theme="dark"] .btn.primary{background:#796ce1;color:white;border-color:#796ce1}
html[data-app-theme="dark"] .btn.primary:hover{background:#8b7deb}
html[data-app-theme="dark"] input:not([type="range"]):not([type="checkbox"]),html[data-app-theme="dark"] select,html[data-app-theme="dark"] textarea:not(#manuscriptEditor){background:#363b4e;border-color:#5b6179;color:#f5f3ff}
html[data-app-theme="dark"] input::placeholder,html[data-app-theme="dark"] textarea::placeholder{color:#9aa6bc}
html[data-app-theme="dark"] .editor-input-wrap>textarea{background:transparent;color:#f4f2ff;caret-color:#fff}
html[data-app-theme="dark"] .note-sheet{background:#2b2f3e}
html[data-app-theme="dark"] .character-profile{background:#252a38;border-color:#4a5369}
html[data-app-theme="dark"] .character-profile-heading strong{color:#f2efff}
html[data-app-theme="dark"] .note-kind{background:#494065;color:#e3d8ff}
html[data-app-theme="dark"] .note-tag-filter{background:#373a53;color:#ded6ff;border-color:#615982}
html[data-app-theme="dark"] .note-tag-filter.selected{background:#766cdb;border-color:#9d90ff;color:#fff}
html[data-app-theme="dark"] .note-bottom{border-color:#464b5f;color:#b3bfd2}
html[data-app-theme="dark"] .inspector-card,html[data-app-theme="dark"] .inspector-rule{background:#323747;border-color:#4b5269;color:#e7eaf7}
html[data-app-theme="dark"] .map-wrapper{background-color:#202534;background-image:none!important}
html[data-app-theme="dark"] .map-node{color:#f2f1fc;box-shadow:0 7px 18px #0307114d}
html[data-app-theme="dark"] .map-node.color-rose{background:#53364c;border-color:#aa6c90}
html[data-app-theme="dark"] .map-node.color-sky{background:#29465c;border-color:#658cbb}
html[data-app-theme="dark"] .map-node.color-green{background:#294d46;border-color:#62a68d}
html[data-app-theme="dark"] .map-node.color-violet{background:#40385e;border-color:#8a78cd}
html[data-app-theme="dark"] .dialog-head,html[data-app-theme="dark"] .dialog-actions{background:#292c39;border-color:#474c61}
html[data-app-theme="dark"] .settings-section{background:#303548;border-color:#4a5066}
html[data-app-theme="dark"] .settings-section-main h3,html[data-app-theme="dark"] .dialog-body h3{color:#f5f3ff}
html[data-app-theme="dark"] .settings-section-main p,html[data-app-theme="dark"] .dialog-body p,html[data-app-theme="dark"] .settings-subtitle{color:#bbc5d9}
html[data-app-theme="dark"] .folder-display{background:#232735;color:#e5e6f7;border:1px solid #545b70}
html[data-app-theme="dark"] .memo-popup{background:#34394a;color:#f4f0ff;border-color:#8b80bb}
html[data-app-theme="dark"] .memo-popup-kind,html[data-app-theme="dark"] .memo-popup small{color:#d0c8ed}
html[data-app-theme="dark"] .page-scroll{background:#222636}
/* Paper is always the same physical-looking ivory color in both themes. */
html[data-app-theme="dark"] .paper.page-sheet{background:#faf5e8;color:#332b24;color-scheme:light}
html[data-app-theme="dark"] .paper.page-sheet *{color:inherit}
/* Extra dark-theme cleanup for inline formatting tools and icon controls. */
html[data-app-theme="dark"] .formatting-set{background:#242937;border:1px solid #4f566c;color:#e8eafa}
html[data-app-theme="dark"] .format-btn{background:transparent;color:#e8eafa;border-color:transparent}
html[data-app-theme="dark"] .format-btn:hover{background:#444b65;color:#fff}
html[data-app-theme="dark"] .toolbar-help,html[data-app-theme="dark"] .toolbar-label,html[data-app-theme="dark"] .footer-orientation{color:#c7d0e1}
html[data-app-theme="dark"] .chapter-title-input::placeholder,html[data-app-theme="dark"] #manuscriptEditor::placeholder{color:#9eabc0}
html[data-app-theme="dark"] .work-title{color:#a9b3c8}


/* v0.6.4 / Web v0.5.6 — keep the full character profile visible.
   Long freeform descriptions scroll independently. */
.memo-popup{
 position:fixed;
 top:12px;
 left:12px;
 right:auto;
 width:min(426px,calc(100vw - 24px));
 max-height:calc(100dvh - 24px);
 z-index:1100;
 display:flex;
 flex-direction:column;
 overflow:hidden;
 padding:15px 17px 13px;
 gap:0;
}
.memo-popup strong{padding-right:34px;line-height:1.45}
.memo-popup-profile{
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 gap:5px 7px;
 margin-top:10px;
 flex:none;
 overflow:visible;
}
.memo-profile-item{
 display:flex;
 flex-direction:column;
 gap:1px;
 min-width:0;
 padding:5px 8px;
 background:#f5f4f0;
 border:1px solid #e6e1d3;
 border-radius:6px;
}
.memo-profile-label{font-size:10px;line-height:1.3;color:#65728a}
.memo-profile-value{font-size:12px;font-weight:650;line-height:1.4;overflow-wrap:anywhere;white-space:pre-wrap}
.memo-popup-body{
 max-height:190px;
 overflow-y:auto;
 overflow-x:hidden;
 min-height:0;
 flex:0 1 auto;
 margin-top:10px;
 padding-top:9px;
 border-top:1px solid #e8e3d8;
 overscroll-behavior:contain;
}
html[data-app-theme="dark"] .memo-profile-item{background:#292e3c;border-color:#525b73}
html[data-app-theme="dark"] .memo-profile-label{color:#bec8dc}
html[data-app-theme="dark"] .memo-profile-value{color:#f3f0ff}
html[data-app-theme="dark"] .memo-popup-body{border-color:#525b73}
@media(max-width:440px){
 .memo-popup{padding:12px}
 .memo-profile-item{padding:4px 5px}
}
@media(max-height:520px){
 .memo-popup{max-height:calc(100dvh - 16px)}
 .memo-popup-body{max-height:90px}
}

/* Keep the app title anchored left; scroll only the actions on narrow screens. */
.app-header{justify-content:flex-start}
.app-header .header-left{flex:0 0 auto}
.app-header .header-left .brand{flex:0 0 auto}
.app-header .header-actions{margin-left:auto;min-width:0;flex:0 1 auto;overflow-x:auto;scrollbar-width:thin}

.manuscript-tcy{text-combine-upright:all;-webkit-text-combine:horizontal;letter-spacing:0}

/* Writing running matter: the page number is outside; the chapter is inside. */
.paper-running-number{flex:none}.paper-running-chapter{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* PDF編集：編集ワークスペースを全幅で表示 */
.pdf-editor-mode .navigator,.pdf-editor-mode .inspector{display:none!important}
.pdf-editor-mode .workspace{display:flex}
.pdf-editor-mode .main-panel{width:100%;flex:1 1 100%;min-width:0}
.pdf-editor-view{padding:0!important;overflow:hidden;flex:1;min-height:0}
.pdf-editor-view iframe{display:block;width:100%;height:100%;min-height:0;border:0;background:#f5f6fa}
/* PDF editing shares the same app header and navigation tabs as the other workspaces. */
.pdf-editor-mode .app-header{display:flex!important}

/* v0.9.6 — non-modal unsaved-cache warning and optional Google Drive connection */
.app-header{position:relative;z-index:22}
.cloud-status{font-size:10px;white-space:nowrap;color:var(--muted);font-weight:700}
.cloud-status.connected{color:#25885d}
.cache-warning{position:fixed;z-index:90;top:70px;left:50%;transform:translateX(-50%);width:min(660px,calc(100vw - 24px));display:flex;align-items:center;gap:15px;justify-content:space-between;padding:11px 14px;border:1px solid #e3c77b;background:#fff8e8;color:#684f1d;box-shadow:0 6px 20px #2b281e24;border-radius:10px;font-size:12px;line-height:1.65;pointer-events:none}
.cache-warning[hidden]{display:none!important}.cache-warning button{pointer-events:auto;background:transparent;font-size:21px;color:#6e5b37;padding:0 6px;border-radius:5px}
.drive-dialog{width:min(650px,calc(100% - 30px))}.drive-actions{display:flex;gap:7px;flex-wrap:wrap}.drive-message{font-size:11px;line-height:1.7;color:var(--muted)}
.drive-file-list{display:flex;flex-direction:column;max-height:35vh;min-height:90px;overflow:auto;border:1px solid var(--stroke);border-radius:9px;margin:10px 0}
.drive-file{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px;border-bottom:1px solid var(--stroke)}.drive-file:last-child{border-bottom:0}.drive-file strong{font-size:12px;word-break:break-all}.drive-file small{font-size:10px;color:var(--muted)}
.drive-file a{color:var(--primary);font-size:11px;white-space:nowrap}.drive-file .drive-file-meta{min-width:0;display:flex;flex-direction:column;gap:5px}
html[data-app-theme="dark"] .cache-warning{background:#493e2a;color:#ffe7ae;border-color:#a48c54}
@media(max-width:900px){.cloud-status{display:none}.app-header .header-actions #googleDriveButton{font-size:10px;padding:7px}.cache-warning{top:62px}}

/* Drive stage 2 — file actions */
.drive-file-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}.drive-download{font-size:11px;padding:7px 9px}@media(max-width:580px){.drive-file{align-items:flex-start;flex-direction:column}.drive-file-actions{justify-content:flex-start}}

/* v0.9.8 — confirm switching to Drive NOV editor */
.drive-open-actions{flex-wrap:wrap}.drive-open-actions button{min-height:36px}.drive-edit{font-size:11px;padding:7px 12px}


/* Memo reference card: anchored inside the on-screen print preview, never on the manuscript canvas. */
.preview-pane{position:relative}
.preview-pane .memo-popup{
 position:absolute!important;left:auto!important;right:12px!important;top:52px!important;
 width:min(426px,calc(100% - 24px));max-height:calc(100% - 108px);
 z-index:25;overflow:hidden;box-shadow:0 9px 28px #17283e45;
}
.preview-pane .memo-popup[hidden]{display:none!important}
.preview-pane .memo-popup-body{overflow-y:auto}
@media(max-width:650px){.preview-pane .memo-popup{right:7px!important;top:45px!important;width:calc(100% - 14px);max-height:calc(100% - 94px)}}


/* v0.9.14 / Windows v0.34.6: memo details replace the printed-page view. */
.preview-pane .preview-heading-actions{display:flex;align-items:center;gap:10px;min-width:0}
.preview-pane .preview-heading-actions #pageCount{font-weight:500}
.preview-pane .memo-preview-back{font-size:11px;white-space:nowrap;border:1px solid var(--stroke);background:var(--pale);color:var(--primary);padding:6px 10px}
.preview-pane.memo-detail-active .page-scroll,
.preview-pane.memo-detail-active .preview-footer,
.preview-pane.memo-detail-active #pageCount{display:none!important}
.preview-pane .memo-popup{display:none}
.preview-pane.memo-detail-active .memo-popup:not([hidden]){
 position:relative!important;inset:auto!important;left:auto!important;right:auto!important;top:auto!important;
 width:100%!important;height:auto;max-width:none!important;max-height:none!important;
 min-height:0;flex:1 1 auto;display:flex!important;flex-direction:column;
 padding:24px 28px;overflow:auto;box-shadow:none;border:0;border-radius:0;
 background:var(--panel,#fff);color:var(--ink);z-index:auto;
}
.preview-pane.memo-detail-active .memo-popup strong{font-size:20px;padding:0}
.preview-pane.memo-detail-active .memo-popup-profile{flex:none}
.preview-pane.memo-detail-active .memo-popup-body{max-height:none;overflow:visible;flex:none;font-size:13px;line-height:1.9}
@media(max-width:650px){.preview-pane.memo-detail-active .memo-popup:not([hidden]){padding:16px!important;width:100%!important;max-height:none!important}}

/* v0.9.17 — lightweight headers; maximize working canvas. */
#notesView .notes-compact-header{padding:7px 13px;min-height:44px;gap:8px;justify-content:flex-end;border-bottom:1px solid var(--stroke)}
#notesView .notes-compact-header .studio-notes-tabs{margin-left:0;padding:2px}
#notesView .notes-compact-header .studio-notes-tabs button{padding:7px 10px;font-weight:500}
#notesView .notes-compact-header #noteAddButton{order:2;padding:8px 12px;font-weight:550}
#plotView .plot-compact-header{padding:7px 16px 1px;background:var(--panel,#fff);flex:none;border-bottom:0}
#plotView .plot-board-name{font-size:15px;font-weight:500;width:min(480px,90%);max-width:90%;margin:0;padding:5px 7px;color:var(--ink)}
#plotView .plot-board-tabs{padding-top:5px;flex:none}
#mindmapView .map-bottom{gap:8px}
#mindmapView .map-bottom-center{background:var(--pale);border:1px solid var(--stroke);color:var(--ink);border-radius:6px;padding:6px 9px;font-size:11px;white-space:nowrap;flex:none}
#mindmapView .map-bottom-center:hover{color:var(--primary)}
#navigator .panel-heading{align-items:center}
#navigator .panel-heading .icon-action{width:auto;min-width:27px;height:auto;min-height:27px;padding:7px 9px;font-size:11px;font-weight:600;line-height:1.35;white-space:normal;text-align:center}
#navigator .panel-heading strong{font-weight:600}
#navigator .panel-heading small{font-weight:400}
#notesView .note-name{font-weight:550}
#manuscriptView .chapter-title-input{font-weight:550}
@media(max-width:700px){#navigator .panel-heading{flex-wrap:wrap}#navigator .panel-heading .icon-action{width:100%;padding:6px 3px;font-size:10px}#notesView .notes-compact-header{flex-wrap:wrap}#mindmapView .map-bottom .map-hint{display:none}}

/* v0.9.18 compact picture / multiple planning canvases */
.note-identity{display:flex;align-items:center;gap:14px;margin:9px 0 22px}.note-identity .note-name{min-width:0;flex:1;margin:0}
.note-avatar{flex:none;width:68px;height:68px;border-radius:50%;background:var(--pale);border:2px dashed var(--primary);display:grid;place-items:center;color:var(--primary);font-size:26px;overflow:hidden;padding:0}
.note-avatar img{width:100%;height:100%;object-fit:cover}.note-avatar img[hidden]{display:none}
.avatar-crop-stage{width:min(340px,100%);aspect-ratio:1;overflow:hidden;position:relative;background:#222;margin:10px auto;touch-action:none;cursor:grab}
.avatar-crop-stage img{position:absolute;max-width:none;pointer-events:none;user-select:none}
.avatar-crop-circle{position:absolute;inset:0;border-radius:50%;box-shadow:0 0 0 100px #0007;pointer-events:none;outline:2px solid #fff8;outline-offset:-2px}
.plot-board-tabs{flex:none}.studio-rel-viewport{min-height:0;flex:1}.multi-graph-top{display:flex;flex-direction:column;flex:none}
.multi-graph-top .plot-compact-header{padding-top:8px;padding-bottom:4px}.multi-graph-top .plot-board-tabs{padding-top:0}

/* v0.9.20: consistent title and tab alignment for all planning canvases. */
#plotView > .plot-compact-header,#mindmapView > .plot-compact-header,#relationshipsView > .plot-compact-header{padding:7px 16px 1px!important;min-height:39px;flex:none;background:var(--panel,#fff)!important;border:0!important;display:flex;align-items:center}
#plotView > .plot-compact-header .plot-board-name,#mindmapView > .plot-compact-header .plot-board-name,#relationshipsView > .plot-compact-header .plot-board-name{font-size:15px;font-weight:500;width:min(480px,90%);max-width:90%;margin:0;padding:5px 7px;color:var(--ink);background:transparent}
#plotView > .plot-board-tabs,#mindmapView > .plot-board-tabs,#relationshipsView > .plot-board-tabs{padding-top:5px;min-height:43px;flex:none;background:var(--bg);border-bottom:1px solid var(--stroke)}
.memo-preview-identity{display:flex;align-items:center;gap:14px;flex:none;margin:3px 0 12px}
.memo-preview-title{display:flex;flex-direction:column;min-width:0;gap:4px}
.memo-preview-title strong{overflow-wrap:anywhere}
.memo-preview-image{width:88px;height:88px;flex:none;border-radius:50%;object-fit:cover;border:2px solid var(--stroke);background:var(--pale)}
.memo-preview-image[hidden]{display:none!important}
@media(max-width:600px){.memo-preview-image{width:64px;height:64px}}

/* Drive three-way conflict review (Web edition). No data is discarded on modal close. */
.drive-conflict-dialog{width:min(780px,calc(100vw - 28px));max-height:min(90vh,900px)}
.drive-conflict-dialog .dialog-body{max-height:60vh;overflow:auto}
.drive-conflict-list{display:grid;gap:8px;margin:14px 0}
.drive-conflict-row{border:1px solid var(--stroke,#dfe3ef);border-radius:10px;padding:10px 12px;display:grid;gap:6px}
.drive-conflict-row strong{font-size:13px}.drive-conflict-row small{color:var(--muted,#697489)}
.drive-conflict-row label{display:grid;gap:5px;font-size:12px}
.drive-conflict-row select{max-width:100%;border:1px solid var(--stroke,#dfe3ef);background:var(--surface,#fff);border-radius:6px;padding:8px;color:inherit}
.drive-conflict-dialog .dialog-actions{flex-wrap:wrap}

/* v0.9.36: characters may show an initial instead of an uploaded portrait. */
.genko-initial-avatar{display:inline-flex;align-items:center;justify-content:center;flex:none;box-sizing:border-box;border-radius:50%;background:var(--avatar-bg,#7168be);color:#fff;font-weight:750;font-family:system-ui,"Yu Gothic",sans-serif;line-height:1;overflow:hidden;white-space:nowrap;user-select:none}
.genko-initial-avatar[hidden]{display:none!important}
.note-avatar .genko-initial-avatar{width:100%;height:100%;font-size:34px}
.note-avatar.is-initial{border-style:solid;border-color:var(--primary);background:transparent}
.note-initial-toggle{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:-9px 0 20px 83px;font-size:12px;font-weight:650;color:var(--ink);cursor:pointer}
.note-initial-toggle input{width:17px;height:17px;accent-color:var(--primary);margin:0;flex:none}
.note-initial-toggle span{width:100%;margin-left:25px;font-weight:400;font-size:10px;color:var(--muted)}
@media(max-width:500px){.note-initial-toggle{margin-left:0}}
.memo-preview-image.genko-initial-avatar{display:inline-flex;font-size:37px;border:2px solid #ffffff88}
