:root{--teal: #294c60;--teal-dark: #1e3a4a;--teal-light: #6e8a9b;--bg: #faf6ef;--surface: #fffdf8;--surface-2: #f1eadd;--text: #262019;--text-muted: #6e6353;--border: #e4dbcb;--danger: #9e3b32;--shadow: 0 1px 3px rgba(38, 32, 25, .09);--radius: 6px;--safe-bottom: env(safe-area-inset-bottom, 0px);--safe-top: env(safe-area-inset-top, 0px);--safe-left: env(safe-area-inset-left, 0px);--safe-right: env(safe-area-inset-right, 0px);--nav-height: 64px;--footer-height: 54px;--font-brand: "Playfair Display", Georgia, "Times New Roman", serif;--font-serif: "Playfair Display", Georgia, "Times New Roman", serif;--font-read: Georgia, "Iowan Old Style", "Times New Roman", serif;font-family:Segoe UI,system-ui,-apple-system,sans-serif;line-height:1.55;font-weight:400;color:var(--text);background:var(--bg);font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.dark{--teal: #86abc0;--teal-dark: #6890a4;--teal-light: #aecad7;--bg: #17140f;--surface: #201c15;--surface-2: #2a251c;--text: #ece4d5;--text-muted: #a99d88;--border: #3a342a;--danger: #d98a82;--shadow: 0 2px 14px rgba(0, 0, 0, .4)}*{box-sizing:border-box}html,body,#root{margin:0;height:100%;min-height:100dvh;background:var(--bg)}body{overscroll-behavior:none;-webkit-tap-highlight-color:transparent}button,input,textarea,select{font:inherit;color:inherit}button{cursor:pointer;border:none;background:none}input,textarea,select{width:100%;border:1px solid var(--border);border-radius:10px;padding:10px 12px;background:var(--surface)}textarea{resize:vertical;min-height:80px}.app{min-height:100%;min-height:100dvh;background:var(--bg);color:var(--text)}.page{max-width:480px;margin:0 auto;min-height:100%;min-height:100dvh;display:flex;flex-direction:column}h1,h2,h3,h4,.app-brand,.brand,.auth-brand,.part-heading,.scene-title-input,.section-title-row strong{font-family:var(--font-serif);font-weight:600;letter-spacing:.01em}.tab-intro{font-family:var(--font-serif);font-style:italic}.bookshelf-page{padding:calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) calc(var(--footer-height) + 92px + var(--safe-bottom)) calc(16px + var(--safe-left))}.bookshelf-header{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;margin-bottom:16px}.bookshelf-header>div:first-child{min-width:0}.bookshelf-header-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px}.header-icon-btn{color:var(--teal)}.header-icon-btn:active{background:var(--surface-2)}.language-switcher{display:inline-flex;align-items:center;gap:4px;color:var(--teal);border:1px solid var(--border);border-radius:999px;padding:4px 6px 4px 10px;background:var(--surface)}.language-switcher select{border:none;padding:2px 4px;background:transparent;font-size:.8rem;font-weight:600;width:auto;color:var(--text)}.language-switcher select:focus{outline:none}.progress-bar{width:100%;height:8px;border-radius:999px;background:var(--surface-2);overflow:hidden}.progress-bar-fill{height:100%;background:var(--teal);transition:width .2s ease}.app-brand{font-family:var(--font-brand);font-weight:600;letter-spacing:.02em}.bookshelf-header h1.app-brand{margin:0;font-size:clamp(1.6rem,6.5vw,2.25rem);font-weight:700;color:var(--teal);line-height:1.1;overflow-wrap:anywhere}.top-bar-titles p.app-brand{font-size:.85rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;opacity:.9}.bookshelf-header p{margin:4px 0 0;color:var(--text-muted)}.search-bar{display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:10px 12px;margin-bottom:16px}.search-bar input{border:none;padding:0;background:transparent}.vault-page-main{flex:1;overflow:auto;padding:16px 16px calc(var(--safe-bottom) + 16px);display:flex;flex-direction:column;gap:12px}.vault-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px;margin-bottom:12px;box-shadow:var(--shadow)}.vault-panel.vault-unsupported{display:flex;align-items:flex-start;gap:12px;opacity:.85}.vault-panel-header{display:flex;align-items:flex-start;gap:10px}.vault-panel-info{flex:1;min-width:0}.vault-panel-info strong{display:block;font-size:.95rem}.vault-online{display:flex;align-items:center;gap:4px;font-size:.75rem;font-weight:600;flex-shrink:0}.vault-online.online{color:var(--teal)}.vault-online.offline{color:var(--text-muted)}.vault-status-line{margin:10px 0 8px;font-size:.85rem;color:var(--text-muted)}.vault-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.vault-actions .primary-btn,.vault-actions .secondary-btn{display:inline-flex;align-items:center;gap:6px}.bookshelf-grid{display:flex;flex-direction:column;gap:12px}.wheel-stage{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}.wheel{position:relative;aspect-ratio:1 / 1;margin:0 auto;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}.wheel:active{cursor:grabbing}.wheel-rotor{position:absolute;top:0;right:0;bottom:0;left:0;will-change:transform}.wheel-svg{width:100%;height:100%;display:block;filter:drop-shadow(0 4px 10px rgba(38,32,25,.32))}.wheel-wedge{cursor:pointer;transition:filter .15s ease}.wheel-wedge:hover{filter:brightness(1.08)}.wheel-wedge.landed{stroke:var(--teal);filter:brightness(1.05);animation:wedge-pulse .8s ease-in-out infinite alternate}@keyframes wedge-pulse{0%{stroke-width:2}to{stroke-width:6}}.wheel-spin-btn{display:inline-flex;align-items:center;gap:8px;margin-top:16px;padding:9px 20px;border-radius:999px;background:var(--teal);color:#fff;font-family:var(--font-serif);font-weight:600;font-size:.95rem;box-shadow:0 3px 10px #294c6052}.wheel-spin-btn:active{transform:translateY(1px)}.wheel-hint.landed{color:var(--text);font-style:normal;font-weight:700;font-size:1rem}.wheel-wedge.empty{opacity:.55}.wheel-wedge.empty:hover{opacity:.85;filter:none}.wheel-label{position:absolute;width:30%;transform:translate(-50%,-50%);text-align:center;font-family:var(--font-serif);font-weight:600;font-size:.66rem;line-height:1.15;color:#2c2418;text-shadow:0 1px 1px rgba(255,255,255,.55);pointer-events:none;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;will-change:transform}.wheel-label.empty{color:var(--text-muted);text-shadow:none;font-size:1.2rem;font-weight:700}.delete-picker{display:flex;flex-direction:column;gap:6px;max-height:55vh;overflow-y:auto}.delete-picker-row{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:1px solid var(--border);border-radius:8px;background:var(--surface);text-align:left}.delete-picker-row:hover{border-color:var(--danger);background:var(--surface-2)}.delete-picker-cover{width:30px;height:40px;border-radius:2px 3px 3px 2px;flex-shrink:0;display:grid;place-items:center;color:#fff;font-family:var(--font-serif);font-weight:700;box-shadow:inset 3px 0 #0000002e}.delete-picker-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.delete-picker-icon{color:var(--danger);flex-shrink:0}.wheel-pointer{position:absolute;top:-6px;left:50%;transform:translate(-50%);width:0;height:0;padding:0;background:none;border-left:13px solid transparent;border-right:13px solid transparent;border-top:22px solid var(--teal);border-radius:2px;cursor:pointer;transform-origin:50% 0;filter:drop-shadow(0 1px 2px rgba(0,0,0,.3));transition:transform .15s ease,border-top-color .15s ease;z-index:3}.wheel-pointer:hover,.wheel-pointer:focus-visible{transform:translate(-50%) scale(1.45);border-top-color:var(--teal-dark);outline:none}.wheel-pointer:active{transform:translate(-50%) scale(1.2)}.wheel-hint{margin:16px 0 0;font-family:var(--font-serif);font-style:italic;font-size:.85rem;color:var(--text-muted);text-align:center}.book-card{display:flex;gap:12px;align-items:center;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px;box-shadow:var(--shadow);text-align:left;position:relative;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.book-card:hover{border-color:var(--teal-light);box-shadow:0 4px 16px #0000001f}.book-cover{width:52px;height:74px;border-radius:2px 5px 5px 2px;display:grid;place-items:center;color:#fffffff2;font-family:var(--font-serif);font-size:1.6rem;font-weight:700;flex-shrink:0;box-shadow:inset 5px 0 #00000029,inset 7px 0 #ffffff2e}.book-card-body{flex:1;min-width:0}.book-card-body h3{margin:0 0 4px;font-size:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.book-card-body p{margin:0;font-size:.85rem}.muted{color:var(--text-muted)}.small{font-size:.85rem}.book-card-actions{display:flex;flex-direction:column;align-items:center;gap:2px;flex-shrink:0}.book-delete{opacity:.5}.book-sync{color:var(--text-muted)}.book-sync.synced{color:var(--teal)}.book-sync.error{color:var(--danger)}.spinner.tiny{width:16px;height:16px;border-width:2px}.toast{position:fixed;left:50%;bottom:calc(var(--footer-height) + var(--safe-bottom) + 12px);transform:translate(-50%);width:min(92vw,440px);display:flex;align-items:center;gap:8px;padding:8px 8px 8px 14px;background:var(--surface);border:1px solid var(--border);border-left:4px solid var(--danger);border-radius:10px;box-shadow:0 6px 24px #0003;z-index:40;font-size:.85rem}.toast-message{flex:1;min-width:0}.toast-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}.book-page{height:100dvh}.top-bar{display:flex;align-items:center;justify-content:space-between;padding:calc(12px + var(--safe-top)) calc(12px + var(--safe-right)) 10px calc(12px + var(--safe-left));background:var(--surface);color:var(--text);border-bottom:1px solid var(--border);box-shadow:0 1px 0 var(--border);position:sticky;top:0;z-index:10}.top-bar-left{display:flex;align-items:center;gap:4px;min-width:0}.top-bar-titles h1{margin:0;font-family:var(--font-serif);font-size:1.12rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.top-bar-titles p{margin:0;font-size:.7rem;text-transform:uppercase;letter-spacing:.12em;color:var(--text-muted)}.top-bar-actions{display:flex;gap:2px;flex-shrink:0}.icon-btn{width:40px;height:40px;display:grid;place-items:center;border-radius:50%;color:inherit}.icon-btn.small{width:32px;height:32px}.icon-btn:active{background:var(--surface-2)}.book-main{flex:1;overflow:auto;padding:12px 16px calc(var(--nav-height) + var(--safe-bottom) + 12px)}.bottom-nav{position:fixed;bottom:0;left:0;right:0;max-width:480px;margin:0 auto;display:grid;grid-template-columns:repeat(2,1fr);background:var(--surface);border-top:1px solid var(--border);box-shadow:0 -2px 12px #00000014;min-height:var(--nav-height);padding-bottom:var(--safe-bottom);z-index:20}.bottom-nav-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:10px 4px;color:var(--text-muted);font-size:.75rem;min-height:var(--nav-height);border-top:3px solid transparent}.bottom-nav-item.active{color:var(--teal);font-weight:600;border-top-color:var(--teal);background:color-mix(in srgb,var(--teal) 8%,transparent)}.tab-content{display:flex;flex-direction:column;gap:12px}.tab-intro{margin:0;color:var(--text-muted);font-size:.9rem}.empty-state{text-align:center;padding:32px 16px;color:var(--text-muted)}.empty-state.compact{padding:24px 8px}.plot-category{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.plot-category-header{width:100%;display:flex;align-items:center;gap:8px;padding:12px 14px;font-weight:600;background:var(--surface-2);text-align:left}.badge{margin-left:auto;background:var(--teal);color:#fff;font-size:.75rem;padding:2px 8px;border-radius:999px}.plot-items{padding:8px;display:flex;flex-direction:column;gap:8px}.plot-item-card{text-align:left;padding:12px;border-radius:10px;border:1px solid var(--border);background:var(--bg)}.plot-item-card strong{display:block;margin-bottom:6px}.plot-item-notes{margin:6px 0 0;font-size:.85rem;color:var(--text-muted)}.status-pill{display:inline-block;font-size:.7rem;padding:2px 8px;border-radius:999px;background:var(--surface-2);color:var(--text-muted)}.status-todo{border-left:3px solid #90a4ae}.status-in-progress{border-left:3px solid #ffa726}.status-done{border-left:3px solid #66bb6a}.status-first{border-left:3px solid #42a5f5}.status-revised{border-left:3px solid #ab47bc}.status-final{border-left:3px solid #26a69a}.tag-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.tag{font-size:.75rem;padding:2px 8px;border-radius:999px;background:var(--surface-2);color:var(--text-muted)}.tag.removable{border:1px dashed var(--border)}.add-row-btn,.inline-add{display:flex;align-items:center;gap:8px;padding:8px;color:var(--teal);font-size:.9rem}.inline-add input{flex:1}.part-list{display:flex;flex-direction:column;gap:22px}.part-group{display:flex;flex-direction:column;gap:10px}.part-heading{width:100%;display:flex;align-items:center;gap:8px;margin:0;padding:4px 0 10px;border-bottom:1px solid var(--border);font-size:1.18rem;color:var(--text);text-align:left}.part-heading .part-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.part-heading .part-title:before{content:"❧ ";color:var(--teal);font-style:normal}.part-count{font-family:Segoe UI,system-ui,sans-serif;font-size:.68rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--text-muted);white-space:nowrap}.scene-list{display:flex;flex-direction:column;gap:10px}.sortable-item{will-change:transform}.sortable-item.dragging{position:relative;z-index:1000}.drop-indicator{position:fixed;height:3px;border-radius:2px;background:var(--teal);box-shadow:0 0 0 1px color-mix(in srgb,var(--teal) 40%,transparent);z-index:999;pointer-events:none}.sortable-item.dragging .scene-card{box-shadow:0 8px 24px #00000038;border-color:var(--teal-light)}.scene-card{display:flex;align-items:stretch;gap:4px;text-align:left;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}.drag-handle{display:grid;place-items:center;padding:0 6px;color:var(--text-muted);cursor:grab;touch-action:none;flex-shrink:0}.drag-handle:active{cursor:grabbing;background:var(--surface-2)}.scene-card-body{flex:1;min-width:0;text-align:left;padding:14px 14px 14px 4px;background:none}.scene-card-top{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}.scene-card-top h3{margin:0;font-size:1rem;min-width:0;overflow-wrap:anywhere}.scene-synopsis{margin:8px 0 0;color:var(--text-muted);font-size:.9rem}.scene-meta{margin-top:10px;font-size:.8rem;color:var(--text-muted);display:flex;flex-wrap:wrap;align-items:center;gap:2px 8px}.scene-meta span:not(:last-child):after{content:"·";margin-left:8px;color:var(--border)}.scene-editor{display:flex;flex-direction:column;gap:12px}.scene-editor-toolbar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:4px 8px}.scene-editor-toolbar-right{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.scene-editor-toolbar-right .text-btn{display:inline-flex;align-items:center;gap:4px}.word-count{font-size:.85rem;color:var(--text-muted)}.scene-title-input{font-size:1.25rem;font-weight:600;border:none;border-bottom:1px solid var(--border);border-radius:0;padding-left:0}.scene-synopsis-input{border:none;background:var(--surface-2)}.linked-items{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px}.section-label{margin:0 0 8px;font-size:.85rem;font-weight:600}.chip-row{display:flex;flex-wrap:wrap;gap:6px}.chip{padding:6px 10px;border-radius:999px;border:1px solid var(--border);font-size:.8rem;background:var(--surface-2)}.chip.active{background:var(--teal);color:#fff;border-color:var(--teal)}.rich-editor-wrap{display:flex;flex-direction:column}.editor-head{position:sticky;top:0;z-index:5}.editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:1px;padding:5px 6px;background:var(--surface-2);border:1px solid var(--border);border-bottom:none;border-radius:var(--radius) var(--radius) 0 0}.editor-search{display:flex;align-items:center;gap:4px;padding:5px 6px;background:var(--surface-2);border:1px solid var(--border);border-top:1px solid var(--border);border-bottom:none}.editor-search-icon{color:var(--text-muted);flex-shrink:0}.editor-search-input{flex:1;min-width:0;width:auto;border:none;background:none;padding:4px 6px;font-size:.9rem}.editor-search-input:focus{outline:none}.editor-search-count{flex-shrink:0;font-size:.75rem;color:var(--text-muted);min-width:44px;text-align:right;padding-right:2px}.toolbar-btn:disabled{opacity:.4;cursor:default}::highlight(chapter-search){background:#ffe08a;color:#262019}::highlight(chapter-search-current){background:#f5a300;color:#1a1206}.toolbar-group{display:flex;align-items:center;gap:1px}.toolbar-divider{width:1px;height:22px;margin:0 5px;background:var(--border)}.toolbar-btn{width:34px;height:34px;display:grid;place-items:center;border-radius:6px;color:var(--text-muted)}.toolbar-btn:hover{background:var(--surface);color:var(--text)}.toolbar-btn:active{background:var(--teal-light);color:#fff}.toolbar-btn.active{background:var(--surface);color:var(--teal)}.rich-editor{min-height:260px;padding:22px 20px;background:var(--surface);border:1px solid var(--border);border-radius:0 0 var(--radius) var(--radius);font-family:var(--font-read);font-size:1.06rem;line-height:1.9;color:var(--text)}.rich-editor:focus{outline:none;border-color:var(--teal-light);box-shadow:0 0 0 2px color-mix(in srgb,var(--teal-light) 40%,transparent)}.rich-editor h1,.rich-editor h2{font-family:var(--font-serif)}.rich-editor h1{font-size:1.4rem;margin:.6em 0 .3em}.rich-editor h2{font-size:1.18rem;margin:.6em 0 .3em}.rich-editor p{margin:0;text-indent:1.5em}.rich-editor p:first-child{text-indent:0}.rich-editor ul,.rich-editor ol{margin:0 0 .6em;padding-left:1.5em}.rich-editor ul{list-style:disc}.rich-editor ol{list-style:decimal}.rich-editor li{margin:.2em 0}.editor-actions{display:flex;justify-content:space-between;gap:8px}.section-tree{display:flex;flex-direction:column;gap:10px}.section-node{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:10px 12px}.section-header{display:flex;align-items:flex-start;gap:6px}.section-toggle{padding:4px 2px;color:var(--text-muted);flex-shrink:0}.section-info{flex:1;min-width:0}.section-title-row{display:flex;align-items:baseline;gap:8px}.section-title-row strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1rem}.section-count{flex-shrink:0;font-size:.72rem;font-weight:600;color:var(--text-muted);background:var(--surface-2);border-radius:999px;padding:2px 8px}.section-info p{margin:4px 0 0;font-size:.85rem;color:var(--text-muted)}.section-body{margin-top:8px;padding-left:26px}.chapter-rows{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.chapter-row{display:flex;align-items:center;gap:8px;padding:6px 8px;background:var(--surface-2);border-radius:8px;font-size:.9rem}.chapter-row.muted{background:transparent;border:1px dashed var(--border);color:var(--text-muted)}.chapter-row-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chapter-remove{flex-shrink:0;color:var(--text-muted)}.chapter-empty{margin:0}.add-chapters-btn{display:inline-flex;align-items:center;gap:6px;margin-top:8px;padding:6px 0}.section-children{margin-top:10px;padding-left:12px;border-left:2px solid var(--border);display:flex;flex-direction:column;gap:10px}.unassigned-block{margin-top:18px}.unassigned-block .chapter-rows{margin-top:6px}.chapter-picker{display:flex;flex-direction:column;gap:4px;max-height:55vh;overflow-y:auto}.scene-checkbox{display:flex;align-items:center;gap:10px;font-size:.9rem;padding:8px 6px;border-radius:8px}.scene-checkbox:hover{background:var(--surface-2)}.scene-checkbox input{width:auto;flex-shrink:0}.goal-card{display:flex;align-items:center;gap:16px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px}.progress-ring{width:80px;height:80px;border-radius:50%;background:conic-gradient(var(--teal) calc(var(--progress, 0) * 1%),var(--surface-2) 0);display:grid;place-items:center;flex-shrink:0}.progress-ring span{width:60px;height:60px;border-radius:50%;background:var(--surface);display:grid;place-items:center;font-weight:700;font-size:.9rem}.goal-stats p{margin:0 0 4px}.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px;text-align:center}.stat-value{display:block;font-size:1.25rem;font-weight:700;color:var(--teal)}.stat-label{font-size:.75rem;color:var(--text-muted)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:flex-end;justify-content:center;z-index:100;padding:0}.modal{width:100%;max-width:480px;max-height:90dvh;background:var(--surface);border-radius:16px 16px 0 0;display:flex;flex-direction:column;animation:slideUp .25s ease}.modal-wide{max-height:95dvh}@keyframes slideUp{0%{transform:translateY(100%)}to{transform:translateY(0)}}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:1px solid var(--border)}.modal-header h2{margin:0;font-size:1.1rem}.modal-body{padding:16px;overflow:auto}.preview-document{font-family:Georgia,Times New Roman,serif}.preview-title-page{text-align:center;padding:24px 0 32px;border-bottom:1px solid var(--border);margin-bottom:24px}.preview-title-page h1{margin:0 0 8px}.preview-toc{margin-bottom:24px}.preview-toc h2{font-size:1rem;margin:0 0 8px}.preview-section{margin-bottom:32px}.preview-scene{margin-bottom:24px}.preview-desc{color:var(--text-muted);font-style:italic}.preview-content{margin-top:12px;line-height:1.8}.form-stack{display:flex;flex-direction:column;gap:14px}.form-stack.flush{gap:8px}.form-stack label{display:flex;flex-direction:column;gap:6px;font-size:.85rem;font-weight:500}.form-actions{display:flex;justify-content:space-between;gap:8px;margin-top:8px}.form-actions.unsaved-actions{flex-wrap:wrap;justify-content:flex-end}.tag-input-row{display:flex;gap:8px}.primary-btn,.secondary-btn,.danger-btn,.text-btn{border-radius:10px;padding:10px 16px;font-weight:600}.primary-btn{background:var(--teal);color:#fff}.primary-btn.small,.secondary-btn.small{padding:8px 12px;font-size:.85rem}.secondary-btn{background:var(--surface-2);border:1px solid var(--border)}.danger-btn{background:transparent;color:var(--danger);border:1px solid var(--danger)}.text-btn{color:var(--teal);padding:8px}.fab{position:fixed;right:20px;bottom:calc(20px + var(--safe-bottom));width:56px;height:56px;border-radius:50%;background:var(--teal);color:#fff;display:grid;place-items:center;box-shadow:0 4px 16px #00897b66;z-index:15}.fab.inline-fab{position:static;width:auto;height:auto;border-radius:var(--radius);padding:12px 16px;display:inline-flex;align-items:center;gap:8px;margin-top:8px;box-shadow:none}.write-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.write-actions .secondary-btn{display:inline-flex;align-items:center;gap:8px;margin-top:8px}.backup-bar{position:fixed;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:space-between;gap:8px;height:calc(var(--footer-height) + var(--safe-bottom));padding:0 10px var(--safe-bottom);background:var(--surface);border-top:1px solid var(--border);box-shadow:0 -2px 12px #00000014;z-index:20;font-size:.8rem}.book-page .fab{bottom:calc(var(--nav-height) + var(--safe-bottom) + 16px)}.bookshelf-page .fab{bottom:calc(var(--footer-height) + var(--safe-bottom) + 16px);z-index:25}.import-choose{display:flex;flex-direction:column;gap:16px}.import-dropzone{display:flex;flex-direction:column;align-items:center;gap:6px;padding:28px 16px;border:2px dashed var(--border);border-radius:var(--radius);background:var(--surface-2);color:var(--teal);text-align:center}.import-dropzone:active{background:var(--bg)}.import-dropzone strong{color:var(--text)}.format-hints{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;font-size:.85rem;color:var(--text-muted)}.format-hints li{display:flex;align-items:center;gap:8px}.import-divider{display:flex;align-items:center;gap:12px;color:var(--text-muted);font-size:.8rem}.import-divider:before,.import-divider:after{content:"";flex:1;height:1px;background:var(--border)}.gdocs-import{display:flex;flex-direction:column;gap:10px}.gdocs-import label{display:flex;flex-direction:column;gap:6px;font-size:.85rem;font-weight:500}.secondary-btn:disabled{opacity:.5}.import-status{display:flex;flex-direction:column;align-items:center;gap:16px;padding:24px 8px;text-align:center}.spinner{width:36px;height:36px;border-radius:50%;border:3px solid var(--surface-2);border-top-color:var(--teal);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.error-text{color:var(--danger)}.import-summary{display:flex;align-items:center;gap:8px;background:var(--surface-2);border-radius:10px;padding:10px 12px;font-size:.9rem}.import-translated-badge{margin:0;padding:8px 12px;border-radius:10px;background:color-mix(in srgb,var(--teal) 12%,var(--surface));border:1px solid color-mix(in srgb,var(--teal) 35%,var(--border));color:var(--teal);font-size:.85rem;font-weight:600}.import-preview-list{display:flex;flex-direction:column;gap:6px;max-height:200px;overflow:auto;border:1px solid var(--border);border-radius:10px;padding:8px}.import-preview-row{display:flex;align-items:center;gap:10px;font-size:.9rem}.import-preview-index{width:22px;height:22px;flex-shrink:0;display:grid;place-items:center;border-radius:50%;background:var(--surface-2);font-size:.75rem;color:var(--text-muted)}.import-preview-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media (min-width: 481px){.modal-backdrop{align-items:center;padding:16px}.modal{border-radius:var(--radius);max-height:85vh}}.auth-loading{display:flex;align-items:center;justify-content:center;height:100dvh;color:var(--text-muted);font-size:1.5rem}.auth-screen{min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 16px calc(var(--safe-bottom) + 24px);background:var(--bg)}.auth-topbar{position:absolute;top:calc(16px + var(--safe-top));right:calc(16px + var(--safe-right))}.auth-card{width:100%;max-width:380px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:28px 24px;display:flex;flex-direction:column;gap:14px}.auth-brand{display:flex;align-items:center;gap:10px;color:var(--teal)}.auth-brand h1{font-family:var(--font-brand);font-size:1.6rem;margin:0;color:var(--text)}.auth-tagline{color:var(--text-muted);margin:-6px 0 6px;font-size:.9rem}.auth-card h2{margin:0;font-size:1.15rem}.auth-card label{display:flex;flex-direction:column;gap:4px;font-size:.85rem;color:var(--text-muted)}.auth-card input{padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface-2);color:var(--text);font-size:.95rem}.auth-card .primary-btn{margin-top:4px}.auth-toggle{align-self:center}.auth-error{background:color-mix(in srgb,var(--danger) 12%,transparent);color:var(--danger);border-radius:8px;padding:8px 10px;font-size:.85rem;margin:0}.auth-notice{background:color-mix(in srgb,var(--teal) 14%,transparent);color:var(--teal-dark);border-radius:8px;padding:8px 10px;font-size:.85rem;margin:0}.backup-bar-group{display:flex;align-items:center;gap:2px;min-width:0}.footer-btn{display:inline-flex;align-items:center;gap:6px;padding:8px 10px;border-radius:8px;color:var(--text-muted);white-space:nowrap}.footer-btn:hover,.footer-btn:active{background:var(--surface-2);color:var(--text)}.account-email{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-muted);padding:0 4px}@media (max-width: 480px){.footer-btn-label,.account-email{display:none}.footer-btn{padding:8px}.backup-bar-group{gap:4px}}.cloud-upload-list{display:flex;flex-direction:column;gap:8px}.cloud-upload-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface-2)}.cloud-upload-info{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.cloud-upload-info strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
