#enterprise-entry{display:flex;align-items:center;gap:9px;flex:1;min-width:0;text-align:left;padding:4px;border-radius:8px}
#enterprise-entry:hover{background:var(--hover)}#enterprise-entry>div{min-width:0}#workspace-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#account-view{flex:1;min-width:0;overflow:auto;overscroll-behavior:contain}.account-page{max-width:1000px;margin:0 auto;padding:32px 34px 64px}.account-page>h1{font-size:26px;font-weight:500;line-height:1.5;margin:0 0 26px}.account-page form,.account-page .segmented{max-width:460px}#enterprise-entry.active{background:var(--soft)}
.account-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}.account-group{min-width:0;padding:18px 20px;background:var(--surface);border:1px solid color-mix(in srgb,var(--line) 60%,transparent);border-radius:10px}.account-group h2{font-size:14px;font-weight:600;line-height:1.5;margin:0 0 16px}.account-group .library-heading{justify-content:space-between;margin:0 0 3px}.account-group .library-heading h2{margin:0}.account-group .account-profile,.account-group .enterprise-row{border:0}.account-group .account-profile{padding:0;gap:12px}.account-group>.account-section{border-top:1px solid var(--line);margin-top:16px;padding-top:16px}.account-group .account-section .enterprise-row+.enterprise-row{border-top:1px solid var(--line)}.account-group form{max-width:none}.account-group .quiet-button{white-space:nowrap}.account-page>.small-note{margin-top:20px}@media(max-width:1100px){.account-grid{grid-template-columns:1fr}}
.account-field{display:block;font-size:12px;margin:15px 0;color:var(--muted)}.account-field input,.account-field textarea{display:block;color:var(--text);width:100%;margin-top:7px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg);font-size:14px}.account-field textarea{resize:vertical;min-height:320px;line-height:1.7}
.account-submit{width:100%;margin-top:18px}.account-profile{display:flex;align-items:center;justify-content:space-between;padding-bottom:20px;border-bottom:1px solid var(--line)}.account-profile strong{font-size:16px;font-weight:500}.account-profile small,.enterprise-row small{display:block;color:var(--muted);font-size:11px;line-height:1.7;margin-top:5px}.account-section{border-top:1px solid var(--line);margin-top:18px;padding-top:16px}.account-section>h3{font-size:13px;font-weight:500;line-height:1.5;margin:0 0 12px}.segmented{display:flex;padding:3px;background:var(--soft);border-radius:8px;gap:3px}.segmented button{flex:1;padding:7px;font-size:12px;border-radius:5px;color:var(--muted)}.segmented .active{background:var(--surface);color:var(--text);box-shadow:0 1px 3px #0001}
.library-tabs{display:flex;border-bottom:1px solid var(--line);gap:24px;margin-bottom:18px}.library-tabs button{font-size:12px;color:var(--muted);padding:11px 0}.library-tabs .active{color:var(--text);border-bottom:2px solid var(--text)}.library-heading{gap:10px}.library-heading h3{flex:1;font-size:14px;font-weight:500}.knowledge-toolbar{display:flex;align-items:center;justify-content:space-between;color:var(--muted);font-size:12px}.enterprise-row{display:flex;align-items:center;gap:8px;padding:13px 0;border-bottom:1px solid var(--line)}.enterprise-row>div,.source-name{flex:1;min-width:0;text-align:left;overflow-wrap:anywhere}.enterprise-row strong,.source-name{font-size:13px;font-weight:500}.enterprise-row .quiet-button{font-size:11px;flex-shrink:0;padding:6px}.knowledge-section-title{font-size:14px;font-weight:500;margin:26px 0 8px}.knowledge-section-title span{font-size:11px;font-weight:400;color:var(--muted);margin-left:7px}.source-references{border-top:1px solid var(--line);padding-top:12px;margin-top:18px;display:flex;flex-wrap:wrap;gap:5px}.source-references>span{font-size:11px;color:var(--muted);width:100%;margin-bottom:3px}.source-references button{font-size:11px}.source-references svg{width:13px}
#messages.library-surface{max-width:none;height:100%;display:flex;flex-direction:column;padding:24px 32px 18px}
.kb-heading{display:flex;align-items:center;gap:12px;flex-shrink:0;margin-bottom:18px}.kb-heading>div,.kb-heading>h1{flex:1;min-width:0}.kb-heading h1{font-size:23px;font-weight:500;letter-spacing:-.02em;margin:0}.kb-heading p{font-size:12px;color:var(--muted);margin:0}.kb-heading .primary-button{display:inline-flex;align-items:center;gap:6px;font-size:12px;white-space:nowrap}.kb-heading svg{width:15px;height:15px}.kb-heading select,.kb-toolbar select{font-size:12px;padding:7px 9px;border-radius:7px;background:var(--soft);max-width:150px;cursor:pointer}
.kb-tabs{display:flex;gap:25px;border-bottom:1px solid var(--line);flex-shrink:0}.kb-tabs button,.kb-local-label{font-size:13px;color:var(--muted);padding:0 0 13px;position:relative}.kb-tabs button[aria-selected=true]{color:var(--text)}.kb-tabs button[aria-selected=true]::after{content:'';position:absolute;bottom:-1px;height:2px;background:var(--text);left:0;right:0}.kb-tabs button span{font-size:11px;margin-left:7px;color:var(--muted);font-variant-numeric:tabular-nums}
.kb-toolbar{display:flex;align-items:center;gap:10px;padding:4px 0 16px;flex-shrink:0}.kb-search{display:flex;align-items:center;gap:8px;color:var(--muted);max-width:260px;min-width:120px;flex:1;padding:7px 9px;border-radius:7px;background:var(--soft)}.kb-search svg{width:15px;height:15px}.kb-search input{font-size:12px;min-width:0;width:100%}.kb-search:focus-within{outline:1px solid var(--muted)}.kb-toolbar .quiet-button{white-space:nowrap}.kb-notice{font-size:12px;color:var(--muted);margin:0 0 12px}
.kb-personal-heading{align-items:center}.kb-personal-note{padding:14px;margin:0 0 16px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}.kb-personal-note textarea{display:block;width:100%;min-height:78px;resize:vertical;border:0;background:transparent;font-size:13px;line-height:1.7}.kb-personal-note textarea:focus{outline:0}.kb-personal-note>div{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px}.kb-personal-note button{font-size:12px;white-space:nowrap}.kb-personal-library{display:flex;flex:1;min-height:0;flex-direction:column}.kb-personal-toolbar{display:flex;align-items:center;gap:12px;padding:0 0 12px;border-bottom:1px solid var(--line)}.kb-personal-toolbar .kb-search{max-width:360px}.kb-personal-toolbar>span{margin-left:auto;color:var(--muted);font-size:11px}.kb-personal-list{min-height:0;overflow:auto}.kb-personal-row{display:flex;align-items:center;gap:8px;min-height:62px;border-bottom:1px solid var(--line)}.kb-personal-row:hover{background:var(--soft)}.kb-personal-open{display:flex;align-items:center;gap:12px;flex:1;min-width:0;padding:10px 8px;text-align:left}.kb-personal-icon{display:grid;place-items:center;width:34px;height:34px;flex:none;border-radius:8px;background:var(--soft);color:var(--action)}.kb-personal-icon svg{width:17px;height:17px}.kb-personal-copy{display:flex;min-width:0;flex-direction:column;gap:5px}.kb-personal-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:500}.kb-personal-copy small{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:10.5px}.kb-personal-copy i{font-style:normal}.kb-personal-row>.kb-row-menu{margin-right:5px;flex:none}
.kb-list{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column}.kb-list .kb-table{flex-shrink:0}.kb-table[hidden]{display:none}.kb-table{width:100%;min-width:560px;table-layout:fixed;border-collapse:separate;border-spacing:0}.kb-type-col{width:65px}.kb-status-col{width:88px}.kb-date-col{width:88px}.kb-action-col{width:42px}.kb-table th{font-size:11px;font-weight:400;color:var(--muted);text-align:left;padding:10px 12px;background:var(--bg);position:sticky;top:0;z-index:2;border-bottom:1px solid var(--line)}.kb-table td{padding:10px 12px;height:53px;border-bottom:1px solid var(--line);font-size:12px}.kb-table th:first-child,.kb-table td:first-child{padding-left:0}.kb-table tr:hover td{background:var(--soft)}.kb-name{display:flex;align-items:center;gap:10px;width:100%;padding:5px 0;min-width:0;text-align:left;font-size:13px}.kb-name svg{width:17px;height:17px;color:var(--muted)}.kb-name span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kb-file-type,.kb-date{color:var(--muted);font-size:11px!important;font-variant-numeric:tabular-nums}.kb-status{font-size:11px;color:var(--muted);white-space:nowrap}.kb-status.pending{color:var(--text);background:var(--hover);padding:4px 7px;border-radius:5px}
.kb-row-menu{position:relative}.kb-row-menu summary{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;color:var(--muted);cursor:pointer;list-style:none}.kb-row-menu summary::-webkit-details-marker{display:none}.kb-row-menu summary:hover,.kb-row-menu[open] summary{background:var(--hover);color:var(--text)}.kb-row-menu>div{position:absolute;right:0;top:32px;min-width:134px;padding:5px;border:1px solid var(--line);border-radius:9px;background:var(--surface);box-shadow:var(--shadow);z-index:5}.kb-row-menu button{display:block;text-align:left;width:100%;padding:8px 10px;border-radius:5px;font-size:12px;white-space:nowrap}.kb-row-menu button:hover{background:var(--hover)}.kb-table tr:nth-child(n+4):nth-last-child(-n+3) .kb-row-menu>div{top:auto;bottom:32px}
.kb-import-menu{position:relative}.kb-import-menu summary{cursor:pointer;list-style:none}.kb-import-menu summary::-webkit-details-marker{display:none}.kb-import-menu summary svg:last-child{width:12px}.kb-import-menu>div{position:absolute;right:0;top:42px;min-width:126px;padding:5px;border:1px solid var(--line);border-radius:9px;background:var(--surface);box-shadow:var(--shadow);z-index:8}.kb-import-menu button{display:block;width:100%;padding:8px 10px;border-radius:5px;text-align:left;font-size:12px;white-space:nowrap}.kb-import-menu button:hover{background:var(--hover)}.kb-person-col{width:80px}.kb-person{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:11px!important}.kb-submission-table{min-width:720px}
.kb-empty{text-align:center;margin:auto;padding:60px 20px;color:var(--muted)}.kb-empty strong{font-size:14px;font-weight:500;color:var(--text)}.kb-empty p{font-size:12px;line-height:1.8;margin:10px 0 18px}.kb-empty .primary-button{font-size:12px}.kb-footer{display:flex;justify-content:space-between;gap:16px;padding-top:16px;font-size:11px;color:var(--muted);flex-shrink:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.source-references{display:block;border:0;padding-top:0;margin-top:20px}.source-references summary{display:flex;align-items:center;gap:7px;width:fit-content;font-size:11px;color:var(--muted);cursor:pointer;list-style:none;padding:5px 0;border-radius:4px}.source-references summary::-webkit-details-marker{display:none}.source-references summary:hover{color:var(--text)}.source-references summary .source-chevron{width:11px;height:11px}.source-references[open] .source-chevron{transform:rotate(90deg)}.source-references>div{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}.source-references button{max-width:100%;text-align:left;overflow-wrap:anywhere}.source-references summary:focus-visible,.kb-row-menu summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ppt-viewer{display:flex;flex-direction:column;height:calc(100% - 40px);min-height:310px;gap:10px}.ppt-main{display:flex;flex-direction:column;min-height:0;flex:1;order:-1}.ppt-toolbar{display:flex;align-items:center;gap:8px;height:36px;flex-shrink:0;font-size:11px;color:var(--muted)}.ppt-toolbar button{padding:5px;font-size:11px}.ppt-toolbar-space{flex:1}.ppt-viewport{flex:1;min-height:0;overflow:auto;background:var(--soft);border-radius:7px}.ppt-canvas{min-width:100%;min-height:100%;width:max-content;display:flex;align-items:center;justify-content:center;padding:20px}.ppt-slide{display:block;max-width:none;box-shadow:0 2px 12px #0001}.ppt-thumbnails{display:flex;gap:9px;overflow-x:auto;flex-shrink:0;padding:5px 2px 10px}.ppt-thumbnails button{flex-shrink:0;width:82px;padding:4px;border-radius:6px;border:1px solid transparent;font-size:10px;color:var(--muted)}.ppt-thumbnails img{width:72px;height:42px;object-fit:contain;background:var(--soft);display:block;margin-bottom:4px}.ppt-thumbnails [aria-current=true]{border-color:var(--accent);background:var(--soft)}
.sheet-container{height:calc(100% - 40px);min-height:300px}.sheet-workbook{height:100%;display:flex;flex-direction:column;min-width:0;border:1px solid var(--line);border-radius:7px;overflow:hidden}.sheet-formula{height:37px;display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line);padding:0 10px;font-size:11px;flex-shrink:0}.sheet-address{min-width:36px}.sheet-formula span{color:var(--muted)}.sheet-formula input{flex:1;min-width:0;font-size:12px}.sheet-grid-host{flex:1;min-height:0;overflow:auto}.sheet-grid-host table{border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:12px}.sheet-grid-host th,.sheet-grid-host td{height:29px;min-width:105px;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:5px 8px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);font-weight:400;text-align:left}.sheet-grid-host th{background:var(--soft);color:var(--muted);text-align:center;position:sticky;top:0;z-index:1}.sheet-grid-host tr>th:first-child{min-width:38px;left:0;z-index:2}.sheet-grid-host td[aria-selected]{outline:2px solid var(--accent);outline-offset:-2px;background:var(--hover)}.pending-value{color:var(--muted);font-style:italic}.sheet-tabs{display:flex;overflow:auto;border-top:1px solid var(--line);min-height:36px;flex-shrink:0}.sheet-tabs button{font-size:11px;white-space:nowrap;padding:9px 14px;border-right:1px solid var(--line)}.sheet-tabs [aria-selected=true]{color:var(--accent);box-shadow:inset 0 -2px var(--accent);background:var(--soft)}.sheet-note{font-size:10px;line-height:1.7;color:var(--muted);padding:7px 10px;margin:0;border-top:1px solid var(--line);flex-shrink:0}

