:root { --right-sidebar-w: 440px; --right-sidebar-top: 57px; }

.right-sidebar {
    position: fixed;
    top: var(--right-sidebar-top);
    right: 0;
    bottom: 0;
    width: var(--right-sidebar-w);
    max-width: 100vw;
    background: #fff;
    border-left: 1px solid rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    z-index: 1020;
    visibility: hidden;
    view-transition-name: right-sidebar;
}
@view-transition { navigation: auto; }
.right-sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
}

body.right-sidebar-open {
    overflow: hidden;
    height: 100vh;
}
html:has(body.right-sidebar-open) {
    scrollbar-gutter: auto;
}
body.right-sidebar-open .page {
    height: 100vh;
    min-height: 0;
}
body.right-sidebar-open .page-wrapper {
    overflow-y: auto;
    min-height: 0;
    flex: 1 1 0;
    margin-right: var(--right-sidebar-w);
}

.right-sidebar-resize-handle {
    position: absolute;
    top: 0;
    left: -3px;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    z-index: 1;
    background: transparent;
    transition: background 0.15s;
}
.right-sidebar-resize-handle:hover,
.right-sidebar-resize-handle.is-dragging {
    background: var(--tblr-primary);
    opacity: 0.4;
}
body.right-sidebar-resizing .right-sidebar,
body.right-sidebar-resizing .page-wrapper {
    transition: none !important;
}
body.right-sidebar-resizing {
    cursor: ew-resize;
    user-select: none;
}

[data-right-sidebar-open] {
    transition: background-color 0.18s ease, color 0.18s ease,
                border-color 0.18s ease;
}
body.right-sidebar-open [data-right-sidebar-open] {
    background-color: var(--tblr-primary);
    border-color: var(--tblr-primary);
    color: #fff;
}
body.right-sidebar-open [data-right-sidebar-open]:hover {
    filter: brightness(0.94);
}

.right-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.right-sidebar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.right-sidebar-title .ti {
    color: var(--tblr-primary);
    font-size: 18px;
}

.right-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
}
.right-sidebar-body { padding: 16px; }

.right-sidebar-footer {
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 12px 16px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
