/* The shared sidebar ID keeps this contract above older page-specific rules.
 * Navigation and history scroll together; Safety and Account stay outside. */
html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] {
    min-height: 0 !important;
    grid-template-rows: auto minmax(0, 1fr) auto auto !important;
    flex-direction: column !important;
    gap: 0 !important;
    overflow: hidden !important;
}

/* The drawer keeps its full catalog; category switches appear only when it
 * becomes the desktop sidebar's inline navigation. */
.home-tool-drawer-scroll .sidebar-tool-group-toggle {
    display: none;
}

/* An explicitly opened desktop sidebar occupies a layout column. Temporary
 * tools/hover previews keep their overlay behavior and never change this width. */
@media (min-width: 921px) {
    html body.desktop-sidebar-docked {
        --fuuvo-desktop-sidebar-width: clamp(224px, 19.2vw, 268.8px);
        --fuuvo-desktop-navigation-width: calc(var(--fuuvo-workspace-rail-width) + var(--fuuvo-desktop-sidebar-width));
    }

    /* Expanded navigation keeps its tools above history in the same scroller. */
    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        .home-tool-drawer-scroll[data-sidebar-inline-tools="1"] {
        display: grid !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: none !important;
        margin: 8px 0 0 !important;
        padding: 0 !important;
        gap: 8px !important;
        overflow: visible !important;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .home-tool-group {
        padding: 0 !important;
        gap: 0 !important;
        border: 0 !important;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .home-tool-group h2 {
        display: none !important;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .sidebar-tool-group-toggle {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 44px;
        padding: 10px 8px;
        gap: 12px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: inherit;
        font: inherit;
        font-size: 14px;
        font-weight: 500;
        line-height: 20px;
        text-align: left;
        cursor: pointer;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .sidebar-tool-group-toggle:is(:hover, :focus-visible) {
        background: rgba(128, 128, 128, .1);
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .sidebar-tool-group-toggle:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: -2px;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .sidebar-tool-group-toggle svg {
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
        opacity: .65;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .sidebar-tool-group-toggle[aria-expanded="true"] svg {
        transform: rotate(180deg);
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .home-tool-grid[hidden] {
        display: none !important;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .home-tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 4px 8px !important;
        margin: 4px 0 8px !important;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .home-tool-drawer-item {
        display: grid !important;
        grid-template-columns: 20px minmax(0, 1fr) !important;
        align-items: center !important;
        justify-content: start !important;
        height: auto !important;
        min-height: 44px !important;
        padding: 6px 8px !important;
        gap: 8px !important;
        font-size: 12px !important;
        line-height: 18px !important;
        text-align: left !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .home-tool-drawer-item > span:last-child {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .home-tool-drawer-item:is([hidden], [data-home-icon="ask"]) {
        display: none !important;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .home-tool-drawer-item .capability-icon,
    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        [data-sidebar-inline-tools="1"] .home-tool-drawer-item .capability-icon :is(svg, img) {
        width: 20px !important;
        min-width: 20px !important;
        height: 20px !important;
        flex-basis: 20px !important;
        background-size: contain !important;
    }

    html body.desktop-sidebar-docked [data-fuuvo-app-shell="1"]:has(> nav#fuuvo-workspace-rail),
    html body.desktop-sidebar-docked [data-fuuvo-app-shell="1"].sidebar-collapsed:has(> nav#fuuvo-workspace-rail),
    html body.desktop-sidebar-docked.sidebar-collapsed [data-fuuvo-app-shell="1"]:has(> nav#fuuvo-workspace-rail) {
        grid-template-columns: var(--fuuvo-desktop-navigation-width) minmax(0, 1fr) !important;
    }

    html body.desktop-sidebar-docked [data-fuuvo-app-shell="1"]
        > aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] {
        top: 0 !important;
        bottom: 0 !important;
        left: var(--fuuvo-workspace-rail-width) !important;
        width: var(--fuuvo-desktop-sidebar-width) !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 100dvh !important;
        border: 0 !important;
        border-right: 1px solid #e4e8ee !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        transition: none !important;
    }

    html body.desktop-sidebar-docked:is([data-ui-theme="dark"], [data-theme="dark"])
        [data-fuuvo-app-shell="1"] > aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] {
        border-right-color: #34445c !important;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        > .sidebar-scroll-region {
        overflow-y: scroll !important;
        margin-right: 10px !important;
        scrollbar-width: none !important;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        > .sidebar-scroll-region > .sidebar-scroll-space {
        display: block !important;
        flex: 0 0 auto !important;
        width: 100%;
        min-height: 0;
        margin: 0 !important;
        padding: 0 !important;
        pointer-events: none;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        > .sidebar-scroll-region::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        > .sidebar-scrollbar:not([hidden]) {
        position: absolute !important;
        right: 4px !important;
        z-index: 2 !important;
        display: block !important;
        width: 12px !important;
        cursor: default;
        touch-action: none;
        user-select: none;
        border-radius: 6px;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        > .sidebar-scrollbar::before {
        content: '';
        position: absolute;
        inset: 0 3px;
        border-radius: inherit;
        background: rgba(148, 163, 184, .14);
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        > .sidebar-scrollbar .sidebar-scrollbar-thumb {
        position: absolute;
        top: 0;
        right: 3px;
        left: 3px;
        border-radius: 6px;
        background: var(--shared-sidebar-scroll-thumb, rgba(118, 132, 153, .55));
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        > .sidebar-scrollbar[aria-disabled="true"] .sidebar-scrollbar-thumb {
        opacity: .65;
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        > .sidebar-scrollbar:is(:hover, :focus-visible, .is-dragging) .sidebar-scrollbar-thumb {
        background: var(--shared-sidebar-scroll-thumb, rgba(118, 132, 153, .8));
    }

    html body.desktop-sidebar-docked aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        > .sidebar-scrollbar:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 1px;
    }

    html body [data-fuuvo-app-shell="1"] > .home-drawer-backdrop[hidden],
    html body.desktop-sidebar-docked:not(.home-tool-drawer-open)
        [data-fuuvo-app-shell="1"] > .home-drawer-backdrop {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Landing composers are positioned within the workspace; detail composers,
     * replies and legacy chat headings are fixed and need its new center. */
    html body.desktop-sidebar-docked [data-fuuvo-app-shell="1"]:has(> nav#fuuvo-workspace-rail)
        .workspace[data-fuuvo-app-workspace="1"] > .composer {
        width: min(1112px, calc(100vw - var(--fuuvo-desktop-navigation-width) - 96px)) !important;
        max-width: calc(100% - 48px) !important;
    }

    html body.desktop-sidebar-docked:not(.chat-landing)
        [data-fuuvo-app-shell="1"]:has(> nav#fuuvo-workspace-rail)
        .workspace[data-fuuvo-app-workspace="1"] > .composer,
    html body.desktop-sidebar-docked[data-ai-chat-page="1"]
        [data-fuuvo-app-shell="1"]:has(> nav#fuuvo-workspace-rail)
        .workspace[data-fuuvo-app-workspace="1"] > .composer,
    html body.desktop-sidebar-docked:not(.chat-landing)[data-mode="chat"]:has(#ai-chat-model)
        [data-fuuvo-app-shell="1"]:has(> nav#fuuvo-workspace-rail)
        .workspace[data-fuuvo-app-workspace="1"] > .stage,
    html body.desktop-sidebar-docked [data-fuuvo-app-shell="1"]:has(> nav#fuuvo-workspace-rail)
        .workspace[data-fuuvo-app-workspace="1"]
        > :is(.ai-chat-heading, .ai-chat-welcome) {
        left: calc(50% + var(--fuuvo-desktop-navigation-width) / 2) !important;
        width: min(1112px, calc(100vw - var(--fuuvo-desktop-navigation-width) - 96px)) !important;
    }

    /* Chat footers are fixed to the viewport. Use the same navigation width
     * as the workspace grid so both sidebar states share its content center. */
    html body:has(#ai-chat-model) [data-fuuvo-app-shell="1"]:has(> nav#fuuvo-workspace-rail)
        .workspace[data-fuuvo-app-workspace="1"] > .fuuvo-ai-disclaimer {
        left: calc(50% + var(--fuuvo-desktop-navigation-width, var(--fuuvo-workspace-rail-width, 64px)) / 2) !important;
        width: min(960px, calc(100% - var(--fuuvo-desktop-navigation-width, var(--fuuvo-workspace-rail-width, 64px)) - 24px)) !important;
        box-sizing: border-box !important;
        white-space: normal;
    }
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-scrollbar {
    display: none !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
    > .sidebar-scroll-region > .sidebar-scroll-space {
    display: none !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"].is-quick-settings-open,
html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]:has(.sidebar-quick-settings:not(.hidden)) {
    overflow: visible !important;
}

/* The account menu is opened from the bottom of the More drawer. The drawer
 * normally clips its own scroll surface, which would cut off the upward menu
 * and leave a later account click visually underneath the drawer. Promote the
 * drawer only while this surface is open so it wins against the rail and any
 * older sidebar stacking context without changing the closed layout. */
html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"].is-account-menu-open,
html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]:has(.sidebar-account-dropdown:not(.hidden)) {
    overflow: visible !important;
    z-index: 6000 !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"].is-account-menu-open
    .sidebar-account-area,
html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]:has(.sidebar-account-dropdown:not(.hidden))
    .sidebar-account-area {
    position: relative !important;
    z-index: 6001 !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
    .sidebar-account-dropdown:not(.hidden) {
    z-index: 6002 !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-scroll-region {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-bottom: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
    scrollbar-gutter: stable !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--shared-sidebar-scroll-thumb, rgba(118, 132, 153, .55)) transparent !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-scroll-region::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-scroll-region::-webkit-scrollbar-track {
    background: transparent !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-scroll-region::-webkit-scrollbar-thumb {
    border-radius: 8px !important;
    background: var(--shared-sidebar-scroll-thumb, rgba(118, 132, 153, .55)) !important;
}

html body:is([data-ui-theme="dark"], [data-theme="dark"]) aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] {
    --shared-sidebar-scroll-thumb: rgba(148, 163, 184, .6);
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-scroll-region
    :is(.sidebar-shell, .workspace-recent-panel, .history-main, .portal-recent, .conversation-list, .task-list, .portal-recent-list) {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] .sidebar-brand-row,
html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] .fuuvo-sidebar-brand {
    justify-content: flex-start !important;
    justify-items: start !important;
    text-align: left !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] .fuuvo-sidebar-brand {
    display: flex !important;
    width: auto !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    margin-inline: 0 !important;
}

/* The shared sidebar uses the same compact mark and plain wordmark on every
 * route. Keep the language-specific label beside the icon instead of relying
 * on the legacy image lockups used by older page shells. */
html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
    .fuuvo-sidebar-brand[data-fuuvo-sidebar-brand] .sidebar-brand-logo {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 9px !important;
    width: auto !important;
    min-width: 0 !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
    .fuuvo-sidebar-brand[data-fuuvo-sidebar-brand] .sidebar-brand-logo-mark {
    display: block !important;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    flex: 0 0 36px !important;
    object-fit: contain !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
    .fuuvo-sidebar-brand[data-fuuvo-sidebar-brand] .sidebar-brand-label {
    display: inline-block !important;
    color: currentColor !important;
    font-family: SimHei, "Microsoft YaHei", Arial, sans-serif !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
    .fuuvo-sidebar-brand[data-fuuvo-sidebar-brand] .sidebar-brand-label[hidden] {
    display: none !important;
}

/* This header stays outside the only scrolling region so close is always reachable. */
html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-brand-row {
    position: relative !important;
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    margin: 0 0 8px !important;
    gap: 8px !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-brand-row > .fuuvo-sidebar-brand {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
}

/* Desktop already displays the brand in its compact rail. Keep only the
 * collapse control above search, then the existing recent-conversation list. */
@media (min-width: 921px) {
    html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-brand-row {
        justify-content: flex-end !important;
    }

    html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        > .sidebar-brand-row > .fuuvo-sidebar-brand,
    html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        .history-main > .history-head {
        display: none !important;
    }
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] .shared-sidebar-collapse {
    position: static !important;
    display: inline-flex !important;
    flex: 0 0 32px !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] .shared-sidebar-collapse:is(:hover, :focus-visible) {
    background: rgba(148, 163, 184, .16) !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] .shared-sidebar-collapse:focus-visible {
    outline: 2px solid currentColor !important;
    outline-offset: 2px !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] .shared-sidebar-collapse
    :is(svg, .fuuvo-linear-icon, .fuuvo-linear-svg) {
    width: 20px !important;
    min-width: 20px !important;
    height: 20px !important;
    flex: 0 0 20px !important;
}

html body nav[data-fuuvo-workspace-rail="1"] button.home-rail-logo[data-workspace-sidebar-open] {
    appearance: none !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: inherit !important;
    font: inherit !important;
    cursor: pointer !important;
}

html body nav[data-fuuvo-workspace-rail="1"] button.home-rail-logo[data-workspace-sidebar-open]:focus-visible {
    outline: 2px solid currentColor !important;
    outline-offset: 2px !important;
}

/* The compact rail uses the same icon and localized plain-text brand. */
@media (min-width: 921px) {
    html body nav#fuuvo-workspace-rail[data-fuuvo-workspace-rail="1"] button.home-rail-logo[data-workspace-sidebar-open] {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 36px !important;
        display: inline-flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        padding: 0 !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    html body nav#fuuvo-workspace-rail[data-fuuvo-workspace-rail="1"] .home-rail-logo > .home-rail-logo-mark {
        width: 24px !important;
        min-width: 24px !important;
        max-width: 24px !important;
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;
        flex: 0 0 24px !important;
    }

    html body nav#fuuvo-workspace-rail[data-fuuvo-workspace-rail="1"] .home-rail-logo > .home-rail-brand-label {
        display: inline-block !important;
        flex: 0 0 auto !important;
        color: currentColor !important;
        font-family: SimHei, "Microsoft YaHei", Arial, sans-serif !important;
        font-size: 12px !important;
        font-weight: 400 !important;
        line-height: 1 !important;
        letter-spacing: 0 !important;
        white-space: nowrap !important;
    }

    html body nav#fuuvo-workspace-rail[data-fuuvo-workspace-rail="1"] .home-rail-logo
        > :is(.home-rail-logo-mark, .home-rail-brand-label) {
        transform: translateX(-4px) !important;
    }
}

/* Inline menu strokes follow the theme; the old image had a fixed dark ink. */
@media (max-width: 920px) {
    html body header[data-fuuvo-shared-topbar="1"]
        button:is(.mobile-home-sidebar-trigger, .fuuvo-mobile-sidebar-inline-trigger)[data-toggle-shared-sidebar]
        > svg.fuuvo-menu-icon[aria-hidden="true"] {
        display: block !important;
        width: 24px !important;
        min-width: 24px !important;
        height: 24px !important;
        min-height: 24px !important;
        color: inherit !important;
        stroke: currentColor !important;
        stroke-width: 2 !important;
        opacity: 1 !important;
        filter: none !important;
    }

    html body:is([data-ui-theme="dark"], [data-theme="dark"])
        header[data-fuuvo-shared-topbar="1"]
        button:is(.mobile-home-sidebar-trigger, .fuuvo-mobile-sidebar-inline-trigger)[data-toggle-shared-sidebar]
        > svg.fuuvo-menu-icon[aria-hidden="true"] {
        color: #e4edf8 !important;
    }
}

@media (min-width: 921px) {
    html body.home-history-drawer-open aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] .sidebar-shell {
        display: grid !important;
        align-content: start !important;
        gap: 8px !important;
    }

    html body.home-history-drawer-open aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] .sidebar-nav.portal-nav {
        /* Primary navigation is already available in the desktop rail. */
        display: none !important;
    }
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
    .brand.fuuvo-sidebar-brand[data-fuuvo-sidebar-brand] .sidebar-brand-logo {
    margin: 0 !important;
}

@media (max-width: 920px) {
    html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-brand-row {
        box-sizing: border-box !important;
        padding: 0 9px !important;
    }

    html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        .brand.fuuvo-sidebar-brand[data-fuuvo-sidebar-brand] .sidebar-brand-logo {
        justify-content: flex-start !important;
    }

    html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"]
        .brand.fuuvo-sidebar-brand[data-fuuvo-sidebar-brand] .sidebar-brand-logo-mark {
        margin: 0 !important;
        object-position: left center !important;
    }
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-safety-link {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 44px !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    border: 0 !important;
    border-top: 1px solid rgba(148, 163, 184, .2) !important;
    border-radius: 0 !important;
    background: inherit !important;
    color: inherit !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 18px !important;
    white-space: normal !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-safety-link
    > :is(.fuuvo-linear-icon, img.fuuvo-design-icon) {
    width: 18px !important;
    min-width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px !important;
}

html body aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-account-area {
    position: relative !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding-top: 0 !important;
}

/* The compact rail stays visible; this switch opens the shared More sidebar. */
html body .workspace-rail-toggle[data-workspace-rail-toggle] {
    display: none !important;
}

@media (min-width: 921px) {
    html body [data-fuuvo-app-shell="1"]:has(> #fuuvo-workspace-rail) header[data-fuuvo-shared-topbar="1"] {
        padding-left: 56px !important;
    }

    html body:is(.chat-landing, .chat-detail-page, .chat-detail-open)[data-mode="chat"]
        [data-fuuvo-app-shell="1"]:has(> #fuuvo-workspace-rail) header[data-fuuvo-shared-topbar="1"] {
        height: 72px !important;
        min-height: 72px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        box-sizing: border-box !important;
    }

    html body:is(.chat-landing, .chat-detail-page, .chat-detail-open)[data-mode="chat"]
        [data-fuuvo-app-shell="1"] > .workspace-rail-toggle[data-workspace-rail-toggle] {
        top: 20px !important;
    }

    html body:is(.chat-landing, .chat-detail-page, .chat-detail-open)[data-mode="chat"]
        aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-brand-row {
        min-height: 48px !important;
    }

    html body:is(.chat-detail-page, .chat-detail-open)[data-mode="chat"]
        aside#workspace-more-drawer[data-fuuvo-shared-sidebar="1"] > .sidebar-brand-row {
        min-height: 44px !important;
    }

    html body:is(.chat-detail-page, .chat-detail-open):is([data-ui-theme="dark"], [data-theme="dark"])[data-mode="chat"]
        header[data-fuuvo-shared-topbar="1"] #desktop-new-chat-icon {
        background: #172131 !important;
        color: #d7e2f3 !important;
        border-color: #34445c !important;
    }

    html body [data-fuuvo-app-shell="1"] .kc-header .kc-header-inner {
        padding-left: 32px !important;
        box-sizing: border-box !important;
    }

    html body [data-fuuvo-app-shell="1"] > .workspace-rail-toggle[data-workspace-rail-toggle] {
        position: fixed !important;
        top: 18px !important;
        left: calc(var(--fuuvo-workspace-rail-width, 64px) + 8px) !important;
        z-index: 1301 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid #e4e8ee !important;
        border-radius: 8px !important;
        background: #f7f7f8 !important;
        color: #525866 !important;
        box-shadow: 0 2px 8px rgba(23, 49, 84, .06) !important;
        cursor: pointer !important;
        box-sizing: border-box !important;
    }

    html body [data-fuuvo-app-shell="1"] > .workspace-rail-toggle[data-workspace-rail-toggle]:is(:hover, :focus-visible) {
        background: #edf0f4 !important;
        color: #20242c !important;
    }

    html body [data-fuuvo-app-shell="1"] > .workspace-rail-toggle[data-workspace-rail-toggle]:focus-visible {
        outline: 2px solid #2379e8 !important;
        outline-offset: 2px !important;
    }

    html body [data-fuuvo-app-shell="1"] > .workspace-rail-toggle[data-workspace-rail-toggle]
        :is(.fuuvo-linear-icon, svg) {
        width: 20px !important;
        height: 20px !important;
        flex: 0 0 20px !important;
    }

    /* Expanded drawers already provide their own close button in this area. */
    html body.home-drawer-open [data-fuuvo-app-shell="1"] > .workspace-rail-toggle[data-workspace-rail-toggle] {
        visibility: hidden !important;
    }

    html body:is([data-ui-theme="dark"], [data-theme="dark"]) [data-fuuvo-app-shell="1"]
        > .workspace-rail-toggle[data-workspace-rail-toggle] {
        border: 0 !important;
        background: #172131 !important;
        color: #c8d8ee !important;
    }

    html body:is([data-ui-theme="dark"], [data-theme="dark"]) [data-fuuvo-app-shell="1"]
        > .workspace-rail-toggle[data-workspace-rail-toggle]:is(:hover, :focus-visible) {
        background: #20334c !important;
        color: #e7f1ff !important;
    }

}