/* Knowledge navigation: existing AI topics, with independent directory scrolling. */
.kb-browser{display:flex;flex:1;min-height:0;gap:24px}
.kb-tree{width:226px;flex:0 0 226px;min-height:0;overflow:auto;padding:14px 14px 16px 0;border-right:1px solid var(--line);overscroll-behavior:contain}
.kb-tree-caption{margin:0 0 12px 7px;font-size:11px;line-height:18px;color:var(--muted)}
.kb-section-tabs{position:sticky;top:0;z-index:3;display:flex;flex-direction:column;gap:8px;padding:0 0 14px;background:var(--bg)}
.kb-section-tab{display:grid;grid-template-columns:minmax(0,1fr) auto;width:100%;min-width:0;height:46px;align-items:center;gap:10px;padding:0 12px 0 13px;border:0;border-left:4px solid color-mix(in srgb,var(--action) 28%,var(--line));border-radius:12px;background:color-mix(in srgb,var(--surface) 82%,transparent);color:var(--muted);font-size:12px;font-weight:500;text-align:left;transition:background .16s ease,border-color .16s ease,color .16s ease}
.kb-section-tab small{font-size:10px;font-weight:500;color:var(--muted);font-variant-numeric:tabular-nums}.kb-section-tab:hover{border-left-color:color-mix(in srgb,var(--action) 60%,var(--line));background:var(--surface);color:var(--text)}.kb-section-tab[aria-selected=true]{border-left-color:var(--action);background:color-mix(in srgb,var(--action) 10%,var(--surface));color:var(--text)}.kb-section-tab[aria-selected=true] small{color:var(--action)}
.kb-tree-content{padding-top:2px}
.kb-tree-row{display:flex;align-items:center;min-width:0}.kb-tree-toggle{flex:0 0 20px;width:20px;height:32px;padding:4px;color:var(--muted)}
.kb-tree-toggle svg{width:12px;height:12px;transform:rotate(90deg)}.kb-tree-toggle[aria-expanded=false] svg{transform:rotate(0)}
.kb-tree-label,.kb-tree-leaf{display:flex;align-items:center;gap:7px;min-width:0;text-align:left;border-radius:6px;font-size:12px;min-height:32px;padding:6px 7px;width:100%}
.kb-tree-label svg,.kb-tree-leaf svg{width:14px;height:14px;flex-shrink:0;color:var(--muted)}
.kb-tree-label span,.kb-tree-leaf span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kb-tree-label small{font-size:10px;color:var(--muted);font-variant-numeric:tabular-nums}
.kb-tree-label:hover,.kb-tree-leaf:hover{background:var(--soft)}.kb-tree .selected{background:var(--hover);color:var(--text)}
.kb-tree-children{margin-left:12px;padding-left:7px;border-left:1px solid var(--line)}.kb-tree-children[hidden]{display:none}.kb-tree-folder{margin-bottom:3px}.kb-tree-empty{margin:5px 7px 10px;font-size:11px;line-height:1.6;color:var(--muted)}
.kb-folder-content{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;padding-top:14px}.kb-breadcrumb{font-size:12px;margin:0 0 12px;line-height:18px;overflow-wrap:anywhere}.kb-breadcrumb span{color:var(--muted);margin:0 5px}
.kb-folder-content .kb-table{min-width:460px}.kb-organization-records{max-height:160px;overflow:auto;flex-shrink:0}.kb-tree button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
@media(max-width:1050px){#messages.library-surface{padding:24px 22px 16px}.kb-browser{gap:14px}.kb-tree{width:185px;flex-basis:185px;padding-right:8px}.kb-folder-content .kb-toolbar{flex-wrap:wrap}.kb-folder-content .kb-toolbar .kb-search{flex-basis:100%}}
.kb-browser{container-type:inline-size}.kb-folder-content .kb-toolbar{flex-wrap:wrap}.kb-folder-content .kb-footer{flex-wrap:wrap;gap:6px}.kb-folder-content .kb-organization-status{overflow-wrap:anywhere}
@container(max-width:700px){.kb-tree{width:180px;flex-basis:180px;padding-right:8px}.kb-folder-content .kb-search{flex-basis:100%;max-width:none}.kb-folder-content .kb-toolbar{gap:6px}.kb-folder-content .kb-toolbar .top-spacer{display:none}.kb-folder-content .kb-toolbar button{font-size:11px}.kb-folder-content .kb-table{min-width:0}.kb-folder-content .kb-type-col,.kb-folder-content .kb-date-col,.kb-folder-content th:nth-child(2),.kb-folder-content td:nth-child(2),.kb-folder-content th:nth-child(4),.kb-folder-content td:nth-child(4){display:none}.kb-folder-content .kb-status-col{width:64px}.kb-folder-content .kb-action-col{width:30px}.kb-folder-content .kb-table td{padding:8px 5px}}
.brand-body{flex:1;min-height:0;overflow:auto;padding-right:4px}.brand-body .kb-tabs{margin-bottom:24px}.brand-profile-layout{display:grid;grid-template-columns:minmax(0,1fr) 260px;align-items:start;gap:20px;max-width:1040px}.brand-fields,.brand-assets{display:grid;gap:20px;min-width:0}.brand-group{min-width:0;padding:20px 24px;background:var(--surface);border:1px solid color-mix(in srgb,var(--line) 55%,transparent);border-radius:12px}.brand-group h2{font-size:14px;font-weight:600;margin:0 0 18px;line-height:1.5}.brand-field{display:grid;grid-template-columns:100px minmax(0,1fr);gap:18px;padding:9px 0;min-width:0}.brand-field>span{font-size:12px;line-height:1.8;color:var(--muted)}.brand-field p{font-size:13px;line-height:1.7;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.brand-unfilled{color:var(--muted)}.brand-fields .account-field{margin:0 0 16px}.brand-fields .account-field:last-child{margin-bottom:0}.brand-fields .account-field textarea{min-height:80px}.brand-media>span{font-size:12px;display:block;margin-bottom:12px;color:var(--muted)}.brand-media img{width:100%;height:160px;object-fit:contain;border-radius:8px;background:var(--soft)}.brand-media audio{width:100%;height:36px}.brand-media small{display:block;font-size:11px;color:var(--muted);overflow-wrap:anywhere;margin:8px 0}.brand-media-empty{height:140px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:var(--soft);border-radius:8px;color:var(--muted);font-size:11px}.brand-media-empty svg{width:24px;height:24px}.brand-upload{cursor:pointer;display:inline-block}.brand-upload input{display:none}.brand-consent{display:flex;gap:6px;font-size:11px;line-height:1.6;color:var(--muted);margin-top:14px}.brand-actions{display:flex;justify-content:flex-end;gap:12px;margin:24px 0;max-width:1040px}.brand-empty{padding:40px;max-width:720px;background:var(--surface);border-radius:12px}.brand-empty h2{font-size:20px;font-weight:500;margin-top:0}.brand-empty p{color:var(--muted);font-size:13px;line-height:1.8}
.brand-document{min-height:68px;display:flex;align-items:center;gap:10px;padding:12px;background:var(--soft);border-radius:8px;color:var(--text);font-size:12px;overflow-wrap:anywhere}.brand-document svg{width:22px;height:22px;flex:0 0 auto;color:var(--muted)}

#industry-view{display:flex;flex:1;min-width:0;min-height:0;flex-direction:column;background:var(--bg)}#industry-view[hidden]{display:none}#industry-frame{border:0;flex:1;width:100%;min-height:0;background:var(--bg);color-scheme:light}.industry-loading{padding:18px 24px;font-size:12px;color:var(--muted)}.industry-footer{display:flex;align-items:center;justify-content:space-between;padding:8px 18px;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}
@media(max-width:1100px){.brand-profile-layout{grid-template-columns:1fr}.brand-assets{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:700px){.brand-assets{grid-template-columns:1fr}.brand-group{padding:18px}.brand-field{grid-template-columns:80px minmax(0,1fr);gap:12px}}

/* The document owns cell colors. Keep selection as an outline, never a theme wash. */
.sheet-grid-host{background:#fff;color:#000;color-scheme:light}
.sheet-grid-host td,.sheet-grid-host td[aria-selected]{background:var(--sheet-cell-bg,#fff);color:var(--sheet-cell-ink,#000)}
.sheet-grid-host td{border-color:#d9dfe8}

/* Page headings share the same scale without adding separator rows. */
#messages.library-surface{padding-top:28px}
.kb-heading h1,.account-page>h1,.archives-heading h1{font-size:22px;font-weight:600;line-height:1.4}
.account-page{padding-top:28px}.kb-heading{margin-bottom:24px}

/* Brand setup and shared documents keep a stable navigation and form hierarchy. */
#messages.library-surface input,#messages.library-surface textarea{caret-color:var(--text)}
:root[data-dark=true] #messages.library-surface input,:root[data-dark=true] #messages.library-surface textarea{caret-color:#fff}
#messages.library-surface input::placeholder,#messages.library-surface textarea::placeholder{color:var(--muted);opacity:1}
.knowledge-nav{flex:none;margin-bottom:20px;gap:24px;overflow-x:auto;scrollbar-width:none}.knowledge-nav::-webkit-scrollbar{display:none}.knowledge-nav button{white-space:nowrap}.knowledge-nav button[aria-current=page]{color:var(--text);border-bottom:2px solid var(--text)}
.dataset-toolbar{flex-wrap:wrap;padding:0 0 20px}.dataset-search{display:flex;align-items:center;gap:8px;min-width:240px;max-width:360px;flex:1;padding:8px 10px;border-radius:9px;background:var(--soft);color:var(--muted)}.dataset-search svg{width:15px;height:15px;flex:none}.dataset-search input{width:100%;min-width:0;font-size:12px}.dataset-search:focus-within{outline:1px solid var(--muted)}.dataset-count{margin-left:auto;font-size:11px;color:var(--muted);white-space:nowrap}
.dataset-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:10px;min-height:0;overflow:auto;padding:1px 4px 18px 0}.dataset-card{display:flex;min-width:0;flex-direction:column;gap:9px;padding:12px 13px 11px;border-left:3px solid var(--action);border-radius:12px;background:var(--surface)}.dataset-card.connected{border-left-color:var(--success)}.dataset-card.pending{border-left-color:var(--warning)}.dataset-card.excluded{border-left-color:var(--muted)}.dataset-card-head{display:flex;align-items:center;gap:10px}.dataset-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;font-size:14px;font-weight:600;line-height:1.4;color:var(--text)}.dataset-title:hover{color:var(--action)}.dataset-status{flex:none;padding:3px 6px;border-radius:6px;background:var(--selected);font-size:10px;color:var(--muted)}.dataset-card.connected .dataset-status{color:var(--success)}.dataset-card.pending .dataset-status{color:var(--warning)}.dataset-meta{display:flex;gap:9px;min-width:0;color:var(--muted);font-size:10.5px}.dataset-meta span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dataset-meta span+span{flex:none}.dataset-card-footer{display:flex;align-items:center;gap:12px}.dataset-file-area{display:flex;align-items:center;gap:8px;min-width:0;font-size:11px;color:var(--muted)}.dataset-file-area>small{font-size:10px;white-space:nowrap}.dataset-file-menu{position:relative}.dataset-file-menu summary{display:flex;align-items:center;gap:4px;cursor:pointer;list-style:none;white-space:nowrap}.dataset-file-menu summary::-webkit-details-marker{display:none}.dataset-file-menu summary svg{width:11px;height:11px}.dataset-file-menu[open] summary svg{transform:rotate(180deg)}.dataset-file-menu>div{position:absolute;left:0;bottom:24px;z-index:8;min-width:190px;max-width:280px;padding:5px;border:1px solid var(--line);border-radius:9px;background:var(--surface);box-shadow:var(--shadow)}.dataset-file-menu button{display:block;width:100%;padding:8px 9px;border-radius:5px;text-align:left;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dataset-file-menu button:hover{background:var(--hover)}.dataset-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex:1}.dataset-actions button{font-size:11px;white-space:nowrap}.dataset-unavailable,.dataset-file-count{font-size:11px;color:var(--muted)}@media(max-width:980px){.dataset-grid{grid-template-columns:1fr}.dataset-count{width:100%;margin-left:0}}

/* One knowledge ledger across enterprise sources, datasets, and personal knowledge. */
.kb-scope-tabs{display:flex;align-items:center;gap:22px;flex:none;min-height:38px;margin:-4px 0 14px;border-bottom:1px solid var(--line)}
.kb-scope-tabs button{position:relative;display:flex;align-items:center;gap:7px;height:38px;padding:0;color:var(--muted);font-size:12px;white-space:nowrap}
.kb-scope-tabs button[aria-selected=true]{color:var(--text)}.kb-scope-tabs button[aria-selected=true]::after{content:"";position:absolute;right:0;bottom:-1px;left:0;height:2px;background:var(--text)}
.kb-scope-tabs small{font-size:10px;color:var(--muted);font-variant-numeric:tabular-nums}
.kb-ledger{display:flex;flex:1;min-height:0;flex-direction:column}.kb-ledger-toolbar{display:flex;align-items:center;gap:9px;flex:none;min-height:50px;padding:0 0 10px;border-bottom:1px solid var(--line)}
.kb-ledger-toolbar .kb-search{max-width:360px;height:36px}.kb-ledger-toolbar select{height:34px;max-width:190px;padding:0 28px 0 9px;border-radius:7px;background:var(--soft);font-size:11px}
.kb-ledger-toolbar>span{margin-left:auto;color:var(--muted);font-size:11px;white-space:nowrap}.kb-ledger-toolbar .kb-library-actions{flex:none}
.kb-ledger-list{min-height:0;overflow:auto;overscroll-behavior:contain}.kb-ledger-row{display:flex;align-items:center;gap:10px;min-height:64px;border-bottom:1px solid var(--line)}.kb-ledger-row:hover{background:var(--soft)}
.kb-ledger-open{display:flex;align-items:center;gap:12px;flex:1;min-width:0;align-self:stretch;padding:9px 8px;text-align:left}.kb-ledger-icon{display:grid;place-items:center;width:34px;height:34px;flex:none;border-radius:8px;background:var(--soft);color:var(--action)}
.kb-ledger-icon svg{width:17px;height:17px}.kb-ledger-copy{display:flex;min-width:0;flex-direction:column;gap:5px}.kb-ledger-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:500;color:var(--text)}
.kb-ledger-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:10.5px}.kb-ledger-copy i{padding:0 3px;font-style:normal}.kb-ledger-state{flex:none;max-width:92px;padding:4px 7px;border-radius:6px;background:var(--soft);color:var(--muted);font-size:10.5px;white-space:nowrap}
.kb-ledger-state.pending{background:var(--selected);color:var(--text)}.kb-ledger-row>.kb-row-menu{flex:none;margin-right:5px}.kb-ledger-footer{display:flex;justify-content:flex-end;flex:none;padding:11px 0 0;color:var(--muted);font-size:10.5px}
.kb-upload-guidance{margin:10px 0 0;color:var(--muted);font-size:10.5px;line-height:1.6}.kb-personal-add>div{width:286px;padding:6px}.kb-personal-add button{padding:9px 10px}.kb-personal-add button strong,.kb-personal-add button small{display:block}.kb-personal-add button strong{font-size:12px;font-weight:500;color:var(--text)}.kb-personal-add button small{margin-top:3px;color:var(--muted);font-size:10px}.kb-personal-add>div>p{margin:5px 7px 3px;color:var(--muted);font-size:10px;line-height:1.55;white-space:normal}
.dataset-toolbar{flex-wrap:nowrap;padding:0 0 10px}.dataset-toolbar .dataset-search{min-width:180px;max-width:360px;padding:7px 9px;border-radius:7px}.dataset-ledger-row{min-height:72px}.dataset-row-files{flex:none;min-width:74px;color:var(--muted);font-size:10.5px}.dataset-ledger-row.connected .dataset-status{color:var(--success)}.dataset-ledger-row.pending .dataset-status{color:var(--warning)}.dataset-ledger-row.excluded .dataset-status{color:var(--muted)}.dataset-ledger-row .dataset-actions{flex:0 0 auto}.dataset-ledger-row .dataset-actions:empty{display:none}
.kb-ledger-open:focus-visible,.kb-scope-tabs button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.brand-profile-intro{max-width:1040px;margin:0 auto 20px}.brand-profile-intro h2{font-size:18px;font-weight:600;margin:0 0 6px}.brand-profile-intro p,.brand-group-hint{font-size:12px;color:var(--muted);line-height:1.7;margin:0 0 16px}.brand-group h2{margin-bottom:8px}.brand-group-hint+.account-field{margin-top:0}
.brand-field-kind{font-size:10px;color:var(--muted);margin-left:8px}.brand-fields .account-field textarea{min-height:72px}
.brand-profile-layout,.brand-actions,.brand-saved-footer{width:100%;margin-left:auto;margin-right:auto}.brand-actions{position:sticky;bottom:0;background:var(--bg);padding:12px 0;margin-top:16px;border-top:1px solid var(--line);align-items:center}.brand-actions>.small-note{flex:1;margin:0}.brand-saved-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:1040px;margin-top:16px}.brand-empty{padding:28px}.brand-empty h2{font-size:18px}.brand-empty .primary-button{margin-top:8px}

/* Figma-aligned knowledge library hierarchy: one navigation, one status strip, one ledger. */
#messages.library-surface{padding:22px 28px 16px;overflow:hidden}
.kb-heading{gap:16px;margin-bottom:16px}.kb-heading-title{display:flex;align-items:flex-start;gap:14px;min-width:0}.kb-heading-copy{min-width:0;flex:1}.kb-heading-copy h1{margin:0;font-size:24px;font-weight:650;letter-spacing:-.025em;line-height:1.3}.kb-heading-copy p{margin:5px 0 0;color:var(--muted);font-size:11px;line-height:1.5}.kb-heading-title>select{flex:none;margin-top:2px;max-width:180px}.kb-heading-actions{display:flex;align-items:center;gap:8px;flex:none}.kb-heading-actions .primary-button{min-height:36px}.knowledge-nav{display:flex;align-items:center;gap:4px;margin:0 0 16px;padding:4px;border:1px solid var(--line);border-radius:10px;background:color-mix(in srgb,var(--surface) 56%,transparent);overflow-x:auto;scrollbar-width:none}.knowledge-nav::-webkit-scrollbar{display:none}.knowledge-nav button{min-height:32px;padding:0 12px;border-radius:7px;color:var(--muted);font-size:12px;white-space:nowrap}.knowledge-nav button:hover{background:var(--soft);color:var(--text)}.knowledge-nav button[aria-current=page]{border:0;background:var(--selected);color:var(--text);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--action) 28%,transparent)}
.kb-scope-tabs{gap:6px;min-height:42px;margin:0 0 14px;padding:4px;border:1px solid var(--line);border-radius:10px;background:color-mix(in srgb,var(--surface) 45%,transparent);overflow-x:auto;scrollbar-width:none}.kb-scope-tabs::-webkit-scrollbar{display:none}.kb-scope-tabs button{height:32px;padding:0 12px;border-radius:7px;gap:6px}.kb-scope-tabs button[aria-selected=true]{background:var(--selected);color:var(--text)}.kb-scope-tabs button[aria-selected=true]::after{display:none}.kb-scope-tabs button[aria-selected=true] small{color:var(--action)}
.kb-ledger{min-height:0}.kb-ledger-toolbar{justify-content:flex-end;min-height:34px;padding:0 0 8px;border-bottom:1px solid var(--line)}.kb-ledger-toolbar .kb-search{height:36px;max-width:420px;border:1px solid transparent;background:var(--soft)}.kb-ledger-toolbar .kb-search:focus-within{border-color:color-mix(in srgb,var(--action) 60%,var(--line));outline:0}.kb-ledger-toolbar select{height:34px;border:1px solid var(--line)}.kb-ledger-toolbar>span{margin-left:0;font-variant-numeric:tabular-nums}.kb-library-actions summary{width:32px;height:32px}.kb-upload-guidance{display:flex;align-items:center;gap:8px;margin:10px 0 8px;padding:9px 11px;border:1px solid color-mix(in srgb,var(--action) 22%,var(--line));border-radius:9px;background:color-mix(in srgb,var(--action) 6%,var(--surface));color:var(--muted);font-size:11px}.kb-upload-guidance::before{content:'i';display:grid;place-items:center;width:16px;height:16px;border-radius:50%;background:color-mix(in srgb,var(--action) 20%,var(--surface));color:var(--action);font-size:10px;font-weight:700}.kb-ledger-list{padding-top:2px}.kb-ledger-row{min-height:70px;gap:12px;border-bottom:1px solid color-mix(in srgb,var(--line) 80%,transparent)}.kb-ledger-row:hover{background:color-mix(in srgb,var(--soft) 75%,transparent)}.kb-ledger-open{gap:12px;padding:11px 8px;cursor:default}.kb-ledger-view{flex:none;min-width:48px;height:32px;padding:0 10px;border-radius:7px;color:var(--action);font-size:11px}.kb-ledger-view:hover{background:var(--selected)}.kb-ledger-icon{width:36px;height:36px;border-radius:9px;background:color-mix(in srgb,var(--action) 12%,var(--soft));color:var(--action)}.kb-ledger-copy{gap:4px}.kb-ledger-copy strong{font-size:13px;font-weight:600}.kb-ledger-copy small{font-size:10.5px}.kb-ledger-state{max-width:none;padding:5px 8px;border-radius:999px;background:var(--soft);font-size:10px}.kb-ledger-state.published{background:color-mix(in srgb,var(--success) 18%,var(--surface));color:var(--success)}.kb-ledger-state.pending{background:color-mix(in srgb,var(--warning) 17%,var(--surface));color:var(--warning)}.kb-ledger-state.review{background:color-mix(in srgb,var(--muted) 16%,var(--surface));color:var(--text)}.kb-ledger-state.processing{background:color-mix(in srgb,var(--action) 15%,var(--surface));color:var(--action)}.kb-ledger-row>.kb-row-menu{margin-right:4px}.kb-ledger-footer{justify-content:flex-start;padding:10px 0 0;font-size:10px}
.kb-personal-heading .kb-heading-copy{flex:1}.kb-personal-add{flex:none}.kb-personal-add>div{min-width:270px}.kb-personal-add>div>p{margin-top:7px}.kb-personal-heading+.knowledge-nav{margin-top:0}

