/* Library actions — the shared ⋮ menu (#nav-context-menu.la-menu) and the
   multi-select bar (#nav-bulk-bar.la-bar). Drawn by js/tools/LibraryActions.js.
   Loaded last; `html body #id.class` + !important beats every theme. */

:root {
    --la-ink: #1e293b;
    --la-muted: #64748b;
    --la-line: #e2e8f0;
    --la-surface: #ffffff;
    --la-hover: #f4f6fb;
    --la-primary: #4f46e5;
    --la-danger: #dc2626;
    --la-font: 'Outfit', 'Inter', 'Cairo', system-ui, sans-serif;
}

/* ---------------- ⋮ menu ---------------- */
html body #nav-context-menu.la-menu {
    position: fixed !important;
    display: none;
    min-width: 236px !important;
    max-width: min(300px, calc(var(--app-vw, 100vw) - 24px)) !important;
    padding: 6px !important;
    background: var(--la-surface) !important;
    background-image: none !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 16px !important;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.06) !important;
    font-family: var(--la-font) !important;
    color: var(--la-ink) !important;
    -webkit-text-fill-color: var(--la-ink) !important;
    text-shadow: none !important;
    z-index: var(--z-context-menu, 500000) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    max-height: calc(var(--app-vh, 100vh) - 24px);
    overflow-y: auto;
}
html body #nav-context-menu.la-menu.show { display: block !important; }

html body #nav-context-menu.la-menu .la-head {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 10px !important;
    margin: 0 0 4px !important;
    border-bottom: 1px solid #eef2f7 !important;
}
html body #nav-context-menu.la-menu .la-head-ico {
    flex: none;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: #eef2ff !important;
    color: var(--la-primary) !important;
    -webkit-text-fill-color: var(--la-primary) !important;
    font-size: 14px;
}
html body #nav-context-menu.la-menu .la-head-text { display: flex; flex-direction: column; min-width: 0; }
html body #nav-context-menu.la-menu .la-head-title {
    font-size: 14px !important; font-weight: 700 !important; line-height: 1.25;
    color: var(--la-ink) !important; -webkit-text-fill-color: var(--la-ink) !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html body #nav-context-menu.la-menu .la-head-sub {
    font-size: 11.5px !important; font-weight: 600 !important; letter-spacing: .02em;
    color: var(--la-muted) !important; -webkit-text-fill-color: var(--la-muted) !important;
}

html body #nav-context-menu.la-menu .la-group { display: flex; flex-direction: column; gap: 1px; }
html body #nav-context-menu.la-menu .la-sep {
    height: 1px !important; margin: 5px 8px !important;
    background: #eef2f7 !important; border: none !important;
}

html body #nav-context-menu.la-menu .la-item {
    all: unset;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 40px !important;
    padding: 0 10px !important;
    border-radius: 10px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    font-family: var(--la-font) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--la-ink) !important;
    -webkit-text-fill-color: var(--la-ink) !important;
    text-align: start !important;
    transition: background .12s ease;
}
html body #nav-context-menu.la-menu .la-item:hover,
html body #nav-context-menu.la-menu .la-item:focus-visible {
    background: var(--la-hover) !important;
    outline: none !important;
}
html body #nav-context-menu.la-menu .la-ico {
    flex: none;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 8px;
    background: color-mix(in srgb, var(--la-c) 11%, white) !important;
    color: var(--la-c) !important;
    -webkit-text-fill-color: var(--la-c) !important;
    font-size: 13px;
}
html body #nav-context-menu.la-menu .la-ico i {
    color: inherit !important; -webkit-text-fill-color: currentColor !important; width: auto !important;
}
html body #nav-context-menu.la-menu .la-item.la-danger {
    color: var(--la-danger) !important; -webkit-text-fill-color: var(--la-danger) !important;
}
html body #nav-context-menu.la-menu .la-item.la-danger:hover,
html body #nav-context-menu.la-menu .la-item.la-danger:focus-visible { background: #fef2f2 !important; }

/* ---------------- selection bar ---------------- */
html body #nav-bulk-bar.la-bar {
    position: fixed !important;
    left: 50% !important;
    bottom: 28px !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: max-content !important;
    max-width: calc(var(--app-vw, 100vw) - 24px) !important;
    padding: 8px !important;
    padding-inline-start: 10px !important;
    background: var(--la-surface) !important;
    background-image: none !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22), 0 2px 8px rgba(15, 23, 42, 0.08) !important;
    font-family: var(--la-font) !important;
    color: var(--la-ink) !important;
    -webkit-text-fill-color: var(--la-ink) !important;
    text-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
    transition: transform .3s cubic-bezier(.16, 1, .3, 1), opacity .2s ease !important;
    z-index: var(--z-bulk-bar, 50000) !important;
}
html body #nav-bulk-bar.la-bar:not(.show) {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(-50%) translateY(140%) !important;
}

html body #nav-bulk-bar.la-bar .la-count {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 0 6px 0 2px !important;
    background: none !important; border: none !important;
    white-space: nowrap;
}
html body #nav-bulk-bar.la-bar .la-count::before { content: none !important; }
html body #nav-bulk-bar.la-bar .la-count-num {
    min-width: 30px; height: 30px; padding: 0 8px;
    display: grid; place-items: center;
    border-radius: 999px;
    background: var(--la-primary) !important;
    color: #fff !important; -webkit-text-fill-color: #fff !important;
    font-size: 14px !important; font-weight: 800 !important;
}
html body #nav-bulk-bar.la-bar .la-count-text {
    font-size: 14px !important; font-weight: 700 !important;
    color: var(--la-ink) !important; -webkit-text-fill-color: var(--la-ink) !important;
}

