/* VelChat profile grid manual ordering. Loaded only on profile pages. */
.velchat-profile-order-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
}
.velchat-profile-order-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.25;
}
.velchat-profile-order-copy strong {
    font-size: 14px;
    font-weight: 700;
}
.velchat-profile-order-copy span {
    font-size: 12px;
    opacity: .68;
}
.velchat-profile-order-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}
.velchat-profile-order-actions .btn {
    min-width: 0 !important;
    padding: 8px 14px !important;
    line-height: 1.2 !important;
    border-radius: 999px !important;
}
.velchat-profile-order-toolbar.is-saving,
.velchat-grid-mobile-order-bar.is-saving {
    opacity: .72;
    pointer-events: none;
}
#photos-list.user_media_list_section.profile.velchat-grid-order-active {
    outline: 2px dashed rgba(255, 71, 87, .48);
    outline-offset: 6px;
    border-radius: 12px;
    user-select: none;
    -webkit-user-select: none;
}
#photos-list.user_media_list_section.profile.velchat-grid-order-active .photo-data {
    cursor: pointer !important;
    touch-action: manipulation !important;
    content-visibility: visible !important;
    contain: none !important;
    overflow: hidden !important;
}
#photos-list.user_media_list_section.profile.velchat-grid-order-active .photo-data > a {
    pointer-events: none !important;
}
#photos-list.user_media_list_section.profile .photo-data.velchat-grid-order-selected {
    outline: 3px solid #ff4757 !important;
    outline-offset: -3px !important;
    z-index: 4 !important;
}
#photos-list.user_media_list_section.profile .photo-data.velchat-grid-order-source {
    opacity: .38 !important;
    filter: saturate(.75) brightness(.82);
}
.velchat-grid-order-ghost {
    position: fixed !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 2147483000 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    border-radius: 14px !important;
    background: #111116 !important;
    box-shadow: 0 18px 46px rgba(0,0,0,.42) !important;
    opacity: .97 !important;
    transform: scale(1.035) translateZ(0) !important;
    contain: none !important;
    content-visibility: visible !important;
}
.velchat-grid-order-ghost > a,
.velchat-grid-order-ghost .photo-data > a,
.velchat-grid-order-ghost a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    pointer-events: none !important;
}
.velchat-grid-order-ghost img,
.velchat-grid-order-ghost video {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.velchat-grid-drag-handle {
    position: absolute;
    right: 7px;
    top: 7px;
    z-index: 8;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.68);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: grab;
    touch-action: none;
}
.velchat-grid-drag-handle:active {
    cursor: grabbing;
    transform: scale(.96);
}
.velchat-grid-drag-handle svg {
    width: 20px;
    height: 20px;
    display: block;
}
#photos-list.user_media_list_section.profile.velchat-grid-order-active .velchat-grid-drag-handle {
    display: flex;
}
.velchat-grid-order-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 18px);
    z-index: 2147483001;
    max-width: min(92vw, 390px);
    padding: 11px 14px;
    border-radius: 999px;
    background: rgba(22,22,26,.94);
    color: #fff;
    font-size: 13px;
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 14px 38px rgba(0,0,0,.32);
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
}
.velchat-grid-order-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
.velchat-grid-mobile-order-bar {
    display: none;
}
@media (max-width: 767px) {
    .velchat-profile-order-toolbar {
        margin: 0 12px 12px;
        padding: 10px;
        border-radius: 15px;
        gap: 8px;
    }
    .velchat-profile-order-copy span {
        display: none;
    }
    .velchat-profile-order-copy strong {
        font-size: 13px;
    }
    .velchat-profile-order-actions .btn {
        padding: 7px 10px !important;
        font-size: 12px !important;
    }
    #photos-list.user_media_list_section.profile.velchat-grid-order-active {
        outline-offset: 2px;
        padding-bottom: 82px !important;
    }
    .velchat-grid-drag-handle {
        width: 34px;
        height: 34px;
        right: 6px;
        top: 6px;
    }
    .velchat-grid-mobile-order-bar {
        position: fixed;
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
        bottom: calc(70px + env(safe-area-inset-bottom));
        z-index: 2147482500;
        display: none;
        align-items: center;
        gap: 8px;
        padding: 9px;
        border-radius: 22px;
        background: rgba(20,20,24,.94);
        border: 1px solid rgba(255,255,255,.12);
        box-shadow: 0 18px 50px rgba(0,0,0,.35);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
    .velchat-grid-mobile-order-bar.is-visible {
        display: flex;
    }
    .velchat-grid-mobile-order-bar button {
        border: 0;
        border-radius: 999px;
        min-height: 42px;
        padding: 0 14px;
        font-weight: 700;
        color: #fff;
        background: rgba(255,255,255,.11);
    }
    .velchat-grid-mobile-order-bar button:disabled {
        opacity: .42;
    }
    .velchat-grid-mobile-order-bar .velchat-grid-mobile-prev,
    .velchat-grid-mobile-order-bar .velchat-grid-mobile-next {
        width: 46px;
        padding: 0;
        font-size: 30px;
        line-height: 1;
    }
    .velchat-grid-mobile-order-bar .velchat-grid-mobile-save {
        flex: 1 1 auto;
        background: linear-gradient(135deg, #ff4757, #8e44ff);
    }
    .velchat-grid-mobile-order-bar .velchat-grid-mobile-cancel {
        flex: 0 0 auto;
    }
    .velchat-grid-order-toast {
        bottom: calc(128px + env(safe-area-inset-bottom));
    }
}

/* Delete entire post while arranging the profile grid. */
.velchat-grid-delete-post {
    position: absolute;
    left: 7px;
    top: 7px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(220, 38, 38, .92);
    box-shadow: 0 6px 18px rgba(0,0,0,.3);
    cursor: pointer;
    touch-action: manipulation;
}
.velchat-grid-delete-post svg { width: 19px; height: 19px; display: block; }
#photos-list.user_media_list_section.profile.velchat-grid-order-active .velchat-grid-delete-post { display: flex; }
#photos-list.user_media_list_section.profile .photo-data.velchat-grid-order-deleting { opacity: .45 !important; pointer-events: none !important; }
@media (max-width: 767px) {
    .velchat-grid-delete-post { width: 34px; height: 34px; left: 6px; top: 6px; }
}
