/* The box, styled as this site's form fields. The whole border is set on focus, as themes restyle
   focused fields. */
.content-editable-div {
    position: relative;
    padding: 10px 12px;
    border: 1px solid #b9c0c9;
    border-radius: 6px;
    background: #ffffff;
    color: #000;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-line;
    overflow: hidden;
}

.content-editable-div:focus {
    outline: 2px solid #2b65a5;
    outline-offset: 1px;
    border: 1px solid #2b65a5;
}

.content-editable-div[contenteditable="false"], .content-editable-div[contenteditable="null"] {
    background: #f9fafb;
}

.content-editable-div p {
    margin: 0 0 10px;
}

.content-editable-div p:last-child {
    margin-bottom: 0;
}

.editor-placeholder:before {
    position: absolute;
    left: 12px;
    right: 12px;
    content: attr(placeholder);
    white-space: nowrap;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
}

.word-count {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
    text-align: right;
}

.word-count em {
    font-style: normal;
}

/* The offer to restore saved drafts: bottom left and above everything, focus mode included. */
.restore-progress-popup {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 100000;
    max-width: 360px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #1a3a5c;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    color: #1f2937;
    font-size: 15px;
    line-height: 1.45;
}
.restore-progress-popup p { margin: 0 36px 10px 0; }
.restore-progress-popup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.restore-progress-popup .restore-progress-popup-yes,
.restore-progress-popup .restore-progress-popup-yes:focus {
    padding: 7px 16px;
    border: 1px solid #2e7d32;
    border-radius: 6px;
    background: #2e7d32;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
}
.restore-progress-popup .restore-progress-popup-yes:hover {
    background: #1b5e20;
    color: #ffffff;
    border-color: #1b5e20;
}
/* "No" is the lighter choice: small and grey. */
.restore-progress-popup .restore-progress-popup-no,
.restore-progress-popup .restore-progress-popup-no:focus {
    padding: 7px 14px;
    border: 1px solid #d6dbe2;
    border-radius: 6px;
    background: #ffffff;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}
.restore-progress-popup .restore-progress-popup-no:hover {
    background: #f3f4f6;
    color: #1f2937;
    border-color: #b9c0c9;
}
/* A filled circle, big enough to see and hit easily. */
.restore-progress-popup .restore-progress-popup-close,
.restore-progress-popup .restore-progress-popup-close:focus {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #d6dbe2;
    border-radius: 50%;
    background: #eef0f3;
    color: #1f2937;
    font-size: 22px;
    font-weight: 400;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
}
.restore-progress-popup .restore-progress-popup-close:hover {
    background: #d6dbe2;
    color: #000;
    border-color: #b9c0c9;
}
.restore-progress-popup button:focus-visible {
    outline: 2px solid #2b65a5;
    outline-offset: 2px;
}
@media (max-width: 600px) {
    .restore-progress-popup { left: 8px; right: 8px; bottom: 8px; max-width: none; }
}
