/* Sidebar logo offset and reversible compact navigation. */
.sidebar .brand img.brand-logo{transform:translateX(10px)}
.sidebar-toggle{position:absolute;right:12px;top:calc(var(--promo-offset,60px) + 13px);width:24px;height:24px;display:grid;place-items:center;padding:0;border:0;border-radius:6px;background:transparent;color:var(--muted);opacity:.42;cursor:pointer;z-index:6;transition:opacity .18s ease,color .18s ease}
.sidebar-toggle:hover{color:var(--accent);background:transparent;opacity:.8}
.sidebar-toggle:focus-visible{outline:1px solid var(--accent);outline-offset:2px;opacity:.85}
.sidebar-toggle svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round}
@media(min-width:761px){
body.sidebar-compact{--sidebar:68px}
.sidebar-compact .sidebar{padding-left:8px;padding-right:8px}
.sidebar-compact .sidebar .brand{padding:0;border-bottom:1px solid var(--line);background:none;justify-content:center}
.sidebar-compact .sidebar .brand img{display:none!important}
.sidebar-compact .sidebar .nav-item{font-size:0;gap:0;justify-content:center;padding:13px 0}
.sidebar-compact .sidebar .nav-item svg{width:20px;height:20px;flex-shrink:0}
.sidebar-compact .sidebar .nav-item:after,.sidebar-compact .sidebar .nav-item em,.sidebar-compact .sidebar .nav-label,.sidebar-compact .sidebar .resource-grade-tree,.sidebar-compact .sidebar .side-note{display:none!important}
.sidebar-compact .sidebar-toggle svg{transform:rotate(180deg)}
.sidebar-compact .sidebar nav{display:flex;flex-direction:column;gap:8px}
}

.sidebar-toggle{border:1px solid color-mix(in srgb,var(--line) 78%,transparent);background:color-mix(in srgb,var(--panel) 26%,transparent);opacity:.55}.sidebar-toggle:hover{background:color-mix(in srgb,var(--soft) 48%,transparent);opacity:.82}

/* The expanded control stays at the top; only compact mode puts it at the bottom. */
.sidebar .brand .sidebar-compact-logo{display:none!important}
.sidebar-toggle{opacity:.85;color:var(--muted);border-color:var(--line)}
.sidebar-toggle:hover{opacity:1;color:var(--accent)}
@media(min-width:761px){
.sidebar-compact .sidebar .sidebar-toggle{position:static;top:auto;right:auto;bottom:auto;align-self:center;flex:0 0 28px;width:32px;height:28px;margin-top:auto}
.sidebar-compact .sidebar .brand svg.sidebar-compact-logo{display:block!important;width:28px;height:28px;max-width:28px;object-fit:contain;transform:none}
}

/* Compact sidebar: expand at the top, brand at the bottom. */
@media(min-width:761px){
 body.sidebar-compact .sidebar{padding-top:calc(var(--promo-offset,60px) + 50px)}
 body.sidebar-compact .sidebar .brand{order:2;margin-top:auto;min-height:28px;height:28px;flex:0 0 28px;border:0;padding:0;justify-content:center}
 body.sidebar-compact .sidebar .sidebar-toggle{position:absolute;top:calc(var(--promo-offset,60px) + 13px);right:calc(50% - 12px);bottom:auto;width:24px;height:24px;min-width:24px;min-height:24px;flex:none;margin:0;padding:0;border-radius:6px}
 body.sidebar-compact .sidebar .sidebar-toggle svg{width:16px;height:16px}
}
