.text-editor { min-width: 0; margin: 7px 0; }
.text-editor [hidden] { display: none !important; }
.text-toolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px; border: 1px solid #cbd3df; border-bottom: 0; background: #f0f3f8; border-radius: 5px 5px 0 0; }
.admin-body form .text-toolbar .btn, .text-toolbar select { min-height: 28px; height: 28px; padding: 3px 6px; font-size: 12px; line-height: 20px; }
.text-toolbar select { max-width: 155px; min-width: 0; border: 1px solid #cbd3df; border-radius: 4px; background: white; }
.text-toolbar [data-command="bold"] { font-weight: 800; }
.text-size-control {display: inline-flex; align-items: center; gap: 3px; height: 28px; color: #59647a; font-size: 11px; flex: 0 0 auto}
.admin-body form .text-toolbar [data-editor-size] {width: 52px; min-width: 0; height: 28px; padding: 3px 4px; border: 1px solid #cbd3df; border-radius: 4px; background: #fff; font-size: 12px; line-height: 20px}
.admin-body form .text-toolbar [data-editor-size-apply] {padding: 3px 5px; color: #51469c}
.text-color-control {display:inline-flex;align-items:center;gap:3px;height:28px;flex:0 0 auto}
.admin-body form .text-toolbar .text-color-control label {display:inline;margin:0;font-size:11px;line-height:20px;color:#51469c;white-space:nowrap}
.admin-body form .text-toolbar [data-editor-color] {width:32px;min-width:0;height:28px;padding:2px;border:1px solid #cbd3df;border-radius:4px;background:#fff;cursor:pointer}
.admin-body form .text-toolbar [data-editor-color-apply] {padding:3px 5px;color:#51469c}
.text-image-size-control {display:inline-flex;align-items:center;gap:3px;height:28px;max-width:100%;color:#51469c;font-size:11px;flex:0 0 auto}
.admin-body form .text-toolbar .text-image-size-control label {display:inline;margin:0;font-size:11px;line-height:20px;white-space:nowrap}
.admin-body form .text-toolbar [data-editor-image-width] {width:64px;min-width:0;height:28px;padding:3px 4px;border:1px solid #cbd3df;border-radius:4px;background:#fff;font-size:12px;line-height:20px}
.admin-body form .text-toolbar [data-editor-image-width]:disabled {background:#e9edf3;color:#788293}
.admin-body form .text-toolbar [data-editor-image-width-apply] {padding:3px 5px;color:#51469c}
.text-toolbar [data-command="italic"] { font-style: italic; }
.text-toolbar [data-command="underline"] { text-decoration: underline; }
.text-toolbar [data-command="strikeThrough"] { text-decoration: line-through; }
.text-toolbar [data-media="emphasis"] { background: #fff1dc; color: #765016; border-color: #e2bd81; }
.text-editable { min-height: 180px; max-height: 380px; overflow: auto; padding: 10px; border: 1px solid #aebbd0; background: #fff; border-radius: 0 0 5px 5px; font-size: 14px; line-height: 1.5; }
#guide-editor .text-editable { min-height: 350px; max-height: 60vh; }
.text-editable:focus { outline: 2px solid #6977ad; outline-offset: -2px; }
.text-editor-status { font-size: 12px; margin: 4px 0; color: #43546c; }
.text-editor-status:empty { display: none; }
.admin-body .text-editor-keyboard-help { margin: 4px 0; font-size: 11px; line-height: 1.4; color: #677387; }
.text-content { overflow-wrap: anywhere; }
.text-content p { margin: 0 0 10px; }
.text-content img { max-width: 100%; height: auto; }
.text-content table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 10px 0; }
.text-content td, .text-content th { padding: 6px; border: 1px solid #bdc9d7; overflow-wrap: anywhere; }
.text-content th { background: #edf2f8; }
.text-content h1 { font-size: 23px; }.text-content h2 { font-size: 20px; }.text-content h3 { font-size: 18px; }
.editor-emphasis, .article-content .editor-emphasis { border: 0; border-left: 4px solid #d39336; background: #fff1dc; color: #715020; padding: 10px 13px; margin: 12px 0; font-size: inherit; line-height: inherit; }
.editor-emphasis > :last-child { margin-bottom: 0; }
.editor-align-left { text-align: left; }.editor-align-center { text-align: center; }.editor-align-right { text-align: right; }.editor-align-justify { text-align: justify; }
body.text-editor-open { overflow: hidden; }
.text-editor-expanded { position: fixed; z-index: 2000; inset: 8px; margin: 0; padding: 10px; background: #fff; box-shadow: 0 0 0 20px rgba(25,35,55,.35); display: flex; flex-direction: column; }
.text-editor-expanded .text-editor-ui { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.text-editor-expanded .text-editable, #guide-editor .text-editor-expanded .text-editable { flex: 1; min-height: 0; max-height: none; }
.news-body { font-size: 14px; line-height: 1.5; }
.text-editor-dialog { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; background: #f8f5eb; border: 1px solid #d6c6a9; }
.text-editor-dialog > label { flex: 1 1 130px; min-width: 0; }
.text-link-settings > label:first-of-type { flex-basis: 100%; }
.text-editor-dialog > .text-dialog-checkbox { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: normal; }
.text-dialog-checkbox input[type="checkbox"] { flex: 0 0 auto; width: 15px; height: 15px; margin: 0; accent-color: #60549c; }
a.editor-link-button { display: inline-block; max-width: 100%; padding: 5px 10px; margin: 2px 0; border: 1px solid #60549c; border-radius: 5px; background: #60549c; color: #fff; line-height: 1.4; text-decoration: none; vertical-align: baseline; overflow-wrap: anywhere; }
a.editor-link-button::after { content: "→"; display: inline-block; margin-left: .45em; font-weight: bold; }
a.editor-link-button[target="_blank"]::after { content: "↗"; }
a.editor-link-button:hover, a.editor-link-button:focus { background: #4d417f; border-color: #4d417f; color: #fff; text-decoration: none; }
.text-dialog-actions { display: flex; gap: 6px; align-items: end; }

/* Inline emphasis covers only the selected text; old block callouts remain readable. */
span.editor-emphasis, mark.editor-emphasis, .article-content span.editor-emphasis, .article-content mark.editor-emphasis {
    display: inline;
    padding: 2px 6px;
    margin: 0;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* Page editor: compact controls within the Concept Caméléon viewport. */
.media-library-dialog > .media-library-gallery,
.media-library-dialog > .media-library-pagination,
.media-library-dialog > .media-library-choice,
.media-library-dialog > .text-dialog-actions { grid-column:1 / -1; min-width:0; }
.media-library-dialog > .media-library-tools { margin:0; }
.media-library-gallery { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; min-height:110px; max-height:280px; max-height:min(280px,32vh); overflow:auto; overscroll-behavior:contain; padding:3px; }
.media-library-gallery > button { display:grid; grid-template-columns:110px minmax(0,1fr); grid-template-rows:auto auto; align-content:center; column-gap:12px; row-gap:4px; width:100%; min-width:0; padding:8px; text-align:left; white-space:normal; background:#fff; border:1px solid #d5d9e5; border-radius:4px; color:#293449; font-size:13px; line-height:1.4; }
.media-library-gallery > button > img { grid-column:1; grid-row:1 / 3; align-self:center; }
.media-library-gallery > button > span { align-self:end; font-weight:600; overflow-wrap:anywhere; }
.media-library-gallery > button > small { align-self:start; color:#647088; font-size:11px; overflow-wrap:anywhere; }
.media-library-gallery > button:hover { background:#f8f7fc; border-color:#a99ecc; }
.media-library-gallery > button[aria-pressed="true"] { border-color:#60549c; box-shadow:inset 0 0 0 1px #60549c; background:#efedf8; }
.media-library-gallery > button:focus-visible { outline:2px solid #60549c; outline-offset:1px; }
.media-library-pagination { display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-size:12px; }
.text-editor .btn-default {border:1px solid #cbd3df;background:white;color:#302a29;padding:4px 8px;font-size:12px;letter-spacing:normal;text-transform:none}
.text-editor-dialog input,.text-editor-dialog select {display:block;max-width:100%;width:100%}
.text-editor-dialog .text-dialog-checkbox input {width:auto}
.media-library-gallery,.media-library-pagination,.media-library-tools,.media-library-choice {flex-basis:100%}
img.editor-image-violet {filter:sepia(1) saturate(1.8) hue-rotate(285deg)}
img.editor-image-grayscale {filter:grayscale(1)}
.editor-table-striped tr:nth-child(even){background:#f5f1ed}.editor-table-plain td,.editor-table-plain th{border:0}.editor-table-compact td{padding:3px}
.editor-valign-top{vertical-align:top}.editor-valign-middle{vertical-align:middle}.editor-valign-bottom{vertical-align:bottom}
.text-content td,.text-content th{border-top:var(--editor-border-top,1px solid #bdc9d7);border-right:var(--editor-border-right,1px solid #bdc9d7);border-bottom:var(--editor-border-bottom,1px solid #bdc9d7);border-left:var(--editor-border-left,1px solid #bdc9d7)}
.show-thumb {display:block;width:76px;max-width:100%;height:auto;background:transparent;border-radius:0}
.show-row {grid-template-columns:160px minmax(0,1fr) auto}.show-row.has-photo{grid-template-columns:160px 76px minmax(0,1fr) auto}.show-info{min-width:0}
.admin-nav{display:flex;flex-wrap:wrap;gap:16px;margin-bottom:24px}.pagination{flex-wrap:wrap}.page-link{color:#6a1a14}.page-item.active .page-link{background:#6a1a14;border-color:#6a1a14}
@media(max-width:767px){.show-row{grid-template-columns:minmax(0,1fr) auto}.show-row.has-photo{grid-template-columns:76px minmax(0,1fr)}.show-row time{grid-column:1/-1}.show-row.has-photo .show-action{grid-column:2}.text-editor-expanded{inset:3px}.admin-wrap{padding:20px 12px}}

.media-library-gallery > button > img {width:110px;max-width:100%;height:90px;object-fit:contain;background:#f5f4fa}

.image-filter-preview{flex-basis:100%;text-align:center}.image-filter-preview img{max-width:100%;max-height:220px;object-fit:contain}
.text-editable img.selected-image{outline:3px solid #6a1a14}

/* Bibliothèque intégrée : aide sur une ligne dédiée, champs alignés et galerie séparée. */
.text-editor-dialog > .text-dialog-hint {
    flex: 0 0 100%;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}
.text-editor-dialog.media-library-dialog {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.5fr) 140px;
    gap: 16px 12px;
    padding: 16px;
    background: #faf7f2;
}
.media-library-dialog > .text-dialog-hint,
.media-library-dialog > .media-library-tools,
.media-library-dialog > .text-dialog-checkbox {
    grid-column: 1 / -1;
}
.media-library-dialog > label {
    display: block;
    min-width: 0;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}
.admin-body .media-library-dialog > label > .form-control {
    width: 100%;
    min-width: 0;
    height: 32px;
    margin-top: 6px;
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1.4;
}
.media-library-dialog > .media-library-tools,
.media-library-dialog > .text-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.media-library-dialog > .media-library-choice {
    margin: 0;
    font-size: 13px;
    overflow-wrap: anywhere;
}
.admin-body .media-library-dialog .btn {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 13px;
    line-height: 1.4;
}
@media (max-width: 991px) {
    .text-editor-dialog.media-library-dialog {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 575px) {
    .text-editor-dialog.media-library-dialog {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px;
        gap: 12px;
    }
    .media-library-gallery > button {
        grid-template-columns: 64px minmax(0, 1fr);
        column-gap: 8px;
    }
    .media-library-gallery > button > img {
        width: 64px;
        height: 64px;
    }
}