@media(max-width:760px){
  #messages.library-surface{padding:16px 14px 12px}
  .kb-heading{align-items:flex-start;flex-wrap:wrap;gap:12px;margin-bottom:12px}
  .kb-heading-title{width:100%;align-items:flex-start;gap:8px}
  .kb-heading-copy h1{font-size:21px}
  .kb-heading-copy p{font-size:10px}
  .kb-heading-title>select{max-width:140px;font-size:10px;padding:6px 7px}
  .kb-heading-actions{width:100%;justify-content:flex-end}
  .kb-heading-actions .kb-import-menu,.kb-heading-actions .primary-button{width:100%}
  .kb-heading-actions .kb-import-menu>summary{justify-content:center;width:100%}
  .knowledge-nav{margin-bottom:12px;padding:3px;border-radius:9px}
  .knowledge-nav button{min-height:30px;padding:0 10px;font-size:11px}
  .kb-scope-tabs{min-height:38px;margin-bottom:10px;padding:3px;border-radius:9px}
  .kb-scope-tabs button{height:30px;padding:0 10px;font-size:11px}
  .kb-ledger-toolbar{justify-content:flex-end;flex-wrap:wrap;gap:7px;min-height:0;padding-bottom:9px}
  .kb-ledger-toolbar .kb-search{flex:1 1 100%;max-width:none;width:100%;height:36px}
  .kb-ledger-toolbar select{flex:0 1 auto;max-width:none;height:32px;font-size:10px}
  .kb-ledger-toolbar>span{margin-left:auto;font-size:10px}
  .kb-library-actions{margin-left:0}
  .kb-library-actions summary{width:30px;height:30px}
  .kb-upload-guidance{margin:8px 0 5px;padding:8px 9px;font-size:10px;line-height:1.45}
  .kb-ledger-row{align-items:flex-start;min-height:76px;gap:6px}
  .kb-ledger-open{align-items:flex-start;gap:9px;padding:11px 2px 10px 0}
  .kb-ledger-icon{width:32px;height:32px;border-radius:8px}
  .kb-ledger-copy{gap:3px;padding-top:1px}
  .kb-ledger-copy strong{font-size:12px;line-height:1.45;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .kb-ledger-copy small{font-size:10px;line-height:1.4;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .kb-ledger-state{margin-top:12px;padding:4px 7px;font-size:9.5px}
  .kb-ledger-view{min-width:48px;height:36px;margin-top:8px;padding:0 8px}
  .kb-ledger-row>.kb-row-menu{margin:9px 0 0 0}
  .kb-ledger-footer{padding-top:8px;font-size:9.5px}
  .kb-personal-add>div{right:0;min-width:240px;width:min(286px,calc(100vw - 28px))}
  .dataset-toolbar{flex-wrap:wrap}
  .dataset-toolbar .dataset-search{min-width:100%;max-width:none;flex-basis:100%}
  .dataset-row-files{display:none}
  .dataset-ledger-row .dataset-actions{display:none}
}

@media(max-width:420px){
  .kb-heading-title>select{max-width:120px}
  .kb-scope-tabs button{padding:0 8px}
  .kb-ledger-state{max-width:64px;overflow:hidden;text-overflow:ellipsis}
}

/* Knowledge pages keep their navigation fixed; only the records or brand form scroll. */
#messages-scroll:has(>.library-surface){overflow:hidden}
#messages.library-surface{height:100%;min-height:0;overflow:hidden}
#messages.library-surface>.kb-heading,#messages.library-surface>.knowledge-nav,#messages.library-surface>.kb-scope-tabs{flex-shrink:0}
.kb-ledger{flex:1;min-height:0;overflow:hidden}
.kb-ledger-list,.brand-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
.kb-heading{align-items:center;flex-wrap:nowrap;gap:10px;margin-bottom:12px}
.kb-heading h1{font-size:22px;line-height:32px;white-space:nowrap}
.kb-heading-count{margin-left:5px;color:var(--muted);font-size:12px;font-weight:400;vertical-align:middle}
.kb-heading>.kb-heading-actions{flex:0 0 auto;width:auto;gap:6px}
.kb-heading-actions .kb-import-menu,.kb-heading-actions .primary-button,.kb-heading-actions .kb-import-menu>summary{width:auto}
.kb-heading .kb-library-actions{flex:none}
.kb-heading .kb-library-actions>div{min-width:160px}
.kb-heading .kb-library-actions #knowledge-space{width:100%;max-width:none;margin:0 0 4px}
.knowledge-nav{margin-bottom:10px}
.kb-scope-tabs{margin-bottom:6px}
@media(max-width:760px){
 body.studio-web #messages.library-surface>.kb-heading{display:flex;align-items:center;flex-wrap:nowrap;gap:8px;min-height:40px;margin:0 0 8px}
 body.studio-web .kb-heading h1{flex:1;min-width:0;font-size:20px;line-height:32px}
 body.studio-web .kb-heading-actions{flex:0 0 auto;width:auto}
 body.studio-web .kb-heading-actions .kb-import-menu,body.studio-web .kb-heading-actions .primary-button,body.studio-web .kb-heading-actions .kb-import-menu>summary{width:auto}
 body.studio-web .kb-heading-actions .primary-button{padding:0 10px}
 body.studio-web .kb-heading .kb-row-menu summary{width:40px;height:40px}
 body.studio-web #messages.library-surface>.knowledge-nav{margin-bottom:8px}
 body.studio-web #messages.library-surface>.kb-scope-tabs{margin-bottom:4px}
}
