/* Load after cosmic.css, space-layout.css and space-navigation.css. */
@media(min-width:761px){
 body.unified-navigation .workspace{--unified-left:260px;--unified-right:0px}
 body.unified-navigation.chat-list-collapsed .workspace{--unified-left:68px!important}
 body.unified-navigation .workspace,
 body.unified-navigation.space-room .workspace,
 body.unified-navigation[data-mode=spaces] .workspace,
 body.unified-navigation.chat-list-collapsed .workspace,
 body.unified-navigation.space-room.chat-list-collapsed .workspace:has(.context-rail:not([hidden])),
 body.unified-navigation.space-room.chat-list-collapsed.context-collapsed .workspace,
 body.unified-navigation.space-room .workspace:has(.context-rail:not([hidden])),
 body.unified-navigation.space-room.context-collapsed .workspace,
 body.unified-navigation[data-mode=spaces].chat-list-collapsed .workspace{grid-template-columns:var(--unified-left) minmax(0,1fr) var(--unified-right)!important}
 body.unified-navigation .main{grid-column:2;grid-row:1;min-width:0}
 body.unified-navigation .context-rail{grid-column:3;grid-row:1;min-width:0}
 body.unified-navigation .app-nav,
 body.unified-navigation .app-nav.space-navigation-active{grid-column:1;grid-row:1;display:flex;flex-direction:column;align-items:stretch;min-width:0;min-height:0;gap:0;padding:22px 14px 12px;overflow:hidden;background:linear-gradient(160deg,#08101e,#040812 75%);border-inline-end:1px solid #1b2948;color:#d4def6;color-scheme:dark;--muted:#9aacca;--accent:#acb8ff}
 body.unified-navigation.chat-list-collapsed .app-nav{display:flex!important;padding-inline:10px}
 body.unified-navigation.chat-list-collapsed .app-nav>:not(.nav-logo){display:none!important}
 body.unified-navigation.chat-list-collapsed .app-nav .nav-logo{width:46px;min-width:46px;justify-content:center;margin-inline:0}
 body.unified-navigation.chat-list-collapsed .app-nav .nav-logo span{display:none!important}
 body.unified-navigation .app-nav .nav-logo{display:flex;align-items:center;gap:12px;width:100%;height:auto;justify-content:flex-start;margin:0 0 20px;padding:0 2px;background:transparent;border:0;border-radius:8px;color:inherit;font-size:1.1rem;min-height:46px;text-align:start}
 body.unified-navigation .app-nav .nav-logo span{display:inline}
 body.unified-navigation .app-nav .nav-logo img{width:38px;height:38px}
 body.unified-navigation .unified-chat-link{margin:0 0 12px}
 body.unified-navigation .unified-chat-link>.nav-item{display:flex;flex-direction:row;justify-content:flex-start;gap:11px;width:100%;min-height:44px;padding:10px 12px;white-space:normal;font-size:.94rem;text-align:start}
 body.unified-navigation .unified-searches{flex-shrink:0;min-width:0;margin-bottom:12px}
 body.unified-navigation .unified-searches>.search{display:block;min-width:0;margin:0}
 body.unified-navigation .unified-searches>.search input{width:100%;min-width:0;min-height:42px;border:1px solid #263956;border-radius:10px;background:#0d1627;color:#d5def6;font-size:.87rem}
 body.unified-navigation .unified-searches>.space-nav-search{margin:0}
 body.unified-navigation .app-nav>.sidebar{display:flex;position:static;inset:auto;grid-column:auto;grid-row:auto;flex:1;min-height:0;min-width:0;width:100%;padding:0;transform:none;transition:none;background:transparent;border:0;overflow:hidden}
 body.unified-navigation .app-nav>.sidebar>.brand{display:none}
 body.unified-navigation .app-nav>.sidebar .new-chat{min-height:42px;width:100%;margin:0}
 body.unified-navigation .app-nav>.sidebar .chat-list{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
 body.unified-navigation .app-nav>.sidebar .chat-scopes{margin:12px 0 9px;min-width:0}
 body.unified-navigation .app-nav>.sidebar .chat-scopes button{min-width:0;font-size:.79rem;padding:7px 3px}
 body.unified-navigation .app-nav>.sidebar .chat-filters{gap:5px;flex-wrap:wrap;margin-bottom:10px}
 body.unified-navigation .app-nav>.sidebar .chat-filters button{min-width:0;font-size:.77rem;padding:7px}
 body.unified-navigation .app-nav>.sidebar .search{min-width:0;margin-bottom:10px}
 body.unified-navigation .app-nav>.sidebar .search input{width:100%;min-width:0}
 body.unified-navigation .app-nav>.sidebar .chat-row{padding:10px 8px}
 body.unified-navigation .app-nav>.sidebar .side-bottom{margin-top:12px;padding-top:10px;gap:7px;flex-shrink:0}
 body.unified-navigation .app-nav>.sidebar .library-shortcuts{gap:3px}
 body.unified-navigation .app-nav>.sidebar .library-shortcuts button{min-width:0;font-size:.75rem;line-height:1.25;overflow-wrap:anywhere;padding:7px 3px}
 body.unified-navigation .app-nav.space-navigation-active>.sidebar,body.unified-navigation.unified-profile .app-nav>.sidebar{display:none!important}
 body.unified-navigation .app-nav .space-nav-search{margin-bottom:10px}
 body.unified-navigation .app-nav .space-nav-recent{flex:1;min-height:0;margin-top:0}
 body.unified-navigation .app-nav .space-nav-account{flex-shrink:0;margin-top:10px}
 body.unified-navigation .app-nav>.modes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));flex:none;gap:3px;width:100%;margin-top:auto;padding-top:12px;border-top:1px solid #24304a}
 body.unified-navigation .app-nav>.modes>.nav-item{display:flex;flex-direction:column;justify-content:flex-start;align-items:center;gap:6px;min-width:0;min-height:65px;width:100%;padding:9px 2px 7px;border-radius:10px;font-size:.74rem;line-height:1.2;white-space:normal;text-align:center}
 body.unified-navigation .app-nav>.modes>.nav-item span{max-width:100%;overflow-wrap:normal;word-break:normal;text-align:center}
 body.unified-navigation .app-nav>.modes>.nav-item svg{width:21px;height:21px;flex-shrink:0}
 body.unified-navigation .app-nav .nav-item:focus-visible{outline:2px solid #aeb6ff;outline-offset:2px}
 body.unified-navigation .unified-chat-link[hidden],body.unified-navigation .unified-searches[hidden],body.unified-navigation .unified-searches>[hidden],body.unified-navigation .app-nav .nav-item[hidden]{display:none!important}
}
@media(min-width:1200px){
 body.unified-navigation.space-room:not(.context-collapsed) .workspace:has(.context-rail:not([hidden])){--unified-right:var(--space-context-width,310px)}
}
@media(min-width:1450px){
 body.unified-navigation .workspace{--unified-left:300px}
 body.unified-navigation:not(.space-room):not(.context-collapsed) .workspace:has(.context-rail:not([hidden])){--unified-right:280px}
}
/* Shared navigation states in personal chats and Spaces. */
@media(min-width:761px){
 body.unified-navigation .app-nav .nav-item.selected{background:#294364;color:#edf4ff;border-color:#3b5e87;box-shadow:none}
 body.unified-navigation .app-nav .nav-item:hover{background:#203650;color:#edf4ff}
 body.unified-navigation .app-nav .chat-row{border:1px solid transparent;border-radius:9px;background:transparent;color:#c8d6e9}
 body.unified-navigation .app-nav .chat-row.selected{background:#294364;border-color:#3f6084;color:#f1f6ff;box-shadow:none}
 body.unified-navigation .app-nav>.sidebar .chat-filters{display:flex}
 body.unified-navigation .app-nav>.sidebar .chat-filters button{flex:1 1 auto;white-space:normal;overflow-wrap:anywhere}
 body.unified-navigation .space-nav-search-box{background:#0d1627;border-color:#263956}
}
/* The original mobile bottom bar remains in place; only the opened drawer is contextual. */
@media(max-width:760px){
 #sidebar .space-drawer-personal-hidden{display:none!important}
 #sidebar .mobile-space-navigation{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;overflow:hidden;color:#d4def6;color-scheme:dark;--muted:#9aacca;--accent:#acb8ff}
 #sidebar .mobile-space-navigation[hidden]{display:none!important}
 #sidebar .mobile-space-navigation .space-nav-search{margin:0 0 12px}
 #sidebar .mobile-space-navigation .space-nav-search-box{background:#0d1627;border-color:#263956;min-height:44px}
 #sidebar .mobile-space-navigation .space-nav-search input{font-size:1rem}
 #sidebar .mobile-space-navigation .space-nav-search-help{font-size:.73rem}
 #sidebar .mobile-space-navigation .space-nav-search-clear{min-width:44px;min-height:44px}
 #sidebar .mobile-space-navigation .space-nav-recent{margin:0;min-height:0;flex:1;padding-top:12px}
 #sidebar .mobile-space-navigation .space-nav-list{flex:1;overscroll-behavior:contain}
 #sidebar .mobile-space-navigation .space-nav-room{min-height:52px}
 #sidebar .mobile-space-navigation .space-nav-room-title{font-size:.9rem}
 #sidebar .mobile-space-navigation .space-nav-account{margin-top:12px;padding-top:12px;min-height:60px;flex-shrink:0}
 #sidebar .mobile-space-navigation button:focus-visible{outline:2px solid #91baff;outline-offset:2px}
}

.app-nav .nav-item[hidden]{display:none!important}
.app-nav .nav-item:disabled{opacity:.6;cursor:default;transform:none}
@media(max-width:540px){.app-nav .modes{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}.app-nav .nav-item span{overflow-wrap:normal!important;word-break:normal}}

#sidebar #account{display:none!important}
.chat-scopes{justify-content:center}.chat-scopes button{text-align:center}

#sidebar .chat-scopes{display:none!important}#sidebar .chat-filters{margin-top:12px}

@media(min-width:761px){#open-sidebar{display:none!important}}
