.rs-editor-gallery-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.65rem;
}

.rs-editor-gallery-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 1px solid rgba(122, 85, 255, 0.28);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: -0.02em;
    color: rgba(48, 30, 120, 0.95);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 255, 0.9) 100%);
    box-shadow: 0 2px 10px rgba(122, 85, 255, 0.12);
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.rs-editor-gallery-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(122, 85, 255, 0.45);
    box-shadow: 0 6px 18px rgba(122, 85, 255, 0.18);
}

.rs-editor-gallery-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

[data-bs-theme="dark"] .rs-editor-gallery-btn {
    color: rgba(235, 230, 255, 0.96);
    border-color: rgba(152, 120, 255, 0.35);
    background: linear-gradient(135deg, rgba(40, 40, 48, 0.95) 0%, rgba(28, 28, 34, 0.92) 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.rs-audio-editor__player {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.rs-audio-editor__url-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.rs-audio-editor__url-row .rs-audio-editor__url {
    flex: 1 1 12rem;
    min-width: 0;
}

.rs-audio-editor__url-row .rs-editor-gallery-btn,
.rs-audio-editor__gallery-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 0.48rem 1rem;
    font-weight: 850;
    font-size: 0.84rem;
    letter-spacing: -0.02em;
    color: #fff !important;
    background: linear-gradient(135deg, #4338ca 0%, #7c3aed 48%, #0d9488 120%);
    box-shadow:
        0 3px 14px rgba(15, 23, 42, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.14s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.rs-audio-editor__url-row .rs-editor-gallery-btn:hover:not(:disabled),
.rs-audio-editor__gallery-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow:
        0 6px 22px rgba(122, 85, 255, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

[data-bs-theme="dark"] .rs-audio-editor__url-row .rs-editor-gallery-btn,
[data-bs-theme="dark"] .rs-audio-editor__gallery-btn {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.image-tool .rs-editor-gallery-actions,
.cdx-attaches .rs-editor-gallery-actions {
    justify-content: flex-start;
}

/* Attaches block — selected file card */
.codex-editor .cdx-attaches--with-file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border-radius: 1rem;
    border: 1px solid rgba(122, 85, 255, 0.18);
    background:
        radial-gradient(480px 180px at 8% 0%, rgba(122, 85, 255, 0.08), transparent 55%),
        rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

[data-bs-theme="dark"] .codex-editor .cdx-attaches--with-file {
    border-color: rgba(152, 120, 255, 0.24);
    background:
        radial-gradient(480px 180px at 8% 0%, rgba(122, 85, 255, 0.14), transparent 55%),
        rgba(28, 28, 34, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.codex-editor .cdx-attaches__file-info {
    flex: 1 1 8rem;
    min-width: 0;
}

.codex-editor .cdx-attaches__title {
    font-weight: 750;
    font-size: 0.92rem;
    line-height: 1.35;
    word-break: break-word;
    color: var(--bs-body-color);
}

.codex-editor .cdx-attaches__download-button {
    flex: 0 0 auto;
    margin: 0 !important;
}

.codex-editor .cdx-attaches--with-file .rs-attaches-replace-actions {
    flex: 1 1 100%;
    width: 100%;
    order: 10;
    margin-top: 0.35rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(122, 85, 255, 0.12);
}

[data-bs-theme="dark"] .codex-editor .cdx-attaches--with-file .rs-attaches-replace-actions {
    border-top-color: rgba(152, 120, 255, 0.18);
}

.codex-editor .cdx-attaches--with-file .rs-attaches-replace-btn {
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    color: #fff !important;
    background: linear-gradient(135deg, #4338ca 0%, #7c3aed 48%, #0d9488 120%) !important;
    box-shadow:
        0 3px 14px rgba(15, 23, 42, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
