/* Shared transparent navigation rail. Mobile keeps the existing drawer behavior. */
.studio-sidebar-toggle,.studio-rail-icon,.studio-sidebar-brand-icon { display:none; }
.studio-sidebar-tooltip { position:fixed;z-index:450;pointer-events:none;transform:translateY(-50%);padding:9px 14px;border:1px solid var(--studio-color-border,#294354);border-radius:10px;background:var(--studio-color-canvas,#071522);color:var(--studio-color-text,#edf5ff);font-size:13px;font-weight:700;line-height:1.5;white-space:nowrap;box-shadow:0 6px 22px #0004; }
.studio-sidebar-tooltip[hidden] { display:none; }
@media(max-width:1120px) { .studio-sidebar-tooltip { display:none; } }
@media(min-width:1121px) {
    body.studio-theme[data-public-header=sidebar].studio-sidebar-open:not(.is-section-preview) { padding-inline-start:var(--sidebar-expanded-width); }
    body.studio-theme[data-public-header=sidebar]:not(.is-section-preview) {
        padding-inline-start:var(--public-header-rail,88px);
        --studio-header-height:0px;
        --sidebar-expanded-width:208px;
        --rail-inset:calc((var(--public-header-rail,88px) - var(--rail-button))/2);
        --rail-button:44px;
        --rail-gap:8px;
    }
    body.studio-theme[data-public-header=sidebar] .studio-site-header {
        position:fixed!important;
        inset:var(--studio-admin-height,0px) auto 0!important;
        inset-inline-start:0!important;
        width:var(--public-header-rail,88px)!important;
        height:calc(100dvh - var(--studio-admin-height,0px))!important;
        max-height:none!important;
        padding:16px 0!important;
        background:transparent!important;
        background-image:none!important;
        border:0!important;
        box-shadow:none!important;
        backdrop-filter:none!important;
        -webkit-backdrop-filter:none!important;
        transform:none!important;
        display:flex!important;
        flex-direction:column;
        align-items:center;
        gap:var(--rail-gap);
        overflow-y:auto;
        scrollbar-width:none;
        z-index:400!important;
    }
    body.studio-theme[data-public-header=sidebar] .studio-site-header::before,
    body.studio-theme[data-public-header=sidebar] .studio-site-header::after { display:none!important; }
    body.studio-theme[data-public-header=sidebar] .studio-site-header.is-sidebar-expanded { width:var(--sidebar-expanded-width)!important; }
    body.studio-theme[data-public-header=sidebar] :is(.studio-exact-head,.studio-header-nav-group) {
        display:flex!important;flex-direction:column!important;align-items:center!important;
        justify-content:flex-start!important;width:100%!important;height:auto!important;
        min-height:0!important;flex:none!important;padding:0!important;margin:0!important;gap:var(--rail-gap)!important;
    }
    body.studio-theme[data-public-header=sidebar] .studio-exact-head { flex:1 0 auto!important; }
    body.studio-theme[data-public-header=sidebar] .studio-exact-logo {
        display:flex!important;justify-content:center;align-items:center;
        align-self:flex-start;order:-1;width:var(--public-header-rail,88px)!important;height:44px;flex:none!important;margin:0 0 8px!important;
    }
    body.studio-theme[data-public-header=sidebar] .studio-exact-logo img:not(.studio-sidebar-brand-icon) { display:none!important; }
    /* Animate the artwork only: the logo slot stays anchored in both rail states. */
    body.studio-theme[data-public-header=sidebar] .studio-exact-logo .studio-sidebar-brand-icon {
        display:block!important;width:32px!important;height:32px!important;object-fit:contain;
        transform-origin:center;
        animation:studio-sidebar-logo-breathe 6s ease-in-out infinite;
        transition:transform .25s ease,filter .25s ease;
    }
    body.studio-theme[data-public-header=sidebar] .studio-exact-logo:is(:hover,:focus-visible) .studio-sidebar-brand-icon {
        animation:none;transform:scale(1.08);
        filter:drop-shadow(0 0 5px color-mix(in srgb,var(--studio-color-accent,#62a7ff) 35%,transparent));
    }
    @keyframes studio-sidebar-logo-breathe {
        0%,100% { transform:scale(1) rotate(0deg);filter:drop-shadow(0 0 0 transparent); }
        50% { transform:scale(1.08) rotate(2deg);filter:drop-shadow(0 0 5px color-mix(in srgb,var(--studio-color-accent,#62a7ff) 35%,transparent)); }
    }
    @media(prefers-reduced-motion:reduce) {
        body.studio-theme[data-public-header=sidebar] .studio-exact-logo .studio-sidebar-brand-icon { animation:none;transition:none;transform:none!important; }
    }
    body.studio-theme[data-public-header=sidebar] [data-studio-exact-nav] {
        display:flex!important;flex-direction:column!important;align-items:center!important;
        justify-content:flex-start!important;gap:var(--rail-gap)!important;
        position:static!important;width:100%!important;max-height:none!important;overflow:visible!important;
    }
    body.studio-theme[data-public-header=sidebar] [data-studio-exact-nav]>.studio-nav-parent {
        width:var(--rail-button)!important;height:var(--rail-button)!important;flex:none!important;margin:0!important;
    }
    body.studio-theme[data-public-header=sidebar] .studio-exact-actions {
        display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;
        gap:var(--rail-gap)!important;flex:none!important;width:100%!important;
        margin:auto 0 0!important;padding:12px 0 0!important;border:0!important;
    }
    body.studio-theme[data-public-header=sidebar] .studio-exact-actions::before {
        content:'';width:22px;height:1px;background:var(--studio-color-border,#294354);margin-bottom:4px;
    }
    body.studio-theme[data-public-header=sidebar] .studio-exact-actions>:is(.studio-tools-menu,.site-language-switch,.studio-notification-menu,.studio-account-menu) {
        width:var(--rail-button)!important;min-width:0!important;margin:0!important;flex:none!important;align-self:auto!important;
    }
    body.studio-theme[data-public-header=sidebar] .studio-exact-actions>.site-language-switch { order:1!important; }
    body.studio-theme[data-public-header=sidebar] .studio-exact-actions>.studio-tools-menu { order:2!important; }
    body.studio-theme[data-public-header=sidebar] .studio-exact-actions>[data-studio-search-open] { order:3!important; }
    body.studio-theme[data-public-header=sidebar] .studio-exact-actions>.studio-notification-menu { order:4!important; }
    body.studio-theme[data-public-header=sidebar] .studio-exact-actions>.studio-account-menu { order:5!important; }
    body.studio-theme[data-public-header=sidebar] .studio-exact-actions>:is(.studio-hamburger,.studio-trend-in-actions) { display:none!important; }
    /* Higher specificity intentionally replaces guest/member legacy button styles. */
    body.studio-theme[data-public-header=sidebar] .studio-site-header .studio-rail-control {
        display:flex!important;align-items:center!important;justify-content:center!important;
        width:var(--rail-button)!important;min-width:var(--rail-button)!important;max-width:var(--rail-button)!important;
        height:var(--rail-button)!important;min-height:var(--rail-button)!important;max-height:var(--rail-button)!important;
        flex:0 0 var(--rail-button)!important;gap:0!important;padding:0!important;margin:0!important;
        border:1px solid transparent!important;border-radius:12px!important;
        background:transparent!important;background-image:none!important;box-shadow:none!important;
        color:var(--studio-color-text-muted,#a3b6c8)!important;transform:none!important;
        cursor:pointer;position:relative;text-decoration:none!important;
        transition:color .18s,background-color .18s,border-color .18s;
    }
    body.studio-theme[data-public-header=sidebar] .studio-site-header .studio-rail-control::before,
    body.studio-theme[data-public-header=sidebar] .studio-site-header .studio-rail-control::after,
    body.studio-theme[data-public-header=sidebar] .studio-site-header .studio-rail-control>:not(.studio-rail-icon):not([data-notification-badge]) { display:none!important; }
    body.studio-theme[data-public-header=sidebar] .studio-site-header .studio-rail-control>svg.studio-rail-icon {
        display:block!important;width:22px!important;height:22px!important;min-width:22px!important;max-width:22px!important;
        flex:0 0 22px!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;
        background:none!important;fill:none!important;stroke:currentColor!important;stroke-width:1.7!important;
        transform:none!important;filter:none!important;
    }
    body.studio-theme[data-public-header=sidebar] .studio-site-header .studio-rail-control:is(:hover,:focus-visible,.active,.is-active,[aria-expanded=true]),
    body.studio-theme[data-public-header=sidebar] .studio-site-header .active>.studio-rail-control,
    body.studio-theme[data-public-header=sidebar] .studio-site-header [data-studio-exact-nav]>.studio-nav-parent:is(:hover,:focus-within,.is-open)>.studio-rail-control {
        color:var(--studio-color-accent,#62a7ff)!important;
        background:color-mix(in srgb,var(--studio-color-accent,#62a7ff) 13%,transparent)!important;
        border-color:color-mix(in srgb,var(--studio-color-accent,#62a7ff) 30%,transparent)!important;
    }
    body.studio-theme[data-public-header=sidebar] .studio-rail-control:focus-visible { outline:2px solid var(--studio-color-accent,#62a7ff);outline-offset:2px; }
    body.studio-theme[data-public-header=sidebar] .studio-rail-control [data-notification-badge] { position:absolute!important;top:0!important;inset-inline-end:0!important; }
    body.studio-theme[data-public-header=sidebar] .is-sidebar-expanded [data-studio-exact-nav]>.studio-nav-parent,
    body.studio-theme[data-public-header=sidebar] .is-sidebar-expanded [data-studio-exact-nav]>.studio-rail-control,
    body.studio-theme[data-public-header=sidebar] .is-sidebar-expanded [data-studio-exact-nav]>.studio-nav-parent>.studio-rail-control {
        width:calc(var(--sidebar-expanded-width) - 2 * var(--rail-inset))!important;max-width:calc(var(--sidebar-expanded-width) - 2 * var(--rail-inset))!important;
    }
    body.studio-theme[data-public-header=sidebar] .is-sidebar-expanded [data-studio-exact-nav] .studio-rail-control { justify-content:flex-start!important;padding-inline:calc((var(--rail-button) - 24px)/2)!important;gap:12px!important; }
    /* Dropdown parents use a row: let their trigger keep the expanded width. */
    body.studio-theme[data-public-header=sidebar] .is-sidebar-expanded [data-studio-exact-nav]>.studio-nav-parent>.studio-rail-control { flex:0 0 auto!important; }
    body.studio-theme[data-public-header=sidebar] .is-sidebar-expanded .studio-sidebar-toggle { align-self:flex-start;margin-inline-start:var(--rail-inset)!important; }
    body.studio-theme[data-public-header=sidebar] .is-sidebar-expanded .studio-exact-actions { align-items:flex-start!important;padding-inline-start:var(--rail-inset)!important; }
    body.studio-theme[data-public-header=sidebar] .is-sidebar-expanded .studio-exact-actions::before { margin-inline-start:calc((var(--rail-button) - 22px)/2); }
    body.studio-theme[data-public-header=sidebar] .is-sidebar-expanded [data-studio-exact-nav] .studio-rail-control>span:not(.studio-compact-icon) { display:block!important;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;text-shadow:0 1px 6px var(--studio-color-canvas,#071522); }
    body.studio-theme[data-public-header=sidebar] .studio-nav-dropdown {
        position:fixed!important;inset:auto!important;inset-inline-start:calc(var(--public-header-rail,88px) + 10px)!important;
        top:var(--sidebar-panel-top,90px)!important;max-width:calc(100vw - var(--public-header-rail,88px) - 34px)!important;
        max-height:calc(100dvh - var(--sidebar-panel-top,90px) - 18px)!important;overflow:auto!important;transform:none!important;
        --studio-explore-max-height:calc(100dvh - var(--sidebar-panel-top,90px) - 18px);
    }
    body.studio-theme[data-public-header=sidebar] .studio-nav-dropdown::before { display:none!important; }
    body.studio-theme[data-public-header=sidebar] .is-sidebar-expanded .studio-nav-dropdown { inset-inline-start:calc(var(--sidebar-expanded-width) + 10px)!important;max-width:calc(100vw - var(--sidebar-expanded-width) - 28px)!important; }
    body.studio-theme[data-public-header=sidebar] :is(.studio-account-popover,.studio-tools-popover,.studio-notification-popover) {
        position:fixed!important;inset:auto!important;inset-inline-start:calc(var(--public-header-rail,88px) + 12px)!important;
        bottom:16px!important;max-height:calc(100dvh - 36px)!important;overflow:auto!important;transform:none!important;
    }
    body.studio-theme[data-public-header=sidebar] .is-sidebar-expanded :is(.studio-account-popover,.studio-tools-popover,.studio-notification-popover) { inset-inline-start:calc(var(--sidebar-expanded-width) + 12px)!important; }
}
@media(min-width:1121px) and (max-height:760px) {
    body.studio-theme[data-public-header=sidebar]:not(.studio-section-preview) { --rail-button:40px;--rail-gap:6px; }
}
@media(prefers-reduced-motion:reduce) { .studio-rail-control { transition:none!important; } }

/* The existing chat remains the single source of conversation and unread state. */
.studio-sidebar-support { display:none; }
@media(min-width:1121px) {
    body.studio-theme[data-public-header=sidebar].has-header-support [data-support-widget] :is([data-support-mascot],.a2-support-mascot,[data-support-restore]) { display:none!important; }
    body.studio-theme[data-public-header=sidebar] .studio-sidebar-support { display:grid!important;order:5!important; }
    body.studio-theme[data-public-header=sidebar] .studio-exact-actions>.studio-account-menu { order:6!important; }
    body.studio-theme[data-public-header=sidebar].has-header-support [data-support-panel] { position:fixed!important;left:auto!important;right:auto!important;inset-inline-start:calc(var(--public-header-rail,88px) + 12px)!important;bottom:16px!important;max-height:calc(100dvh - 32px)!important;max-width:calc(100vw - var(--public-header-rail,88px) - 28px)!important; }
    body.studio-theme[data-public-header=sidebar].has-header-support.studio-sidebar-open [data-support-panel] { inset-inline-start:calc(var(--sidebar-expanded-width) + 12px)!important;max-width:calc(100vw - var(--sidebar-expanded-width) - 28px)!important; }
    body.studio-theme[data-public-header=sidebar] .studio-site-header .studio-sidebar-support.has-unread::after { content:'';display:block!important;position:absolute;top:5px;inset-inline-end:5px;width:7px;height:7px;border-radius:50%;background:var(--studio-color-accent,#62a7ff);animation:studio-support-pulse 1.8s ease-in-out infinite; }
    body.studio-theme[data-public-header=sidebar] .studio-site-header .studio-sidebar-support:is(:hover,:focus-visible)>svg.studio-rail-icon { animation:studio-support-wave .5s ease-in-out; }
}
@keyframes studio-support-wave { 30%{rotate:-10deg}70%{rotate:8deg} }
@keyframes studio-support-pulse { 50%{box-shadow:0 0 0 5px transparent;opacity:.55} }
@media(prefers-reduced-motion:reduce) { .studio-sidebar-support::after,.studio-sidebar-support>svg { animation:none!important; } }

@media(min-width:1121px) {
    body.studio-theme[data-public-header=sidebar] { --studio-page-clearance:24px!important; }
    body.studio-theme[data-public-header=sidebar] .studio-page { padding-top:0!important; }
    body.studio-theme[data-public-header=sidebar].studio-title-detail .title-stage,
    body.studio-theme[data-public-header=sidebar] .w146 { padding-top:24px!important; }
}

@media(min-width:1121px){body.studio-theme[data-public-header=sidebar].has-sidebar-support [data-support-widget] :is([data-support-mascot],[data-support-restore]){display:none!important}}
