/* Pin the existing sidebar controls; only the section below New chat scrolls. */
.sidebar{min-height:0}
.sidebar>.sidebar-header,.sidebar>.sidebar-actions,.sidebar>.sidebar-footer{flex:0 0 auto}
.sidebar>.sidebar-footer{margin-top:auto;z-index:2;border-top:0}
.sidebar>.sidebar-scroll{display:flex;flex-direction:column;flex:1 1 0;min-height:0;width:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#454545 transparent}
#sidebar .sidebar-scroll>.chat-list{flex:0 0 auto!important;min-height:0!important;height:auto!important;max-height:none!important;overflow:visible!important}
.sidebar-scroll>.sidebar-spacer{display:none!important}
.sidebar-scroll>.product-history{flex:0 0 auto;min-height:0}
.sidebar-scroll .product-history-list{flex:0 0 auto;max-height:none;overflow:visible}
.sidebar>.sidebar-product-nav{flex:0 1 auto;min-height:0;overflow-y:auto}
.sidebar-scroll::-webkit-scrollbar{width:6px}.sidebar-scroll::-webkit-scrollbar-track{background:transparent}.sidebar-scroll::-webkit-scrollbar-thumb{background:#454545;border:1px solid transparent;border-radius:999px;background-clip:padding-box}
html[data-theme="light"] .sidebar-scroll{scrollbar-color:#c8c8c8 transparent}html[data-theme="light"] .sidebar-scroll::-webkit-scrollbar-thumb{background-color:#c8c8c8}
.sidebar-scroll:focus-visible{outline:2px solid var(--kyro-accent,#888);outline-offset:-2px}

/* Alpha fades preserve solid, gradient and image backgrounds. */
.sidebar-scroll,.sidebar>.sidebar-product-nav{
  --sidebar-fade-top:0px;--sidebar-fade-bottom:0px;
  -webkit-mask-image:linear-gradient(to bottom,transparent,#000 var(--sidebar-fade-top),#000 calc(100% - var(--sidebar-fade-bottom)),transparent);
  mask-image:linear-gradient(to bottom,transparent,#000 var(--sidebar-fade-top),#000 calc(100% - var(--sidebar-fade-bottom)),transparent);
}
.sidebar-scroll[data-scroll-above],.sidebar>.sidebar-product-nav[data-scroll-above]{--sidebar-fade-top:18px}
.sidebar-scroll[data-scroll-below],.sidebar>.sidebar-product-nav[data-scroll-below]{--sidebar-fade-bottom:18px}

.sidebar-footer #displayName{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-plan-badge{display:inline-flex;align-items:center;flex:0 0 auto;padding:3px 7px;border-radius:999px;background:rgba(255,255,255,.1);color:#bfbfbf;font-size:10px;font-weight:650;line-height:1.3;letter-spacing:.02em}
.account-plan-badge[hidden],.sidebar.collapsed .account-plan-badge{display:none!important}
.account-plan-badge[data-plan="plus"]{background:rgba(139,100,235,.18);color:#c4a8ff}
html[data-theme="light"] .account-plan-badge{background:rgba(0,0,0,.07);color:#606060}
html[data-theme="light"] .account-plan-badge[data-plan="plus"]{background:#eee7fc;color:#6942aa}

/* Scroll bar only while hovering the sidebar or scrolling it. */
.sidebar-scroll{scrollbar-color:transparent transparent}
.sidebar-scroll:hover,.sidebar-scroll[data-scrolling]{scrollbar-color:#454545 transparent}
.sidebar-scroll::-webkit-scrollbar-thumb{background-color:transparent!important}
.sidebar-scroll:hover::-webkit-scrollbar-thumb,.sidebar-scroll[data-scrolling]::-webkit-scrollbar-thumb{background-color:#454545!important}
html[data-theme="light"] .sidebar-scroll{scrollbar-color:transparent transparent}
html[data-theme="light"] .sidebar-scroll:hover,html[data-theme="light"] .sidebar-scroll[data-scrolling]{scrollbar-color:#c8c8c8 transparent}
html[data-theme="light"] .sidebar-scroll:hover::-webkit-scrollbar-thumb,html[data-theme="light"] .sidebar-scroll[data-scrolling]::-webkit-scrollbar-thumb{background-color:#c8c8c8!important}

/* Sidebar is exactly the same colour as the chat area (a custom chat background still covers both). */
:root{--kyro-sidebar-surface:#000}
html[data-theme="light"]{--kyro-sidebar-surface:#fff}