html body #nav-bulk-bar.la-bar .la-pills {
    display: flex; align-items: center; gap: 6px;
    min-width: 0;
    padding-inline-start: 10px;
    border-inline-start: 1px solid #eef2f7;
}
html body #nav-bulk-bar.la-bar .la-pills-gap { width: 4px; flex: none; }

html body #nav-bulk-bar.la-bar .la-pill {
    all: unset;
    box-sizing: border-box !important;
    flex: none;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    gap: 8px !important;
    height: 40px !important;
    padding: 0 14px !important;
    border-radius: 12px !important;
    background: var(--la-surface) !important;
    border: 1px solid var(--la-line) !important;
    box-shadow: none !important;
    cursor: pointer !important;
    font-family: var(--la-font) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    white-space: nowrap;
    color: var(--la-ink) !important;
    -webkit-text-fill-color: var(--la-ink) !important;
    transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
html body #nav-bulk-bar.la-bar .la-pill i {
    color: var(--la-c, var(--la-primary)) !important;
    -webkit-text-fill-color: var(--la-c, var(--la-primary)) !important;
    font-size: 14px;
}
html body #nav-bulk-bar.la-bar .la-pill:hover,
html body #nav-bulk-bar.la-bar .la-pill:focus-visible {
    background: var(--la-hover) !important;
    border-color: #cbd5e1 !important;
    outline: none !important;
}
html body #nav-bulk-bar.la-bar .la-pill:active { transform: scale(.97); }

html body #nav-bulk-bar.la-bar .la-pill.la-primary {
    background: var(--la-primary) !important;
    border-color: var(--la-primary) !important;
    color: #fff !important; -webkit-text-fill-color: #fff !important;
}
html body #nav-bulk-bar.la-bar .la-pill.la-primary i { color: #fff !important; -webkit-text-fill-color: #fff !important; }
html body #nav-bulk-bar.la-bar .la-pill.la-primary:hover { background: #4338ca !important; border-color: #4338ca !important; }

html body #nav-bulk-bar.la-bar .la-pill.la-danger {
    border-color: #fecaca !important;
    color: var(--la-danger) !important; -webkit-text-fill-color: var(--la-danger) !important;
}
html body #nav-bulk-bar.la-bar .la-pill.la-danger i { color: var(--la-danger) !important; -webkit-text-fill-color: var(--la-danger) !important; }
html body #nav-bulk-bar.la-bar .la-pill.la-danger:hover { background: #fef2f2 !important; border-color: #fca5a5 !important; }

html body #nav-bulk-bar.la-bar .la-pill.la-more { width: 40px; padding: 0 !important; }
html body #nav-bulk-bar.la-bar .la-pill.la-more i { color: var(--la-muted) !important; -webkit-text-fill-color: var(--la-muted) !important; }

html body #nav-bulk-bar.la-bar .la-clear {
    all: unset;
    box-sizing: border-box !important;
    flex: none;
    width: 36px !important; height: 36px !important;
    display: grid !important; place-items: center;
    border-radius: 999px !important;
    background: #f1f5f9 !important;
    border: none !important;
    cursor: pointer !important;
    color: var(--la-muted) !important; -webkit-text-fill-color: var(--la-muted) !important;
    font-size: 15px;
    transition: background .12s ease;
}
html body #nav-bulk-bar.la-bar .la-clear i { color: inherit !important; -webkit-text-fill-color: currentColor !important; }
html body #nav-bulk-bar.la-bar .la-clear:hover { background: #e2e8f0 !important; color: var(--la-ink) !important; -webkit-text-fill-color: var(--la-ink) !important; }

/* Phone / narrow: full-width dock, icon-over-label buttons that scroll sideways */
@media (max-width: 760px) {
    html body #nav-bulk-bar.la-bar {
        left: 8px !important;
        right: 8px !important;
        bottom: 8px !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        padding: 8px !important;
        border-radius: 18px !important;
    }
    html body #nav-bulk-bar.la-bar:not(.show) { transform: translateY(140%) !important; }
    html body #nav-bulk-bar.la-bar .la-count { flex: 1; }
    html body #nav-bulk-bar.la-bar .la-clear { order: 2; }
    html body #nav-bulk-bar.la-bar .la-pills {
        order: 3;
        flex: 1 0 100%;
        padding: 6px 0 0 !important;
        border-inline-start: none;
        border-top: 1px solid #eef2f7;
        overflow-x: auto;
        scrollbar-width: none;
    }
    html body #nav-bulk-bar.la-bar .la-pills::-webkit-scrollbar { display: none; }
    html body #nav-bulk-bar.la-bar .la-pills-gap { flex: 1; }
    html body #nav-bulk-bar.la-bar .la-pill {
        flex-direction: column !important;
        gap: 3px !important;
        height: 54px !important;
        min-width: 64px;
        padding: 0 8px !important;
        font-size: 11.5px !important;
    }
    html body #nav-bulk-bar.la-bar .la-pill i { font-size: 16px; }
    html body #nav-bulk-bar.la-bar .la-pill.la-more { width: 48px; min-width: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    html body #nav-bulk-bar.la-bar { transition: none !important; }
}
