/* Source-grounded research workspace. */
.library-notebook{--lib-line:#e3e7ee;--lib-muted:#788394;--lib-ink:#243244;display:flex;flex-direction:column;height:calc(100dvh - 52px);min-height:650px;color:var(--lib-ink);font-size:13px}.library-page button{font:inherit;font-size:13px;cursor:pointer;border:1px solid var(--lib-line);border-radius:9px;background:#fff;color:var(--lib-ink);padding:8px 12px;transition:background .15s}.library-page button:hover{background:#f0f3f8}.library-page button.primary{background:#2c5eea;border-color:#2c5eea;color:#fff}.library-page button:disabled{opacity:.5;cursor:wait}.library-page input,.library-page select,.library-page textarea{font:inherit;font-size:13px;min-width:0;border:1px solid var(--lib-line);border-radius:8px;padding:9px;background:#fff;color:var(--lib-ink)}.library-page input[type=checkbox]{width:15px;height:15px;accent-color:#3565df;flex:none;padding:0}.library-page textarea{resize:vertical}.library-page progress{height:5px;border:0;border-radius:20px;background:#e9ecf2;overflow:hidden;width:100%;accent-color:#3969e9}.library-page progress::-webkit-progress-bar{background:#e9ecf2}.library-page progress::-webkit-progress-value{background:#3969e9;border-radius:20px}.library-heading,.library-heading>div{display:flex;align-items:center;gap:10px}.library-heading{justify-content:space-between;margin-bottom:18px;flex:none}.library-logo{font-size:22px;color:#4c6bd3;background:#e8edff;border-radius:12px;padding:7px 10px}.library-heading h1{font-size:22px;font-weight:600;margin:0}.library-heading small{font-size:12px;font-weight:400;color:var(--lib-muted);margin-left:12px}.library-heading-count{font-size:12px;color:var(--lib-muted)}.library-workspace{display:grid;grid-template-columns:270px minmax(280px,1fr) 228px;gap:12px;min-height:0;flex:1}.library-workspace>aside,.library-chat{background:white;border:1px solid var(--lib-line);border-radius:16px;min-width:0;overflow:hidden}.library-sources{display:flex;flex-direction:column;padding:16px 12px 12px}.library-sources>header,.library-chat>header,.library-studio>header,.library-notes>header{display:flex;align-items:center;justify-content:space-between;gap:8px}.library-workspace h2{font-size:15px;font-weight:600;margin:0}.library-sources>header{padding:0 4px 16px}.library-sources h2 span{color:#97a1b2;margin-left:6px;font-size:12px}.library-source-mark{font-size:20px;color:#8b96a8}.library-source-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:12px}.library-source-actions button{padding:9px 5px;font-size:12px;border-radius:20px}.library-classify{border-bottom:1px solid var(--lib-line);padding-bottom:10px;margin:0 2px 10px}.library-classify summary{font-size:12px;cursor:pointer;color:#61718b}.library-classify label{display:flex;align-items:center;gap:6px;font-size:11px;margin-top:8px}.library-classify select{flex:1;font-size:11px;padding:6px;width:100%}.library-classify>div{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.library-classify button{padding:4px 6px;font-size:11px}.library-sources #library-search{display:flex;gap:4px;margin-bottom:10px}.library-sources #library-search input{width:100%;font-size:12px;background:#f8f9fc}.library-sources #library-search button{font-size:19px;padding:4px 9px;border:0}.library-select-all{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#8190a6;padding:5px 5px 10px}.library-select-all label{display:flex;align-items:center;gap:7px}.library-items{overflow:auto;min-height:80px;flex:1}.library-source-row{display:flex;align-items:center;gap:6px;border-radius:9px;padding-right:8px;margin-bottom:3px}.library-source-row:hover,.library-source-row.active{background:#f0f4fd}.library-page .library-card{display:flex;align-items:center;gap:10px;border:0;flex:1;min-width:0;background:transparent;text-align:left;padding:12px 5px}.library-card>span:last-child{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}.library-card strong{font-size:12px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.library-card small{font-size:10px;color:#909aab}.library-type{font-size:9px!important;min-width:28px;height:29px;border-radius:7px;background:#edf0f5;color:#62718a;display:flex;align-items:center;justify-content:center;font-weight:700;flex:none}.library-type-pdf{background:#fff0ed;color:#d96b56}.library-type-doc,.library-type-docx{background:#eaf1ff;color:#5681cf}.library-type-img{background:#ecf6f0;color:#49a27b}.library-type-web{background:#eeeaff;color:#8769c6}.library-source-empty{text-align:center;color:#7f8ca1;font-size:12px;padding:36px 8px;line-height:1.9}.library-source-empty p{font-size:11px}.library-sources>footer{border-top:1px solid var(--lib-line);margin-top:10px;padding-top:10px;font-size:10px;color:#8793a8;flex:none;max-height:55%;overflow:auto}.library-sources>footer>progress{display:block;margin-top:8px}.library-settings{margin-top:12px}.library-settings summary{cursor:pointer;font-size:11px}.library-settings>label{display:flex;flex-direction:column;gap:6px;margin:10px 0;font-size:12px}.library-settings p{font-size:11px;line-height:1.7}.library-settings select{width:100%}.library-settings .chatgpt-connection{margin-top:8px;padding:10px;border-radius:10px}.library-settings .chatgpt-connection h3{font-size:13px}.library-settings button{font-size:11px;padding:6px}.library-settings .chatgpt-connection label{display:flex;flex-direction:column}.library-chat{display:flex;flex-direction:column}.library-chat>header{padding:16px 20px;border-bottom:1px solid var(--lib-line);flex:none}.library-chat>header>div{display:flex;gap:6px}.library-chat>header button{border:0;font-size:11px;color:#7c8aa0;padding:4px 6px}.library-chat-body{flex:1;min-height:200px;overflow:auto;padding:18px 22px}.library-welcome{margin:9vh auto 35px;max-width:540px}.library-welcome-icon{display:inline-flex;width:56px;height:56px;align-items:center;justify-content:center;background:#f0edfe;color:#9a82d2;border-radius:17px;font-size:30px;margin-bottom:18px}.library-eyebrow{text-transform:uppercase;letter-spacing:2px;font-size:11px;color:#8492aa}.library-chat .library-welcome h2{font-size:clamp(23px,2.2vw,34px);font-weight:500;line-height:1.65;letter-spacing:-.7px;margin:14px 0}.library-welcome>p:not(.library-eyebrow){color:#8390a4;font-size:12px;line-height:2}.library-welcome-tags{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.library-welcome-tags span{font-size:10px;color:#818da3;border:1px solid #e7ebf2;border-radius:20px;padding:5px 9px}.library-composer-wrap{padding:10px 18px 12px;flex:none}.library-composer{background:#f4f6fa;border:1px solid #edf0f6;border-radius:20px;padding:11px 14px}.library-page .library-composer textarea{border:0;background:transparent;box-shadow:none;width:100%;resize:none;max-height:170px;min-height:54px;outline:none;font-size:12px;line-height:1.7;padding:2px}.library-composer>div{display:flex;justify-content:space-between;align-items:center;margin-top:4px}.library-composer span{font-size:10px;color:#909bb0}.library-composer button{width:34px;height:34px;border-radius:50%;padding:0;font-size:20px}.library-disclaimer{font-size:10px;color:#9aa4b4;text-align:center;margin:8px 0 0;line-height:1.7}.library-disclaimer span{display:block}.library-error{font-size:12px;color:#bd4a4a;line-height:1.7}.library-thinking{font-size:12px;color:#7f6ab5;padding:15px 0}.library-message{padding:15px 0;overflow-wrap:anywhere;font-size:13px;line-height:1.9}.library-message>header{display:flex;justify-content:space-between;align-items:center;font-size:11px;margin-bottom:8px;color:#7d8ba1;gap:10px}.library-message>header button{font-size:10px;padding:3px 8px;border-radius:15px;color:#7890b0}.library-message-user{background:#f3f6fb;border-radius:14px;padding:12px 16px;margin:10px 0}.library-message-body h1,.library-message-body h2,.library-message-body h3{font-size:16px;margin:18px 0 8px}.library-message-body p{margin:8px 0}.library-message-body pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#f5f6fa;padding:10px;border-radius:8px}.library-message-body a{color:#416ed4}.library-message-body table{border-collapse:collapse;width:100%;font-size:12px}.library-message-body td,.library-message-body th{border:1px solid #e2e7ef;padding:8px}.library-message-body th{background:#f5f7fc}.library-message-body .library-table-scroll{overflow:auto}.library-message-body td p,.library-message-body th p{margin:0}.library-citations{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.library-citations button{font-size:10px;padding:4px 8px;border-radius:15px;background:#eff4ff;color:#587bbf;text-align:left;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.library-studio{padding:16px 14px;overflow:auto!important}.library-studio>p{font-size:11px;color:#9aa5b5;margin:14px 0}.library-tools{display:grid;gap:10px}.library-page .library-tool{display:grid;grid-template-columns:30px 1fr;text-align:left;padding:16px 12px;align-items:center;gap:5px 8px;border:0;background:#f2effb;border-radius:13px}.library-tool>span{grid-row:span 2;font-size:24px;color:#8c75b9}.library-tool strong{font-weight:500;font-size:12px}.library-tool small{font-size:10px;color:#9690a9}.library-page .library-tool-compare{background:#eaf3fa}.library-tool-compare>span{color:#7a9cbe}.library-tool-compare small{color:#8b9bb0}.library-page .library-tool-outline{background:#edf5ee}.library-tool-outline>span{color:#7ea38b}.library-tool-outline small{color:#8f9f92}.library-notes{border-top:1px solid var(--lib-line);margin-top:22px;padding-top:16px}.library-notes h3{font-size:12px;font-weight:500;margin:0}.library-notes>header button{border:0;padding:0 4px;font-size:18px;color:#9aa5b5}.library-note-empty{font-size:11px;line-height:2;color:#a1aaba;text-align:center;padding:30px 0}.library-page .library-note{display:flex;flex-direction:column;text-align:left;width:100%;padding:12px 0;border:0;border-bottom:1px solid #eef1f5;border-radius:0;gap:5px}.library-note strong{font-size:11px;font-weight:400;overflow-wrap:anywhere}.library-note small{color:#a0aabb;font-size:10px}.library-studio .library-studio-note{line-height:1.9;margin-top:30px;color:#a4adbc}.library-source-dialog,.library-detail-dialog,.library-citation-dialog{border:0;box-shadow:0 20px 100px #15254438;border-radius:24px;max-height:90dvh;overflow:auto;color:var(--lib-ink);background:#fff}.library-source-dialog::backdrop,.library-detail-dialog::backdrop,.library-citation-dialog::backdrop{background:#111c3159}.library-source-dialog{width:min(820px,92vw);padding:28px;box-sizing:border-box}.library-source-dialog>header{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.library-source-dialog h2{font-size:22px;font-weight:500;margin:0}.library-source-dialog>header p{font-size:12px;color:#98a1b1;margin:10px 0 22px}.library-page .library-close{border:0;padding:0 4px;font-size:25px;line-height:1;background:transparent;color:#8893a5;float:right}.library-source-tabs{display:flex;gap:8px;margin-bottom:20px}.library-source-tabs button{border-radius:22px;padding:10px 18px}.library-source-tabs button[aria-pressed=true]{background:#eef2ff;border-color:#d8e1fc;color:#466bd1}.library-dropzone{border:1px dashed #dbe1eb;border-radius:18px;background:#fcfcfe;text-align:center;padding:32px 15px 28px;outline:none}.library-dropzone.dragging,.library-dropzone:focus-visible{background:#edf2ff;border-color:#708dea}.library-dropzone>span{font-size:28px;color:#929bad}.library-dropzone h3{font-size:16px;font-weight:500;margin:10px 0}.library-dropzone p{font-size:12px;color:#9ba4b3}.library-dropzone p button{border:0;color:#507bdb;padding:0 3px;background:none}.library-dropzone small{font-size:11px;color:#9ca5b6;line-height:2}.library-upload-target{display:flex;align-items:center;gap:10px;margin:20px 0;font-size:12px;color:#8e98ab}.library-upload-target select{width:240px;max-width:75%;padding:7px}.library-source-dialog>footer{display:flex;align-items:center;gap:15px;font-size:11px;color:#7f8ba0}.library-source-dialog>footer>progress{flex:1;height:7px}.library-source-dialog>footer>span{white-space:nowrap}.library-hint{font-size:11px;line-height:1.8;color:#95a0b2;margin-bottom:0}.library-source-form label{display:flex;flex-direction:column;gap:7px;font-size:12px;margin:12px 0}.library-source-form textarea{width:100%;min-height:150px}.library-source-form p{font-size:11px;color:#95a0b2}.library-source-form>button{margin-top:10px}.library-detail-dialog{width:min(680px,92vw);padding:24px}.library-detail{min-width:0}.library-detail>h2{font-size:19px;font-weight:500;margin:0 0 15px}.library-detail>label{display:flex;flex-direction:column;gap:7px;font-size:12px;margin:14px 0}.library-detail fieldset{border:1px solid var(--lib-line);border-radius:9px;font-size:12px}.library-detail legend{padding:0 5px;color:#8491a5}.library-check{display:inline-flex;gap:6px;align-items:center;margin:4px 12px 4px 0}.library-detail details{margin:16px 0}.library-detail details summary{font-size:12px;cursor:pointer}.library-detail textarea{width:100%;min-height:90px}.library-detail details textarea{min-height:260px}.library-detail p{font-size:11px;color:#8b98ad;line-height:1.8;overflow-wrap:anywhere}.library-detail>div{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.library-detail a{color:#5278c9;font-size:12px}.library-image{display:block;max-width:100%;max-height:260px;object-fit:contain;margin:10px auto}.library-citation-dialog{width:min(680px,92vw);padding:28px}.library-citation-dialog h2{font-size:20px;line-height:1.6;overflow-wrap:anywhere}.library-citation-dialog p{font-size:12px;color:#8a96a8;line-height:1.9}.library-citation-dialog blockquote{background:#f5f7fc;border-left:3px solid #adc0eb;border-radius:6px;margin:20px 0;padding:18px;white-space:pre-wrap;font-size:13px;line-height:1.9;overflow-wrap:anywhere}.assistant-library-list{max-height:210px;overflow:auto;display:grid;gap:8px}.assistant-library-list label{display:flex;gap:6px;align-items:start}.assistant-library-list input{width:auto}.assistant-library pre{max-height:240px;overflow:auto;white-space:pre-wrap;font-size:12px}
@media(max-width:1250px){.library-notebook{height:auto;min-height:calc(100dvh - 50px)}.library-workspace{grid-template-columns:250px minmax(0,1fr);flex:none}.library-sources,.library-chat{height:calc(100dvh - 130px);min-height:590px}.library-studio{grid-column:1/-1}.library-tools{grid-template-columns:repeat(3,minmax(0,1fr))}.library-studio>.library-studio-note{margin:10px 0}.library-notes{margin-top:14px}.library-note-empty{padding:12px}.library-welcome{margin-top:10vh}}
@media(max-width:700px){.library-notebook{min-height:0}.library-heading h1{font-size:19px}.library-heading small,.library-heading-count{display:none}.library-heading>div{gap:6px}.library-heading{gap:10px;margin-bottom:12px}.library-heading button{font-size:11px;padding:8px}.library-workspace{grid-template-columns:minmax(0,1fr);gap:10px}.library-sources{height:auto;min-height:0;max-height:420px;padding:14px}.library-sources>header{padding-bottom:12px}.library-items{max-height:180px;min-height:70px}.library-sources>footer{max-height:150px}.library-sources>footer>progress{margin:5px 0}.library-settings{margin-top:8px}.library-chat{min-height:540px;height:70dvh}.library-chat-body{padding:12px 16px}.library-welcome{margin:35px 0}.library-chat .library-welcome h2{font-size:26px}.library-studio{grid-column:auto}.library-tools{gap:6px}.library-page .library-tool{grid-template-columns:1fr;padding:12px 8px;text-align:center}.library-tool>span{grid-row:auto}.library-tool small{display:none}.library-source-dialog{padding:22px 18px;border-radius:20px}.library-source-tabs{gap:5px}.library-source-tabs button{padding:9px 10px;font-size:11px}.library-dropzone{padding:23px 12px}.library-disclaimer{font-size:9px}.library-detail-dialog,.library-citation-dialog{padding:20px;box-sizing:border-box}.library-composer-wrap{padding:8px 12px 10px}}

/* Override application-wide footer rules inside notebook panels. */
.library-page .library-sources>footer{display:block;padding:10px 3px 0}.library-page .library-sources>footer>span{display:block}.library-page .library-source-dialog>footer{display:flex;padding:0;margin:0}.library-page .library-source-dialog>footer>span{display:inline}

/* Read-only previews stay alongside the conversation; settings use the context menu. */
.library-preview{padding:16px;overflow:auto!important;overflow-wrap:anywhere}.library-preview>header{display:flex;justify-content:space-between;align-items:center;gap:8px}.library-preview>header>div{display:flex;gap:4px}.library-preview>header button{padding:3px 7px}.library-preview h3{font-size:15px;line-height:1.7;margin:18px 0 8px}.library-preview-meta,.library-preview-warning{font-size:11px;color:#788394;line-height:1.8}.library-preview-text{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.9;background:#f8f9fc;border-radius:8px;padding:12px}.library-preview a{font-size:12px;color:#416ed4}.library-preview-notes{font-size:12px;line-height:1.8}.library-page .library-source-more{border:0;background:transparent;padding:4px;font-size:18px;color:#8190a6;flex:none}.library-source-row{gap:3px;padding-right:3px}
@media(min-width:1251px){.library-workspace:has(.library-preview){grid-template-columns:270px minmax(280px,1fr) minmax(280px,32%)}}
@media(max-width:1250px){.library-preview{grid-column:1/-1;max-height:65dvh}}
@media(max-width:700px){.library-preview{grid-column:auto;max-height:65dvh}}

.library-preview-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0}.library-preview-toolbar button{padding:4px 7px;font-size:11px}.library-original-frame{display:block;width:100%;height:65dvh;min-height:420px;border:1px solid #e3e7ee;border-radius:8px;background:#f5f6f9}.library-original-frame[hidden],.library-original-image[hidden]{display:none}.library-original-preview{min-width:0}.library-original-preview>[role=status],.library-original-preview>[role=alert]{font-size:12px;line-height:1.8;overflow-wrap:anywhere}.library-original-preview>[role=alert]{color:#b54a4a}.library-preview-fallback{margin:16px 0;font-size:12px}.library-preview-fallback summary{cursor:pointer;color:#7b8799}.library-image-viewport{overflow:auto;max-height:65dvh;background:#f4f5f8;border-radius:8px}.library-original-image{display:block;height:auto;max-width:none;margin:auto}.library-image-zoom-50{width:50%}.library-image-zoom-75{width:75%}.library-image-zoom-100{width:100%}.library-image-zoom-125{width:125%}.library-image-zoom-150{width:150%}.library-image-zoom-200{width:200%}.library-image-zoom-300{width:300%}.library-original-text{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.9}
.library-preview:has(.library-original-frame),.library-preview:has(.library-original-image){display:flex;flex-direction:column}.library-preview>h3,.library-preview>header,.library-preview>.library-preview-meta,.library-preview-toolbar{flex:none}.library-preview:has(.library-original-frame) .library-original-preview{flex:1;min-height:300px}.library-preview:has(.library-original-frame) .library-original-frame{height:100%;min-height:420px}
@media(min-width:1251px){.library-workspace:has(.library-preview .library-original-frame){grid-template-columns:250px minmax(280px,1fr) minmax(380px,45%)}}
@media(max-width:1250px){.library-preview:has(.library-original-frame),.library-preview:has(.library-original-image){max-height:none}.library-preview:has(.library-original-frame) .library-original-frame{height:65dvh}}

.library-type-filter{display:flex;gap:3px;margin:0 0 10px}.library-type-filter button{flex:1;padding:6px 3px;border:0;font-size:11px;background:#f5f7fa}.library-type-filter button[aria-pressed=true]{background:#eaf0ff;color:#3963c4}.library-type-filter small{font-size:10px;opacity:.7}.library-organize-help{font-size:10px;line-height:1.7;color:#8895a6;margin:8px 0}.library-type-笔记{background:#fff4db;color:#a3792c}.library-detail>label>textarea[name=text]{min-height:270px}

/* Folder navigation remains visible beside the source list. */
.library-folders{border-bottom:1px solid var(--lib-line);padding:0 2px 8px;margin-bottom:8px;min-height:0;flex:none}
.library-folders>header{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px;color:#65758e;font-size:11px}
.library-folders>header button{padding:1px 7px;font-size:17px;border:0;background:transparent}
.library-folder-tree{max-height:190px;overflow:auto;overscroll-behavior:contain}
.library-folder-tree ul{list-style:none;margin:0;padding:0}
.library-folder-tree ul ul{margin-left:11px;padding-left:9px;border-left:1px solid #e5eaf3}
.library-folder-tree ul[hidden]{display:none}
.library-folder-row{display:flex;align-items:center;min-width:0}
.library-page .library-folder-pick{display:flex;gap:7px;align-items:center;width:100%;min-width:0;border:0;border-radius:6px;padding:6px;font-size:12px;background:transparent;text-align:left}
.library-folder-pick[aria-current=true]{background:#eaf0ff;color:#315fc6;font-weight:600}
.library-page .library-folder-pick:hover{background:#f0f4fc}
.library-folder-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.library-folder-icon{color:#8c9bb2;font-size:15px;flex:none}
.library-folder-pick small{font-size:10px;color:#8f9bb0;font-weight:400}
.library-page .library-folder-toggle{width:20px;flex:none;border:0;background:transparent;padding:4px 0;color:#8796ac;font-size:12px}
.library-folder-spacer{width:20px;flex:none}
.library-folder-tools{display:flex;gap:4px;flex-wrap:wrap;padding-top:6px}
.library-folder-tools button{font-size:10px;padding:3px 5px}
.library-folder-tree button:focus-visible{outline:2px solid #6589e9;outline-offset:-2px}
@media(max-width:700px){.library-sources{max-height:640px}.library-folder-tree{max-height:150px}}

.library-page .library-delete-button{color:#bd4848;border-color:#efd8d8;background:#fff;padding:4px 7px;font-size:11px}

.library-card[draggable=true]{cursor:grab}
.library-source-dragging{opacity:.45}
.library-page .library-folder-pick.library-folder-drop{background:#e4edff;outline:2px solid #527fe0;outline-offset:-2px;color:#2858bd}
.library-drag-active .library-folder-pick:not([data-folder=""]){transition:background .12s,outline .12s}

/* Management actions live in the context menu; tags only retain filter controls. */
.library-classify .library-tag-list{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px;max-height:105px;overflow:auto}
.library-page .library-tag-list button{border:0;border-radius:5px;background:#f3f5f9;padding:4px 7px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
.library-page .library-tag-list button[aria-pressed=true]{background:#eaf0ff;color:#315fc6}
.library-folders>header{padding:2px 0 5px}
.library-folders:focus-visible{outline:2px solid #6589e9;outline-offset:2px}

.library-folder-memberships{max-height:220px;overflow:auto;display:grid;gap:4px}.library-folder-memberships .library-check{align-items:flex-start;overflow-wrap:anywhere}

/* Keep collection actions and counts together in the page toolbar. */
.library-heading{flex-wrap:wrap;gap:12px}
.library-heading>.library-heading-tools{gap:16px;flex-wrap:wrap;justify-content:flex-end}
.library-heading .library-type-filter{margin:0;gap:4px}
.library-heading .library-type-filter button{flex:none;padding:7px 12px;white-space:nowrap;border-radius:8px}
.library-heading .library-source-actions{display:flex;gap:8px;margin:0}
.library-heading .library-source-actions button{padding:9px 14px;border-radius:9px;white-space:nowrap;font-size:13px}
@media(max-width:700px){
 .library-heading>.library-heading-tools{width:100%;justify-content:space-between;gap:8px}
 .library-heading .library-type-filter{flex-wrap:wrap}
 .library-heading .library-type-filter button{padding:6px 8px;font-size:11px}
 .library-heading .library-type-filter small{display:inline;margin-left:3px}
 .library-heading .library-source-actions{margin-left:auto}
 .library-heading .library-source-actions button{padding:8px 10px;font-size:11px}
}

/* Start source navigation directly with folders, without a repeated panel title. */
.library-sources{padding-top:10px}

.library-source-row.library-picked{background:#e7efff;box-shadow:inset 3px 0 #547fe0}.library-card{user-select:none}.library-select-all [data-library-picked-status]{color:#3c68c5}

.library-select-all{flex-wrap:wrap;gap:4px}.library-select-all>span{min-width:0}

/* Resize in the existing column gaps without moving document viewers. */
.library-workspace{position:relative}
.library-column-resizer{display:none}
@media(min-width:1251px){
 .library-column-resizer{display:block;position:absolute;top:0;bottom:0;width:12px;z-index:6;cursor:col-resize;touch-action:none;border-radius:6px}
 .library-column-resizer:before{content:"";position:absolute;top:calc(50% - 24px);left:4px;width:4px;height:48px;border-radius:4px;background:#c3ccdb}
 .library-column-resizer:hover,.library-column-resizer:focus-visible{background:#e5edff;outline:none}
 .library-column-resizer:hover:before,.library-column-resizer:focus-visible:before,.library-columns-dragging .library-column-resizer:before{background:#527fe0}
 .library-column-shield{position:absolute;inset:0;z-index:5;cursor:col-resize}
 .library-columns-dragging{user-select:none;cursor:col-resize}
}

/* EndNote-inspired compact navigation, separate from full-text search. */
.library-folders{display:flex;flex-direction:column;max-height:48%;margin-bottom:6px;padding-bottom:6px}
.library-nav-scroll{min-height:0;overflow:auto;overscroll-behavior:contain}
.library-folder-tree{max-height:none;overflow:visible}
.library-folder-tree .library-permanent{padding-bottom:7px;border-bottom:1px solid var(--lib-line)}
.library-nav-heading{display:flex;justify-content:space-between;align-items:center;padding:7px 0 3px}
.library-page .library-nav-heading button{border:0;background:none;padding:3px 5px;font-size:11px;color:#65758e}
.library-page .library-nav-heading button:last-child{font-size:17px}
.library-my-groups[hidden]{display:none}
.library-nav-empty{font-size:11px;color:#95a0b1;padding:5px 8px;margin:0}
.library-folders .library-classify{position:relative;margin:5px 0 0;border-top:1px solid var(--lib-line);padding-top:7px}
.library-classify summary{font-size:11px;color:#65758e;padding:3px 30px 3px 4px;cursor:pointer}
.library-page .library-tag-add{position:absolute;right:0;top:5px;border:0;background:none;padding:0 5px;font-size:17px;color:#65758e}
.library-classify .library-tag-list{display:flex;flex-direction:column;gap:0;max-height:none;margin:4px 0}
.library-page .library-tag-list button{display:flex;align-items:center;gap:8px;width:100%;background:none;text-align:left;border-radius:5px;padding:5px 7px;font-size:12px}
.library-page .library-tag-list button:hover{background:#f0f4fc}
.library-tag-list small{color:#8f9bb0;font-size:10px}
.library-tag-dot{width:5px;height:14px;border-radius:3px;background:#64748b;flex:none}
#library-nav-search{display:flex;align-items:center;gap:5px;border:1px solid #e3e8f0;border-radius:6px;margin-top:6px;padding:2px 6px;color:#8a98ab}
.library-page #library-nav-search input{border:0;background:none;box-shadow:none;min-width:0;width:100%;font-size:11px;padding:4px 0}
.library-page #library-nav-search button{border:0;background:none;padding:0 3px}
@media(max-width:700px){.library-folders{max-height:260px}.library-nav-scroll{max-height:220px}}

.library-tag-dot[data-tag-color="#3b82f6"]{background:#3b82f6}
.library-tag-dot[data-tag-color="#10b981"]{background:#10b981}
.library-tag-dot[data-tag-color="#f59e0b"]{background:#f59e0b}
.library-tag-dot[data-tag-color="#ef4444"]{background:#ef4444}
.library-tag-dot[data-tag-color="#8b5cf6"]{background:#8b5cf6}

/* Independently resizable groups, tags, files and AI settings in the first column. */
.library-sources>.library-folders,.library-sources>.library-items,.library-page .library-sources>footer{flex:0 0 auto;min-height:0;max-height:none;box-sizing:border-box;margin:0}
.library-sources>.library-folders{padding:0;border:0;overflow:hidden}
.library-folders .library-nav-scroll{display:flex;flex-direction:column;flex:1;overflow:hidden;max-height:none}
.library-nav-scroll>.library-folder-tree{flex:0 0 auto;min-height:0;overflow:auto;overscroll-behavior:contain}
.library-folders .library-classify{flex:0 0 auto;box-sizing:border-box;min-height:0;margin:0;padding:3px 0 0;overflow:hidden}
.library-classify[open]{display:flex;flex-direction:column}
.library-classify summary{flex:none}
.library-classify .library-tag-list{min-height:0;overflow:auto;overscroll-behavior:contain}
.library-folders #library-nav-search{flex:none;margin:5px 0 0}
.library-sources>#library-search,.library-sources>.library-select-all{flex:none}
.library-page .library-sources>footer{padding:6px 3px 0;border:0;overflow:auto;overscroll-behavior:contain}
.library-height-resizer{height:10px;min-height:10px;flex:none;position:relative;cursor:row-resize;touch-action:none;border-radius:5px;outline:none}
.library-height-resizer:before{content:"";position:absolute;width:36px;height:3px;left:calc(50% - 18px);top:3px;background:#cbd4e2;border-radius:3px}
.library-height-resizer:hover,.library-height-resizer:focus-visible{background:#eaf0ff}
.library-height-resizer:hover:before,.library-height-resizer:focus-visible:before,.library-heights-dragging .library-height-resizer:before{background:#527fe0}
.library-nav-scroll:has(.library-classify:not([open]))>[data-height-divider="2"]{display:none}
.library-heights-dragging,.library-heights-dragging *{user-select:none!important;cursor:row-resize!important}
@media(max-width:700px){.library-sources{height:680px;min-height:0;max-height:none}}

/* Details content must have a bounded viewport rather than shrinking tag rows. */
.library-classify[open]{display:block}
.library-classify .library-tag-list{display:block;height:calc(100% - 30px);margin:0;max-height:none;overflow:auto}

.library-folder-pick[draggable=true]{cursor:grab}
.library-page .library-group-dragging{opacity:.45}
.library-page .library-group-drop{background:#e4edff!important;outline:2px solid #527fe0;outline-offset:-2px;border-radius:6px;color:#2858bd}

/* Shared reference table and Q&A workspace. */
.library-center-top{flex:0 0 auto;border-bottom:1px solid var(--border,#e2e8f0);padding:12px 14px 0;background:var(--surface,#fff)}
.library-center #library-search{display:flex;gap:6px;margin:0 0 10px;padding:0;background:none;border:0}
.library-center #library-search input{flex:1;min-width:0;border:1px solid #d9e2eb;border-radius:7px;padding:9px 11px;font:inherit;background:var(--surface,#fff);color:inherit}
.library-center #library-search button{flex:none;border:1px solid #d9e2eb;border-radius:7px;padding:7px 12px;background:#f8fafc;color:#475569;cursor:pointer}
.library-center-tabs{display:flex;align-items:center;gap:14px;min-width:0}
.library-center-tabs [role=tab]{border:0;border-bottom:2px solid transparent;background:none;padding:9px 1px;font-weight:600;color:#64748b;cursor:pointer;white-space:nowrap}
.library-center-tabs [aria-selected=true]{color:#0f766e;border-bottom-color:#0d9488}
.library-center-tabs>span{margin-left:auto;font-size:11px;color:#64748b;white-space:nowrap}
.library-records,.library-dialogue{flex:1;min-height:0;min-width:0;display:flex;flex-direction:column;overflow:hidden}
.library-center [hidden]{display:none!important}
.library-dialogue>header{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-bottom:1px solid #edf1f5;flex:none}
.library-dialogue>header h2{margin:0;font-size:14px}
.library-dialogue>header>div{display:flex;gap:6px}
.library-dialogue>header button{border:1px solid #dbe3eb;background:#fff;padding:5px 9px;border-radius:6px;color:#64748b;cursor:pointer}
.library-records .library-select-all{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px;padding:9px 12px;margin:0;flex:none;font-size:11px;border-bottom:1px solid #e8eef3}
.library-select-all>button{border:0;background:#e9f5f2;border-radius:5px;padding:5px 8px;color:#0f766e;cursor:pointer}
.library-records .library-items{flex:1;min-height:0;overflow:auto;padding:0;margin:0;max-height:none}
.library-record-table{border-collapse:separate;border-spacing:0;table-layout:fixed;width:100%;min-width:920px;font-size:12px;color:#475569}
.library-record-table caption{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.library-record-table th{position:sticky;top:0;z-index:1;background:#f3f6fa;color:#526174;text-align:left;font-weight:600;border-bottom:1px solid #dbe3eb;height:37px;padding:5px 10px;white-space:nowrap}
.library-record-table th:first-child{width:36px;padding:7px;text-align:center}
.library-record-table th:nth-child(2){width:270px}
.library-record-table th:nth-child(4){width:70px}
.library-record-table th:nth-child(5){width:150px}
.library-record-table th:nth-child(6){width:120px}
.library-record-table th:nth-child(7){width:106px}
.library-record-table th:nth-child(8){width:84px}
.library-record-table th:nth-child(9){width:76px}
.library-record-table th button{border:0;padding:0;background:none;color:inherit;font:inherit;cursor:pointer}
.library-record-table .library-source-row{display:table-row;border-radius:0;cursor:pointer}
.library-record-table td{padding:8px 10px;border-bottom:1px solid #edf1f5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:43px}
.library-record-table td:first-child{text-align:center;padding:7px}
.library-record-table .library-source-row:nth-child(even){background:#fafcfd}
.library-record-table .library-source-row:hover{background:#f0f7fa}
.library-record-table .library-source-row.active,.library-record-table .library-source-row.library-picked{background:#e4f2ee;box-shadow:none;outline:0}
.library-record-table .library-card{display:block;width:100%;min-width:0;border:0;border-radius:0;padding:0;margin:0;text-align:left;background:transparent;box-shadow:none;cursor:grab;overflow:hidden}
.library-record-table .library-card strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;color:#263c4a}
.library-record-table .library-type{font-size:10px;display:inline-block;min-width:0;padding:2px 5px;background:#edf2f7;color:#526174;border-radius:4px}
.library-record-hint{flex:none;margin:0;padding:8px 12px;font-size:11px;color:#7a8999;border-top:1px solid #e8eef3;background:#fafcfd}
.library-sources #library-nav-search{flex:none;margin:0 0 8px}
@media(max-width:700px){.library-center-tabs{gap:12px}.library-center-tabs>span{font-size:10px}.library-center-top{padding:10px 10px 0}.library-record-hint{font-size:10px}}

@media(min-width:1251px){.library-workspace,.library-workspace:has(.library-preview .library-original-frame){grid-template-columns:230px minmax(400px,1fr) minmax(280px,27%)}}
.library-record-table{min-width:864px}
.library-record-table th:nth-child(2){width:210px}
.library-record-table th:nth-child(4){width:62px}
.library-record-table th:nth-child(5){width:130px}
.library-record-table th:nth-child(6){width:100px}
.library-record-table th:nth-child(7){width:96px}
.library-record-table th:nth-child(8){width:75px}
.library-record-table th:nth-child(9){width:70px}
.library-record-table .library-type{width:auto;height:auto;line-height:1.5}

/* Reference-inspired library theme; all icons and styles are served locally. */
.library-notebook{--lib-line:#e5e9f0;--lib-muted:#64748b;--lib-ink:#334155}
.library-icon{display:inline-block;flex:none;vertical-align:middle;pointer-events:none}
.library-workspace>aside,.library-workspace>.library-center{border-color:#e2e8f0;border-radius:16px;box-shadow:0 2px 5px #0f172a03}
.library-heading{margin-bottom:16px}
.library-heading h1{font-weight:650;letter-spacing:-.5px;color:#1e293b}
.library-logo{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;background:#eff6ff;color:#2563eb;border-radius:12px}
.library-logo .library-icon{width:22px;height:22px}
.library-heading small{letter-spacing:0;color:#64748b}
.library-page button.primary{background:#2563eb;border-color:#2563eb;box-shadow:0 2px 4px #2563eb15}
.library-page button.primary:hover{background:#1d4ed8;border-color:#1d4ed8}
.library-page button:focus-visible,.library-page input:focus-visible,.library-page textarea:focus-visible,.library-page select:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}
.library-page input[type=checkbox]{accent-color:#2563eb;border-radius:4px}
.library-page .library-type-filter button{color:#64748b}
.library-page .library-type-filter button[aria-pressed=true]{background:#eff6ff;color:#2563eb;border-color:#dbeafe}
.library-page .library-sources{padding:16px 12px 12px}
.library-sources #library-nav-search{border:0;border-radius:8px;background:#f1f5f9;padding:3px 9px;margin-bottom:12px;gap:7px}
.library-sources #library-nav-search .library-icon{width:14px;height:14px;color:#94a3b8}
.library-page #library-nav-search input{font-size:12px;padding:6px 0;line-height:1.5}
.library-folder-tree .library-permanent{padding-bottom:14px;margin-bottom:5px;border-color:#f1f5f9}
.library-page .library-folder-pick{gap:9px;border-radius:8px;padding:8px 10px;font-size:12px;line-height:1.5;color:#475569}
.library-page .library-folder-pick:hover{background:#f8fafc;color:#334155}
.library-page .library-folder-pick[aria-current=true]{background:#eff6ff;color:#2563eb}
.library-folder-icon{display:inline-flex;align-items:center;justify-content:center;color:#94a3b8}
.library-folder-icon .library-icon{width:15px;height:15px}
.library-folder-pick[aria-current=true] .library-folder-icon{color:#3b82f6}
.library-folder-pick small{font-size:10px;color:#94a3b8;min-width:18px;text-align:center}
.library-permanent .library-folder-pick[aria-current=true] small{color:#2563eb;background:#dbeafe;padding:1px 6px;border-radius:20px}
.library-nav-heading{padding:10px 2px 5px}
.library-page .library-nav-heading button{font-size:11px;font-weight:600;color:#64748b;letter-spacing:.2px}
.library-folder-tree ul ul{border-left:1px solid #e9eef5;margin-left:12px;padding-left:9px}
.library-folder-tree .library-folder-toggle{color:#94a3b8}
.library-page .library-tag-list button{font-size:12px;border-radius:8px;padding:7px 9px;color:#475569}
.library-page .library-tag-list button[aria-pressed=true]{color:#2563eb;background:#eff6ff}
.library-tag-list .library-icon{width:14px;height:14px;color:#94a3b8}
.library-tag-dot{width:6px;height:6px;border-radius:50%}
.library-classify summary{font-weight:600;font-size:11px;color:#64748b;padding-top:5px;padding-bottom:5px}
.library-page .library-sources>footer{padding:9px 2px 0}
.library-storage{display:flex;align-items:center;justify-content:space-between;gap:5px;font-size:10px;color:#64748b;line-height:1.5}
.library-page .library-sources>footer>progress{display:block;height:4px;margin:6px 0 8px}
.library-settings{margin:0}
.library-settings>summary{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 7px;border-radius:8px;color:#475569;list-style:none;font-size:12px;cursor:pointer}
.library-settings>summary::-webkit-details-marker{display:none}
.library-settings>summary:hover{background:#f8fafc}
.library-settings>summary>span{display:inline-flex;align-items:center;gap:8px}
.library-settings>summary .library-icon{width:14px;height:14px;color:#94a3b8}
.library-settings[open]>summary{background:#eff6ff;color:#2563eb;margin-bottom:8px}
.library-settings[open]>summary .library-icon{color:#3b82f6}
.library-height-resizer:before{background:#dbe2eb;width:28px;left:calc(50% - 14px);height:2px;top:4px}
.library-column-resizer:before{width:3px;left:4px;background:#d5dde8}
.library-center-top{padding:18px 18px 0;border-bottom:1px solid #edf1f5}
.library-center #library-search{position:relative;gap:8px;margin:0 0 14px}
.library-search-icon{position:absolute;top:50%;left:12px;transform:translateY(-50%);display:flex;color:#94a3b8;pointer-events:none}
.library-search-icon .library-icon{width:16px;height:16px}
.library-center #library-search input{padding:10px 12px 10px 36px;border-radius:10px;background:#f8fafc;border-color:#e2e8f0;font-size:12px;line-height:1.5}
.library-center #library-search input:focus{background:#fff;border-color:#93c5fd}
.library-center #library-search button[type=submit]{background:#2563eb;color:#fff;border-color:#2563eb;border-radius:10px;padding:9px 18px;font-weight:600;font-size:12px;box-shadow:0 2px 4px #2563eb15}
.library-center #library-search button[type=submit]:hover{background:#1d4ed8}
.library-center #library-search [data-library=search-clear]{border-color:transparent;background:#f8fafc;font-size:12px}
.library-center-toolbar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px 14px;min-width:0}
.library-center-tabs{gap:22px;align-self:stretch}
.library-center-tabs [role=tab]{font-size:13px;font-weight:500;padding:7px 0 12px;color:#64748b;border-radius:0}
.library-center-tabs [aria-selected=true]{color:#2563eb;border-bottom-color:#2563eb;font-weight:650}
.library-center-tabs [role=tab]:hover{background:none;color:#2563eb}
.library-selection-tools{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:6px 10px;padding:0 0 9px;min-width:0}
.library-selection-status{font-size:11px;line-height:1.6;color:#64748b;overflow-wrap:anywhere}
.library-selection-status [data-library-picked-status]{color:#2563eb}
.library-page .library-ask-selected{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;font-size:11px;color:#047857;background:#ecfdf5;border:1px solid #d1fae5;border-radius:8px;white-space:nowrap}
.library-page .library-ask-selected:hover{background:#d1fae5}
.library-ask-selected .library-icon{width:14px;height:14px}
.library-record-table{font-size:12px;color:#475569}
.library-record-table th{background:#f8fafc;color:#64748b;font-size:11px;font-weight:500;border-color:#edf1f5;height:41px;padding:9px 12px}
.library-record-table th button:hover{background:none;color:#2563eb}
.library-record-table td{height:49px;padding:11px 12px;border-color:#f1f5f9}
.library-record-table th:first-child,.library-record-table td:first-child{padding-left:12px}
.library-record-table .library-source-row:nth-child(even){background:#fff}
.library-record-table .library-source-row:hover{background:#f8fafc}
.library-record-table .library-source-row.library-ai-selected{background:#f0fdf780}
.library-record-table .library-source-row.active{background:#ecfdf580}
.library-record-table .library-source-row.library-picked{background:#eff6ff}
.library-record-table .library-source-row.library-picked td:first-child{box-shadow:inset 3px 0 #60a5fa}
.library-record-table .library-card strong{font-size:12px;color:#1e293b;font-weight:500}
.library-record-table td:nth-child(6),.library-record-table td:nth-child(7){font-variant-numeric:tabular-nums;color:#64748b;font-size:11px}
.library-record-table td:nth-child(7),.library-record-table th:nth-child(8){text-align:right}
.library-record-table .library-type{border:1px solid #e2e8f0;border-radius:4px;padding:1px 6px;font-size:10px;line-height:1.5;font-weight:500;background:#f8fafc;color:#64748b}
.library-record-table .library-type[data-kind=note]{background:#fffbeb;border-color:#fde68a80;color:#b45309}
.library-record-table .library-type[data-kind=pdf]{background:#fff1f2;border-color:#fecdd380;color:#be123c}
.library-record-table .library-type[data-kind=html],.library-record-table .library-type[data-kind=web]{background:#eff6ff;border-color:#bfdbfe80;color:#1d4ed8}
.library-record-table .library-type[data-kind=word]{background:#eef2ff;border-color:#c7d2fe80;color:#4338ca}
.library-record-table .library-type[data-kind=image]{background:#faf5ff;border-color:#e9d5ff80;color:#7e22ce}
.library-index-status{font-size:10px;color:#92400e}
.library-index-status[data-indexed=true]{color:#047857}
.library-record-hint{padding:10px 18px;font-size:10px;line-height:1.7;color:#64748b;border-color:#edf1f5;background:#f8fafc80}
.library-source-empty{padding:40px 18px;color:#64748b;line-height:1.8}
.library-page .library-studio{display:flex;flex-direction:column;padding:20px 18px}
.library-studio>header{justify-content:flex-start;gap:7px}
.library-studio>header h2{font-size:15px;color:#1e293b;font-weight:650}
.library-studio>header>.library-icon{color:#a855f7;width:16px;height:16px}
.library-studio>p{font-size:11px;line-height:1.7;color:#64748b;margin:5px 0 18px}
.library-tools{gap:12px}
.library-page .library-tool{--tool-color:#7c3aed;--tool-tint:#ede9fe;--tool-line:#ede9fe;display:grid;grid-template-columns:34px minmax(0,1fr);gap:3px 12px;min-height:76px;padding:14px 12px;border:1px solid var(--tool-line);border-radius:12px;background:linear-gradient(100deg,#faf5ffb3,#eef2ff99);transition:transform .15s,box-shadow .15s,background .15s}
.library-page .library-tool-compare{--tool-color:#2563eb;--tool-tint:#dbeafe;--tool-line:#dbeafe;background:linear-gradient(100deg,#eff6ffb3,#ecfeff99)}
.library-page .library-tool-outline{--tool-color:#059669;--tool-tint:#d1fae5;--tool-line:#d1fae5;background:linear-gradient(100deg,#ecfdf5b3,#f0fdfa99)}
.library-page .library-tool:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 5px 12px #3341550a}
.library-tool>.library-tool-icon{display:flex;align-items:center;justify-content:center;width:34px;height:34px;background:var(--tool-tint);color:var(--tool-color);border-radius:9px;grid-row:span 2;transition:background .15s,color .15s}
.library-tool:hover:not(:disabled)>.library-tool-icon{background:var(--tool-color);color:#fff}
.library-tool .library-icon{width:17px;height:17px}
.library-tool strong{font-size:12px;font-weight:600;color:#334155}
.library-tool small{font-size:11px;color:#64748b;line-height:1.6}
.library-studio>.library-studio-note{margin:24px 0 0;margin-top:auto;padding-top:16px;border-top:1px solid #f1f5f9;color:#64748b;line-height:1.8;font-size:11px}
.library-tools{margin-bottom:24px}
.library-dialogue>header{border-color:#f1f5f9;padding:12px 18px}
.library-dialogue>header h2{color:#334155;font-size:13px}
.library-composer textarea{background:#f8fafc}
.library-workspace ::-webkit-scrollbar{width:5px;height:5px}
.library-workspace ::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:5px}
.library-workspace ::-webkit-scrollbar-track{background:transparent}
@media(max-width:1250px){.library-studio>.library-studio-note{margin-top:0}.library-tools{margin-bottom:8px}}
@media(max-width:700px){.library-center-top{padding:14px 12px 0}.library-center-toolbar{gap:5px}.library-center-tabs{gap:22px}.library-selection-tools{justify-content:flex-start;width:100%;padding-bottom:10px}.library-center #library-search button[type=submit]{padding:8px 13px}.library-page .library-studio{padding:16px 12px}.library-page .library-tool{grid-template-columns:minmax(0,1fr);gap:7px;justify-items:center;padding:12px 7px;min-height:90px}.library-tool>.library-tool-icon{grid-row:auto}.library-tool small{display:none}.library-record-hint{padding:9px 12px}}
@media(prefers-reduced-motion:reduce){.library-page .library-tool,.library-tool>.library-tool-icon{transition:none}.library-page .library-tool:hover:not(:disabled){transform:none}}

@media(max-width:700px){.library-page .library-sources{height:440px;max-height:none}}

/* The assistant's library chooser reuses the library's record table and badges. */
.library-picker-dialog{--lib-line:#e5e9f0;--lib-ink:#334155;box-sizing:border-box;width:min(1240px,calc(100vw - 48px));height:min(820px,88dvh);max-width:calc(100vw - 32px);max-height:90dvh;padding:0;border:1px solid #e2e8f0;border-radius:18px;box-shadow:0 24px 90px #0f172a30;color:#334155;background:#fff;font:13px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;overflow:hidden}
.library-picker-dialog[open]{display:flex;flex-direction:column}
.library-picker-dialog::backdrop{background:#0f172a66;backdrop-filter:blur(2px)}
.library-picker-dialog [hidden]{display:none!important}
.library-picker-heading{display:flex;justify-content:space-between;align-items:center;flex:none;padding:16px 20px;gap:10px;border-bottom:1px solid #edf1f5}
.library-picker-heading>div{display:flex;align-items:center;gap:12px;min-width:0}
.library-picker-heading h2{font-size:17px;font-weight:650;margin:0;color:#1e293b}
.library-picker-heading p{font-size:11px;line-height:1.7;color:#64748b;margin:3px 0 0}
.library-picker-heading>button{font-size:22px;padding:3px 8px;border:0;color:#64748b;background:none}
.library-picker-workspace{display:grid;grid-template-columns:220px minmax(0,1fr);flex:1;min-height:0}
.library-picker-navigation{overflow:auto;padding:14px 10px;border-right:1px solid #edf1f5;background:#fbfcfe;min-height:0}
.library-picker-navigation ul{padding:0;list-style:none;margin:0}
.library-picker-navigation ul ul{margin-left:11px;border-left:1px solid #e9eef5;padding-left:7px}
.library-picker-navigation h3{font-size:11px;font-weight:600;letter-spacing:.3px;color:#64748b;margin:16px 7px 7px;padding-top:12px;border-top:1px solid #e9eef5}
.library-picker-dialog .library-picker-nav-pick,.library-picker-dialog .library-picker-tag{display:flex;align-items:center;gap:8px;width:100%;min-width:0;border:0;background:none;text-align:left;padding:8px 9px;font-size:12px;border-radius:8px;line-height:1.5;color:#475569}
.library-picker-nav-pick>span:not(.library-tag-dot),.library-picker-tag>span:not(.library-tag-dot){flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.library-picker-nav-pick .library-icon,.library-picker-tag .library-icon{width:15px;height:15px;color:#94a3b8}
.library-picker-nav-pick small,.library-picker-tag small{font-size:10px;color:#94a3b8;margin-left:auto}
.library-picker-dialog .library-picker-nav-pick:hover,.library-picker-dialog .library-picker-tag:hover{background:#f1f5f9}
.library-picker-dialog .library-picker-nav-pick[aria-current=true],.library-picker-dialog .library-picker-tag[aria-pressed=true]{background:#eff6ff;color:#2563eb}
.library-picker-nav-pick[aria-current=true] .library-icon{color:#3b82f6}
.library-picker-nav-row{display:flex;align-items:center;min-width:0}
.library-picker-dialog .library-picker-nav-row>[data-lp=fold]{width:19px;flex:none;padding:4px 0;border:0;background:none;color:#94a3b8}
.library-picker-nav-spacer{width:19px;flex:none}
.library-picker-main{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}
.library-picker-search{display:flex;align-items:center;gap:8px;position:relative;padding:16px 18px 12px;flex:none}
.library-picker-search>.library-icon{position:absolute;left:30px;top:50%;transform:translateY(-40%);width:16px;height:16px;color:#94a3b8;pointer-events:none}
.library-picker-dialog .library-picker-search input{width:100%;flex:1;min-width:0;padding:10px 12px 10px 36px;background:#f8fafc;border-radius:10px;font-size:12px;line-height:1.5}
.library-picker-search button{flex:none;font-size:12px}
.library-picker-search>[data-lp=refresh]{display:inline-flex;align-items:center;padding:8px;color:#64748b}
.library-picker-search>[data-lp=refresh] .library-icon{width:16px;height:16px}
.library-picker-status{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;padding:0 18px 12px;border-bottom:1px solid #edf1f5;font-size:11px;color:#64748b;flex:none}
.library-picker-status>div{display:flex;gap:6px;flex-wrap:wrap}
.library-picker-dialog .library-picker-status button{font-size:11px;padding:5px 8px;border-color:#dbeafe;color:#2563eb;background:#eff6ff}
.library-picker-table-scroll{min-height:100px;flex:1;overflow:auto}
.library-picker-dialog .library-record-table .library-card{cursor:pointer}
.library-picker-empty{padding:36px 20px;text-align:center;font-size:12px;color:#64748b}
.library-picker-muted{color:#64748b;font-size:11px;line-height:1.8;padding:0 7px}
.library-picker-error{padding:8px 18px;margin:0;background:#fffbeb;color:#92400e;font-size:11px;line-height:1.7;flex:none}
.library-picker-preview{padding:12px 18px;border-top:1px solid #e2e8f0;background:#f8fafc;flex:none;max-height:210px;overflow:auto}
.library-picker-preview header{display:flex;justify-content:space-between;align-items:center;gap:12px}
.library-picker-preview strong{font-size:12px;overflow-wrap:anywhere}
.library-picker-preview header>div{display:flex;align-items:center;gap:10px;flex:none}
.library-picker-preview a{font-size:11px;color:#2563eb;text-decoration:none}
.library-picker-dialog .library-picker-preview button{padding:1px 6px;font-size:18px;border:0;background:none;color:#64748b}
.library-picker-preview>p{font-size:10px;color:#64748b;margin:6px 0}
.library-picker-preview pre{white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;font-size:12px;line-height:1.8;margin:4px 0;color:#475569}
.library-picker-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px;border-top:1px solid #e2e8f0;flex:none;background:#fafcfe}
.library-picker-footer>span{font-size:11px;color:#64748b;line-height:1.7}
.library-picker-footer>div{display:flex;gap:8px;flex:none}
.library-picker-dialog ::-webkit-scrollbar{width:5px;height:5px}
.library-picker-dialog ::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:5px}
@media(max-width:700px){.library-picker-dialog{width:calc(100vw - 20px);max-width:calc(100vw - 20px);height:92dvh;max-height:94dvh;border-radius:12px}.library-picker-heading{padding:12px}.library-picker-heading h2{font-size:15px}.library-picker-heading .library-logo{display:none}.library-picker-workspace{grid-template-columns:145px minmax(0,1fr)}.library-picker-navigation{padding:8px 5px}.library-picker-dialog .library-picker-nav-pick,.library-picker-dialog .library-picker-tag{gap:5px;padding:7px 5px;font-size:11px}.library-picker-nav-pick .library-icon{width:12px;height:12px}.library-picker-nav-spacer,.library-picker-dialog .library-picker-nav-row>[data-lp=fold]{width:12px}.library-picker-search{flex-wrap:wrap;padding:12px 10px 8px;gap:6px}.library-picker-search>.library-icon{display:none}.library-picker-dialog .library-picker-search input{flex-basis:100%;padding:9px}.library-picker-search button{font-size:11px;padding:7px 9px}.library-picker-status{padding:0 10px 9px}.library-picker-status>div{gap:4px}.library-picker-dialog .library-picker-status button{font-size:10px;padding:4px 5px}.library-picker-footer{padding:10px;align-items:flex-end;gap:8px}.library-picker-footer>span{font-size:10px}.library-picker-footer button{font-size:11px;padding:7px 9px}.library-picker-preview{padding:10px;max-height:180px}.library-picker-preview header{flex-wrap:wrap}}

.library-picker-dialog .library-picker-type-filter{display:flex;gap:3px}.library-picker-dialog .library-picker-type-filter button{border:0;background:#f8fafc;color:#64748b}.library-picker-dialog .library-picker-type-filter button[aria-pressed=true]{background:#eff6ff;color:#2563eb}

/* Record separators are independent from the three workspace panel dividers. */
.library-record-table th{overflow:hidden;text-overflow:ellipsis}
.library-record-resizer{position:absolute;right:0;top:0;bottom:0;width:7px;cursor:col-resize;touch-action:none;user-select:none;z-index:2;border-right:1px solid #dbe3eb}
.library-record-resizer:hover,.library-record-resizer:focus-visible{background:#93c5fd80;outline:0;border-right:2px solid #3b82f6}
.library-record-resizing,.library-record-resizing *{cursor:col-resize!important;user-select:none!important}

.library-selection-tools .library-delete-picked{color:#b91c1c;border-color:#fecaca;background:#fff;font-size:11px;padding:4px 8px;white-space:nowrap}
.library-selection-tools .library-delete-picked[hidden]{display:none}

.library-record-table th:nth-child(3){width:240px}.library-record-table td.library-record-notes{white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal;text-overflow:clip;line-height:1.6;color:#526174;vertical-align:top}

.library-page .library-tag-list [data-library-group-id].library-tag-drop{background:#e4edff;outline:2px solid #527fe0;outline-offset:-2px;color:#2858bd;border-radius:6px}
.library-monitoring{margin-top:12px;border-top:1px solid #e5edf7;padding-top:4px}
.library-monitoring>.library-nav-heading{justify-content:flex-start;gap:2px}
.library-page .library-monitoring>.library-nav-heading>.library-folder-pick{flex:1;min-width:0;font-size:11px;font-weight:600;padding:3px 5px;line-height:normal}
.library-monitoring>.library-nav-heading>[data-library=monitor-toggle]{flex:0 0 20px;padding:4px 0}
.library-monitor-note{font-size:12px;line-height:1.6;color:#64748b}

.library-record-pages{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;padding:8px 0;font-size:12px}.library-record-pages span{margin-right:auto;color:#64748b}.library-record-pages button{padding:5px 10px}

.qa-coverage{display:flex;gap:5px 12px;flex-wrap:wrap;align-items:center;padding:8px 10px;margin:8px 0;background:#f0f7ff;border:1px solid #c8def7;border-radius:6px;font-size:11px;color:#335575}
.qa-coverage strong,.qa-coverage>span{flex-basis:100%}.qa-coverage button{font-size:11px!important;padding:3px 7px!important}.qa-coverage a{color:#185ca2}

/* Persistent question jobs stay compact beside the composer. */
.qa-agent-jobs{margin:8px 0;padding:8px 10px;border:1px solid #dce5f3;border-radius:8px;background:#f8faff;font-size:12px;flex:none;max-width:100%;min-width:0}.qa-agent-jobs>summary{cursor:pointer;color:#315a98}.qa-agent-jobs [data-qa-jobs-body]{max-height:260px;overflow:auto}.qa-agent-job{padding:8px 0;border-bottom:1px solid #e0e7f0;overflow-wrap:anywhere}.qa-agent-job:last-child{border:0}.qa-agent-job strong{font-weight:600}.qa-agent-job p{margin:4px 0;line-height:1.45}.qa-agent-job small{color:#64748b}.qa-agent-job button{margin:5px 6px 0 0;padding:3px 8px;font-size:12px;cursor:pointer}

/* Compact conversation switching and recoverable turns. */
.qa-thread-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 16px;border-bottom:1px solid #e7ecf2;background:#fafbfd;flex:none;min-width:0}
.qa-thread-bar label{display:flex;align-items:center;gap:8px;min-width:0;font-size:12px}.qa-thread-bar select{max-width:min(460px,55vw);min-width:140px!important;padding:5px 8px!important;font-size:12px!important}.qa-thread-bar>span{font-size:11px;color:#748297}
.qa-turn-state{padding:8px 10px;margin:8px 0;border:1px solid #e2e8f0;border-radius:7px;background:#f8fafc;color:#64748b;font-size:12px;line-height:1.7}.qa-turn-state[data-status=failed]{border-color:#f0c8c4;background:#fff8f7;color:#a4473b}.qa-turn-state button{margin-left:8px;font-size:11px!important;padding:3px 7px!important}
@media(max-width:650px){.qa-thread-bar{padding:8px;flex-wrap:wrap}.qa-thread-bar>span{display:none}.qa-thread-bar select{max-width:70vw}}

.library-dialogue.qa-fullscreen{position:fixed;inset:12px;z-index:1900;border:1px solid #d9e2ef;border-radius:12px;background:#fff;box-shadow:0 0 0 14px #1c2c4559;display:flex!important;overflow:hidden}
.library-dialogue .library-chat-body{min-height:80px;scrollbar-gutter:stable}.library-dialogue .library-message{max-width:1100px;margin-left:auto;margin-right:auto}.library-dialogue .library-welcome{margin:28px auto;max-width:700px}.library-dialogue .library-welcome h2{font-size:24px;line-height:1.5}.library-dialogue .library-composer-wrap{background:#fff;border-top:1px solid #edf1f5}.library-dialogue .library-composer{max-width:1100px;margin:0 auto;border-radius:12px}.library-dialogue .library-composer button[data-library=qa-stop]{width:auto;font-size:12px;padding:4px 10px;border-radius:7px}.library-dialogue .library-composer button[data-library=qa-save]{width:auto;font-size:11px;padding:4px 7px;border-radius:7px}

.library-upload-problems{font-size:12px;color:#7a6670;margin-top:12px}.library-upload-problems summary{cursor:pointer}.library-upload-problems ul{max-height:180px;overflow:auto;padding-left:20px;overflow-wrap:anywhere}.library-upload-problems li{margin:6px 0}.library-upload-problems strong{font-weight:500}
