.cp-frontend-editor {
    margin-top: 12px;
    font-family: adobe-clean, Arial, sans-serif;
}

body.cp-frontend-editors .tox-tinymce {
    border: 1px solid #d5d5d5;
    border-radius: 8px;
}

.cp-editor-status {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

.cp-editor-status p:empty {
    display: none;
}

.cp-editor-status[hidden] {
    display: none;
}

.cp-editor-status[role="alert"],
.cp-editor-status [role="alert"] {
    color: #b3261e;
}

.cp-editor-status button {
    margin-bottom: 12px;
}

.cp-editor-status button[hidden] {
    display: none;
}

.cp-frontend-editor textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 400px;
    max-height: 600px;
    resize: vertical;
    overflow: auto;
    padding: 16px;
    font: 16px/1.6 adobe-clean, Arial, sans-serif;
}

.cp-frontend-editor textarea#uspPostEditor,
.cp-frontend-editor textarea#uspThreadEditor {
    max-height: 900px;
}

/* The theme hides these globally for older editors; keep errors visible here. */
body.cp-frontend-editors .tox .tox-notifications-container,
body.cp-frontend-editors .tox .tox-text {
    display: block !important;
}

/* Keep menus and dialogs above our fullscreen editor, including TinyMCE's fullscreen sink rule. */
body.cp-frontend-editors .tox.tox-tinymce-aux {
    z-index: 100100;
}

body.cp-frontend-editors {
    --cp-editor-top: 0px;
}

body.cp-frontend-editors.admin-bar {
    --cp-editor-top: 32px;
}

body.cp-frontend-editors .tox .tox-dialog-wrap {
    top: var(--cp-editor-top);
    bottom: 0 !important;
}

body.cp-frontend-editors .tox-tinymce.tox-fullscreen,
body.cp-frontend-editors #wp-comment-editor-container .tox-tinymce.tox-fullscreen {
    top: var(--cp-editor-top) !important;
    height: calc(100vh - var(--cp-editor-top)) !important;
    z-index: 100000;
}

@media (max-width: 782px) {
    body.cp-frontend-editors.admin-bar {
        --cp-editor-top: 46px;
    }
}

/* Phones: tighter toolbar groups keep the More drawer to three rows instead of four. */
@media (max-width: 600px) {
    body.cp-frontend-editors .tox .tox-toolbar__group {
        padding: 0 2px;
    }
}
