/* Business variant: DESIGN FEREBRUM AI. Existing ThemeContext owns colors. */
.ferebrum-sources-trigger,.ferebrum-close,.ferebrum-consent-actions button{cursor:pointer;min-height:40px;border:1px solid rgb(var(--border-medium));border-radius:20px;padding:7px 12px;background:rgb(var(--surface-primary));color:rgb(var(--text-primary))}
.ferebrum-sources-trigger{display:inline-flex;align-items:center;gap:7px;font-size:14px;white-space:nowrap}
.ferebrum-sources-trigger:hover,.ferebrum-close:hover,.ferebrum-consent-actions button:hover{border-color:var(--ferebrum-brand)}
.ferebrum-sources-trigger:focus-visible,.ferebrum-resources :is(button,a,summary):focus-visible,.ferebrum-consent-dialog :is(input,button):focus-visible{outline:2px solid var(--ferebrum-brand);outline-offset:3px}
.ferebrum-resources[hidden]{display:none!important}
.ferebrum-resources{position:fixed;right:0;top:0;bottom:0;width:290px;max-width:calc(100vw - 24px);z-index:35;display:flex;flex-direction:column;overflow:hidden;padding:18px 18px 12px;background:rgb(var(--surface-primary));color:rgb(var(--text-primary));border-left:1px solid rgb(var(--border-medium));font-size:14px;font-weight:400;line-height:1.5;scrollbar-gutter:stable}
.ferebrum-resources-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;margin-bottom:22px}
.ferebrum-resources h2{font-size:21px;font-weight:600;margin-top:5px}
.ferebrum-design-caption{font-size:10px;letter-spacing:.09em;color:rgb(var(--text-secondary))}
.ferebrum-close{font-size:11px;padding:4px 8px;min-height:34px}
.ferebrum-resources details{border-top:1px solid rgb(var(--border-medium));padding-top:16px;margin-top:18px}
.ferebrum-resources details:first-of-type{flex:1;min-height:100px;overflow:auto}
.ferebrum-resources details:last-of-type{flex:0 1 auto;max-height:42%;overflow:auto}
.ferebrum-resources details:last-of-type li{padding:5px 0}
.ferebrum-resources details:last-of-type li p{display:none}
.ferebrum-resources summary{cursor:pointer;font-size:16px;font-weight:600;min-height:36px}
.ferebrum-source-list{list-style:none;padding:0;margin:0}
.ferebrum-source-list li{padding:10px 0;border-bottom:1px solid rgb(var(--border-light))}
.ferebrum-source-list p{font-size:12px;color:rgb(var(--text-secondary));margin-top:5px}
.ferebrum-resource-row{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.ferebrum-status{font-size:10px;white-space:nowrap;color:rgb(var(--text-secondary))}
.ferebrum-status.is-connected{color:#269958}
.dark .ferebrum-status.is-connected{color:#70d99c}
.ferebrum-text-button{cursor:pointer;font-size:12px;text-decoration:underline;text-underline-offset:3px;margin-top:8px;min-height:28px}
.ferebrum-site-link{font-size:15px;text-decoration:underline;text-underline-offset:4px;display:inline-block;min-height:28px}
.ferebrum-site-link:hover,.ferebrum-text-button:hover{color:var(--ferebrum-brand)}
.ferebrum-resource-note{font-size:11px!important;color:rgb(var(--text-secondary));margin-top:12px;flex-shrink:0}
.ferebrum-resource-help{padding:8px 0}
@media(min-width:1280px){main:has(.ferebrum-resources[data-open="true"]){padding-right:290px}}
@media(max-width:900px){.ferebrum-sources-trigger span{display:none}.ferebrum-sources-trigger{padding:6px 10px}}
.ferebrum-consent-dialog{position:fixed;inset:0;margin:auto;padding:26px;width:640px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);overflow:auto;border:1px solid rgb(var(--border-medium));border-radius:22px;background:rgb(var(--surface-primary));color:rgb(var(--text-primary));font-size:15px;line-height:1.5;box-shadow:0 18px 70px #0005}
.ferebrum-consent-dialog::backdrop{background:#0009}
.ferebrum-consent-dialog h2{font-size:23px;font-weight:600;margin:0 0 12px}
.ferebrum-consent-dialog p{margin:12px 0}
.ferebrum-consent-previews{display:flex;gap:12px;overflow:auto;margin:16px 0}
.ferebrum-consent-previews figure{min-width:140px;max-width:240px;flex:1}
.ferebrum-consent-previews img{width:100%;height:150px;object-fit:contain;border-radius:10px;background:rgb(var(--surface-secondary))}
.ferebrum-consent-previews figcaption{font-size:12px;overflow-wrap:anywhere;margin-top:5px}
.ferebrum-consent-check{display:flex;gap:12px;align-items:flex-start;margin:20px 0;cursor:pointer}
.ferebrum-consent-check input{width:20px;height:20px;flex-shrink:0;margin-top:3px;accent-color:var(--ferebrum-brand)}
.ferebrum-consent-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:20px}
.ferebrum-consent-actions .ferebrum-primary{background:var(--ferebrum-brand);color:#121212;border-color:var(--ferebrum-brand);font-weight:600;min-width:210px}
.ferebrum-consent-actions button:disabled{cursor:not-allowed;opacity:.45}
.ferebrum-consent-error{color:#c24732}.dark .ferebrum-consent-error{color:#ff9a8a}
[data-testid="convo-item"]{min-height:42px;margin-block:3px;border-radius:12px!important}
@media(max-width:600px){.ferebrum-consent-dialog{padding:18px}.ferebrum-consent-actions button{width:100%}.ferebrum-resources{top:0}}
@media(forced-colors:active){.ferebrum-resources,.ferebrum-consent-dialog{border-color:CanvasText}.ferebrum-status.is-connected{color:CanvasText}}

/* Sources drawer aligns with the native header, not one header below it. */
.ferebrum-resources-heading{margin-bottom:12px;flex-shrink:0}

/* Canonical ThemeContext owns all modes, including OS-following system mode. */
.ferebrum-theme-modes{display:flex;gap:2px;border:1px solid rgb(var(--border-medium));border-radius:24px;padding:2px}
.ferebrum-theme-modes button{border:0!important;min-height:34px!important;padding:5px 9px!important}
.ferebrum-theme-modes button[aria-pressed=true]{background:var(--ferebrum-brand)!important;color:#121212!important}
aside[aria-label="Контрольная панель"]{background:#f4f5f7;color:rgb(var(--text-primary))}
aside[aria-label="Контрольная панель"] .bg-surface-primary-alt{background:#f4f5f7}
.dark aside[aria-label="Контрольная панель"],.dark aside[aria-label="Контрольная панель"] .bg-surface-primary-alt{background:#101214}
@media(max-width:600px){.ferebrum-theme-modes button{min-width:32px;padding:5px!important}}
@media(forced-colors:active){.ferebrum-theme-modes button[aria-pressed=true]{outline:2px solid Highlight}}

/* Research Room: dimensions derived from the approved 1488 × 1058 reference. */
:root{--rr-sources:368px;--rr-header:68px;--rr-line:rgb(var(--border-medium));--rr-muted:rgb(var(--text-secondary))}
.rr-icon{display:inline-block;flex-shrink:0;width:24px;height:24px;background:currentColor;mask-repeat:no-repeat;mask-position:center;mask-size:contain;-webkit-mask-repeat:no-repeat;-webkit-mask-position:center;-webkit-mask-size:contain}
.rr-nav button,.rr-rail button,.rr-rail a,.rr-suggestions button,.rr-resources button,.rr-resources summary{cursor:pointer}
.rr-nav button:focus-visible,.rr-rail :is(button,a):focus-visible,.rr-suggestions button:focus-visible,.rr-resources :is(button,a,summary):focus-visible{outline:2px solid #73d7e4;outline-offset:3px}
.ferebrum-header{height:var(--rr-header)!important;padding:12px 24px!important}
.ferebrum-wordmark{font-size:23px!important;white-space:nowrap}
@media(min-width:1280px){main:has(.ferebrum-resources[data-open=true]){padding-right:var(--rr-sources)!important}main:has(.ferebrum-resources[data-open=true]) .ferebrum-header{width:calc(100% + var(--rr-sources))!important}}
.ferebrum-resources.rr-resources{top:var(--rr-header);width:var(--rr-sources);padding:0 24px 20px;font-size:14px;overflow:auto;scrollbar-gutter:auto}
.rr-resources-heading{display:flex;align-items:center;gap:12px;height:78px;flex-shrink:0;border-bottom:1px solid var(--rr-line)}
.rr-resources-heading h2{font-size:21px;margin:0;font-weight:600}
.rr-resources-heading>button{margin-left:auto;border-radius:8px;padding:8px;color:var(--rr-muted)}
.rr-resources-heading>button:hover{background:rgb(var(--surface-hover));color:rgb(var(--text-primary))}
.rr-resources details,.rr-resources details:first-of-type,.rr-resources details:last-of-type{flex:none;min-height:0;max-height:none;overflow:visible;padding:24px 0 20px;margin:0;border:0;border-bottom:1px solid var(--rr-line)}
.rr-resources summary{font-size:16px;font-weight:400;min-height:32px;list-style:none;position:relative;padding-right:22px}
.rr-resources summary::marker{display:none}.rr-resources summary:after{content:'';position:absolute;right:2px;top:3px;width:18px;height:18px;background:currentColor;mask:url('/assets/ferebrum/research-icons/ChevronDown.svg') center/contain no-repeat}
.rr-resources details[open]>summary:after{transform:rotate(180deg)}
.rr-library-list,.rr-sites{list-style:none;margin:0;padding:0}
.rr-library-list>li{display:flex;align-items:center;flex-wrap:wrap;gap:12px;min-height:72px;padding:12px 0}
.rr-library-icon{width:30px;height:30px}.rr-solargy{color:#ff8500}.rr-drive{color:#69bfa4}
.rr-library-copy{flex:1;min-width:65px}.rr-library-copy strong{font-size:13px;font-weight:600}.rr-library-copy p{font-size:11px;line-height:1.4;color:var(--rr-muted);margin-top:5px}
.rr-connected{font-size:11px;color:#69d6a1;white-space:nowrap;display:flex;align-items:center;gap:5px}.rr-connected:before{content:'';width:7px;height:7px;border-radius:50%;background:#20c470}
.rr-configure{border:1px solid var(--rr-line);border-radius:24px;padding:8px 10px;font-size:11px;white-space:nowrap}.rr-configure:hover{background:rgb(var(--surface-hover))}
.rr-help{font-size:12px;color:var(--rr-muted);flex-basis:100%;padding:8px;background:rgb(var(--surface-secondary));border-radius:8px}
.rr-sites>li,.rr-resources details:last-of-type .rr-sites>li{display:flex;align-items:center;gap:18px;padding:18px 0;min-height:82px}
.rr-sites>li>.rr-icon:first-child{color:#8ed4ec;width:28px;height:28px}.rr-sites>li>.rr-icon:last-child{width:18px;height:18px}
.rr-sites a{flex:1;text-decoration:none}.rr-sites strong{display:block;font-size:13px;font-weight:600}.rr-sites a span{display:block;margin-top:5px;font-size:11px;color:var(--rr-muted)}.rr-sites a:hover strong{color:#ff8500}
.rr-source-footnote{font-size:10px;color:var(--rr-muted);letter-spacing:.1em;margin-top:auto;padding-top:20px}
aside[aria-label="Контрольная панель"]{min-width:368px!important;width:368px!important;max-width:368px!important}
aside[aria-label="Контрольная панель"]>div>div:first-child{width:94px;align-items:center;padding:10px 9px}
aside[aria-label="Контрольная панель"] [data-testid="new-chat-button"],aside[aria-label="Контрольная панель"]>div>div:first-child>div.border-b,aside[aria-label="Контрольная панель"]>div>div:first-child>div:has(>[data-testid="nav-panel-conversations"]){display:none!important}
.rr-rail-mount{width:100%}.rr-rail{display:flex;flex-direction:column;gap:8px}.rr-rail button,.rr-rail a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;width:100%;min-height:82px;font-size:11px;border-radius:12px;color:rgb(var(--text-primary));text-decoration:none}
.rr-rail .rr-icon{width:27px;height:27px}.rr-rail .is-selected{background:#21343a}.light .rr-rail .is-selected{background:#d7edf2}.rr-rail :is(button,a):hover{background:rgb(var(--surface-hover))}
.rr-nav-mount{flex-shrink:0}.rr-nav{padding:12px 18px 0}.rr-nav-heading{display:flex;align-items:center;justify-content:space-between;margin:0 0 22px}.rr-nav-heading h2{font-size:21px;font-weight:600}.rr-nav-heading .rr-icon{width:20px;height:20px}
.rr-new{display:flex;align-items:center;gap:16px;width:100%;background:#ff8500;color:#121212;border-radius:10px;padding:13px 16px;font-weight:600;font-size:14px;margin-bottom:18px}.rr-new:hover{background:#ff9a2c}
.rr-categories{display:flex;flex-direction:column;gap:8px}.rr-categories button{display:flex;align-items:center;gap:15px;width:100%;border:1px solid var(--rr-line);border-radius:10px;min-height:50px;padding:10px 14px;font-size:14px;text-align:left;background:rgb(var(--surface-primary))}.rr-categories button:hover{background:rgb(var(--surface-hover));border-color:#60939b}.rr-categories small{font-size:9px;color:var(--rr-muted);margin-left:auto}
.rr-recent{margin:30px 0 8px;color:var(--rr-muted);font-size:13px}.rr-room-note{font-size:12px;line-height:1.4;margin-top:10px;color:var(--rr-muted)}
div[aria-label="История чатов"]{padding-top:0!important}
div[aria-label="История чатов"] .min-h-full>div:first-child:not(:has(button[aria-expanded=true])){display:none}
div[aria-label="История чатов"] .min-h-full>div:nth-child(2)>div:first-child{display:none}
/* Keep native project disclosures accessible through the rail; show only when expanded. */
div[aria-label="История чатов"] button[aria-expanded=true]:has(+div){display:initial}
[data-testid="convo-item"]{border:0!important;background:transparent!important;min-height:46px!important;margin:2px 8px!important;border-radius:10px!important}
.rr-welcome{width:100%;max-width:740px;min-height:0;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:90px 42px 32px;color:rgb(var(--text-primary))}
.rr-bot{display:flex;align-items:center;justify-content:center;width:76px;height:76px;border:1px solid #65b8c6;background:#19363d88;border-radius:22px;margin-bottom:26px}.rr-bot .rr-icon{width:40px;height:40px}
.rr-welcome h2{font-size:34px;font-weight:600;line-height:1.2;letter-spacing:-.02em;margin:0 0 18px}.rr-subtitle{font-size:19px;margin:0 0 14px}.rr-intro{font-size:17px;line-height:1.5;color:var(--rr-muted);margin:0}
.rr-suggestions{display:grid;grid-template-columns:1fr 1fr;gap:16px;width:100%;margin-top:40px;text-align:left}
.rr-suggestions button{display:flex;align-items:center;gap:18px;min-height:78px;padding:15px 18px;border:1px solid #64777b66;border-radius:22px;background:#14191955;text-align:left;font-size:13px;line-height:1.6}.light .rr-suggestions button{background:#ffffff88}.rr-suggestions button:hover{border-color:#75cad6;background:#28434a66}.rr-suggestions .rr-arrow{margin-left:auto;width:17px;height:17px}
[data-chat-pane]:has(>.rr-welcome){justify-content:flex-start!important;overflow-y:auto;min-height:0;width:100%;padding-bottom:16px}
[data-chat-pane]:has(>.rr-welcome)>div:last-child{margin-top:auto;max-width:100%!important;min-width:0;padding:0}
main form:has([data-testid="composer-surface"]){margin:0 auto!important;padding:14px 14px max(14px,env(safe-area-inset-bottom))!important;max-width:100%!important;min-width:0;box-sizing:border-box}
[data-testid="composer-surface"]{border-radius:24px!important;border:1px solid #65707355!important;background:rgb(var(--surface-primary))!important;padding:10px!important;box-shadow:0 0 0 9px #11151688,0 0 0 10px #64777b44!important}
.light [data-testid="composer-surface"]{box-shadow:0 0 0 9px #ffffff88,0 0 0 10px #64777b33!important}
main #prompt-textarea{min-height:66px!important;padding:10px 10px 18px!important;font-size:14px!important}
.ferebrum-composer-bar{padding:0!important;min-height:48px!important}
button[aria-label="Отправить сообщение"]{background:#ff8500!important;color:#111!important;width:48px!important;height:48px!important;border-radius:50%!important}button[aria-label="Отправить сообщение"]:disabled{opacity:.45}
button[aria-label="Attach and tools"]{width:44px!important;height:44px!important;border:1px solid var(--rr-line)!important;border-radius:50%!important}
main:has(.rr-welcome) a[href="https://librechat.ai"]{display:none}main:has(.rr-welcome) [data-chat-pane]+div{display:none}
@media(max-height:850px){.rr-welcome{padding-top:85px;padding-bottom:24px}.rr-bot{width:62px;height:62px;margin-bottom:18px}.rr-welcome h2{font-size:29px}.rr-suggestions{margin-top:24px;gap:12px}.rr-suggestions button{min-height:68px}.rr-recent{margin-top:20px}.rr-categories button{min-height:44px}.rr-sites>li,.rr-resources details:last-of-type .rr-sites>li{min-height:70px;padding:13px 0}}
@media(max-width:1279px){:root{--rr-sources:330px}.ferebrum-resources.rr-resources{box-shadow:-12px 0 40px #0005}.rr-welcome{max-width:780px}aside[aria-label="Контрольная панель"]{min-width:310px!important;width:310px!important;max-width:310px!important}aside[aria-label="Контрольная панель"]>div>div:first-child{width:70px}.rr-nav{padding-inline:12px}.rr-categories button{gap:10px;padding-inline:10px}}
@media(max-width:767px){.ferebrum-header{padding:8px!important;height:60px!important}:root{--rr-header:60px}.ferebrum-wordmark{font-size:16px!important}.ferebrum-header .ferebrum-team-link{display:none}.rr-welcome{padding:84px 20px 28px;justify-content:flex-start}.rr-welcome h2{font-size:27px}.rr-subtitle{font-size:16px}.rr-intro{font-size:14px}.rr-suggestions{gap:10px;margin-top:24px}.rr-suggestions button{padding:12px;gap:10px;font-size:12px;min-height:88px}.rr-suggestions .rr-arrow{display:none}.rr-suggestions .rr-icon{width:20px;height:20px}.ferebrum-resources.rr-resources{width:min(340px,calc(100vw - 16px))}.ferebrum-header:has([data-testid="header-open-sidebar-button"]) .ferebrum-wordmark{display:none}}
.rr-sites a{color:rgb(var(--text-primary))!important}
.rr-nav .rr-new{margin-bottom:12px}.rr-nav .rr-recent{margin:0 0 8px}
.rr-actions-mount{flex-shrink:0;max-height:45%;overflow-y:auto;border-top:1px solid var(--rr-line)}
.rr-actions{padding:12px 18px 14px}.rr-actions summary{cursor:pointer;font-size:13px;font-weight:600;padding:3px 0}
.rr-action-help{font-size:11px;line-height:1.5;color:var(--rr-muted);margin:6px 0 10px}
.rr-actions .rr-categories{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.rr-actions .rr-categories button{min-height:48px;padding:8px;gap:7px;font-size:12px;line-height:1.3}
.rr-actions .rr-categories .rr-icon{width:18px;height:18px}
.rr-room{border-top:1px solid var(--rr-line);margin-top:12px;padding-top:10px}
.rr-room>button{display:flex;align-items:center;gap:8px;width:100%;min-height:38px;font-size:12px;cursor:pointer;border-radius:8px;padding:6px}
.rr-room>button:hover{background:rgb(var(--surface-hover))}.rr-room small{margin-left:auto;color:var(--rr-muted);font-size:10px}
.rr-actions :is(button,summary):focus-visible{outline:2px solid #73d7e4;outline-offset:2px}
aside[aria-label="Контрольная панель"]:has([data-testid="open-sidebar-button"]){min-width:52px!important;width:52px!important;max-width:52px!important}
@media(max-width:767px){
 :root{--rr-header:108px}
 .ferebrum-header{display:flex!important;flex-wrap:wrap!important;height:108px!important;gap:4px 8px!important;align-content:center!important}
 .ferebrum-header>div:nth-child(2){flex:1!important}
 .ferebrum-header .ferebrum-wordmark{display:block!important}
 .ferebrum-header>div:nth-child(3){width:100%!important;justify-content:flex-end!important;flex-wrap:nowrap!important;display:flex!important}
 .ferebrum-appearance{display:flex!important;position:static!important;width:auto!important;gap:4px!important}
 .ferebrum-theme-modes{display:flex!important;width:auto!important;gap:0!important}
 .ferebrum-theme-modes button{min-width:36px!important;width:36px!important;padding:8px!important}
 .ferebrum-control-label{display:none!important}
 .ferebrum-sources-trigger{width:40px!important;min-width:40px!important;padding:8px!important}
 .ferebrum-sources-trigger>.rr-icon{display:inline-block!important}
 .ferebrum-resources.rr-resources{top:108px!important;bottom:0!important;height:calc(100dvh - 108px)!important;max-height:none!important}
 .rr-welcome{padding-top:128px!important}
}
@media(prefers-reduced-motion:reduce){.rr-welcome,.rr-nav *{transition:none!important}}
@media(forced-colors:active){.rr-icon{background:CanvasText}.rr-new,.rr-connected{color:CanvasText}.rr-suggestions button,.rr-categories button{border-color:CanvasText}}

aside[aria-label="Контрольная панель"]:has([data-testid="open-sidebar-button"])>div>div:first-child{width:52px!important;padding-inline:6px!important}

/* 18 Oct: non-blocking transfer notice and centered team control. */
.ferebrum-transfer-notice{padding:0 12px 8px;color:var(--rr-muted);font-size:12px;line-height:1.35;overflow-wrap:anywhere}.ferebrum-transfer-notice small{font-size:inherit}.ferebrum-transfer-notice [role="alert"]{color:rgb(var(--text-primary));margin-top:4px}.ferebrum-header .ferebrum-team-link{position:relative!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;padding:0!important;width:44px!important;min-width:44px!important;height:44px!important;gap:0!important}.ferebrum-header .ferebrum-team-link::before{position:absolute!important;inset:0!important;margin:auto!important;width:24px!important;height:24px!important;background-position:center!important;mask-position:center!important;-webkit-mask-position:center!important}@media(max-width:767px){.ferebrum-header .ferebrum-team-link{display:none!important}}
