.right-sidebar {
    flex-shrink: 0;
    flex-grow: 0;
    width: 100%;
    max-width: 1000px;
    background-color: var(--bg-1);
    border: none;
    border-left: 1px solid var(--border-1);
    z-index: 90;
    height: 100svh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 900px) {
    .right-sidebar-hidden {
        display: none;
    }

    .right-sidebar {
        transition: width 0.05s;
    }

    /* Desktop-only resize handle */
    .resize-handle {
        position: absolute;
        width: 10px;
        height: 100%;
        top: 0;
        z-index: 150;
        transition: background-color 0.2s;
    }

    .resize-handle-left {
        left: -5px;
        cursor: col-resize;
    }

    .resize-handle:hover {
        background-color: var(--bg-3);
    }

    .sidebar-resizing {
        cursor: col-resize;
        user-select: none;
    }

    .sidebar-resizing iframe,
    .sidebar-resizing .right-sidebar-body {
        pointer-events: none;
    }
}

@media (max-width: 900px) {
    .right-sidebar {
        width: 90%;
        max-width: 100%;
        position: fixed;
        top: 0;
        right: 0;
        height: 100%;
        margin: 0;
        border-radius: 0;
        border: none;
        filter: var(--drop-shadow);
        border-left: 1px solid var(--border-1);
        transition: right 0.2s;
    }

    .right-sidebar-hidden {
        right: -100%;
    }

    .resize-handle {
        display: none;
    }
}

.right-sidebar-close {
    outline: none;
    border: none;
    background-color: transparent;
    color: var(--fg-1);
    cursor: pointer;
    padding: var(--padding-w1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    gap: var(--gap-2);
    transition: background-color 0.2s;
    user-select: none;
}

.right-sidebar-close:hover {
    background-color: var(--bg-3);
}

.right-sidebar-body {
    overflow: auto;
    height: 100%;
    position: relative;
}

.right-sidebar-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: var(--padding-2);
    font-weight: 400;
}
