.wp-rich-editor {
    overflow: hidden;
    width: 100%;
    border: 1px solid #d8dde3;
    border-radius: .25rem;
    background: #fff;
}

.wp-rich-editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .25rem;
    padding: .45rem;
    border-bottom: 1px solid #e5e8ec;
    background: #f7f8fa;
}

.wp-rich-editor-group {
    display: inline-flex;
    align-items: center;
    gap: .18rem;
    padding-right: .3rem;
    border-right: 1px solid #dde2e7;
}

.wp-rich-editor-group:last-child {
    padding-right: 0;
    border-right: 0;
}

.wp-rich-editor-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: .2rem;
    background: transparent;
    color: #4f5b66;
    font-size: .95rem;
    cursor: pointer;
}

.wp-rich-editor-button:hover,
.wp-rich-editor-button:focus,
.wp-rich-editor-button.is-active {
    border-color: #c7d9eb;
    background: #e8f1fb;
    color: #245685;
    outline: 0;
}

.wp-rich-editor-button:disabled {
    cursor: wait;
    opacity: .5;
}

.wp-rich-editor-upload-input {
    display: none !important;
}

.wp-rich-editor-select {
    height: 2rem;
    padding: 0 1.6rem 0 .5rem;
    border: 1px solid #d8dde3;
    border-radius: .2rem;
    background-color: #fff;
    color: #4f5b66;
    font-size: .875rem;
}

.wp-rich-editor-color {
    width: 2rem;
    height: 2rem;
    padding: .18rem;
    border: 1px solid transparent;
    border-radius: .2rem;
    background: transparent;
    cursor: pointer;
}

.wp-rich-editor-color:hover,
.wp-rich-editor-color:focus {
    border-color: #c7d9eb;
    background: #e8f1fb;
    outline: 0;
}

.wp-rich-editor-content {
    min-height: 300px;
    max-height: 70vh;
    overflow: auto;
    padding: .9rem 1rem;
    color: #222;
    font-size: 16px;
    line-height: 1.75;
    word-break: break-word;
    outline: 0;
}

.wp-rich-editor-content.is-dragover {
    background: #eef7ff;
    box-shadow: inset 0 0 0 2px #3f82bd;
}

.wp-rich-editor-content:empty:before {
    content: attr(data-placeholder);
    color: #9aa3ab;
    pointer-events: none;
}

.wp-rich-editor-content p {
    margin: 0 0 .7rem;
}

.wp-rich-editor-content blockquote {
    margin: .75rem 0;
    padding: .55rem .8rem;
    border-left: 4px solid #2d5f8f;
    background: #f3f7fa;
    color: #4d5964;
}

.wp-rich-editor-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: .65rem auto;
}

.wp-rich-editor-content a {
    color: #1769aa;
    text-decoration: underline;
}

.wp-rich-editor-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2rem;
    padding: .3rem .65rem;
    border-top: 1px solid #edf0f2;
    background: #fbfcfd;
    color: #8a949d;
    font-size: .75rem;
}

.wp-rich-editor-status-message {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wp-rich-editor-status-message.is-loading {
    color: #245685;
}

.wp-rich-editor-status-message.is-success {
    color: #218838;
}

.wp-rich-editor-status-message.is-error {
    color: #c9302c;
}

.wp-rich-editor-dialog {
    position: fixed;
    z-index: 1090;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, .52);
}

.wp-rich-editor-dialog.is-open {
    display: flex;
}

.wp-rich-editor-dialog-panel {
    width: min(100%, 520px);
    overflow: hidden;
    border-radius: .25rem;
    background: #fff;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .2);
}

.wp-rich-editor-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem 1rem;
    border-bottom: 1px solid #e5e8ec;
    font-size: 1rem;
    font-weight: 700;
}

.wp-rich-editor-dialog-close {
    border: 0;
    background: transparent;
    color: #66717b;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.wp-rich-editor-dialog-body {
    padding: 1rem;
}

.wp-rich-editor-dialog-body label {
    display: block;
    margin-bottom: .35rem;
    color: #59636c;
    font-size: .875rem;
}

.wp-rich-editor-dialog-body input[type="url"] {
    width: 100%;
    height: 2.5rem;
    padding: .45rem .65rem;
    border: 1px solid #ccd3da;
    border-radius: .2rem;
}

.wp-rich-editor-dialog-error {
    display: none;
    margin-top: .45rem;
    color: #c9302c;
    font-size: .82rem;
}

.wp-rich-editor-dialog-error.is-visible {
    display: block;
}

.wp-rich-editor-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: .45rem;
    padding: .75rem 1rem;
    border-top: 1px solid #e5e8ec;
    background: #fafbfc;
}

textarea.wp-rich-editor-source {
    display: none !important;
}

@media (max-width: 576px) {
    .wp-rich-editor-toolbar {
        gap: .18rem;
        padding: .35rem;
    }

    .wp-rich-editor-group {
        gap: .08rem;
        padding-right: .18rem;
    }

    .wp-rich-editor-button,
    .wp-rich-editor-color {
        width: 1.9rem;
        height: 1.9rem;
    }

    .wp-rich-editor-select {
        max-width: 5.4rem;
        height: 1.9rem;
        padding-left: .35rem;
        font-size: .8rem;
    }

    .wp-rich-editor-content {
        min-height: 240px;
        padding: .75rem;
    }

    .wp-rich-editor-status-message {
        max-width: 72%;
    }
}
