.admin-wysiwyg {
    --editor-navy: #001328;
    --editor-gold: #c59a10;
    --editor-border: #d7dee6;
    --editor-muted: #687586;
    position: relative;
    width: 100%;
    margin: 8px 0 24px;
    border: 1px solid var(--editor-border);
    border-top: 3px solid var(--editor-gold);
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 19, 40, 0.08);
}

.admin-wysiwyg__toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--editor-border);
    background: #f5f7f9;
}

.admin-wysiwyg__group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding-right: 7px;
    margin-right: 2px;
    border-right: 1px solid #d6dde5;
}

.admin-wysiwyg__group:last-child {
    padding-right: 0;
    border-right: 0;
}

.admin-wysiwyg__button,
.admin-wysiwyg__format {
    min-width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #25364a;
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
}

.admin-wysiwyg__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    cursor: pointer;
}

.admin-wysiwyg__button:hover,
.admin-wysiwyg__button:focus,
.admin-wysiwyg__button.is-active {
    border-color: #bcc7d2;
    outline: 0;
    background: #fff;
    color: var(--editor-navy);
}

.admin-wysiwyg__button.is-active {
    border-color: var(--editor-gold);
    box-shadow: inset 0 -2px 0 var(--editor-gold);
}

.admin-wysiwyg__button i {
    margin: 0;
    font-size: 13px;
    pointer-events: none;
}

.admin-wysiwyg__format {
    width: 154px;
    padding: 0 30px 0 10px;
    border-color: #c7d0da;
    background-color: #fff;
    cursor: pointer;
}

.admin-wysiwyg__color {
    width: 34px;
    height: 34px;
    padding: 6px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
}

.admin-wysiwyg__color:hover,
.admin-wysiwyg__color:focus {
    border-color: #bcc7d2;
    outline: 0;
    background: #fff;
}

.admin-wysiwyg__canvas {
    min-height: 420px;
    padding: 30px 34px;
    overflow-y: auto;
    background: #fff;
    color: #243246;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    line-height: 1.75;
    text-align: left;
}

.admin-wysiwyg__canvas:focus {
    outline: 0;
    box-shadow: inset 0 0 0 2px rgba(197, 154, 16, 0.3);
}

.admin-wysiwyg__canvas:empty::before {
    color: #8b96a3;
    content: attr(data-placeholder);
    pointer-events: none;
}

.admin-wysiwyg__canvas h2,
.admin-wysiwyg__canvas h3,
.admin-wysiwyg__canvas h4 {
    margin: 1.2em 0 0.5em;
    color: var(--editor-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    line-height: 1.25;
}

.admin-wysiwyg__canvas h2 { font-size: 30px; }
.admin-wysiwyg__canvas h3 { font-size: 24px; }
.admin-wysiwyg__canvas h4 { font-size: 20px; }

.admin-wysiwyg__canvas p {
    margin: 0 0 1em;
    color: #3e4d5e !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

.admin-wysiwyg__canvas ul,
.admin-wysiwyg__canvas ol {
    margin: 0 0 1em;
    padding-left: 28px;
}

.admin-wysiwyg__canvas ul { list-style: disc; }
.admin-wysiwyg__canvas ol { list-style: decimal; }

.admin-wysiwyg__canvas li {
    margin-bottom: 5px;
    color: #3e4d5e !important;
    font-size: inherit !important;
}

.admin-wysiwyg__canvas blockquote {
    margin: 1.2em 0;
    padding: 14px 20px;
    border-left: 4px solid var(--editor-gold);
    background: #f8f5eb;
    color: var(--editor-navy);
    font-style: italic;
}

.admin-wysiwyg__canvas img {
    max-width: 100%;
    height: auto;
}

.admin-wysiwyg__canvas table {
    width: 100%;
    margin: 1.2em 0;
    border-collapse: collapse;
}

.admin-wysiwyg__canvas th,
.admin-wysiwyg__canvas td {
    padding: 10px 12px;
    border: 1px solid #ccd5de;
    color: #354356 !important;
}

.admin-wysiwyg__canvas th {
    background: var(--editor-navy);
    color: #fff !important;
}

.admin-wysiwyg__source {
    display: none !important;
    width: 100% !important;
    min-height: 420px !important;
    margin: 0 !important;
    padding: 24px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #111a24 !important;
    color: #edf3f8 !important;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace !important;
    font-size: 14px !important;
    line-height: 1.65 !important;
    resize: vertical;
}

.admin-wysiwyg.is-source .admin-wysiwyg__canvas { display: none; }
.admin-wysiwyg.is-source .admin-wysiwyg__source { display: block !important; }

.admin-wysiwyg__statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 38px;
    padding: 8px 13px;
    border-top: 1px solid var(--editor-border);
    background: #f8fafb;
    color: var(--editor-muted);
    font-family: Arial, sans-serif;
    font-size: 12px;
}

.admin-wysiwyg__statusbar strong {
    color: var(--editor-navy);
    font-weight: 600;
}

.admin-wysiwyg.is-fullscreen {
    position: fixed;
    z-index: 10050;
    inset: 12px;
    display: flex;
    flex-direction: column;
    margin: 0;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.admin-wysiwyg.is-fullscreen .admin-wysiwyg__canvas,
.admin-wysiwyg.is-fullscreen .admin-wysiwyg__source {
    flex: 1;
    min-height: 0 !important;
}

body.has-wysiwyg-fullscreen { overflow: hidden; }

@media (max-width: 767px) {
    .admin-wysiwyg__toolbar {
        align-items: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-wysiwyg__group { flex: 0 0 auto; }

    .admin-wysiwyg__canvas {
        min-height: 340px;
        padding: 22px 18px;
        font-size: 16px;
    }

    .admin-wysiwyg__statusbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .admin-wysiwyg.is-fullscreen { inset: 0; }
}
