/* Library controls stay quiet until they are needed. */
.research-library-row{display:flex;align-items:center;border-bottom:1px solid var(--line-soft);gap:8px;min-width:0}
.research-library-row:last-child{border-bottom:0}
.research-library-row>.research-file-row{flex:1;min-width:0;border:0;padding-right:0}
.research-library-row .research-file-row>.company-logo{width:30px;height:30px;border-radius:8px}
.research-item-menu{flex:none;width:28px;height:28px;color:var(--muted);opacity:0;transition:opacity 120ms}
.research-library-row:hover .research-item-menu,.research-library-row:focus-within .research-item-menu{opacity:1}
.research-select-item{flex:none;display:grid;place-items:center;margin:0;width:24px}
.research-select-item input{width:15px!important;height:15px!important;min-height:0!important;margin:0;accent-color:var(--ink)}
.research-selection-bar{display:flex;align-items:center;gap:18px;padding:10px 12px;background:var(--paper);border-radius:8px;margin-bottom:5px;font-size:11px}
.research-selection-bar>span{margin-left:auto;color:var(--muted)}
.research-selection-bar .secondary{padding:7px 10px;min-height:30px;font-size:11px;display:flex;gap:8px;align-items:center}
.research-selection-bar .icon{width:14px;height:14px}
.research-collection-heading>.text-link{margin-left:auto;font-size:11px;color:var(--muted)}
.research-collection-heading>label{margin-left:18px}
.research-library-nav{max-height:calc(100dvh - 48px);overflow:auto;scrollbar-width:thin;overscroll-behavior:contain}
.library-folder-row .folder-edit{opacity:0}
.library-folder-row:hover .folder-edit,.library-folder-row:focus-within .folder-edit{opacity:1}
.research-library-nav .is-drop-target{outline:1px solid var(--ink);outline-offset:-2px;background:var(--selected)}
.research-library-row.is-dragging{opacity:.4}
.library-action-menu{display:grid;gap:4px;margin:4px 0 16px}
.library-action-menu>button{display:flex;align-items:center;gap:12px;padding:13px 10px;text-align:left;border-radius:8px;font-size:13px}
.library-action-menu>button:hover{background:var(--selected)}
.library-action-menu .icon{width:17px;height:17px}
.library-action-hint{font-size:12px;color:var(--muted);line-height:1.5;margin:0}
.library-action-dialog{max-width:360px!important}
.research-document-toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px;gap:12px}
.research-document-toolbar>.text-link{margin:0}
.research-document-toolbar .icon-button{width:30px;height:30px;color:var(--muted)}
.research-detail-layout.context-closed{grid-template-columns:minmax(0,1fr)}
.research-detail-layout.context-closed .research-document{max-width:800px}
#research-context[hidden]{display:none!important}
.report-metadata summary{display:flex;align-items:center;justify-content:space-between;list-style:none;color:var(--muted);cursor:pointer;font-size:11px}
.report-metadata summary::-webkit-details-marker{display:none}
.report-metadata summary>.icon{width:12px;height:12px;transition:transform 150ms}
.report-metadata[open] summary>.icon{transform:rotate(180deg)}
.report-metadata .report-facts{border:0;padding-top:15px;margin-bottom:0;font-size:11px}
.report-inspector{gap:20px}
.report-inspector-top{padding-bottom:0}
.report-company{gap:11px;padding-bottom:20px}
.report-company>.company-logo{width:32px;height:32px;border-radius:8px}
.report-company strong{font-size:14px}
.report-company small{font-size:11px}
.report-forecast{padding-top:0}
.report-forecast>small{font-size:10px}
.report-inspector-bottom>.secondary{display:flex;align-items:center;justify-content:center;gap:10px;width:100%}
.report-inspector-bottom .icon{width:16px;height:16px}
.research-document .research-report{font-size:14px;line-height:1.8}
.research-document .research-report h2{font-size:20px}
.research-document .research-report h3{font-size:16px}
/* The discussion remains independent of the main chat and report scroll. */
.side-chat-dock{position:fixed;z-index:45;right:16px;top:76px;bottom:16px;width:380px;display:flex;flex-direction:column;min-height:0;background:var(--paper);border:1px solid var(--line);border-radius:13px;box-shadow:0 12px 55px #0004;overflow:hidden}
.side-chat-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:17px 15px 12px}
.side-chat-header>div:first-child{display:flex;flex-direction:column;min-width:0;gap:3px}
.side-chat-header strong{font-size:14px;font-weight:550}
.side-chat-header>div:last-child{display:flex;align-items:center;gap:2px}
.side-chat-header .icon-button{display:grid;place-items:center;width:28px;height:28px;color:var(--muted)}
.side-chat-header .icon{width:16px;height:16px;transform:none!important}
.side-chat-header .model-picker-trigger{font-size:11px;padding:4px 0;min-height:24px;max-width:200px;justify-content:flex-start}
.side-chat-header .model-picker-trigger .icon{width:11px!important;height:11px!important}
.side-chat-context{padding:0 15px 12px;border-bottom:1px solid var(--line-soft)}
.side-chat-context select{width:100%;border:0;background:transparent;font-size:11px;color:var(--muted);min-height:25px;max-width:100%;text-overflow:ellipsis}
.side-chat-messages{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:20px 17px;scrollbar-width:thin}
.side-chat-messages .live-message{font-size:13px;margin-bottom:24px;padding:0;background:transparent;border:0}
.side-chat-messages .live-message>span{display:block;color:var(--muted);font-size:10px;margin-bottom:9px}
.side-chat-messages .live-message.user>p{background:var(--selected);border-radius:9px;padding:12px;margin:0 0 0 20px;white-space:pre-wrap}
.side-chat-messages .markdown-body{font-size:13px;line-height:1.75;overflow-wrap:anywhere}
.side-chat-messages .markdown-body h2{font-size:17px}
.side-chat-messages .markdown-body h3{font-size:15px}
.side-chat-messages .run-status{padding:0;border:0;background:transparent;min-height:0}
.side-chat-messages .run-status-top{gap:8px}
.side-chat-messages .run-status-top strong{font-size:11px}
.side-chat-messages .run-status-top time,.side-chat-messages .run-cancel{font-size:10px}
.side-chat-messages .run-cancel{padding:3px 0;margin:5px 0 10px}
.side-chat-empty{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:10px;min-height:200px}
.side-chat-empty p{font-size:17px;margin:0 0 10px;letter-spacing:-.3px}
.side-chat-empty button{font-size:12px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;color:var(--sub)}
.side-chat-composer{flex:none;margin:0 12px 12px;border:1px solid var(--line);border-radius:11px;padding:12px;background:var(--bg)}
.side-chat-composer textarea{display:block;resize:none;width:100%;border:0;border-radius:0;background:transparent;padding:0;min-height:58px;max-height:150px;font-size:13px;line-height:1.6;outline:none}
.side-chat-composer>div{display:flex;align-items:center;gap:10px;justify-content:space-between}
.side-chat-composer [data-form-feedback]{font-size:11px;color:var(--muted)}
.side-chat-composer .primary{display:grid;place-items:center;width:32px;height:32px;min-height:32px;margin-left:auto;padding:0;border-radius:8px}
.side-chat-composer .icon{width:17px;height:17px;transform:rotate(-45deg)}
.side-chat-error{font-size:12px;color:var(--negative)}
@media(min-width:1450px){body.has-side-chat .app-shell{margin-right:410px}}
@media(max-width:1000px){.report-inspector{display:flex;flex-direction:column}.research-detail-layout #research-context{grid-row:2}.report-forecast>div{max-width:260px}.report-inspector-bottom{margin-top:0}.report-company{border-bottom:1px solid var(--line-soft)}.research-document-toolbar{margin-bottom:18px}}
@media(max-width:760px){.research-item-menu,.library-folder-row .folder-edit{opacity:1}.research-library-nav{max-height:none;overflow-x:auto}.research-collection-heading>label{margin-left:8px}.research-selection-bar{gap:10px}.side-chat-dock{inset:auto 8px 8px;width:auto;top:60px;z-index:65;border-radius:12px}.side-chat-composer textarea{font-size:16px}.research-library-row>.research-file-row{padding:17px 0}.research-document .research-report{font-size:14px}.research-document-toolbar{margin-top:8px}.research-file-name{min-width:0}.research-file-name strong{overflow-wrap:anywhere}.research-file-state{font-size:10px}.research-library-row .research-file-row>.company-logo{width:27px;height:27px}}
@media(prefers-reduced-motion:reduce){.research-item-menu,.report-metadata summary>.icon{transition:none}}
.research-library-nav .library-settings>span{white-space:normal;line-height:1.5;overflow:visible;text-overflow:clip}
.library-folder-row>button:first-child{padding-right:32px}
.library-folder-row>button:first-child>span{overflow-wrap:anywhere}
.report-inspector-top h2{font-size:13px;color:var(--ink)}
.side-chat-composer textarea:focus-visible{outline:none;box-shadow:none}
.side-chat-composer:focus-within{border-color:var(--sub)}
body.has-side-chat .research-detail-layout{grid-template-columns:minmax(0,1fr)}
body.has-side-chat .research-detail-layout #research-context{display:none}
body.has-side-chat .research-library-shell:has(.research-detail-layout){grid-template-columns:minmax(0,1fr)}
body.has-side-chat .research-workspace:has(.research-detail-layout) .research-library-nav{display:none}
@media(min-width:1100px){body.has-side-chat .app-shell{margin-right:405px}.research-library-shell{grid-template-columns:168px minmax(0,1fr);gap:24px}}
.research-drag-preview{position:fixed;top:0;left:0;z-index:100;pointer-events:none;max-width:240px;padding:11px 15px;background:var(--selected);color:var(--ink);font-size:12px;border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 24px #0004;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.research-library-row.is-dragging{user-select:none;cursor:grabbing}
.workspace-retry{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;min-height:100dvh;padding:24px;text-align:center}
.workspace-retry h1{font-size:24px;margin:0}.workspace-retry p{font-size:13px;color:var(--muted);margin:0}.workspace-retry .secondary{margin-top:8px}
