.mt-sidebar-shell { --mt-sidebar-width: 288px; position: relative; z-index: 60; flex: 0 0 auto; }
.mt-sidebar-panel { position: relative; width: var(--mt-sidebar-width); z-index: 30; }
.mt-sidebar-shell #nav-sidebar { width: var(--mt-sidebar-width); }
.mt-sidebar-backdrop { display: none; }
.mt-sidebar-shell[data-sidebar-mode="desktop"][data-desktop-open="false"] .mt-sidebar-panel { display: none; }
.mt-sidebar-toggle-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 28px; min-height: 32px; padding: 2px; border-radius: 6px; cursor: pointer; }
.mt-sidebar-toggle-button:hover { background: #e2e8f066; }
.mt-sidebar-toggle-button:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.mt-sidebar-mobile-close { display: none; }
.mt-sidebar-resize { touch-action: none; }
/* The classic list's fixed action bar follows the actual drawer width too. */
#changelist-actions-wrapper { margin-left: var(--mt-sidebar-offset, 0px) !important; }
html.mt-sidebar-resizing, html.mt-sidebar-resizing * { cursor: col-resize !important; user-select: none !important; }
html.mt-sidebar-drawer-open, html.mt-sidebar-drawer-open body { overflow: hidden; overscroll-behavior: none; }
html.mt-sidebar-drawer-open body { position: fixed; top: var(--mt-sidebar-scroll-top, 0px); left: 0; right: 0; width: 100%; }
.mt-sidebar-shell[data-sidebar-mode="drawer"] { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; z-index: 900; pointer-events: none; }
.mt-sidebar-shell[data-sidebar-mode="drawer"] .mt-sidebar-panel {
    position: absolute; inset: 0 auto 0 0; width: min(360px, calc(100% - 48px)); height: 100%;
    transform: translateX(-100%); visibility: hidden; pointer-events: none;
    transition: transform .22s ease, visibility 0s linear .22s;
}
.mt-sidebar-shell[data-sidebar-mode="drawer"] #nav-sidebar {
    position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none;
    border-radius: 0 16px 16px 0; overflow: hidden; box-shadow: 12px 0 40px rgb(15 23 42 / 20%);
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}
.mt-sidebar-shell[data-sidebar-mode="drawer"] .mt-sidebar-panel > div { height: 100%; }
.mt-sidebar-shell[data-sidebar-mode="drawer"] #nav-sidebar-inner { min-height: 0; height: 100%; }
.mt-sidebar-shell[data-sidebar-mode="drawer"] .mt-sidebar-backdrop {
    display: block; position: absolute; inset: 0; z-index: 20; margin: 0; border: 0;
    background: rgb(15 23 42 / 50%); opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .22s ease, visibility 0s linear .22s; touch-action: none;
}
.mt-sidebar-shell[data-sidebar-mode="drawer"][data-mobile-open="true"] .mt-sidebar-panel,
.mt-sidebar-shell[data-sidebar-mode="drawer"][data-mobile-open="true"] .mt-sidebar-backdrop {
    visibility: visible; pointer-events: auto; transition-delay: 0s;
}
.mt-sidebar-shell[data-sidebar-mode="drawer"][data-mobile-open="true"] .mt-sidebar-panel { transform: translateX(0); }
.mt-sidebar-shell[data-sidebar-mode="drawer"][data-mobile-open="true"] .mt-sidebar-backdrop { opacity: 1; }
.mt-sidebar-shell[data-sidebar-mode="drawer"] .mt-sidebar-mobile-close { display: inline-flex; }
.mt-sidebar-shell[data-sidebar-mode="drawer"] .mt-sidebar-resize { display: none; }
html.mt-sidebar-drawer-mode .mt-sidebar-toggle-button { min-width: 44px; min-height: 44px; touch-action: manipulation; }
@media (max-width: 1279px), (hover: none), (pointer: coarse) {
    .mt-sidebar-shell:not([data-sidebar-mode]) { width: 0; }
    .mt-sidebar-shell:not([data-sidebar-mode]) .mt-sidebar-panel { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .mt-sidebar-shell[data-sidebar-mode="drawer"] .mt-sidebar-panel,
    .mt-sidebar-shell[data-sidebar-mode="drawer"] .mt-sidebar-backdrop { transition: none; }
}

#nav-sidebar-apps .mt-sidebar-heading,
#nav-sidebar-apps .mt-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: left;
    line-height: 1.3;
    transition: color .15s ease, background-color .15s ease;
}
#nav-sidebar-apps .mt-sidebar-heading { font-weight: 600; color: #1e293b; }
#nav-sidebar-apps .mt-sidebar-link { font-size: 14px; }
#nav-sidebar-apps .mt-sidebar-link:hover,
#nav-sidebar-apps .mt-sidebar-heading:hover { color: #0064d9; background: #f1f5f9; }
#nav-sidebar-apps .mt-sidebar-link.active { color: #0064d9; background: #edf2f7; font-weight: 600; }
#nav-sidebar-apps .mt-sidebar-link:focus-visible,
#nav-sidebar-apps .mt-sidebar-heading:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
#nav-sidebar-apps .mt-sidebar-list { padding-inline: 12px; display: flex; flex-direction: column; gap: 2px; }
#nav-sidebar-apps .mt-sidebar-children { margin-left: 21px; padding-left: 8px; border-left: 1px solid #dce3eb; }
#nav-sidebar-apps .mt-sidebar-children .mt-sidebar-link { font-size: 12px; min-height: 33px; padding: 7px 8px; gap: 7px; }
#nav-sidebar-apps .mt-sidebar-children .mt-sidebar-children { margin-left: 16px; padding-left: 5px; }
#nav-sidebar-apps .mt-sidebar-icon { font-size: 18px; width: 18px; flex: 0 0 18px; }
#nav-sidebar-apps .mt-sidebar-label { min-width: 0; overflow-wrap: anywhere; }
#nav-sidebar-apps .mt-sidebar-chevron { font-size: 18px; margin-left: auto; flex-shrink: 0; transition: transform .15s; }
#nav-sidebar-apps .mt-sidebar-chevron-open { transform: rotate(90deg); }
#nav-sidebar-apps .mt-sidebar-divider { border-top-width: 1px; margin-block: 8px; }
.dark #nav-sidebar-apps .mt-sidebar-heading { color: #e2e8f0; }
.dark #nav-sidebar-apps .mt-sidebar-link:hover,
.dark #nav-sidebar-apps .mt-sidebar-heading:hover { color: #93c5fd; background: #ffffff08; }
.dark #nav-sidebar-apps .mt-sidebar-link.active { color: #60a5fa; background: #ffffff0f; }
.dark #nav-sidebar-apps .mt-sidebar-children { border-color: #334155; }
