:root{--ink:#26382d;--muted:#7a887c;--line:#e2e7dc;--paper:#fbfbf6;--canvas:#f2f4ed;--green:#3e6b49;--green-strong:#315d3d;--green-soft:#eaf0e5;--sage:#97aa90;--gold:#c6a96d;--shadow:0 10px 28px #314b3510;font-family:'DM Sans','Noto Sans SC','Microsoft YaHei',sans-serif;color:var(--ink);background:var(--canvas);font-synthesis:none;text-rendering:optimizeLegibility}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-width:320px}.app-header{height:58px;background:#fcfcf8;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 24px}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);font-size:15px;font-weight:700}.brand small{font-size:12px;font-weight:500;color:#8b978b;margin-left:8px}.brand-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:var(--green);color:white;font-size:14px}.demo-badge{display:flex;align-items:center;gap:7px;color:#6e856e;font-size:11px;border:1px solid #d9e3d4;background:#f5f8f1;border-radius:99px;padding:6px 10px}.demo-badge span{width:7px;height:7px;background:#6da06c;border-radius:50%}.toolbar{position:sticky;top:0;z-index:15;min-height:74px;padding:11px 24px;display:flex;align-items:center;gap:20px;background:#fdfdf9ed;border-bottom:1px solid var(--line);backdrop-filter:blur(14px)}.book-title{min-width:238px;display:flex;flex-direction:column;gap:3px}.book-kicker,.overline{font-size:9px;letter-spacing:.16em;font-weight:700;color:#8b9d8a}.book-title strong{font-size:14px}.mode-switch{display:flex;align-items:center;padding:3px;background:#eef2e9;border:1px solid #e1e8dc;border-radius:9px}.mode-button{border:0;color:#758276;background:transparent;font-size:11px;padding:7px 10px;border-radius:7px;cursor:pointer}.mode-button.active{background:#fff;color:var(--green-strong);box-shadow:0 2px 8px #435b4218;font-weight:700}.search-box{height:36px;display:flex;align-items:center;gap:8px;padding:0 10px;border:1px solid #e3e8df;background:#fff;border-radius:8px;flex:1;min-width:140px;color:#98a398}.search-box>span{font-size:21px;line-height:1}.search-box input{border:0;outline:0;width:100%;min-width:0;background:transparent;color:var(--ink);font:inherit;font-size:11px}.search-box kbd{font:10px inherit;color:#99a49a;border:1px solid #e8ece5;border-radius:4px;padding:2px 5px;white-space:nowrap}.icon-button{width:37px;height:37px;flex:none;border:1px solid #e0e7dc;border-radius:9px;background:#fff;color:var(--green);font-size:21px;cursor:pointer}.icon-button:hover{background:var(--green-soft)}.workspace{display:grid;grid-template-columns:236px minmax(440px,1fr) 344px;gap:0;min-height:calc(100vh - 74px);height:calc(100vh - 74px);max-height:1050px}.chapter-panel,.reader-panel,.assistant-panel{min-width:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#c8d3c5 transparent}.chapter-panel{background:#f7f8f2;border-right:1px solid var(--line);padding:24px 16px 22px}.panel-heading,.progress-label,.saved-title,.subhead{display:flex;align-items:center;justify-content:space-between;gap:10px}.panel-heading h2,.assistant-heading h2{font-size:16px;margin:4px 0 0}.quiet-count{font-size:10px;color:#89978a;background:#edf1e8;border-radius:99px;padding:5px 8px}.progress-block{margin:24px 2px 18px}.progress-label{font-size:10px;color:var(--muted);margin-bottom:8px}.progress-label b{font-size:10px;font-weight:600;color:#5d765e}.progress-track{height:5px;background:#e4e9e0;border-radius:99px;overflow:hidden}.progress-track span{display:block;height:100%;width:33%;background:var(--green);border-radius:99px;transition:width .25s}.chapter-list{display:flex;flex-direction:column;gap:5px}.chapter-link{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:1px solid transparent;background:transparent;color:#637265;padding:10px 9px;border-radius:9px;cursor:pointer}.chapter-link:hover{background:#fff}.chapter-link.current{color:var(--green-strong);border-color:#dce7d7;background:#edf3e8}.chapter-dot{width:27px;height:27px;display:grid;place-items:center;border:1px solid #d7e1d3;border-radius:50%;font-size:9px;color:#839883;flex:none}.chapter-link.current .chapter-dot{color:white;background:var(--green);border-color:var(--green)}.chapter-link b,.saved-link b{display:block;font-size:10px;font-weight:700;line-height:1.45}.chapter-link small,.saved-link small{display:block;margin-top:2px;color:#8a978b;font-size:9px}.saved-section{margin-top:27px;padding-top:17px;border-top:1px solid #e4e9e0}.saved-title h3{font-size:11px;margin:0}.saved-title>span{color:#799078;font-size:10px}.saved-list{display:flex;flex-direction:column;gap:6px;margin-top:10px}.empty-hint{font-size:10px;line-height:1.65;color:#9aa49a;margin:0;padding:9px 8px}.saved-link{width:100%;display:flex;align-items:flex-start;gap:8px;text-align:left;border:1px solid #e3e8df;border-radius:8px;background:#fff;padding:9px;color:#586c59;cursor:pointer}.saved-link>span:first-child{color:#829c76;flex:none}.saved-link b{font-size:9px;font-weight:500;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.source-note{font-size:9px;color:#96a092;line-height:1.6;margin:22px 3px 0}.reader-panel{position:relative;background:#fffefa;padding:30px clamp(28px,4.2vw,68px) 26px;scroll-behavior:smooth;scroll-padding-top:86px}.reader-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding-bottom:18px;border-bottom:1px solid #edf0e9}.reader-heading h1{font-family:Georgia,'Noto Serif SC',serif;font-size:27px;letter-spacing:-.04em;margin:7px 0 0}.sample-chip{font-size:9px;color:#6f866e;background:#edf2e9;border-radius:99px;padding:6px 9px;white-space:nowrap}.chapter{padding-top:35px;scroll-margin-top:26px}.chapter-title-row{display:flex;align-items:center;gap:13px;margin-bottom:22px}.chapter-number{width:31px;height:31px;display:grid;place-items:center;border-radius:9px;background:#edf2e8;color:#638266;font-size:10px;font-weight:700}.chapter-title-row h2{font-family:Georgia,'Noto Serif SC',serif;font-size:20px;margin:0 0 3px}.chapter-title-row p{font-size:11px;color:#8c998d;margin:0}.passage{display:grid;grid-template-columns:24px 1fr;gap:13px;padding:0 0 22px;margin:0 0 20px;border-bottom:1px solid #f0f1eb;scroll-margin-top:95px}.paragraph-marker{font-size:9px;color:#b1bbb0;padding-top:5px}.passage-copy p{font-size:14px;line-height:1.9;margin:0}.passage-copy .english{font-family:Georgia,'Times New Roman',serif;font-size:15px;line-height:1.8;color:#344438}.passage-copy .translation{font-size:13px;line-height:1.9;color:#748177;margin-top:10px}.article-content[data-mode="en"] .translation,.article-content[data-mode="zh"] .english{display:none}.article-content[data-mode="zh"] .translation{margin-top:0}.saved-highlight{background:#f4e9bb;color:inherit;border-radius:3px;padding:0 1px;box-shadow:0 0 0 2px #f4e9bb}.article-footer{display:flex;justify-content:space-between;gap:10px;color:#a4aca2;font-size:9px;padding:19px 0;border-top:1px solid #ecefe8}.assistant-panel{background:#f7f8f3;border-left:1px solid var(--line);padding:21px 17px 16px;display:flex;flex-direction:column;gap:14px}.assistant-heading{display:flex;align-items:center;gap:10px;padding-bottom:12px;border-bottom:1px solid #e6ebe2}.assistant-avatar{display:grid;place-items:center;width:35px;height:35px;border:1px solid #dbe5d5;border-radius:12px;background:#edf3e9;color:#628269;font-size:18px}.assistant-heading h2{font-size:14px}.assistant-heading .overline{font-size:8px}.demo-chip{margin-left:auto;color:#7a8b72;border:1px solid #dce5d6;background:#eef3e9;border-radius:99px;font-size:9px;padding:5px 7px;white-space:nowrap}.assistant-intro{display:flex;gap:9px;padding:11px 10px;background:#edf2e9;border:1px solid #e1e9dc;border-radius:9px;color:#748174}.assistant-intro .sparkle{color:#66876a}.assistant-intro p{margin:0;font-size:10px;line-height:1.7}.selection-preview,.collected-section{padding:12px;border:1px solid #e4e9e0;border-radius:10px;background:#fff}.subhead{margin-bottom:9px}.subhead h3{font-size:10px;margin:0}.subhead>span{font-size:9px;color:#99a49a}.preview-copy{font-size:10px;line-height:1.65;color:#78857a;margin:0;max-height:94px;overflow:auto;white-space:pre-wrap}.selection-actions{display:flex;gap:8px;margin-top:11px}.mini-action{border-radius:7px;padding:7px 10px;font-size:10px;font-weight:700;cursor:pointer}.ask-action{border:1px solid #d8e5d4;color:#3e7048;background:#eef5eb}.highlight-action{border:1px solid #ebdfb8;color:#867342;background:#fbf6e5}.mini-action:hover{filter:brightness(.98)}.counter-pill{border:1px solid #e2e8df;background:#f6f8f3;border-radius:99px;padding:4px 7px}.quote-list{display:flex;flex-direction:column;gap:8px;max-height:30vh;overflow:auto}.quote-card{border:1px solid #e6ebe3;background:#fbfcf8;border-radius:8px;padding:8px}.quote-top{display:flex;align-items:center;gap:7px}.quote-number{display:grid;place-items:center;width:19px;height:19px;border-radius:6px;color:white;background:var(--green);font-size:9px;font-weight:700}.quote-location{font-size:8px;color:#869488;flex:1}.remove-quote{border:0;background:transparent;color:#a0aaa0;font-size:17px;cursor:pointer;line-height:1}.remove-quote:hover{color:#a75a50}.quote-card blockquote{margin:7px 0;font-family:Georgia,'Noto Serif SC',serif;font-size:10px;line-height:1.55;color:#59675b}.note-label{display:block;color:#94a094;font-size:8px}.note-label input{display:block;width:100%;border:1px solid #e8ece5;border-radius:5px;background:#fff;padding:6px 7px;margin-top:4px;outline-color:#91a98d;font:inherit;font-size:9px}.question-form{margin-top:auto;border:1px solid #e0e7dc;border-radius:10px;background:#fff;padding:11px}.question-form>label{display:block;font-size:9px;font-weight:700;color:#6c7b6e;margin-bottom:7px}.question-form textarea{display:block;width:100%;resize:vertical;min-height:66px;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:10px;line-height:1.6}.question-form textarea::placeholder{color:#a5aea4}.form-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid #eef1eb;padding-top:8px}.form-footer>span{font-size:8px;color:#9ba59a}.send-button{border:0;border-radius:7px;background:var(--green);color:#fff;padding:8px 11px;font-size:9px;font-weight:700;cursor:pointer}.send-button:hover{background:var(--green-strong)}.conversation{display:flex;flex-direction:column;gap:9px}.sent-message{border:1px solid #dce7d8;background:#fff;border-radius:9px;padding:10px}.sent-label{font-size:8px;font-weight:700;color:#5a7d5d}.sent-question{font-size:10px;line-height:1.6;margin:7px 0;color:#3d5140}.sent-message ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.sent-message li{display:grid;grid-template-columns:17px 1fr;gap:7px;padding-top:6px;border-top:1px solid #eef1eb}.sent-message li>span{font-size:8px;color:#658168;font-weight:700}.sent-message li b{font-size:8px;color:#8b978b}.sent-message li p{font-family:Georgia,'Noto Serif SC',serif;font-size:9px;line-height:1.55;margin:3px 0;color:#566557}.sent-message li small{font-size:8px;color:#89958a}.no-answer{font-size:8px;color:#879386;line-height:1.6;border-top:1px solid #eef1eb;padding-top:7px;margin:8px 0 0}.privacy-hint{font-size:8px;color:#97a197;margin:0;text-align:center;line-height:1.5}.selection-popover{position:fixed;z-index:40;display:flex;align-items:center;gap:2px;padding:4px;border:1px solid #dae5d6;border-radius:9px;background:#fff;box-shadow:0 6px 22px #263d2b24}.selection-popover[hidden],.selection-actions[hidden],.search-results[hidden]{display:none}.selection-popover button{border:0;background:transparent;color:#446c49;padding:7px 9px;border-radius:6px;font-size:10px;font-weight:700;cursor:pointer}.selection-popover button:hover{background:#edf3e9}.selection-popover i{width:1px;height:15px;background:#e3e9e0}.toast{position:fixed;z-index:50;bottom:20px;left:50%;transform:translate(-50%,12px);opacity:0;pointer-events:none;padding:9px 14px;border-radius:8px;background:#2f4935;color:#fff;font-size:10px;transition:.2s}.toast.visible{opacity:1;transform:translate(-50%,0)}.search-results{position:sticky;top:74px;z-index:8;margin:12px 0;padding:11px;border:1px solid #dfe8da;border-radius:10px;background:#fffffff2;box-shadow:var(--shadow)}.search-result-head{display:flex;align-items:center;gap:9px;margin-bottom:6px;font-size:9px}.search-result-head span{color:#89968a}.search-result-head button{margin-left:auto;border:0;background:transparent;color:#829082;font-size:16px;cursor:pointer}.search-result{display:block;width:100%;padding:7px 4px;border:0;border-top:1px solid #eef1eb;background:transparent;text-align:left;cursor:pointer}.search-result span{display:block;color:#718772;font-size:8px}.search-result b{display:block;font-size:9px;line-height:1.5;color:#59695b;font-weight:500}.search-result:hover{background:#f6f8f3}
@media(max-width:1120px){.workspace{grid-template-columns:200px minmax(360px,1fr) 310px}.toolbar{gap:12px;padding-inline:16px}.book-title{min-width:185px}.reader-panel{padding-inline:30px}}
@media(max-width:850px){.toolbar{flex-wrap:wrap;gap:8px 10px;padding:10px 14px}.book-title{min-width:0;flex:1}.book-title strong{font-size:12px}.mode-switch{order:3}.mode-button{padding:7px 9px}.search-box{flex:1 1 170px;order:4}.workspace{display:flex;flex-direction:column;height:auto;max-height:none;min-height:0;overflow:visible}.chapter-panel,.reader-panel,.assistant-panel{overflow:visible;border:0}.chapter-panel{padding:17px 14px;background:#f7f8f2}.panel-heading{margin-bottom:12px}.progress-block{margin:12px 1px}.chapter-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.chapter-link{padding:8px 6px;gap:6px;min-width:0}.chapter-dot{width:23px;height:23px;font-size:8px}.chapter-link b{font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chapter-link small{font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.saved-section{margin-top:13px;padding-top:12px}.saved-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.source-note{margin-top:12px}.reader-panel{padding:22px 17px 14px;scroll-margin-top:125px}.reader-heading h1{font-size:22px}.chapter{padding-top:26px}.chapter-title-row h2{font-size:18px}.passage{grid-template-columns:18px 1fr;gap:9px}.passage-copy .english{font-size:14px}.passage-copy .translation{font-size:12px}.assistant-panel{border-top:1px solid var(--line);padding:18px 14px 15px;gap:11px}.assistant-heading{position:sticky;top:112px;z-index:5;background:#f7f8f3;padding:3px 0 10px}.assistant-heading h2{font-size:13px}.assistant-intro{padding:9px}.quote-list{max-height:unset}.question-form{margin-top:0}.search-results{top:112px}.article-footer{font-size:8px}}
@media(max-width:430px){.app-header{padding:0 13px;height:52px}.brand{font-size:13px}.brand-icon{width:27px;height:27px}.brand small{font-size:10px}.demo-badge{font-size:9px;padding:5px 7px}.toolbar{top:0;padding:8px 12px}.book-title{flex:1 1 calc(100% - 52px)}.book-title strong{font-size:11px}.mode-switch{flex:none}.mode-button{font-size:9px;padding:7px 8px}.search-box{min-width:100px;height:32px}.search-box input{font-size:9px}.icon-button{width:32px;height:32px;font-size:18px}.chapter-list{grid-template-columns:repeat(2,minmax(0,1fr))}.saved-list{grid-template-columns:1fr}.reader-panel{padding-inline:14px}.reader-heading h1{font-size:20px}.sample-chip{font-size:8px}.passage-copy .english{font-size:13px}.passage-copy .translation{font-size:11px}.assistant-heading{top:108px}}

/* Conversation-first assistant and compact toolbar collections. */
.toolbar{gap:14px}
.local-model-setup-button{display:block;box-sizing:border-box;width:100%;margin-top:8px;padding:9px;border:1px solid #d9e4d5;border-radius:8px;background:#fff;color:#527456;font:inherit;font-size:10px;text-align:center;text-decoration:none;cursor:pointer}.local-model-setup-button:hover{background:#f0f5ed}
.model-settings-dialog{width:min(440px,calc(100vw - 32px));padding:22px;border:1px solid #dce6d8;border-radius:14px;background:#fffefa;color:var(--ink);box-shadow:0 18px 60px #263d2b35}.model-settings-dialog::backdrop{background:#24332966;backdrop-filter:blur(2px)}.model-settings-dialog h2{margin:0 32px 10px 0;font-size:17px}.model-settings-dialog p{color:#758276;font-size:11px;line-height:1.7}.model-settings-dialog>label{display:block;margin:16px 0 6px;font-size:11px;font-weight:700}.model-settings-dialog>input{width:100%;box-sizing:border-box;padding:10px;border:1px solid #cbd9c8;border-radius:8px;background:#fff;font:inherit;font-size:12px;outline-color:#7e9f7a}.model-settings-close{position:absolute;right:12px;top:10px}.model-settings-close button{border:0;background:transparent;color:#798579;font-size:22px;cursor:pointer}.model-settings-status{min-height:22px;margin-top:9px;color:#537458;font-size:10px}.model-settings-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.model-settings-actions button{padding:8px 11px;border:1px solid #dce5d8;border-radius:7px;background:white;color:#55735a;font:inherit;font-size:10px;cursor:pointer}.model-settings-actions button:first-child{border-color:#426c49;background:#426c49;color:#fff}.model-settings-actions button:disabled{opacity:.6;cursor:wait}.model-settings-dialog .model-settings-note{margin-bottom:0;padding-top:8px;border-top:1px solid #edf0e9}.model-settings-trigger{font-size:10px}.toolbar-actions .model-settings-trigger{padding-inline:8px}
.toolbar-actions{display:flex;align-items:center;gap:7px;flex:none}
.toolbar-menu{position:relative}
.toolbar-menu-trigger{height:37px;display:flex;align-items:center;gap:6px;padding:0 9px;border:1px solid #e0e7dc;border-radius:9px;background:#fff;color:#55735a;font-size:11px;cursor:pointer;white-space:nowrap}
.toolbar-menu-trigger:hover,.toolbar-menu-trigger[aria-expanded="true"]{background:var(--green-soft);border-color:#cbdcc8}
.toolbar-menu-trigger b{display:grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border-radius:99px;background:#eef2e9;color:#58745c;font-size:9px}

.toolbar-popover,.quote-popover{position:absolute;z-index:30;width:min(320px,calc(100vw - 24px));max-height:min(420px,70vh);overflow:auto;padding:12px;border:1px solid #dfe7db;border-radius:12px;background:#fff;box-shadow:0 14px 38px #263d2b22}
.toolbar-popover{top:calc(100% + 8px);right:0}
.toolbar-popover[hidden],.quote-popover[hidden]{display:none}
.toolbar-popover-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:1px 2px 9px;border-bottom:1px solid #edf0e9;font-size:11px;color:#536b56}
.toolbar-popover-heading span{color:#839486;font-size:10px}
.toolbar-saved-list{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.toolbar-saved-item{display:flex;align-items:stretch;gap:4px}
.toolbar-saved-item .saved-link{flex:1;min-width:0}
.saved-link{font:inherit}
.remove-highlight{width:30px;flex:none;border:1px solid #e6ebe3;border-radius:8px;background:#fff;color:#929f93;font-size:18px;cursor:pointer}
.remove-highlight:hover{color:#a75a50;background:#fbf5f3}
.toolbar-saved-list .empty-hint{padding:10px 4px}
.paragraph-marker{font-size:11px;font-weight:700;letter-spacing:-.04em;color:#91a38f;padding-top:4px}
.reference-anchor{display:inline-grid;place-items:center;min-width:17px;height:17px;margin:0 2px;padding:0 4px;border-radius:99px;background:#4e84ee;color:#fff;font:700 10px/1 'DM Sans','Microsoft YaHei',sans-serif;vertical-align:super;cursor:pointer;box-shadow:0 2px 5px #4e84ee33}
.assistant-panel{overflow:hidden;gap:0;padding:17px 15px 12px}
.assistant-heading{flex:none;margin-bottom:12px}
.conversation{flex:1;min-height:100px;overflow:auto;overscroll-behavior:contain;padding:2px 2px 14px;scrollbar-width:thin;scrollbar-color:#c8d3c5 transparent}
.conversation-welcome{margin:auto;max-width:230px;text-align:center;padding:28px 10px;color:#859186}
.welcome-sparkle{display:grid;place-items:center;width:40px;height:40px;margin:0 auto 12px;border-radius:14px;background:#eaf1e7;color:#68896a;font-size:21px}.welcome-sparkle img{display:block;width:30px;height:24px;object-fit:contain}
.conversation-welcome h3{margin:0 0 7px;color:#536b56;font-size:12px}
.conversation-welcome p{margin:0;font-size:10px;line-height:1.7;white-space:pre-wrap}
.question-form{position:relative;flex:none;margin-top:8px;padding:10px;border:1px solid #dfe7dc;border-radius:13px;box-shadow:0 5px 18px #344f3810}
.composer-selection{margin:-1px -1px 8px;padding:8px 9px;border:1px solid #edf0e9;border-radius:9px;background:#fbfcf8}
.composer-selection-label{font-size:9px;font-weight:700;color:#718872}
#preview-location{float:right;max-width:58%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8px;color:#9aa49a}
.preview-copy{clear:both;max-height:70px;margin-top:6px;font-size:10px;line-height:1.55}
.preview-copy:empty{display:none}
.selection-actions{margin-top:7px}
.mini-action{padding:5px 8px;font-size:9px}
.reference-composer-row{position:relative;margin-bottom:6px}
.reference-trigger{display:flex;align-items:center;gap:6px;padding:5px 8px;border:1px solid #e8ede6;border-radius:7px;background:#f9faf7;color:#627864;font-size:9px;cursor:pointer}
.reference-trigger:hover,.reference-trigger[aria-expanded="true"]{background:#edf3e9;border-color:#d6e3d3}
.quote-popover{bottom:calc(100% + 8px);left:0;max-height:min(340px,55vh)}
.quote-list{max-height:225px;margin-top:8px}
.quote-card{background:#fbfcf8}
.quote-card blockquote{font-size:10px}
.question-form textarea{min-height:38px;max-height:130px;resize:vertical;font-size:11px}
.form-footer{padding-top:7px}
.form-footer>span{font-size:8px}
.send-button{padding:8px 12px}
.privacy-hint{flex:none;padding-top:8px}
.sent-message{align-self:flex-start;width:min(100%,300px);padding:11px}
.sent-message .no-answer{margin-top:9px}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:1120px){.toolbar{gap:9px}.toolbar-actions{gap:5px}.toolbar-menu-trigger{padding-inline:7px}.assistant-panel{padding-inline:12px}}
@media(max-width:850px){.toolbar{gap:8px 10px}.toolbar-actions{order:2;margin-left:auto}.workspace{align-items:stretch}.assistant-panel{min-height:560px;overflow:visible;padding:16px 14px 12px}.assistant-heading{position:static;margin-bottom:8px}.conversation{min-height:230px;max-height:48vh}.question-form{position:sticky;bottom:0;z-index:12;margin-top:8px;background:#fffefaF5;backdrop-filter:blur(14px);box-shadow:0 -5px 24px #263d2b12}.privacy-hint{padding-bottom:2px}.toolbar-popover{position:fixed;top:var(--toolbar-popover-top,110px);right:12px}.reference-trigger{min-height:34px}}
@media(max-width:430px){.toolbar{align-items:center}.toolbar-actions{width:auto;gap:4px}.toolbar-menu-trigger{height:32px;gap:4px;padding:0 6px;font-size:9px}.toolbar-menu-trigger b{min-width:16px;height:16px;font-size:8px}.assistant-panel{min-height:540px}.conversation{min-height:220px}.question-form{padding:8px}.composer-selection{padding:7px}.toolbar-popover{top:124px}}

.send-button:disabled,.reference-trigger:disabled{opacity:.65;cursor:wait}
.question-form.is-sending{cursor:progress}
.assistant-response{margin-top:9px;border-top:1px solid #eef1eb;padding-top:8px;font-size:10px;line-height:1.7;color:#435849;white-space:pre-wrap;overflow-wrap:anywhere}
.assistant-response p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.assistant-response-error{color:#9a493f}
.assistant-settings-link{margin-top:7px;border:1px solid #dce7d8;border-radius:6px;padding:6px 9px;background:#f7faf5;color:var(--green-strong);font:inherit;cursor:pointer}
.response-loading{display:inline-block;width:12px;height:12px;margin-right:6px;vertical-align:-2px;border:2px solid #dce7d8;border-top-color:var(--green);border-radius:50%;animation:reader-response-spin .8s linear infinite}
@keyframes reader-response-spin{to{transform:rotate(360deg)}}

/* Notes, per-reference annotations, removable bookmarks, and nested contents. */
.note-menu-anchor{flex:none}
.note-menu-trigger{min-width:66px;justify-content:center}
.chapter-tree-node{display:flex;flex-direction:column;gap:3px}
.chapter-nav-row{display:grid;grid-template-columns:minmax(0,1fr) 26px;align-items:center;gap:4px}
.chapter-link{min-width:0;padding-left:calc(9px + var(--tree-depth,0)*5px)}
.chapter-link>span:nth-child(2){min-width:0}
.chapter-expand{width:25px;height:25px;border:1px solid #dce5d9;border-radius:7px;background:#fff;color:#657b67;font-size:16px;line-height:1;cursor:pointer}
.chapter-expand:hover{background:var(--green-soft)}
.chapter-children{display:flex;flex-direction:column;gap:4px;margin:4px 0 4px 14px;padding-left:8px;border-left:1px solid #d8e2d5}
.chapter-children[hidden]{display:none}
.chapter-subnumber{flex:none;min-width:27px;color:#819581;font-size:9px;font-weight:700}
.chapter-level-1{padding-top:20px}
.chapter-level-1>.chapter-title-row{margin:0 0 15px;padding-left:28px}
.chapter-level-1>.chapter-title-row .node-title{font-family:inherit;font-size:15px;letter-spacing:0}
.chapter-level-2{padding-top:14px}
.chapter-level-2>.chapter-title-row{margin:0 0 12px;padding-left:42px}
.chapter-level-2>.chapter-title-row .node-title{font-family:inherit;font-size:13px;letter-spacing:0}
.saved-note{border-bottom:2px dotted #83a9ee;background:#d9e7ff!important;color:#183d78!important;border-radius:3px;cursor:pointer;box-shadow:0 0 0 2px #d9e7ff;outline:1px solid #83a9ee}
.reference-anchor{user-select:none}
.reference-anchor:focus-visible{outline:2px solid #315d3d;outline-offset:2px}
.reference-note-editor,.personal-note-editor{position:fixed;z-index:48;width:min(360px,calc(100vw - 24px));padding:12px;border:1px solid #dce7da;border-radius:12px;background:#fffffff7;box-shadow:0 12px 34px #263d2b28;backdrop-filter:blur(12px)}
.reference-note-editor[hidden],.personal-note-editor[hidden]{display:none}
.reference-note-editor{display:flex;align-items:center;gap:8px}
.reference-note-editor label,.personal-note-editor label{display:block;color:#627864;font-size:10px;font-weight:700}
.reference-note-editor label{position:absolute;top:7px;left:12px;right:42px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8px}
.reference-note-editor input{width:100%;height:33px;margin-top:12px;padding:0 9px;border:1px solid #e2e9de;border-radius:7px;background:#fff;color:var(--ink);font:inherit;font-size:10px;outline-color:#91a98d}
.reference-note-editor>button,.personal-note-editor>div button:last-child{display:grid;place-items:center;width:32px;height:32px;flex:none;margin-top:12px;border:0;border-radius:8px;background:#3e7048;color:#fff;font-size:18px;font-weight:700;cursor:pointer}
.reference-note-editor>button:hover,.personal-note-editor>div button:last-child:hover{background:#315d3d}
.quote-card blockquote{margin-bottom:4px}
.quote-note{margin:5px 0 0;padding-top:5px;border-top:1px solid #edf0e9;color:#66806a;font-size:9px;line-height:1.5;overflow-wrap:anywhere}
.quote-note[hidden]{display:none}
.bookmark-item .saved-link,.note-item .saved-link{flex:1;min-width:0}
.bookmark-item .saved-link{border-radius:8px 0 0 8px}
.remove-bookmark{border-radius:0 8px 8px 0}
.note-item .saved-link{border-radius:8px 0 0 8px}
.note-item .saved-link b,.note-item .saved-link small{overflow-wrap:anywhere}
.note-item .note-body{color:#58745c}
.edit-note{width:30px;flex:none;border:1px solid #e6ebe3;border-radius:8px;background:#fff;color:#7c8d7e;font-size:14px;cursor:pointer}
.edit-note:hover{background:#edf3e9;color:#456b4a}
.personal-note-editor{padding:13px}
.personal-note-editor>label{margin:0 0 8px}
.personal-note-editor textarea{display:block;width:100%;min-height:70px;resize:vertical;padding:8px 9px;border:1px solid #e2e9de;border-radius:8px;background:#fff;color:var(--ink);font:inherit;font-size:11px;line-height:1.6;outline-color:#91a98d}
.personal-note-editor>div{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:8px}
.personal-note-editor>div .note-delete-button{width:auto;height:30px;padding:0 10px;margin:0;border:1px solid #eadfdb;border-radius:7px;background:#fff;color:#a26459;font-size:9px;font-weight:600}
.personal-note-editor>div .note-delete-button[hidden]{display:none}
.personal-note-editor>div .note-delete-button:hover{background:#fbf4f2}
.personal-note-editor>div button:last-child{width:32px;height:30px;margin:0;font-size:16px}
@media(max-width:850px){.chapter-link{padding-left:9px}.chapter-children{margin-left:11px;padding-left:6px}.toolbar-popover{max-height:min(380px,62vh)}.reference-note-editor,.personal-note-editor{width:min(360px,calc(100vw - 24px))}}
@media(max-width:430px){.chapter-link{padding:8px 5px;gap:5px}.chapter-link b{font-size:8px}.chapter-link small{font-size:8px}.chapter-children{margin-left:8px;padding-left:5px}.reference-note-editor,.personal-note-editor{padding:10px}}

/* Keep the reference picker inside the assistant panel and scroll its list. */
.quote-popover{display:flex;flex-direction:column;overflow:hidden;max-height:min(320px,40vh)}
.quote-popover[hidden]{display:none}
.quote-list{flex:1;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain}
.reference-note-editor .reference-delete-button{background:#fff;border:1px solid #eadfdb;color:#a26459}
.reference-note-editor .reference-delete-button:hover{background:#fbf4f2;color:#934f45}
@media(max-width:850px){.quote-list{max-height:none}}
@media(max-width:850px){.question-form{backdrop-filter:none}}

/* Compact bookmark state, scrollable notes, and non-invasive search highlights. */
.passage{position:relative;padding-right:38px}
.passage-bookmark-icon{position:absolute;right:2px;top:1px;display:grid;place-items:center;width:28px;height:30px;border:1px solid transparent;border-radius:8px;background:transparent;color:#a3b1a2;opacity:.7;cursor:pointer;transition:background .15s,color .15s,opacity .15s}
.passage-bookmark-icon:hover,.passage-bookmark-icon.is-saved{background:#eaf2ff;border-color:#cfddf5;color:#3974d4;opacity:1}
.passage-bookmark-icon span{display:block;width:11px;height:15px;background:currentColor;clip-path:polygon(0 0,100% 0,100% 100%,50% 74%,0 100%)}
#note-menu.toolbar-popover{display:flex;flex-direction:column;overflow:hidden;max-height:min(380px,65vh)}
#note-menu[hidden]{display:none}
#note-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:3px}
#note-menu .toolbar-popover-heading{flex:none}
.search-result-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.search-result-controls{display:flex;align-items:center;gap:5px;margin-left:auto}
.search-result-controls button{border:1px solid #dfe7db;border-radius:6px;background:#fff;color:#527456;padding:4px 7px;font:inherit;font-size:9px;cursor:pointer}
.search-result-controls button:hover:not(:disabled){background:#edf3e9}
.search-result-controls button:disabled{color:#a8b0a7;cursor:default}
#search-position{min-width:34px;text-align:center;font-size:9px;color:#617762;font-variant-numeric:tabular-nums}
.search-current-context{margin:5px 0 0;color:#687a69;font-size:9px;line-height:1.6;overflow-wrap:anywhere}
::highlight(reader-search-hit){background:#ffe69a;color:inherit}
::highlight(reader-search-current){background:#ffb84d;color:#26382d;text-decoration:underline;text-decoration-color:#bd732b;text-decoration-thickness:2px}
@media(max-width:850px){.toolbar{backdrop-filter:none}#note-menu.toolbar-popover{max-height:min(380px,65vh)}.search-results{top:112px;margin:8px 0;padding:9px}.search-result-head{gap:6px}.search-result-controls{gap:3px}.search-result-controls button{padding:5px 6px}}
@media(max-width:430px){.passage{padding-right:31px}.passage-bookmark-icon{right:-2px;width:26px;height:28px;font-size:18px}.search-result-controls button{font-size:8px;padding:5px 4px}}

/* Local file entry and import state. */
#reader-app[hidden],.upload-home[hidden]{display:none}
.upload-home{min-height:100vh;background:radial-gradient(ellipse at 50% 12%,#f4f6ed 0,transparent 44%),#f8f8f2;color:var(--ink)}
.upload-header{height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 clamp(18px,5vw,72px);border-bottom:1px solid #e7ebe2;background:#fcfcf8d9}
.local-only-badge{display:flex;align-items:center;gap:7px;border:1px solid #dce7d8;border-radius:99px;background:#f2f6ed;padding:8px 12px;color:#637c65;font-size:10px}
.local-only-badge:before{content:"";width:7px;height:7px;border-radius:50%;background:#6d996e}
.upload-hero{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,430px);align-items:center;gap:clamp(36px,7vw,100px);max-width:1120px;margin:0 auto;padding:72px 28px 58px}
.upload-copy{max-width:560px}.upload-copy .overline,.sample-heading .overline{letter-spacing:.18em;color:#8b9b83}
.upload-copy h1{max-width:510px;margin:15px 0 16px;font-family:Georgia,'Noto Serif SC',serif;font-size:clamp(32px,4vw,49px);line-height:1.27;letter-spacing:-.04em;color:#2d4233;white-space:pre-wrap}
.upload-copy p{max-width:500px;color:#778579;font-size:14px;line-height:1.9}
.upload-card{padding:29px 28px 23px;border:1px solid #dfe7db;border-radius:18px;background:#fff;box-shadow:0 20px 55px #2e4e3710;text-align:center}
.upload-icon{display:grid;place-items:center;width:48px;height:48px;margin:0 auto 14px;border-radius:15px;background:#edf3e8;color:#557c59;font-size:27px;font-weight:400}.upload-icon img{display:block;width:40px;height:32px;object-fit:contain}
.upload-card h2{margin:0;color:#405944;font-size:17px}.upload-card>p{margin:8px 0 19px;color:#929c91;font-size:11px}
.primary-upload-button{width:100%;min-height:48px;border:0;border-radius:10px;background:#456f4c;color:#fff;font-family:inherit;font-size:13px;font-weight:700;cursor:pointer;box-shadow:0 5px 14px #426a491c;transition:background .15s,transform .15s}
.primary-upload-button:hover{background:#365f3d;transform:translateY(-1px)}.upload-card>small{display:block;margin-top:16px;color:#9aa49a;font-size:9px;line-height:1.7;text-align:left}
.upload-progress{display:flex;align-items:center;justify-content:center;gap:9px;margin-top:13px;color:#647d65;font-size:10px}.upload-progress[hidden],.upload-error[hidden]{display:none}
.loading-dot{width:9px;height:9px;border:2px solid #cddbc8;border-top-color:#527a57;border-radius:50%;animation:upload-spin .8s linear infinite}@keyframes upload-spin{to{transform:rotate(360deg)}}
.upload-error{margin:12px 0 0;padding:9px 10px;border:1px solid #f0d8d1;border-radius:8px;background:#fff7f5;color:#a65c4d;font-size:10px;line-height:1.6;text-align:left}
.ocr-cache-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:14px;padding-top:12px;border-top:1px solid #eef1eb;text-align:left}.ocr-cache-tools span{color:#8d998d;font-size:9px;line-height:1.6}.ocr-cache-tools button{flex:none;border:1px solid #e3e8df;border-radius:7px;background:#fff;color:#718171;padding:6px 8px;font:inherit;font-size:9px;cursor:pointer}.ocr-cache-tools button:disabled{opacity:.5;cursor:wait}
.sample-books{max-width:1120px;margin:0 auto;padding:0 28px 46px}.sample-heading{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:15px}.sample-heading h2{margin:4px 0 0;color:#405944;font-size:18px}.sample-heading>p{margin:0;color:#909b90;font-size:10px}.sample-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.sample-book{display:flex;flex-direction:column;align-items:flex-start;min-height:153px;padding:19px 20px;border:1px solid #e2e9de;border-radius:13px;background:#fff;text-align:left;cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .15s}
.sample-book:hover{transform:translateY(-2px);border-color:#b9cdb7;box-shadow:0 10px 28px #2e4e3710}
.sample-format{margin-bottom:10px;color:#6b896b;font-size:9px;font-weight:700;letter-spacing:.06em}.sample-book b{max-width:600px;color:#425946;font-family:Georgia,'Noto Serif SC',serif;font-size:14px;line-height:1.5}.sample-book small{margin-top:7px;color:#929d92;font-size:9px}.sample-action{margin-top:auto;padding-top:13px;color:#54775a;font-size:10px;font-weight:700}
.sample-license{margin:14px 0 0;color:#99a399;font-size:9px;line-height:1.7}.sample-license a{color:#617f62;text-decoration:underline;text-underline-offset:2px}.upload-footer{padding:14px 20px 20px;color:#a1aaa0;text-align:center;font-size:9px}
.return-upload{margin-left:auto;margin-right:15px;border:1px solid #e0e7dc;border-radius:8px;background:#fff;color:#58745d;padding:7px 10px;font:inherit;font-size:10px;cursor:pointer}.return-upload:hover{background:#f0f4ec}
.chapter-list{max-height:45vh;overflow:auto}
.translation-unavailable{color:#a0a99f!important;font-style:italic}
@media(max-width:850px){.upload-header{height:58px;padding-inline:18px}.upload-hero{grid-template-columns:1fr;gap:30px;max-width:640px;padding:45px 22px 36px}.upload-copy{text-align:center;margin:0 auto}.upload-copy h1{margin-inline:auto}.upload-copy p{margin-inline:auto}.upload-card{max-width:480px;width:100%;margin:0 auto}.sample-books{max-width:640px;padding-inline:22px}.sample-heading{align-items:flex-start;flex-direction:column;gap:6px}.sample-grid{grid-template-columns:1fr}.sample-book{min-height:140px}.chapter-list{max-height:none}.return-upload{margin-left:auto}}
@media(max-width:430px){.upload-header{padding-inline:13px}.upload-header .brand{font-size:12px}.upload-header .brand small{font-size:9px}.local-only-badge{padding:6px 8px;font-size:8px}.upload-hero{padding:34px 16px 28px;gap:24px}.upload-copy h1{font-size:30px}.upload-copy p{font-size:12px;line-height:1.75}.upload-card{padding:22px 18px 18px}.sample-books{padding:0 16px 30px}.sample-book{padding:16px}.sample-book b{font-size:13px}.sample-license{font-size:8px}.return-upload{padding:6px 8px;margin-right:7px;font-size:9px}.app-header{padding-inline:12px}}

/* Search is attached to the fixed toolbar, so results remain visible at any reading position. */
.search-results{position:fixed;z-index:60;display:flex;flex-direction:column;overflow:hidden;margin:0;padding:11px;max-height:70vh;background:#fffefa}
.search-results[hidden]{display:none}
.search-result-head{flex:none;min-width:0}
.search-result-head>span{font-size:9px;white-space:nowrap}
.search-result-controls button{margin-left:0}
.search-result-list{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.search-result{border-radius:6px;padding:9px 7px}
.search-result.current{background:#eef4e9}
.search-result mark{padding:0 2px;border-radius:2px;background:#ffe29a;color:#3c492f}
.passage.search-active{outline:2px solid #e9bd62;outline-offset:5px;border-radius:3px}

/* A bookmark belongs to a section heading, never to an individual paragraph. */
.passage{padding-right:0}
.section-bookmark-icon{display:grid;place-items:center;flex:none;width:30px;height:31px;margin-left:auto;border:1px solid #cfddf5;border-radius:8px;background:#eaf2ff;color:#3974d4;cursor:pointer}
.section-bookmark-icon:hover{background:#dceafe}
.section-bookmark-icon span{display:block;width:11px;height:15px;background:currentColor;clip-path:polygon(0 0,100% 0,100% 100%,50% 74%,0 100%)}
@media(max-width:850px){.search-results{padding:9px}.passage{padding-right:0}}
@media(max-width:430px){.search-result-head{align-items:flex-start}.search-result-controls{width:100%;justify-content:flex-end}.passage{padding-right:0}}
.book-title{position:relative;flex:0 1 clamp(140px,18vw,238px);width:clamp(140px,18vw,238px);min-width:0;max-width:238px}.book-title strong{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;outline-offset:3px}.book-title-tooltip{position:absolute;z-index:32;left:0;top:calc(100% + 8px);width:max-content;max-width:min(440px,calc(100vw - 24px));padding:9px 11px;border:1px solid #dce6d8;border-radius:8px;background:#fff;color:var(--ink);box-shadow:0 8px 24px #263d2b20;font-size:12px;font-weight:500;line-height:1.5;white-space:normal;overflow-wrap:anywhere}.book-title-tooltip[hidden]{display:none}.highlight-action-popover{position:fixed;z-index:45;padding:4px;border:1px solid #dce6d8;border-radius:9px;background:#fff;box-shadow:0 6px 22px #263d2b24}.highlight-action-popover[hidden]{display:none}.highlight-action-popover button{border:0;border-radius:6px;background:#edf3e9;color:#365f3e;padding:8px 11px;font:inherit;font-size:12px;font-weight:700;white-space:nowrap;cursor:pointer}.highlight-action-popover button:hover{background:#dfeadb}@media(max-width:1120px){.book-title{flex:0 1 clamp(135px,20vw,200px);width:clamp(135px,20vw,200px);min-width:0;max-width:200px}}@media(max-width:850px){.book-title{flex:1 1 160px;width:auto;max-width:100%;min-width:0}.book-title-tooltip{max-width:calc(100vw - 28px)}}
.passage-copy{min-width:0}.passage-copy .passage-text{overflow-wrap:anywhere}
.passage .passage-copy h3,.passage .passage-copy h4{margin:0;font-weight:inherit}
.passage[data-block-type="document-title"]{border-bottom:0;margin-bottom:10px;padding-bottom:0}
.passage[data-block-type="document-title"] .english{font-family:Georgia,'Times New Roman',serif;font-size:19px;line-height:1.45;font-weight:700;color:#20372a}
.passage[data-block-type="article-label"]{border-bottom:0;margin-bottom:5px;padding-bottom:0}
.passage[data-block-type="article-label"] .english{font:700 9px/1.5 'DM Sans','Noto Sans SC',sans-serif;letter-spacing:.12em;color:#718574;text-transform:uppercase}
.passage[data-block-type="author-name"] .english{font:600 11px/1.65 'DM Sans','Noto Sans SC',sans-serif;color:#33483a}
.passage[data-block-type="author-affiliation"] .english,.passage[data-block-type="author-contact"] .english{font:400 10px/1.7 'DM Sans','Noto Sans SC',sans-serif;color:#778579}
.passage[data-block-type="abstract-heading"],.passage[data-block-type="section-heading"]{border-bottom:0;margin:14px 0 3px;padding-bottom:0}
.passage[data-block-type="abstract-heading"] .english,.passage[data-block-type="section-heading"] .english{font:700 15px/1.5 Georgia,'Times New Roman',serif;color:#294535}
.passage[data-block-type="abstract-text"] .english{font-size:13px;line-height:1.75;color:#536457}
.passage[data-block-type="publisher-metadata"],.passage[data-block-type="footnote"]{border:0;border-left:2px solid #dce5d8;margin:0 0 5px;padding:1px 0 1px 9px}
.passage[data-block-type="publisher-metadata"] .english,.passage[data-block-type="footnote"] .english{font:400 10px/1.65 'DM Sans','Noto Sans SC',sans-serif;color:#748176}
.passage[data-block-type="figure-caption"] .english,.passage[data-block-type="table-caption"] .english{font:600 11px/1.6 'DM Sans','Noto Sans SC',sans-serif;color:#536657}
.passage[data-block-type="table-section-heading"]{margin:2px 0 0;border:0;padding:2px 0;background:#eef3e9}
.passage[data-block-type="table-section-heading"] .english{font:700 10px/1.5 'DM Sans','Noto Sans SC',sans-serif;color:#46594a;text-align:center}
.passage[data-block-type="table-row"]{margin:0;padding:0;border:0}
.pdf-table-scroll{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;scrollbar-color:#c8d3c5 transparent;border:1px solid #e5e9e1;border-radius:7px;margin:8px 0 12px}
.pdf-table-scroll .passage[data-block-type="table-row"] .passage-copy{min-width:0;overflow:visible}
.pdf-table-scroll .passage[data-block-type="table-row"] .table-row-cells{display:grid;grid-template-columns:minmax(180px,1.7fr) repeat(var(--table-columns),minmax(68px,1fr));align-items:stretch;width:100%;min-width:540px;border-bottom:1px solid #e5e9e1;font:400 10px/1.45 'DM Sans','Noto Sans SC',sans-serif;color:#46594a}
.pdf-table-scroll .passage[data-block-type="table-formula"] .table-row-cells,.pdf-table-scroll .passage[data-block-type="table-section-heading"] .table-row-cells{display:grid;grid-template-columns:minmax(180px,1.7fr) repeat(var(--table-columns),minmax(68px,1fr));align-items:stretch;width:100%;min-width:540px;border-bottom:1px solid #e5e9e1;font:400 9px/1.5 'DM Sans','Noto Sans SC',sans-serif;color:#46594a}
.pdf-table-scroll .passage[data-block-type="table-formula"] .table-row-cells span:first-child,.pdf-table-scroll .passage[data-block-type="table-section-heading"] .table-row-cells span:first-child{grid-column:1/-1;font-weight:400;overflow-wrap:anywhere;white-space:normal}
.pdf-table-scroll .passage[data-block-type="table-section-heading"] .table-row-cells span:first-child{text-align:center;font-weight:700}
.passage[data-block-type="table-row"] .table-row-cells span{padding:4px 7px;border-right:1px solid #e5e9e1;overflow-wrap:anywhere}
.passage[data-block-type="table-formula"] .table-row-cells span,.passage[data-block-type="table-section-heading"] .table-row-cells span{padding:6px 7px;overflow-wrap:anywhere}
.passage[data-block-type="table-row"] .table-row-cells span:first-child{font-weight:600}
.passage[data-block-type="table-row"] .translation{display:none}
.passage[data-block-type="table-formula"] .translation,.passage[data-block-type="table-section-heading"] .translation{display:none}
.passage[data-block-type="source-check"]{border-left:3px solid #d69434;background:#fff9e9;padding:8px 10px}
.source-check-note{margin:0 0 4px;color:#875315;font:600 10px/1.5 'DM Sans','Noto Sans SC',sans-serif}
.passage-ocr-empty .passage-copy{padding:0 0 12px}
.ocr-load-more{display:flex;align-items:center;justify-content:center;gap:10px;margin:26px 0 12px;padding:16px 12px;border-top:1px solid #e6ebe3;color:#829080;font:500 11px/1.5 'DM Sans','Noto Sans SC',sans-serif}
.ocr-load-more button{padding:9px 17px;border:1px solid #cfddcc;border-radius:9px;background:#edf3e9;color:#3e6b4b;font:700 12px/1.3 'DM Sans','Noto Sans SC',sans-serif;cursor:pointer}
.ocr-load-more button:hover:not(:disabled){background:#e2eddd}
.ocr-load-more button:disabled{opacity:.55;cursor:wait}
@media(max-width:540px){.ocr-load-more{flex-direction:column;gap:6px;text-align:center}}
.ocr-source-page{margin:6px 0 16px;padding:10px 13px;border:1px solid #dbe4d6;border-radius:10px;background:#f4f6ef;color:#596c5d;font:500 12px/1.55 'DM Sans','Noto Sans SC',sans-serif}
.ocr-source-page summary{cursor:pointer;color:#3e6b4b;font-weight:700}
.ocr-source-page img{display:block;width:auto;max-width:100%;max-height:74vh;height:auto;margin:12px auto 8px;object-fit:contain;box-shadow:0 4px 18px #273b2c22}
.ocr-source-page p{margin:6px 0 0;color:#748476;font-size:11px}
.passage[data-block-type="source-check"] .english{font:400 11px/1.6 'DM Sans','Noto Sans SC',sans-serif;color:#5d5647;white-space:pre-wrap}
.passage[data-block-type="reference-entry"] .english{font:400 11px/1.65 Georgia,'Times New Roman',serif;color:#58665a}
.passage[data-block-type="source-credit"] .english,.passage[data-block-type="running-header"] .english,.passage[data-block-type="running-footer"] .english{font:400 9px/1.5 'DM Sans','Noto Sans SC',sans-serif;color:#89958a}
.passage[data-block-type="running-header"],.passage[data-block-type="running-footer"]{border:0;margin:0 0 4px;padding:0}
.passage[data-block-type="running-header"] .paragraph-marker,.passage[data-block-type="running-footer"] .paragraph-marker,.passage[data-block-type="document-title"] .paragraph-marker,.passage[data-block-type="article-label"] .paragraph-marker,.passage[data-block-type="author-name"] .paragraph-marker,.passage[data-block-type="author-affiliation"] .paragraph-marker,.passage[data-block-type="author-contact"] .paragraph-marker,.passage[data-block-type="abstract-heading"] .paragraph-marker,.passage[data-block-type="section-heading"] .paragraph-marker,.passage[data-block-type="publisher-metadata"] .paragraph-marker,.passage[data-block-type="footnote"] .paragraph-marker,.passage[data-block-type="table-caption"] .paragraph-marker,.passage[data-block-type="table-section-heading"] .paragraph-marker,.passage[data-block-type="table-row"] .paragraph-marker,.passage[data-block-type="table-formula"] .paragraph-marker,.passage[data-block-type="source-credit"] .paragraph-marker{visibility:hidden}
.passage[data-block-type="figure-module"]{display:block;border:0;margin:10px 0 14px;padding:0}
.passage[data-block-type="figure-module"] .paragraph-marker{display:none}
.passage[data-block-type="figure-module"] .passage-copy{width:100%}
.reader-figure{margin:0;max-width:100%}
.reader-figure-open{display:flex;flex-direction:column;align-items:center;gap:6px;width:100%;padding:0;border:0;background:transparent;color:#708271;font:inherit;font-size:10px;cursor:zoom-in}
.reader-figure-open img{display:block;width:100%;height:auto;max-height:70vh;object-fit:contain}
.epub-image-passage .reader-figure-open img{width:auto;max-width:100%}
.epub-cover-module{display:flex;align-items:center;gap:18px;margin:0 0 22px;padding:14px 10px 20px;border-bottom:1px solid #e8ece5}
.epub-cover-module .reader-figure{flex:none;width:min(34%,220px)}
.epub-cover-module .reader-figure-open{width:100%}
.epub-cover-module .reader-figure-open img{width:100%;height:auto;max-height:46vh;object-fit:contain}
.epub-cover-caption{display:grid;gap:5px;color:#718072;font-size:10px;line-height:1.6}
.epub-cover-caption strong{color:#536657;font-size:11px}
.epub-cover-caption p{margin:0;overflow-wrap:anywhere}
.epub-cover-translation{color:#68796c}
.epub-cover-translation span{color:#8a9689}
@media(max-width:540px){.epub-cover-module{flex-direction:column;align-items:center;text-align:center}.epub-cover-module .reader-figure{width:min(68%,220px)}}
.reader-figure-open span{align-self:flex-end;padding:2px 0;font-size:9px}
.figure-module-caption{display:grid;gap:2px;margin-top:3px}
.passage[data-block-type="figure-module"] .figure-module-title{margin:0;color:#536657;font:600 11px/1.5 'DM Sans','Noto Sans SC',sans-serif}
.passage[data-block-type="figure-module"] .figure-module-translation{margin:0;color:#748177;font-size:11px;line-height:1.55}
.figure-module-doi{width:max-content;max-width:100%;overflow-wrap:anywhere;color:#89958a;font:400 9px/1.45 'DM Sans','Noto Sans SC',sans-serif;text-decoration:underline;text-underline-offset:2px}
.figure-lightbox{position:fixed;width:min(94vw,1100px);max-width:none;max-height:92dvh;padding:44px 14px 14px;border:1px solid #dce5d8;border-radius:12px;background:#fffefa;box-shadow:0 18px 60px #18251d55;overflow:auto}
.figure-lightbox::backdrop{background:#111a15b8}
.figure-lightbox img{display:block;width:100%;height:auto;max-height:calc(92dvh - 60px);object-fit:contain}
.figure-lightbox-close{position:absolute;top:8px;right:8px;width:30px;height:30px;border:1px solid #e0e7dc;border-radius:8px;background:#fff;color:#526453;font-size:21px;line-height:1;cursor:pointer}

/* Keep translated passages distinct from the English while staying within the sage palette. */
.passage-copy>.translation:not(.translation-unavailable){margin:13px 0 0;padding:11px 15px;border-left:2px solid #c6d7c5;border-radius:0 7px 7px 0;background:#f1f5ef;color:#5f7163;font-size:14px;line-height:2}
.article-content[data-mode="zh"] .passage-copy>.translation:not(.translation-unavailable){margin-top:0}
@media(max-width:850px){.passage-copy>.translation:not(.translation-unavailable){margin-top:11px;padding:9px 12px;font-size:13px;line-height:1.95}}
@media(max-width:430px){.passage-copy>.translation:not(.translation-unavailable){margin-top:10px;padding:8px 10px;font-size:13px;line-height:1.9}}
.pending-question-reference{background:#d9e7ff!important;color:#183d78!important;border-radius:3px;box-shadow:0 0 0 2px #d9e7ff;outline:1px solid #83a9ee}
.reader-heading-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.searchable-copy-button{border:1px solid #dce5d8;font:inherit;cursor:pointer}.searchable-copy-button:disabled{opacity:.6;cursor:wait}.reader-heading[hidden]{display:none}.reader-heading.imported-actions-only{padding:0;border:0}.reader-heading-title[hidden]{display:none}#reader-app.imported-book .book-title{display:none}.reader-translation-progress{position:sticky;top:0;z-index:8;display:inline-flex;box-sizing:border-box;align-items:center;justify-content:center;gap:6px;width:max-content;min-width:68px;height:30px;margin:0 0 8px;padding:4px 9px;border:1px solid #dce8d8;border-radius:999px;background:#eaf2e8;color:#3e6b49;font:600 12px/1 'DM Sans','Noto Sans SC',sans-serif;vertical-align:top}.reader-translation-progress[hidden]{display:none}.reader-translation-pie{width:20px;height:20px;flex:none;border-radius:50%;background:conic-gradient(#3e6b49 var(--translation-progress-angle,0deg),#cbdcc9 0)}#reader-translation-percent{min-width:25px;text-align:center}.reader-translation-progress:not([hidden])+.reader-import-status:not([hidden]){top:38px}
.reader-import-status{position:sticky;top:0;z-index:7;display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 14px;padding:9px 11px;border:1px solid #dce8d8;border-radius:8px;background:#f4f8f0;color:#58765a;font-size:10px;line-height:1.55}.reader-import-status[hidden]{display:none}.reader-import-status.error{border-color:#ecd5cf;background:#fff7f4;color:#9e5c4e}.reader-import-status button{flex:none;border:1px solid currentColor;border-radius:6px;padding:5px 8px;background:#fff;color:inherit;font:inherit;cursor:pointer}

/* Compact chat turns: keep selected text discoverable without repeating source metadata. */
.assistant-heading{padding-bottom:8px}
.assistant-heading h2{margin:0;font-size:13px}
.conversation{gap:13px;padding:8px 3px 14px}
.conversation-welcome{max-width:250px;padding:24px 10px;color:#8a968b}
.conversation-welcome p{margin:0;font-size:10px;line-height:1.7;white-space:pre-wrap}
.chat-turn{display:flex;flex-direction:column;align-items:stretch;gap:7px;width:100%;min-width:0}
.chat-context{align-self:flex-end;width:min(92%,300px);min-width:0;color:#899489}
.chat-context-summary{display:flex;align-items:center;gap:6px;min-width:0;list-style:none;cursor:pointer;font-size:9px;line-height:1.5}
.chat-context-summary::-webkit-details-marker{display:none}
.chat-context-summary::before{content:"↳";flex:none;color:#a7b1a5}
.chat-context-preview{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-context-count,.chat-context-expand{flex:none;color:#9aa59a;font-size:8px}
.chat-context-full{max-height:150px;overflow:auto;margin-top:5px;padding:7px 9px;border-left:2px solid #dfe7db;background:#f3f5ef;color:#68776a;font-size:10px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.chat-context-full p{margin:0 0 7px}.chat-context-full p:last-child{margin-bottom:0}
.chat-question-group{display:flex;flex-direction:column;align-items:flex-end;gap:5px;max-width:100%}.chat-context-location{display:block;margin-bottom:5px;color:#87958a;font-size:10px}
.user-message{align-self:flex-end;max-width:88%;margin:0;padding:7px 10px;border-radius:12px 12px 3px 12px;background:#edf2e9;color:#354a39;font-size:11px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}
.assistant-message{align-self:flex-start;max-width:100%;margin:0;padding:1px 2px 1px 0;color:#344438;font-size:11px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}
.assistant-message .assistant-answer{margin:0;font:inherit;white-space:pre-wrap;overflow-wrap:anywhere}
.assistant-message.is-loading{color:#94a093;font-size:10px}
.assistant-message-error{color:#9a493f;font-size:10px}
.assistant-message-error .assistant-settings-link{margin-top:5px;padding:0;border:0;background:transparent;color:#55775a;font:inherit;text-decoration:underline;cursor:pointer}
.question-form{margin-top:8px;padding:9px 10px;border:0;border-top:1px solid #e5e9e1;border-radius:0;background:#f7f8f3;box-shadow:none}
.composer-selection{display:flex;align-items:center;gap:7px;margin:0 0 6px;padding:2px 1px;border:0;border-radius:0;background:transparent}
.composer-selection-label{flex:none;font-size:9px;font-weight:600;color:#879487}
.preview-empty{flex:1;min-width:0;margin:0;color:#849084;font-size:9px;line-height:18px}
.selection-preview{flex:1;min-width:0}
.selection-preview[hidden],.preview-empty[hidden]{display:none}
.preview-summary{display:flex;align-items:center;gap:6px;min-width:0;list-style:none;cursor:pointer;font-size:9px;line-height:18px}
.preview-summary::-webkit-details-marker{display:none}
.preview-copy{flex:1;min-width:0;max-height:18px;margin:0;color:#849084;font-size:9px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.preview-count,.preview-expand-label{flex:none;color:#9aa59a;font-size:8px;white-space:nowrap}
.preview-full{max-height:130px;overflow:auto;margin-top:4px;padding:6px 8px;border-left:2px solid #dfe7db;background:#f3f5ef;color:#68776a;font-size:9px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
.preview-full p{margin:0 0 6px}.preview-full p:last-child{margin-bottom:0}
.reference-composer-row{margin-bottom:3px}
.question-form textarea{min-height:46px;max-height:120px;resize:vertical}
.question-form .form-footer{justify-content:flex-end;margin-top:2px}
.sent-label,.sent-question,.sent-message,.sent-message ol,.assistant-response{display:none}

/* Slim reader toolbar and the selected B chat treatment. */
.toolbar-actions .toolbar-return-upload{flex:none;margin:0;padding:8px 10px;white-space:nowrap}
.assistant-panel{gap:0;padding:15px 15px 13px}
.conversation{flex:1;min-height:0;gap:12px;padding:5px 3px 14px}
.user-message{max-width:92%;padding:9px 12px;border:1px solid #eadfd2;border-radius:15px 15px 4px 15px;background:#f2e7db;color:#493e34;font-size:11px;line-height:1.7}
.assistant-message.has-answer{width:100%;max-width:100%;padding:10px 12px;border:1px solid #dce8d8;border-radius:11px;background:#edf3e9;color:#344438}
.assistant-message .assistant-answer{display:block;min-height:1.5em}
.question-form{flex:none;margin-top:9px;padding:10px 11px;border:1px solid #dfe7dc;border-radius:14px;background:#fff;box-shadow:0 4px 16px #314b3510}
.question-form:focus-within{border-color:#b8ccb4;box-shadow:0 0 0 3px #eaf0e588,0 4px 16px #314b3510}
.question-form textarea{min-height:56px;padding:5px 2px}
.reference-composer-row{margin-bottom:3px}
#quote-menu-trigger[hidden]{display:none}
.preview-summary:focus-visible,.chat-context-summary:focus-visible{outline:2px solid #8eae8d;outline-offset:2px;border-radius:4px}
.chat-context-summary{min-height:20px}
.chat-context-full{max-height:min(220px,40vh)}
.excerpt-hover-card{position:fixed;z-index:80;overflow:auto;padding:11px 13px;border:1px solid #dce7d8;border-radius:11px;background:#fffefa;color:#435247;box-shadow:0 12px 34px #253d2b30;font-size:11px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;overscroll-behavior:contain}
.excerpt-hover-card[hidden]{display:none}
.excerpt-hover-card p{margin:0 0 9px}.excerpt-hover-card p:last-child{margin-bottom:0}
@media(max-width:850px){.assistant-panel{gap:0}.conversation{min-height:260px}.question-form{position:sticky;bottom:0;z-index:12;margin-top:8px;background:#fff;box-shadow:0 -4px 18px #314b3510}}
@media(max-width:430px){.toolbar-actions .toolbar-return-upload{height:32px;padding:6px 8px;font-size:9px}.assistant-panel{min-height:530px}.conversation{min-height:240px}.question-form{padding:8px 9px}}

/* DeepLeaf brand marks: one scalable symbol across the entry and reading views. */
.brand-mark{display:block;flex:none;width:36px;height:30px;object-fit:contain}
.upload-header .brand-symbol-only{width:38px;height:38px;justify-content:center}
.upload-header .brand-symbol-only .brand-mark{width:34px;height:28px}
.upload-brand-lockup{display:flex;align-items:center;gap:13px;margin:0 0 22px;color:var(--green-strong)}
.upload-brand-lockup .brand-mark{width:66px;height:54px}

.chapter-library-button{display:block;width:100%;margin:7px 0 18px;padding:9px 10px;border:1px solid #dce6d8;border-radius:9px;background:#fff;color:#486d4c;text-align:left;font:inherit;font-size:10px;font-weight:600;line-height:1.4;cursor:pointer}
.chapter-library-button:hover:not(:disabled){background:#f0f5ed}
.chapter-library-button:disabled{opacity:.55;cursor:not-allowed}
.reader-library-dialog{width:min(460px,calc(100vw - 28px));max-width:none;max-height:min(82dvh,620px);padding:0;border:1px solid #dce6d8;border-radius:15px;background:#fffefa;color:var(--ink);box-shadow:0 18px 60px #263d2b30;overflow:auto}
.reader-library-dialog::backdrop{background:#1a261db8}
.reader-library-content{display:grid;gap:10px;padding:20px}
.reader-library-content header{display:flex;align-items:center;justify-content:space-between;margin-bottom:5px}
.reader-library-content h2{margin:4px 0 0;font:600 19px/1.35 'Noto Sans SC','Microsoft YaHei',sans-serif}
.reader-library-content header button{width:30px;height:30px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--muted);font-size:20px;cursor:pointer}
 .reader-library-content>label,.reader-library-version-admin>label,.reader-library-book-rename>label{font-size:10px;font-weight:700;color:#657768}
 .reader-library-content select,.reader-library-version-admin input,.reader-library-book-rename input{width:100%;min-width:0;padding:9px 10px;border:1px solid #dce5d8;border-radius:8px;background:#fff;color:var(--ink);font:inherit;font-size:12px}
 .reader-library-book-rename{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:7px;margin-top:3px}
 .reader-library-book-rename>label{grid-column:1/-1}
 .reader-library-book-rename .quiet-button{min-height:36px;padding:7px 10px;border:1px solid #dce6d8;border-radius:7px;background:#fff;color:#496c4c;font:inherit;font-size:10px;font-weight:600;line-height:1.4;cursor:pointer}
 .reader-library-book-rename .quiet-button:disabled{opacity:.55;cursor:not-allowed}
.reader-library-version-admin{display:grid;gap:8px;margin-top:4px;padding:12px;border:1px solid #e4eae0;border-radius:10px;background:#f7f9f4}
.reader-library-version-admin[hidden]{display:none}
.reader-library-version-admin>div{display:flex;flex-wrap:wrap;gap:7px}
.reader-library-version-admin .quiet-button{padding:7px 9px;border:1px solid #dce6d8;border-radius:7px;background:#fff;color:#496c4c;font:inherit;font-size:10px;font-weight:600;line-height:1.4;cursor:pointer}
.reader-library-status{min-height:18px;margin:0;color:#7e8a7f;font-size:10px;line-height:1.6}
.reader-library-status.is-error{color:#a34e44}
.reader-library-content footer{display:flex;justify-content:flex-end;margin-top:2px}
.reader-library-content footer .primary-upload-button{min-width:112px;padding:9px 16px}
@media(max-width:850px){.chapter-library-button{margin:0 0 10px}.reader-library-content{padding:16px}}
.upload-brand-name{display:flex;align-items:baseline;gap:11px}
.upload-brand-name b{font-size:25px;letter-spacing:.05em}
.upload-brand-name small{font-family:Georgia,serif;font-size:18px;letter-spacing:.01em}
.brand-positioning{max-width:550px;margin:0 0 23px!important;color:#315d3d!important;font-size:clamp(15px,1.45vw,18px)!important;font-weight:650;line-height:1.7!important}
.upload-copy>.overline{display:block}
.upload-copy h1{margin-top:12px}
.toolbar-brand{display:flex;align-items:center;gap:7px;flex:none;padding-right:14px;border-right:1px solid var(--line);color:var(--green-strong)}
.toolbar-brand .brand-mark{width:30px;height:25px}
.toolbar-brand-name{display:flex;flex-direction:column;gap:2px;line-height:1}
.toolbar-brand-name b{font-size:12px;letter-spacing:.04em}
.toolbar-brand-name small{color:#788a7a;font-family:Georgia,serif;font-size:8px;letter-spacing:.02em}
@media(max-width:1180px){.toolbar{flex-wrap:wrap;gap:8px 12px}.toolbar-brand{padding-right:10px}.book-title{min-width:130px;flex:0 1 clamp(130px,17vw,190px);width:auto}.toolbar-actions{margin-left:auto}}
@media(max-width:850px){.upload-brand-lockup{justify-content:center;margin-bottom:17px}.brand-positioning{margin-inline:auto!important;font-size:15px!important}.toolbar-brand{gap:5px;padding-right:9px}.toolbar-brand .brand-mark{width:26px;height:22px}.toolbar-brand-name{gap:2px}.toolbar-brand-name b{font-size:11px}.toolbar-brand-name small{font-size:7px}.book-title{flex:1 1 160px;width:auto;max-width:100%;min-width:0}}
@media(max-width:430px){.upload-header .brand-symbol-only{width:31px;height:31px}.upload-header .brand-symbol-only .brand-mark{width:29px;height:24px}.upload-brand-lockup{gap:9px}.upload-brand-lockup .brand-mark{width:54px;height:44px}.upload-brand-name{gap:8px}.upload-brand-name b{font-size:22px}.upload-brand-name small{font-size:16px}.brand-positioning{font-size:14px!important;line-height:1.65!important}.toolbar{gap:7px 8px}.toolbar-brand{gap:4px;padding-right:7px}.toolbar-brand .brand-mark{width:23px;height:20px}.toolbar-brand-name b{font-size:10px}.toolbar-brand-name small{font-size:6.5px}.book-title{flex:1 1 150px;width:auto;max-width:100%;min-width:0}}

.visitor-auth-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 9px;border:1px solid #e2e9de;border-radius:8px;background:#fff;color:#748174;font-size:10px}
.visitor-auth-bar>div{display:flex;gap:5px}
.visitor-auth-bar button,.visitor-auth-switch{border:0;background:transparent;color:var(--green-strong);font:inherit;font-size:10px;text-decoration:underline;cursor:pointer}
.visitor-auth-dialog{width:min(380px,calc(100vw - 32px));padding:22px;border:1px solid #dce6d8;border-radius:14px;background:#fffefa;color:var(--ink);box-shadow:0 18px 60px #263d2b35}
.visitor-auth-dialog::backdrop{background:#24332966;backdrop-filter:blur(2px)}
.visitor-auth-dialog h2{margin:0 32px 8px 0;font-size:17px}
.visitor-auth-dialog>p{color:#758276;font-size:11px;line-height:1.7}
.visitor-auth-close{position:absolute;right:12px;top:10px}
.visitor-auth-close button{border:0;background:transparent;color:#798579;font-size:22px;cursor:pointer}
.visitor-auth-dialog label{display:block;margin:14px 0 5px;font-size:11px;font-weight:700}
.visitor-auth-dialog input{width:100%;padding:10px;border:1px solid #cbd9c8;border-radius:8px;background:#fff;font:inherit;font-size:12px;outline-color:#7e9f7a}
.visitor-auth-error{min-height:16px;margin:8px 0;color:#a2463d;font-size:10px}
.visitor-auth-submit{width:100%;padding:9px;border:1px solid #426c49;border-radius:7px;background:#426c49;color:#fff;font:inherit;font-size:11px;cursor:pointer}
.visitor-auth-switch{display:block;margin:12px auto 0}
.home-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;min-width:0}
.home-nav-button{flex:none;width:auto;height:40px;min-height:40px;padding:0 18px;border:1px solid transparent;border-radius:999px;font:inherit;font-size:12px;font-weight:700;white-space:nowrap;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}
.home-nav-button:hover{transform:translateY(-1px)}
.home-nav-button:focus-visible{outline:2px solid #6b916e;outline-offset:2px}
.home-entry-button{border-color:#e2eadc;background:#edf3e8;color:#315d3d}
.home-entry-button:hover{background:#e4eddd}
.home-login-button{border-color:#55745b;background:transparent;color:#315d3d}
.home-login-button:hover{background:#f2f6ef}
.home-register-button{border-color:#396b47;background:#396b47;color:#fff}
.home-register-button:hover{background:#315f3e}
.home-header-actions [hidden],.home-auth-form[hidden],.home-auth-notice[hidden]{display:none}
.home-account{max-width:1120px;margin:0 auto;padding:0 28px}
.home-auth-help{margin:5px 0 0;color:#879387;font-size:10px;line-height:1.65}
.home-auth-form{position:fixed;top:76px;left:12px;z-index:40;width:min(360px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow-y:auto;margin:0;padding:14px;border:1px solid #dfe7db;border-radius:14px;background:#fff;box-shadow:0 14px 36px #263d2b24}
.home-auth-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:7px}
.home-auth-fields label{color:#607263;font-size:10px;font-weight:700}
.home-auth-fields label,.home-auth-fields input{grid-column:1/-1}
.home-auth-fields input{width:100%;min-width:0;height:38px;padding:0 10px;border:1px solid #cbd9c8;border-radius:8px;background:#fff;color:var(--ink);font:inherit;font-size:11px;outline-color:#7e9f7a}
.home-auth-fields button{width:100%;min-width:0;min-height:36px;padding:0 8px;font-size:10px}
.home-auth-help{margin-top:10px}
.home-auth-notice{margin:9px 0 0;padding:10px 13px;border:1px solid #eadfbe;border-radius:9px;background:#fffaf0;color:#795f2b;font-size:11px;line-height:1.6}
.visitor-auth-error{min-height:0;margin:7px 0 0;color:#a2463d;font-size:10px}
.visitor-home-link{border:0;background:transparent;color:var(--green-strong);font:inherit;font-size:10px;text-decoration:underline;cursor:pointer}
@media(max-width:319px){body:has(#upload-home:not([hidden])){min-width:0}}
@media(max-width:850px){.upload-header{padding-inline:18px}.home-header-actions{gap:8px}.home-nav-button{height:38px;min-height:38px;padding-inline:14px}.home-account{padding-inline:22px}}
@media(max-width:540px){.upload-header{padding-inline:13px}.home-header-actions{gap:6px}.home-nav-button{height:36px;min-height:36px;padding-inline:10px;font-size:10px}.home-account{padding:0 16px}.home-auth-form{padding:13px}.home-auth-fields{grid-template-columns:1fr}.home-auth-fields button{grid-column:auto}}
.reader-panel{padding-right:max(56px,clamp(28px,4.2vw,68px))}
.reader-bookmark-tab{position:fixed;z-index:14;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:6px;width:30px;height:82px;padding:7px 4px;border:1px solid #d7e3d2;border-right:0;border-radius:10px 0 0 10px;background:#f3f7f0;color:#476d4b;box-shadow:0 5px 16px #263d2b18;font:700 9px/1.2 'DM Sans','Noto Sans SC',sans-serif;white-space:nowrap;writing-mode:vertical-rl;text-orientation:mixed;cursor:pointer}
.reader-bookmark-tab:hover{background:#eaf2e6;border-color:#cbdcc6}
.reader-bookmark-tab:focus-visible{outline:2px solid #6b916e;outline-offset:2px}
.reader-bookmark-tab[hidden]{display:none}
@media(max-width:1120px){.reader-panel{padding-right:58px}}
@media(max-width:850px){.reader-panel{padding-right:42px}}
@media(max-width:430px){.reader-panel{padding-right:38px}}
.translation-control{display:flex;align-items:center;justify-content:center;flex:none;min-width:0}.translation-batch-button{height:36px;padding:0 13px;border:1px solid var(--green-strong);border-radius:9px;background:var(--green);color:#fff;font:700 11px/1 'DM Sans','Noto Sans SC',sans-serif;white-space:nowrap;cursor:pointer;box-shadow:0 2px 7px #315d3d20}.translation-batch-button:hover{background:var(--green-strong)}.translation-batch-button:focus-visible{outline:2px solid #99b891;outline-offset:2px}.translation-batch-button:disabled{opacity:.62;cursor:wait}.translation-control .reader-translation-progress{position:static;min-width:68px;margin:0}.translation-batch-button[hidden],.translation-control .reader-translation-progress[hidden]{display:none}@media(max-width:850px){.translation-control{order:4}.search-box{order:5;flex:1 1 160px;min-width:100px}}@media(max-width:430px){.translation-batch-button{height:32px;padding:0 9px;font-size:9px}.translation-control .reader-translation-progress{height:30px}}
.reader-translation-progress.is-busy .reader-translation-pie{position:relative;width:18px;height:18px;background:transparent;animation:reader-translation-wait .9s linear infinite}.reader-translation-progress.is-busy .reader-translation-pie::after{position:absolute;top:0;left:50%;width:6px;height:6px;border-radius:50%;background:#3e6b49;content:"";transform:translateX(-50%)}.reader-translation-progress.is-complete .reader-translation-pie{background:#3e6b49}@keyframes reader-translation-wait{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.reader-translation-progress.is-busy .reader-translation-pie{animation:none}}
.translation-control{gap:6px;flex:0 0 auto}.translation-control .translation-batch-button{padding-inline:10px}.chapter-import-button{display:block;width:100%;height:30px;margin:0 0 9px;padding:0 10px;border:1px solid #dce5d8;border-radius:8px;background:#fff;color:var(--green-strong);font:600 10px/1 'DM Sans','Noto Sans SC',sans-serif;text-align:left;cursor:pointer}.chapter-import-button:hover{background:#f4f7f1}.chapter-import-button:focus-visible{outline:2px solid #99b891;outline-offset:2px}.chapter-import-button:disabled{opacity:.62;cursor:wait}@media(max-width:430px){.translation-control{gap:5px}.translation-control .translation-batch-button{height:32px;padding-inline:7px;font-size:9px}.chapter-import-button{height:29px}}


/* DeepLeaf warm-paper reading theme. Scoped to the active reader; paint-only values preserve layout. */
body:has(#reader-app:not([hidden])) {
  --ink:#163e30; --muted:#869180; --line:#dcd4bf; --paper:#fffaf0; --canvas:#f3eee3;
  --green:#2d5c41; --green-strong:#244d37; --green-soft:#eee9db; --sage:#9b8a66; --gold:#b89557;
  --reader-side:#f8f6ec; --reader-toolbar:#fffdf7; --reader-translation:#f4f0e5; --reader-page-line:#dfd1b5;
}
body:has(#reader-app:not([hidden])) .toolbar,
body:has(#reader-app:not([hidden])) .visitor-auth-bar,
body:has(#reader-app:not([hidden])) .question-form,
body:has(#reader-app:not([hidden])) .reader-library-dialog,
body:has(#reader-app:not([hidden])) .visitor-auth-dialog {background-color:var(--reader-toolbar);border-color:var(--line);color:var(--ink)}
body:has(#reader-app:not([hidden])) .chapter-panel,
body:has(#reader-app:not([hidden])) .assistant-panel {background-color:var(--reader-side);border-color:var(--line)}
body:has(#reader-app:not([hidden])) .reader-panel {
  background-color:#e9dfca;
  background-image:linear-gradient(90deg,#c4a66d 0,#ddc99e 4px,#f2e5c8 9px,transparent 15px),linear-gradient(#fffaf0,#fffaf0);
  background-size:15px calc(100% - 28px),calc(100% - 29px) calc(100% - 28px);
  background-position:14px 14px,29px 14px;background-repeat:no-repeat;
  box-shadow:inset 0 0 24px #735f3b12;
}
body:has(#reader-app:not([hidden])) .passage {border-color:#e7dec9}
body:has(#reader-app:not([hidden])) .passage-copy .english {color:#294638}
body:has(#reader-app:not([hidden])) .passage[data-block-type="document-title"] .english {color:#173d2f}
body:has(#reader-app:not([hidden])) .passage[data-block-type="author-name"] .english {color:#3b5945}
body:has(#reader-app:not([hidden])) .passage-copy .translation {background:var(--reader-translation);border-color:#b99a61;color:#61745d}
body:has(#reader-app:not([hidden])) .chapter-link.current {background:#f0ebdd;border-color:#e0d5bf}
body:has(#reader-app:not([hidden])) .mode-switch {background:#f7f2e8;border-color:var(--line)}
body:has(#reader-app:not([hidden])) .mode-button.active {background:var(--green-soft);color:var(--green-strong)}
body:has(#reader-app:not([hidden])) .search-box,
body:has(#reader-app:not([hidden])) .side-entry,
body:has(#reader-app:not([hidden])) .icon-button {background-color:var(--reader-toolbar);border-color:var(--line);color:#405744}
body:has(#reader-app:not([hidden])) .chapter-library-button,
body:has(#reader-app:not([hidden])) .chapter-import-button {color:var(--green)}
body:has(#reader-app:not([hidden])) .progress-track {background:#e7e0d1}
body:has(#reader-app:not([hidden])) .reader-bookmark-tab {background:#eee9db;border-color:#d9c9a8;color:var(--green)}
body:has(#reader-app:not([hidden])) .assistant-heading {background:#f8f6ec}
body:has(#reader-app:not([hidden])) .assistant-intro {background:#f4f0e5;border-color:#e2d6bd}
body:has(#reader-app:not([hidden])) .question-form {box-shadow:0 4px 16px #66564012}
body:has(#reader-app:not([hidden])) .user-message {background:#f2e7db;border-color:#eadfd2;color:#493e34}
body:has(#reader-app:not([hidden])) .assistant-message.has-answer {background:#edf3e9;border-color:#dce8d8;color:#344438}
body:has(#reader-app:not([hidden])) .article-footer {border-color:var(--line);color:#7c826f}
body:has(#reader-app:not([hidden])) .reader-bookmark-tab {box-shadow:0 4px 10px #66564014}
:root{--cloud-preview-notice-height:28px}.cloud-preview-notice{position:relative;z-index:30;padding:6px 12px;background:#eef4e9;border-bottom:1px solid #d5e1d2;color:#426d4d;text-align:center;font:12px/1.35 system-ui,sans-serif;letter-spacing:.01em}
