.favorites-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fav-slide-out {
    from { bottom: 16vh; opacity: 1; }
    to   { bottom: -200px; opacity: 0; }
}

@keyframes fav-slide-in {
    from { bottom: -200px; opacity: 0; }
    to   { bottom: 16vh; opacity: 1; }
}

.favorites {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: max-content;
    max-width: 90vw;
    backdrop-filter: blur(var(--panel-blur)) saturate(1.8);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    position: fixed;
    bottom: 16vh;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 15px;
    gap: 10px;
    padding: 10px;
    user-select: none;
    transition: transform .3s;
    z-index: 2;
}

.invisible-favorites {
    animation: fav-slide-out .3s ease forwards;
    pointer-events: none;
}

.favorites:not(.invisible-favorites) {
    animation: fav-slide-in .3s ease forwards;
}

.add-new-hidden {
    display: none;
}

.favorites a {
    width: 110px;
    text-decoration: none;
    position: relative;
    outline: none;
    overflow: visible;
    transition: opacity .25s ease, transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fav-enter {
    opacity: 0;
    transform: scale(0.7);
}

.fav-exit {
    opacity: 0 !important;
    transform: scale(0.7) !important;
    pointer-events: none;
}

/* ── Right-click context menu ── */
.fav-context-menu {
    position: fixed;
    z-index: 9999;
    backdrop-filter: blur(20px) saturate(1.8);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
    opacity: 0;
    transform: scale(0.88);
    transform-origin: top left;
    transition: opacity .18s ease, transform .2s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.fav-context-menu.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.fav-context-menu button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    padding: 7px 12px;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background .15s;
    width: 100%;
}

.fav-context-menu button:hover {
    background: rgba(255,255,255,0.1);
}

.fav-context-menu button.danger:hover {
    background: rgba(255,80,80,0.2);
}

.favorites article {
    display: flex;
    flex-direction: column;
    height: 70px;
    width: 80px;
    font-size: 14px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 15px;
    padding: 10px 15px;
    position: relative;
    text-align: center;
    justify-content: space-around;
    align-items: center;
    text-transform: capitalize;
    cursor: pointer;
    transition: border-color .3s;
}

.favorites article:hover,
.favorites article:focus {
    border-color: rgba(255,255,255,0.26);
}

.favorites article i {
    font-size: 24px;
}

.favorites article img {
    width: 28px;
    border-radius: 5px;
}

/* ── Drag to reorder ── */
.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
}

.drag-source-hidden {
    opacity: 0;
    pointer-events: none;
}

.drag-placeholder {
    border-radius: 15px;
    background-color: #fff2;
    border: 2px dashed #fff4;
    transition: all 0.2s;
    flex-shrink: 0;
}