@media (max-width: 768px),(pointer: coarse){:root{--mobile-gap: 8px;--mobile-font-scale: .95}.mobile-touch-area{min-height:44px}.mobile-header{display:flex;align-items:center;justify-content:space-between;gap:var(--mobile-gap);padding:8px 10px}.mobile-header .project-title{flex:1;display:flex;flex-direction:column;align-items:flex-start}.mobile-header .title-wrap{display:flex;flex-direction:column;align-items:flex-start;gap:2px}.mobile-header .project-title h3,.mobile-header .project-title small{text-align:left;align-self:flex-start}.editor-header.mobile-header,.sidebar>header.mobile-header,.notes-panel>header.mobile-header{box-sizing:border-box;height:auto;min-height:54px;padding:8px 10px;gap:10px}.sidebar>header.mobile-header .project-back{margin-left:0}.sidebar>header.mobile-header .title-wrap{gap:0}:is(.editor-header,.sidebar>header,.notes-panel>header).mobile-header h3{font-size:var(--text-md);font-weight:600}:is(.editor-header,.sidebar>header,.notes-panel>header).mobile-header small{font-size:var(--text-sm);color:var(--sub)}:is(.editor-header,.sidebar>header,.notes-panel>header).mobile-header .btn.icon-only .icon{margin-bottom:0}.ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sidebar.mobile .panel-search{padding:0 10px var(--space-2)}.sidebar.mobile .panel-search .search-input{height:40px}.sidebar.mobile .panel-search input{font-size:16px}.sidebar.mobile .panel-search .clear-btn{padding:4px}.mobile-scroll{-webkit-overflow-scrolling:touch}.tree-item.mobile{display:flex;align-items:center}.tree-item.mobile .btn.icon-only{display:grid;place-items:center}.tree-item.mobile .label{flex:1}.tree-item.mobile .caret.placeholder{width:16px;display:inline-block}.tree.mobile .tree-item.variant{padding-left:30px!important}.swipe-row{position:relative;overflow:hidden}.swipe-content{will-change:transform;transition:transform .18s ease-out}.swipe-actions{position:absolute;top:0;right:0;bottom:0;display:flex;align-items:stretch;gap:8px;padding:0 8px;background:var(--panel)}.swipe-actions .action{width:64px;display:grid;place-items:center;border:none;border-radius:8px;margin:6px 0;color:var(--bg)}.swipe-actions .rename{background:var(--accent)}.swipe-actions .more{background:var(--primary)}.mobile-editor-panel{padding:0}.workspace>.workspace-sidebar,.workspace>.workspace-notes{position:fixed;top:0;right:0;bottom:0;left:0;width:100vw;height:100dvh;z-index:20;border:none}.sidebar.mobile .sidebar-section__header{min-height:44px}.sidebar.mobile .tree-item{height:36px}.mobile-sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:color-mix(in srgb,black 35%,transparent);display:flex;align-items:flex-end;z-index:12000}.mobile-sheet{width:100%;background:var(--panel);border-top-left-radius:var(--radius-lg);border-top-right-radius:var(--radius-lg);padding:var(--space-2);box-shadow:var(--shadow-sm)}.mobile-sheet.nested{position:absolute;bottom:64px;left:0;right:0}.sheet-group{padding:4px 0}.sheet-item{width:100%;text-align:center;padding:14px 12px;background:var(--bg);border:none;border-radius:var(--radius-md);margin:6px 0;font-family:var(--font-ui);font-size:16px;position:relative}.sheet-item.danger{color:var(--danger)}.sheet-file-input{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0}.sheet-cancel{width:100%;text-align:center;padding:14px 12px;background:transparent;border:none;color:var(--text);margin-top:4px}.mobile-modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:color-mix(in srgb,black 30%,transparent);display:grid;place-items:end center;z-index:13000}.mobile-modal{width:100%;height:90vh;background:var(--panel);border-top-left-radius:var(--radius-lg);border-top-right-radius:var(--radius-lg);box-shadow:var(--shadow-sm);display:flex;flex-direction:column}.mobile-modal .body{flex:1;overflow:auto;padding:12px}.mobile-modal .footer.sticky{border-top:1px solid var(--muted);padding:10px;background:var(--panel);position:sticky;bottom:0}.toast.mobile{position:fixed;left:50%;transform:translate(-50%);bottom:16px;background:var(--text);color:var(--panel);padding:var(--space-3) var(--space-4);border-radius:var(--radius-lg);z-index:50}.editor-toolbar.mobile{padding:6px}.editor-toolbar.mobile select{height:40px}.mobile-indent-controls{position:fixed;left:50%;transform:translate(-50%);bottom:80px;display:flex;gap:8px;background:var(--panel);border:1px solid var(--muted);border-radius:999px;padding:6px;z-index:20;box-shadow:0 6px 20px #0000002e}.editor .toolbar-container .toolbar-right .zoom-controls,.editor .toolbar-container .toolbar-right .toolbar-separator{display:none!important}.editor .toolbar-container .toolbar-right>button{display:none!important}.editor .content{justify-content:flex-start;padding-bottom:calc(env(safe-area-inset-bottom,0px) + 24px)}.editor .page .ProseMirror{padding-bottom:calc(env(safe-area-inset-bottom,0px) + 96px)!important}.editor .page{width:100%!important;max-width:100%!important;margin:0!important;padding:8px!important;box-shadow:none}.notes-panel.mobile .note-image{max-width:100%;border-radius:8px;margin-bottom:8px}.notes-panel.mobile textarea.mobile{width:100%;min-height:200px;resize:vertical;font-size:16px}body.dragging-touch{touch-action:none;overscroll-behavior:none}.drag-ghost{opacity:.9;box-shadow:0 8px 18px #00000040;border-radius:8px;background:var(--panel)}.drop-target{outline:none;position:relative}.drop-target-before:after,.drop-target-after:after{content:"";position:absolute;left:0;right:0;height:0;border-top:2px solid var(--primary)}.drop-target-before:after{top:-1px}.drop-target-after:after{bottom:-1px}}.ellipsis-tooltip{position:fixed;z-index:9999;background:var(--panel);color:var(--text);border:1px solid rgba(0,0,0,.12);border-radius:4px;padding:4px 8px;font-size:.82rem;max-width:320px;word-break:break-word;white-space:normal;pointer-events:none;box-shadow:0 2px 8px #00000026}.tab-bar{display:flex;align-items:stretch;gap:var(--space-4);padding:0 var(--space-4);overflow-x:auto;scrollbar-width:none;background:var(--bg);border-bottom:1px solid var(--muted);flex-shrink:0;min-height:38px}.tab-bar::-webkit-scrollbar{display:none}.tab-bar__tab{display:flex;align-items:center;gap:var(--space-2);padding:0;cursor:pointer;white-space:nowrap;font-family:var(--font-ui);font-size:var(--text-sm);color:var(--sub);-webkit-user-select:none;user-select:none;flex-shrink:0;transition:color .1s,box-shadow .1s}.tab-bar__tab:hover{color:var(--text)}.tab-bar__tab--active{color:var(--text);box-shadow:inset 0 -2px 0 var(--primary)}.tab-bar__title{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab-kind{display:inline-block;width:6px;height:6px;border-radius:50%;flex:0 0 auto}.tab-kind--writing{background:var(--kind-writing)}.tab-kind--outline{background:var(--kind-outline)}.tab-bar__close{background:none;border:none;cursor:pointer;color:inherit;padding:0;font-size:var(--text-md);line-height:1;opacity:0;flex-shrink:0}.tab-bar__tab:hover .tab-bar__close,.tab-bar__tab--active .tab-bar__close{opacity:.6}.tab-bar__close:hover{opacity:1!important}.auth-screen{min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:var(--space-5);box-sizing:border-box;background:color-mix(in srgb,var(--bg) 96%,var(--text));color:var(--text);font-family:var(--font-ui)}.auth-box{width:100%;max-width:280px;text-align:center}.auth-wordmark{margin:0 0 var(--space-1);font-family:Crimson Pro,Georgia,serif;font-size:30px;font-weight:600;letter-spacing:.01em}.auth-tagline{margin:0 0 var(--space-5);color:var(--sub);font-family:Crimson Pro,Georgia,serif;font-size:15px;font-style:italic}.auth-box .btn{width:100%;height:auto;padding:var(--space-2) var(--space-3);gap:var(--space-2);border-radius:var(--radius-md);font-size:13px;background:var(--bg);box-shadow:var(--shadow-sm)}.auth-box .btn.auth-google{border:1px solid var(--muted)}.auth-google-mark{color:var(--primary);font-weight:700}.auth-message{margin:0 0 var(--space-4);color:var(--sub);font-size:var(--text-md)}.auth-message[role=alert]{margin:var(--space-3) 0 var(--space-3);color:var(--danger)}.auth-note{display:block;margin-top:var(--space-3);color:var(--sub);font-size:var(--text-sm)}.auth-heading{margin:0 0 var(--space-3);font-size:var(--text-lg);font-weight:600}@media (max-width: 768px){.auth-box{max-width:360px}.auth-box .btn{min-height:44px;font-size:15px}}.project-list-screen{min-height:100vh;background:var(--bg);color:var(--text);font-family:var(--font-ui)}.project-list-header{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);padding:var(--space-3) var(--space-5);border-bottom:1px solid var(--muted);background:var(--panel)}.project-list-wordmark{font-size:var(--text-lg);font-weight:600}.project-list-avatar{flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:var(--primary);color:var(--panel);font-size:var(--text-sm);font-weight:600}.project-list-main{max-width:960px;margin:0 auto;padding:var(--space-5)}.project-list-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--space-4);margin-bottom:var(--space-5)}.project-list-heading h1{margin:0;font-size:22px;font-weight:600}.project-list-count{color:var(--sub);font-size:var(--text-md)}.project-list-actions{display:flex;gap:var(--space-2)}.project-list-empty{padding:48px 0;text-align:center;color:var(--sub)}.project-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:var(--space-4)}.project-card{--card-meta-h: 36px;position:relative;border:1px solid var(--muted);border-radius:var(--radius-lg);background:var(--panel);box-shadow:var(--shadow-sm);overflow:hidden}.project-card__open{display:block;width:100%;padding:0;border:none;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.project-card__cover{display:flex;align-items:flex-end;height:96px;padding:var(--space-3);background:var(--bg);color:var(--text);font-family:Crimson Pro,Georgia,serif;font-size:var(--text-lg)}.project-card__cover--image{background-image:linear-gradient(to top,color-mix(in srgb,var(--bg) 88%,transparent) 0%,color-mix(in srgb,var(--bg) 35%,transparent) 55%,transparent 100%),var(--cover-image);background-size:cover;background-position:center}.project-card__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;overflow-wrap:anywhere}.project-card__meta{display:flex;align-items:center;height:var(--card-meta-h);padding:0 var(--space-3);padding-right:44px;color:var(--sub);font-size:var(--text-sm)}.project-card__open:hover .project-card__meta{color:var(--text)}.project-card__open:focus-visible{outline:2px solid var(--primary);outline-offset:-2px}.project-card__menu{position:absolute;right:var(--space-1);bottom:0;height:var(--card-meta-h);display:flex;align-items:center}.project-list-screen.mobile{min-height:100dvh}.project-list-screen.mobile .project-card{--card-meta-h: 44px}.project-list-screen.mobile .project-list-header{padding:var(--space-3) var(--space-4)}.project-list-screen.mobile .project-list-main{padding:var(--space-4)}.project-list-screen.mobile .project-list-heading{margin-bottom:var(--space-3);justify-content:flex-start;align-items:baseline;gap:var(--space-3)}.project-list-actions.mobile{flex-direction:column;margin-bottom:var(--space-4)}.project-list-actions.mobile .btn{width:100%;font-size:15px}.project-list-screen.mobile .project-grid{grid-template-columns:1fr}.account-menu{position:relative}button.project-list-avatar{border:none;cursor:pointer;font-family:var(--font-ui)}button.project-list-avatar:focus-visible{outline:2px solid color-mix(in srgb,var(--primary) 55%,transparent);outline-offset:2px}.account-menu__dialog{position:absolute;top:calc(100% + var(--space-2));right:0;z-index:20;display:flex;flex-direction:column;gap:var(--space-2);min-width:220px;max-width:min(320px,calc(100vw - 32px));padding:var(--space-3);border:1px solid var(--muted);border-radius:var(--radius-md);background:var(--panel);color:var(--text);box-shadow:var(--shadow-sm)}.account-menu__label{color:var(--sub);font-size:var(--text-xs)}.account-menu__email{font-size:var(--text-md);overflow-wrap:anywhere}.project-list-screen.mobile .project-list-avatar{width:36px;height:36px;font-size:var(--text-md)}.editor .part-separator{border:none;border-top:1px dotted var(--muted);opacity:.4;margin:2px 0 8px}.editor .page .ProseMirror ul{margin:0 0 8px}.editor .folder-separator{border:none;border-top:1px dashed var(--muted);margin:24px 0}.tree-item{display:flex;align-items:center;width:100%}.tree-item .caret{flex:0 0 auto}.tree-item span:not(.caret){flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tree-item.folder{font-weight:700}.tree-item.file{font-weight:400}.workspace{display:flex;height:100vh;height:100dvh;overflow:hidden;position:relative;background:var(--bg);color:var(--text);font-family:var(--font-ui)}.workspace-sidebar,.workspace-notes{flex:0 0 auto;width:300px;display:flex;flex-direction:column;min-height:0;background:var(--sidebar-bg)}.workspace-sidebar{border-right:1px solid var(--muted)}.workspace-notes{border-left:1px solid var(--muted)}.workspace-sidebar[hidden],.workspace-notes[hidden]{display:none!important}.workspace-main{position:relative;flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column;background:var(--bg)}.sidebar{flex:1 1 auto;min-height:0;background:transparent}.sidebar>header{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;min-height:54px;gap:var(--space-2);padding:var(--space-2);border-bottom:1px solid transparent;flex:0 0 auto}.sidebar>header .project-back{flex:0 0 auto;color:var(--sub)}.sidebar>header .project-back:hover{color:var(--text)}.sidebar>header .project-title{flex:1 1 auto;display:flex;flex-direction:column;min-width:0;cursor:pointer}.sidebar>header h3{margin:0;font-size:var(--text-md);font-weight:600}.sidebar>header small{color:var(--sub);font-size:var(--text-sm)}.sidebar .panel-search{flex:0 0 auto;padding:0 var(--space-3) var(--space-2)}.sidebar .panel-search .search-input{display:flex;align-items:center;gap:var(--space-1);height:30px;padding:0 var(--space-2);background:var(--panel);border:1px solid var(--muted);border-radius:var(--radius-md)}.sidebar .panel-search .icon-wrapper{display:flex;align-items:center;color:var(--sub)}.sidebar .panel-search input{flex:1;min-width:0;height:100%;margin:0;border:none;outline:none;background:transparent;color:inherit;font-size:var(--text-sm)}.sidebar .panel-search input::placeholder{color:var(--sub)}.sidebar .panel-search .clear-btn{display:flex;align-items:center;padding:2px;border:none;background:transparent;color:var(--sub);cursor:pointer}.sidebar-section{display:flex;flex-direction:column;min-height:0}.sidebar-section__header{display:flex;align-items:center;justify-content:space-between;flex:0 0 auto;padding:var(--space-2) var(--space-2) var(--space-1) var(--space-3)}.sidebar-section__toggle{display:inline-flex;align-items:center;gap:var(--space-1);padding:0;border:none;background:transparent;color:var(--sub);cursor:pointer;font-size:var(--text-xs);font-weight:500;letter-spacing:.08em;text-transform:uppercase}.sidebar-section__toggle:hover{color:var(--text)}.sidebar-section__header .btn{color:var(--sub)}.sidebar-section__header .btn:hover{color:var(--text)}.sidebar-section__body{flex:1;min-height:0;overflow:auto;padding:0 var(--space-2) var(--space-2)}.sidebar-divider{position:relative;flex:0 0 auto;height:7px;margin:0 var(--space-3);cursor:row-resize;touch-action:none}.sidebar-divider:after{content:"";position:absolute;left:0;right:0;top:3px;height:1px;background:var(--muted)}.sidebar-divider:hover:after,.sidebar-divider:focus-visible:after{background:var(--primary)}.sidebar .tree ul,.sidebar .tree-item{background:transparent}.sidebar .tree-item{height:28px;margin:1px 0;border-radius:var(--radius-sm);font-size:var(--text-md)}.sidebar .tree-item:hover{background:color-mix(in srgb,var(--text) 6%,transparent)}.sidebar .tree-item.chapter{font-weight:600}.sidebar .tree-item.active{background:var(--text);color:var(--panel)}.sidebar .tree-item.active .btn,.sidebar .tree-item.active .caret{color:inherit}.sidebar li:has(li .tree-item.active)>.tree-item.active{background:color-mix(in srgb,var(--text) 8%,transparent);color:var(--text)}.editor-header{display:flex;align-items:center;gap:var(--space-2);flex:0 0 auto;min-height:44px;padding:var(--space-1) var(--space-3);background:var(--bg)}.editor-header .editor-title{flex:1;min-width:0}.editor-header .editor-title h3{margin:0;font-size:var(--text-md);font-weight:600;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.editor-header .editor-title small{font-size:var(--text-sm)}.editor-header .btn{color:var(--sub)}.editor-header .btn:hover{color:var(--text)}.collapse-handle{position:absolute;top:var(--handle-top, 0px);bottom:0;z-index:2;width:28px;display:flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;color:var(--sub);cursor:pointer;transition:width .16s ease,background-color .16s ease,color .16s ease}.collapse-handle--sidebar{left:0}.collapse-handle--notes{right:0}.collapse-handle .icon{opacity:.65;transition:transform .18s ease,opacity .18s ease}.collapse-handle:hover,.collapse-handle:focus-visible{width:40px;color:var(--text);background:color-mix(in srgb,var(--text) 6%,transparent)}.collapse-handle:hover .icon,.collapse-handle:focus-visible .icon{opacity:1}.collapse-handle--sidebar:hover .icon{transform:translate(-3px)}.collapse-handle--notes:hover .icon{transform:translate(3px)}.focus-mode .collapse-handle{display:none!important}.workspace-main>.editor{flex:1 1 auto;height:auto;min-height:0}.workspace .editor .toolbar-container,.workspace .editor .content{background:var(--bg)}.workspace .editor .page{box-shadow:none}.workspace .editor .page>.editor-content{width:100%;max-width:46rem;margin-inline:auto}.workspace-notes>.notes-panel{flex:1 1 auto;min-height:0;background:transparent}.workspace-notes .notes-panel>header:not(.mobile-header){box-sizing:border-box;min-height:54px;gap:var(--space-3);padding:var(--space-2) var(--space-3)}.workspace-notes .notes-panel>header:not(.mobile-header) h3{font-size:var(--text-md);font-weight:600}.workspace-notes .notes-panel>header:not(.mobile-header) small{color:var(--sub);font-size:var(--text-sm)}.workspace-notes .notes-panel>header:not(.mobile-header) .editor-title{flex:1 1 auto;min-width:0}.sidebar>header h3,.sidebar>header small,.workspace-notes .notes-panel>header:not(.mobile-header) h3,.workspace-notes .notes-panel>header:not(.mobile-header) small{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sidebar>header .btn.icon-only .icon,.editor-header .btn.icon-only .icon,.workspace-notes .notes-panel>header .btn.icon-only .icon{margin-bottom:0}.workspace-notes .notes-panel .notes-editor-toolbar,.workspace-notes .notes-panel .notes-editor-content,.workspace-notes .notes-panel footer.notes-footer{background:transparent}:root{--bg: #ffffff;--panel: #ffffff;--muted: #e9ecef;--text: #212529;--page: #ffffff;--editor-text: #212529;--page-opacity: 1;--sub: #6c757d;--primary: #0d6efd;--danger: #dc3545;--accent: #eff2f5}[data-theme=dark]{--bg: #0d1117;--panel: #161b22;--muted: #30363d;--text: #c9d1d9;--page: #ffffff;--editor-text: #212529;--page-opacity: 1;--sub: #8b949e;--primary: #1f6feb;--danger: #dc3545;--accent: #21262d}[data-theme=forest]{--bg: #172525;--panel: #1a2a2a;--muted: #274545;--text: #c7d9d7;--page: #ffffff;--editor-text: #212529;--page-opacity: 1;--sub: #8ba9a7;--primary: #2ea8a1;--danger: #dc3545;--accent: #1a2e2e}[data-theme=noir]{--bg: #1b1b1b;--panel: #2b2b2b;--muted: #3a3a3a;--text: #e5e5e5;--page: #ffffff;--editor-text: #212529;--page-opacity: 1;--sub: #9e9e9e;--primary: #ff1744;--danger: #e53935;--accent: #262626}[data-theme=romantic]{--bg: #d8bdb9;--panel: #c5d1c1;--muted: #d6ded1;--text: #3c4c37;--page: #ffffff;--editor-text: #212529;--page-opacity: 1;--sub: #688160;--primary: #eb6f95;--danger: #c62828;--accent: #e4d0ca}[data-theme=cyberpunk]{--bg: #200c4a;--panel: #01012b;--muted: #1d0134;--text: #f9ff00;--page: #ffffff;--editor-text: #212529;--page-opacity: 1;--sub: #ff2a6d;--primary: #1ed3be;--danger: #ff1744;--accent: #4f20ad}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.4 Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}button,input,textarea,select{font:inherit;color:inherit;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}input,textarea,[contenteditable=true],.editor .page .ProseMirror,.notes-textarea{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.editor .toolbar-container,.editor .toolbar-container *{-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important}.card{background:var(--panel);display:flex;flex-direction:column;overflow:hidden}.card header{display:flex;justify-content:space-between;align-items:center;padding:11px 12px;border-bottom:1px solid var(--muted);height:54px}.card header h3{margin:0;font-size:14px}.card header .project-title{display:flex;flex-direction:column;cursor:pointer}.card header .project-title small{color:var(--sub)}.card .content{flex:1;overflow:auto}.toolbar{display:flex;gap:8px;align-items:center;justify-content:flex-end}.theme-picker{position:relative}.theme-picker-button{width:20px;height:20px;border-radius:50%;border:2px solid var(--sub);cursor:pointer}.theme-dropdown{position:absolute;top:calc(100% + 4px);right:0;background:var(--panel);border:1px solid var(--muted);border-radius:4px;padding:4px 0;display:flex;flex-direction:column;gap:2px;z-index:100}.theme-option{display:flex;align-items:center;gap:6px;background:transparent;border:none;color:inherit;cursor:pointer;padding:4px 8px;font-size:12px}.theme-option:hover{background:var(--accent)}.theme-option .theme-circle{width:15px;height:15px;border-radius:50%;border:1px solid var(--muted)}.theme-option.selected{background:var(--accent)}.theme-option.selected .theme-circle{outline:2px solid var(--primary);outline-offset:1px}.clickable{cursor:pointer}.btn{background:transparent;border:none;color:var(--text);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:var(--space-1);min-width:32px;height:32px;font-family:var(--font-ui);font-size:var(--text-md)}.btn.outline{border:1px solid var(--muted)}.btn:hover{border-color:var(--sub)}.btn:disabled{opacity:.5;cursor:not-allowed}.btn.ghost{background:transparent}.btn.primary{background:var(--text);border-color:var(--text);color:var(--panel)}.btn.danger{background:transparent;border-color:var(--danger);color:var(--danger)}.btn.icon-only{padding:var(--space-1);min-width:28px;width:28px}.btn.icon-only .icon{align-items:center;margin-bottom:2px}.icon{display:flex;justify-content:center;align-items:baseline;width:16px;height:16px;line-height:1;text-align:center;font-size:14px}.icon.small{width:12px;height:12px;font-size:12px}.icon.large{width:20px;height:20px;font-size:16px}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}.spin{animation:spin 1s linear infinite}.save-indicator{display:inline-flex;align-items:center;justify-content:center;padding:0 4px;color:var(--sub)}.save-indicator.error{color:var(--danger)}.input,select{background:var(--panel);border:1px solid var(--muted);padding:var(--space-1) var(--space-2);border-radius:var(--radius-md);font-family:var(--font-ui);font-size:var(--text-md)}.input:focus,select:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 35%,transparent)}.color-input{width:7vw;height:12vh;border:none}input[type=color]{padding:0}input[type=color]::-moz-color-swatch{border:none}input[type=color]::-webkit-color-swatch-wrapper{padding:0;border-radius:0}input[type=color]::-webkit-color-swatch{border:none}.notes-textarea{background:var(--bg);border:0;padding:18px 20px;font-style:italic}.notes-textarea::placeholder{color:var(--sub)}.notes-textarea:focus{outline:none}.notes-editor-wrapper{display:flex;flex-direction:column;flex:1 0 auto}.notes-editor{display:flex;flex-direction:column;flex:1}.notes-editor-toolbar{display:flex;align-items:center;gap:2px;padding:4px 8px;border-bottom:1px solid var(--muted);background:var(--panel)}.notes-editor-content{background:var(--bg);flex:1;display:flex;flex-direction:column;font-family:inherit}.notes-editor-content .ProseMirror{flex:1;padding:18px 20px;outline:none}.notes-editor-content .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;height:0;pointer-events:none;font-style:italic;color:var(--sub)}.list{padding:8px;display:flex;flex-direction:column;gap:8px}.row{display:flex;align-items:center;gap:8px}.item{border:1px solid var(--muted);border-radius:10px;padding:8px;display:flex;align-items:center;justify-content:space-between;gap:8px;cursor:pointer}.item.active{background:var(--accent)}.item .grow{flex:1;min-width:0}.item .row{display:flex;align-items:center;gap:8px}.scenes{margin:0}.scene-snippet{font-size:12px;color:var(--sub);margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.variants{padding:8px;display:flex;flex-direction:column;gap:8px}.variant{padding:8px;cursor:pointer}.variant.active{background:var(--accent)}.variant .row{display:flex;align-items:center;gap:8px;margin-bottom:8px}.variant .grow{flex:1;min-width:0}.variant .preview{font-size:12px;color:var(--sub);margin:8px 0 0;white-space:pre-wrap;max-height:60px;overflow:hidden;background:var(--bg);padding:6px;border-radius:6px}.context-menu{background:var(--panel);border:1px solid var(--muted);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);padding:var(--space-1) 0;z-index:3000;white-space:nowrap}.context-item{padding:6px 12px;cursor:pointer;white-space:nowrap;position:relative}.context-item:hover{background:var(--muted)}.context-item.disabled{opacity:.5;cursor:default}.context-item.disabled:hover{background:transparent}.context-item.has-submenu:after{position:absolute;right:8px;color:var(--sub)}.context-item.danger{color:var(--danger)}.context-separator{height:1px;background:var(--muted);margin:4px 0}.context-file-input{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.0001;cursor:pointer}.context-menu.submenu{margin-left:4px}.modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;background:color-mix(in srgb,black 50%,transparent);display:flex;align-items:center;justify-content:center;z-index:4000}.modal{background:var(--panel);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);min-width:30vw;max-width:50vw;max-height:90vh;display:flex;flex-direction:column;overflow:hidden}.modal.modal--half{max-width:50vw}.modal header{display:flex;justify-content:space-between;align-items:center;padding:12px;border-bottom:1px solid var(--muted)}.modal .body{padding:12px;overflow:auto;flex:1}.modal .footer{padding:12px;border-top:1px solid var(--muted);display:flex;justify-content:flex-end;gap:8px}.modal .preview{font-family:monospace;font-size:12px;line-height:1.4;white-space:pre-wrap;max-height:400px;overflow:auto;background:var(--bg);padding:12px;border-radius:8px;border:1px solid var(--muted)}.modal .form-section{margin-bottom:12px}.modal .section-title{margin:0 0 8px;font-weight:600;font-size:12px;letter-spacing:.02em;color:var(--sub);text-transform:uppercase}.modal .form-grid{display:grid;grid-template-columns:160px 1fr;column-gap:12px;row-gap:10px;align-items:center}.modal .inline-controls{display:flex;align-items:center;gap:8px}.modal .hint{font-size:12px;color:var(--sub)}.color-input{width:54px;height:28px;border:1px solid var(--muted);border-radius:6px;padding:0}.toast{position:fixed;bottom:20px;right:20px;background:var(--panel);border:1px solid var(--muted);padding:var(--space-3) var(--space-4);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);z-index:1000}.toast.danger{background:var(--danger);border-color:var(--danger);color:#fff}.muted{color:var(--sub)}.drop-target{outline:none;position:relative}.drop-target-before:after,.drop-target-after:after{content:"";position:absolute;left:0;right:0;height:0;border-top:2px solid var(--primary)}.drop-target-before:after{top:-1px}.drop-target-after:after{bottom:-1px}.grow{flex:1;min-width:0}.editor-title,.scene-title,.file-title{display:flex;flex-direction:column}.editor{display:flex;flex-direction:column;height:100%;position:relative}.editor .toolbar-container{display:flex;align-items:center;min-width:0;max-width:100%;border-bottom:1px solid var(--muted);position:relative;z-index:3;background:var(--panel)}.editor .toolbar-container .toolbar-right{display:flex;align-items:center;margin-left:auto;margin-right:16px}.editor .toolbar-container .toolbar-right .zoom-controls{display:flex;align-items:center}.editor .toolbar-container .toolbar-right .zoom-controls .zoom-level{margin:0 8px;width:40px;text-align:center}.editor .toolbar-container .toolbar-right .toolbar-separator{width:1px;height:24px;background:var(--muted);margin:0 8px}.font-select{border:1px solid var(--muted);border-radius:4px;background:transparent;margin:0 0 0 16px;height:24px;min-width:100px}.editor .content{flex:1;overflow:auto;display:flex;justify-content:center;background:var(--muted)}.editor .page{background:transparent;width:21cm;min-height:29.7cm;height:fit-content;margin:40px 0;padding:2cm;box-shadow:0 0 4px #0000001a;display:flex;flex-direction:column;position:relative}.editor .page:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:var(--page);opacity:var(--page-opacity);pointer-events:none;z-index:0}.editor .page>*{position:relative;z-index:1}.editor .page .editor-content{flex:1;display:flex;flex-direction:column;font-family:inherit;font-size:inherit}.editor .page .ProseMirror{flex:1;min-height:100%;padding:12px 15px;outline:none;line-height:1.5;color:var(--editor-text);word-wrap:break-word}.editor.outliner .page .ProseMirror{padding-bottom:24px}.editor .page .ProseMirror p,.editor .page .ProseMirror ol,.editor .page .ProseMirror ul,.editor .page .ProseMirror li,.editor .page .ProseMirror h1,.editor .page .ProseMirror h2,.editor .page .ProseMirror h3,.editor .page .ProseMirror blockquote,.editor .page .ProseMirror pre,.editor .page .ProseMirror code,.editor .page .ProseMirror span,.editor .page .ProseMirror div{color:var(--editor-text)}.editor .page .ProseMirror p{margin:0 0 8px}.editor .page .stack-item{display:block}.editor .scene-separator{border:none;border-top:1px dashed var(--muted);margin:24px 0}.indent-all p,.indent-first p{text-indent:2em}.indent-first p:first-child,.indent-all p.ql-align-center,.indent-first p.ql-align-center,.indent-all li p,.indent-first li p,.indent-all blockquote p,.indent-first blockquote p{text-indent:0}.editor .page .ProseMirror ol,.editor .page .ProseMirror ul{margin:0 0 8px;padding-left:3em}.editor .page .ProseMirror li ol,.editor .page .ProseMirror li ul{margin:0}.editor .page .ProseMirror li>p{margin:0}.editor .page .ProseMirror li::marker{color:var(--editor-text)}.ProseMirror ul{list-style-type:disc}.ProseMirror :is(ul,ol) ul{list-style-type:circle}.ProseMirror :is(ul,ol) :is(ul,ol) ul{list-style-type:square}.ProseMirror :is(ul,ol) :is(ul,ol) :is(ul,ol) ul{list-style-type:disc}.ProseMirror :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) ul{list-style-type:circle}.ProseMirror :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) ul{list-style-type:square}.ProseMirror :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) ul{list-style-type:disc}.ProseMirror :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) ul{list-style-type:circle}.ProseMirror :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) ul{list-style-type:square}.ProseMirror ol{list-style-type:decimal}.ProseMirror :is(ul,ol) ol{list-style-type:lower-alpha}.ProseMirror :is(ul,ol) :is(ul,ol) ol{list-style-type:lower-roman}.ProseMirror :is(ul,ol) :is(ul,ol) :is(ul,ol) ol{list-style-type:decimal}.ProseMirror :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) ol{list-style-type:lower-alpha}.ProseMirror :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) ol{list-style-type:lower-roman}.ProseMirror :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) ol{list-style-type:decimal}.ProseMirror :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) ol{list-style-type:lower-alpha}.ProseMirror :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) :is(ul,ol) ol{list-style-type:lower-roman}.editor .page .ProseMirror h1{font-size:1.5em;margin:0 0 8px}.editor .page .ProseMirror h2{font-size:1.25em;margin:0 0 8px}.editor .page .ProseMirror h3{font-size:1.1em;margin:0 0 8px}.editor .page .ProseMirror blockquote{border-left:4px solid var(--muted);margin:0 0 8px;padding-left:16px}.editor .page .ProseMirror pre{white-space:pre-wrap;margin:0 0 8px;padding:5px 10px;border-radius:3px;background:var(--muted)}.ProseMirror .ql-align-center{text-align:center}.ProseMirror .ql-align-right{text-align:right}.ProseMirror .ql-align-justify{text-align:justify}.ProseMirror .ql-direction-rtl{direction:rtl;text-align:inherit}.ProseMirror .ql-indent-1{padding-left:3em}.ProseMirror .ql-indent-2{padding-left:6em}.ProseMirror .ql-indent-3{padding-left:9em}.ProseMirror .ql-indent-4{padding-left:12em}.ProseMirror .ql-indent-5{padding-left:15em}.ProseMirror .ql-indent-6{padding-left:18em}.ProseMirror .ql-indent-7{padding-left:21em}.ProseMirror .ql-indent-8{padding-left:24em}.ProseMirror .ql-direction-rtl[class*=ql-indent-]{padding-left:0}.ProseMirror .ql-direction-rtl.ql-indent-1{padding-right:3em}.ProseMirror .ql-direction-rtl.ql-indent-2{padding-right:6em}.ProseMirror .ql-direction-rtl.ql-indent-3{padding-right:9em}.ProseMirror .ql-direction-rtl.ql-indent-4{padding-right:12em}.ProseMirror .ql-direction-rtl.ql-indent-5{padding-right:15em}.ProseMirror .ql-direction-rtl.ql-indent-6{padding-right:18em}.ProseMirror .ql-direction-rtl.ql-indent-7{padding-right:21em}.ProseMirror .ql-direction-rtl.ql-indent-8{padding-right:24em}.ProseMirror .ql-size-small{font-size:.75em}.ProseMirror .ql-size-large{font-size:1.5em}.ProseMirror .ql-size-huge{font-size:2.5em}.ProseMirror .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ProseMirror .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ProseMirror .ql-video{display:block;max-width:100%}.editor .page .ProseMirror .ql-align-justify{margin-bottom:8px}.editor .page .ProseMirror a{color:var(--primary);text-decoration:underline}.editor .page .ProseMirror a:hover{opacity:.9}.editor .page .ProseMirror span.note-annot[data-note-id]{background:#fff4a3;border-radius:2px}.note-balloon{background:var(--panel);border:1px solid var(--muted);border-radius:var(--radius-md);padding:28px var(--space-4) 0 var(--space-4);max-width:320px;z-index:3500;box-shadow:var(--shadow-sm);animation:note-pop .14s ease-out;transform-origin:top left}.note-balloon .note-text{white-space:pre-wrap;color:var(--text);margin-bottom:8px}.note-balloon .note-actions{display:flex;gap:8px;justify-content:flex-end;margin-bottom:8px}.note-balloon .note-close{position:absolute;top:0;right:0}@keyframes note-pop{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}.editor .preview{flex:1;overflow:auto;color:var(--editor-text)}.editor .preview p{margin:0 0 4px}.card.notes-panel .content{display:flex;flex-direction:column;overflow:auto}.card.notes-panel .note-image{flex-shrink:0;max-width:100%;border-radius:4px}.card.notes-panel footer.notes-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-top:1px solid var(--muted);background:var(--panel);flex:0 0 auto;font-family:var(--font-ui)}.notes-footer .notes-footer-label{font-size:11px;color:var(--text);opacity:.7;text-transform:uppercase;letter-spacing:.04em}.notes-footer .indent-options{display:inline-flex;gap:2px;border:1px solid var(--muted);border-radius:10px;padding:2px}.notes-footer .indent-options .btn.small{height:26px;min-width:0;padding:2px 10px;border-radius:8px;font-size:11px}.notes-footer .indent-options .btn.small.active{background:var(--accent)}.editor .page .stack-item-header{position:relative;top:-18px;height:0;margin:0;overflow:visible;font-size:10px;line-height:12px;color:var(--muted);text-align:right;-webkit-user-select:none;user-select:none;font-style:italic}.tree{list-style:none;padding-left:0;margin:0}.tree ul{list-style:none;margin:0;padding-left:22px;background:var(--bg)}.tree-item{display:flex;align-items:center;gap:var(--space-1);padding:2px var(--space-3) 2px var(--space-1);cursor:pointer;-webkit-user-select:none;user-select:none;height:32px;font-family:var(--font-ui);font-size:var(--text-md);background:var(--bg)}.tree-item.active{background:var(--accent)}.tree-item.chapter{font-weight:700}.tree-item.scene{font-weight:400}.tree-item.variant{font-style:italic}.tree-item.part{padding-left:30px}.caret{width:16px;cursor:pointer;display:flex;margin:0 4px}.caret.placeholder{cursor:default}.pill{background:var(--muted);border:none;padding:4px 8px;border-radius:12px;font-size:12px;cursor:pointer}.pill:hover{background:var(--sub);color:#fff}*{scrollbar-width:thin;scrollbar-color:var(--accent) transparent}*::-webkit-scrollbar{width:10px;height:10px}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background-color:var(--accent);border-radius:8px;border:2px solid transparent;background-clip:content-box}*::-webkit-scrollbar-thumb:hover{background-color:var(--sub)}.progress-box{background:var(--panel);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:var(--space-4) var(--space-4);width:min(360px,calc(100vw - 32px));display:flex;flex-direction:column;gap:var(--space-3)}.progress-bar{height:6px;border-radius:var(--radius-sm);background:var(--muted);overflow:hidden}.progress-bar__fill{height:100%;background:var(--primary);transition:width .2s ease}.progress-bar__fill--busy{width:30%;animation:progress-busy 1.2s ease-in-out infinite}@keyframes progress-busy{0%{transform:translate(-100%)}to{transform:translate(340%)}}.editor-toolbar{display:flex;flex:1;flex-wrap:wrap;align-items:center;gap:var(--space-1) var(--space-3);padding:var(--space-1) var(--space-2);font-family:var(--font-ui);font-size:var(--text-md)}.editor-toolbar .toolbar-group{display:inline-flex;align-items:center;gap:2px}.editor-toolbar .btn.active{background:var(--muted)}.editor-toolbar .toolbar-color label{position:relative;cursor:pointer}.editor-toolbar .toolbar-color input[type=color]{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;width:100%;height:100%;cursor:pointer}.editor-toolbar .toolbar-right{display:flex;align-items:center;margin-left:auto}.editor-toolbar.mobile{flex-wrap:nowrap;padding:6px;min-width:0;overflow:hidden}.editor-toolbar .mobile-toolbar-scroll{display:flex;align-items:center;gap:12px;flex:1 1 auto;min-width:0;overflow-x:auto;overflow-y:hidden;white-space:nowrap;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;scrollbar-width:none}.editor-toolbar .mobile-toolbar-scroll::-webkit-scrollbar{display:none}.editor-toolbar .mobile-toolbar-scroll .toolbar-group{flex:none}.editor .page .image-node{position:relative;display:inline-block;max-width:100%;line-height:0}.editor .page .image-node img{max-width:100%}.editor .page .image-node.selected img{outline:2px solid var(--primary)}.editor .page .image-node .resize-handle{display:none;position:absolute;width:14px;height:14px;right:-6px;bottom:-6px;background:var(--primary);border:2px solid #fff;border-radius:50%;cursor:se-resize}.editor .page .image-node.selected .resize-handle{display:block}:root{--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 24px;--space-6: 32px;--radius-sm: 6px;--radius-md: 8px;--radius-lg: 12px;--font-ui: Inter, system-ui, sans-serif;--text-xs: 11px;--text-sm: 12px;--text-md: 14px;--text-lg: 18px;--shadow-sm: 0 1px 2px color-mix(in srgb, var(--text) 8%, transparent);--sidebar-bg: color-mix(in srgb, var(--panel) 94%, var(--text));--kind-writing: var(--primary);--kind-outline: var(--sub)}
