/* Desktop Notes sidebar: keep the page row as the primary click target. */
@media (min-width: 769px) {
    .page-item .page-title-text {
        min-width: 0;
    }

    .page-item .page-item-icons {
        display: none !important;
    }

    .page-item-actions-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 28px;
        height: 28px;
        margin-left: auto;
        padding: 0;
        border: 1px solid var(--surface-border, rgba(127, 127, 127, 0.24));
        border-radius: 8px;
        background: var(--surface-bg-elevated, rgba(255, 255, 255, 0.08));
        color: var(--text-secondary);
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
        transition: opacity 140ms ease, color 140ms ease, border-color 140ms ease, background 140ms ease;
    }

    .page-item:hover .page-item-actions-toggle,
    .page-item:focus-within .page-item-actions-toggle,
    .page-item-actions-toggle[aria-expanded="true"] {
        opacity: 1;
        pointer-events: auto;
    }

    .page-item-actions-toggle:hover,
    .page-item-actions-toggle:focus-visible,
    .page-item-actions-toggle[aria-expanded="true"] {
        color: var(--text-primary);
        border-color: var(--accent, rgba(160, 132, 96, 0.8));
        background: var(--surface-bg-hover, rgba(255, 255, 255, 0.12));
        outline: none;
    }
}

@media (min-width: 769px) and (hover: none) {
    .page-item-actions-toggle {
        opacity: 1;
        pointer-events: auto;
    }
}

.sidebar-page-actions-menu {
    position: fixed;
    z-index: 10020;
    min-width: 188px;
    max-width: min(280px, calc(100vw - 16px));
    padding: 6px;
    border: 1px solid var(--surface-border-strong, var(--surface-border, rgba(127, 127, 127, 0.3)));
    border-radius: 12px;
    background: var(--bg-elevated, var(--surface-bg-elevated, #1a1d24));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.sidebar-page-actions-menu[hidden] {
    display: none !important;
}

.sidebar-page-actions-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    gap: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.sidebar-page-actions-menu-item i {
    width: 16px;
    color: var(--text-secondary);
    text-align: center;
}

.sidebar-page-actions-menu-item:hover,
.sidebar-page-actions-menu-item:focus-visible {
    background: var(--surface-bg-hover, rgba(127, 127, 127, 0.14));
    outline: none;
}

.sidebar-page-actions-menu-item:hover i,
.sidebar-page-actions-menu-item:focus-visible i {
    color: var(--accent, var(--text-primary));
}
