/* RBS Admin Center PRO 38.5 — Rich editor contrast repair.
   Covers TinyMCE 4 lightgray, TinyMCE 5+ Oxide and CKEditor 4 on admin,
   profile signatures, news, forum, support tickets and description forms.
   Appearance only: no editing, saving, uploading or editor initialization logic.
   IMPORTANT: keep editable document iframe white, preserving authored text styles. */
:root { --rbs385-paper:#f4f8fc; --rbs385-paper-edge:#bfcedc; --rbs385-paper-ink:#18364d; --rbs385-paper-hover:#d8ecfb; --rbs385-paper-active:#c2e8db; }

/* The dark editor TOOLBAR / dark old icon combination is the primary R38.4 bug. */
body .mce-tinymce.mce-container,
body .tox-tinymce,
body .cke_chrome {
  max-width:100% !important; min-width:0 !important;
  border:1px solid var(--rbs385-paper-edge) !important;
  border-radius:10px !important; overflow:hidden !important;
  background:#fff !important; color:var(--rbs385-paper-ink) !important;
  box-shadow:0 5px 16px rgba(0,15,30,.21) !important;
}
/* TinyMCE 4: editor surface and menu bars. */
body .mce-tinymce.mce-container :is(.mce-panel,.mce-toolbar-grp,.mce-toolbar,.mce-menubar,.mce-statusbar,.mce-container-body,.mce-flow-layout,.mce-stack-layout){
  background:var(--rbs385-paper) !important; background-image:none !important;
  color:var(--rbs385-paper-ink) !important; border-color:var(--rbs385-paper-edge) !important;
  -webkit-text-fill-color:initial !important;
}
body .mce-tinymce.mce-container .mce-toolbar-grp {padding:5px 5px !important; border-bottom:1px solid #c5d5e4 !important;}
body .mce-tinymce.mce-container .mce-toolbar {white-space:normal !important; min-width:0;}
body .mce-tinymce.mce-container .mce-flow-layout-item {margin:2px !important;}
body .mce-tinymce.mce-container .mce-btn,
body .mce-tinymce.mce-container .mce-btn button,
body .mce-tinymce.mce-container .mce-menubtn {
  background:#fff !important; background-image:none !important;
  border-color:#bed0df !important; border-radius:6px !important;
  color:var(--rbs385-paper-ink) !important; box-shadow:none !important;
  text-shadow:none !important;
}
body .mce-tinymce.mce-container .mce-btn button {
  display:inline-flex !important; align-items:center; justify-content:center; gap:3px;
  min-width:30px !important; min-height:32px !important;
  padding:5px 8px !important; line-height:1.35 !important;
  font-weight:600 !important; cursor:pointer !important;
}
body .mce-tinymce.mce-container .mce-btn :is(.mce-ico,.mce-txt,.mce-text,.mce-label,.mce-caret),
body .mce-tinymce.mce-container .mce-btn .mce-ico::before,
body .mce-tinymce.mce-container .mce-btn i {
  color:var(--rbs385-paper-ink) !important;
  -webkit-text-fill-color:var(--rbs385-paper-ink) !important;
  opacity:1 !important; text-shadow:none !important;
}
body .mce-tinymce.mce-container .mce-btn .mce-caret {border-top-color:#18364d !important;}
body .mce-tinymce.mce-container .mce-btn:not(.mce-disabled):is(:hover,.mce-focused),
body .mce-tinymce.mce-container .mce-btn:not(.mce-disabled):is(:hover,.mce-focused) button {
  background:var(--rbs385-paper-hover) !important; border-color:#6ba3c8 !important; color:#123a58 !important;
}
body .mce-tinymce.mce-container .mce-btn:is(.mce-active,.mce-open),
body .mce-tinymce.mce-container .mce-btn:is(.mce-active,.mce-open) button {
  background:var(--rbs385-paper-active) !important; border-color:#68b39f !important; color:#104534 !important;
}
body .mce-tinymce.mce-container .mce-btn.mce-disabled,
body .mce-tinymce.mce-container .mce-btn.mce-disabled button {opacity:.65 !important; cursor:not-allowed !important;}
body .mce-tinymce.mce-container :is(.mce-edit-area,.mce-edit-area iframe){background:#fff !important; border-color:#bdcfdf !important;}
body .mce-tinymce.mce-container .mce-statusbar :is(.mce-path,.mce-path-item,.mce-label){color:#465f73 !important;}
/* TinyMCE 4 menus/modals mount on the body, outside the editor wrapper. */
body :is(.mce-menu,.mce-window,.mce-floatpanel.mce-menu){background:#fff !important; color:#1b3449 !important; border-color:#c4d5e2 !important;}
body .mce-menu :is(.mce-menu-item,.mce-text,.mce-ico,.mce-menu-shortcut),
body .mce-window :is(.mce-title,.mce-label,.mce-text,.mce-ico){color:#19374e !important;-webkit-text-fill-color:#19374e !important;}
body .mce-menu .mce-menu-item:hover{background:#e0effb !important;}
body .mce-window :is(input.mce-textbox,textarea.mce-textbox,select.mce-listbox){background:#fff !important;color:#21394f !important;border:1px solid #91aec3 !important;}

/* TinyMCE 5+ / 6+ Oxide editor. */
body .tox-tinymce :is(.tox-editor-header,.tox-toolbar-overlord,.tox-toolbar,.tox-toolbar__primary,.tox-toolbar__overflow,.tox-menubar,.tox-statusbar){
  background:var(--rbs385-paper) !important; color:var(--rbs385-paper-ink) !important;
  border-color:var(--rbs385-paper-edge) !important;
}
body .tox-tinymce :is(.tox-tbtn,.tox-mbtn){
  background:#fff !important; color:#19384e !important;
  border:1px solid #c3d3e0 !important; border-radius:6px !important;
  min-height:30px !important; opacity:1 !important;
}
body .tox-tinymce :is(.tox-tbtn,.tox-mbtn):not(:disabled):hover{background:#e2f0fa !important;}
body .tox-tinymce :is(.tox-tbtn--enabled,.tox-tbtn--active){background:#c2e8db !important;}
body .tox-tinymce :is(.tox-tbtn,.tox-mbtn) svg,
body .tox-tinymce :is(.tox-tbtn,.tox-mbtn) svg path{fill:currentColor !important;color:#19384e !important;opacity:1 !important;}
body .tox-tinymce :is(.tox-tbtn,.tox-mbtn):disabled{opacity:.46 !important;}
body .tox .tox-collection__item-label,
body .tox .tox-dialog__title,
body .tox .tox-label {color:#19364d !important;}
body .tox-tinymce .tox-edit-area__iframe{background:#fff !important;}
/* Preserve the native light popup controls and avoid dark global form rules. */
body .tox :is(.tox-dialog,.tox-dialog__body,.tox-dialog__footer,.tox-collection,.tox-menu){color:#1b384d !important;}

/* CKEditor 4 sprite buttons: the icon is a background image and MUST stay intact. */
body .cke_chrome :is(.cke_top,.cke_bottom,.cke_toolgroup,.cke_combo_button,.cke_button){
  background:#f4f8fc !important; background-image:none !important;
  border-color:#b9cedd !important; color:#153449 !important;
}
body .cke_chrome :is(.cke_toolgroup,.cke_combo_button,.cke_button){border-radius:6px !important;}
body .cke_chrome .cke_button{min-height:28px !important; min-width:28px !important; padding:3px 5px !important;}
body .cke_chrome .cke_button_icon{opacity:1 !important;filter:contrast(1.15) !important;}
body .cke_chrome :is(.cke_button:hover,.cke_combo_button:hover){background:#dceefb !important;border-color:#76add3 !important;}
body .cke_chrome :is(.cke_button.cke_button_on,.cke_combo_button.cke_combo_on){background:#c2e8db !important;}
body .cke_chrome :is(.cke_button_label,.cke_combo_text,.cke_path_item,.cke_resizer){
  color:#17374d !important; -webkit-text-fill-color:#17374d !important;
  text-shadow:none !important; opacity:1 !important;
}
body .cke_chrome :is(.cke_contents,.cke_contents iframe){background:#fff !important;}
body .cke_dialog :is(.cke_dialog_body,.cke_dialog_title,.cke_dialog_contents,.cke_dialog_footer){background:#fff !important;color:#1a3347 !important;}
body .cke_dialog :is(label,.cke_dialog_ui_labeled_label){color:#1a3347 !important;}

/* Form-based rich editors must not inherit the dark form-control height. */
body :is(.mce-tinymce,.tox-tinymce,.cke_chrome) button:focus-visible,
body :is(.mce-tinymce,.tox-tinymce,.cke_chrome) a:focus-visible{outline:2px solid #1176b6 !important;outline-offset:2px !important;}
body .rbs384-news-editor :is(.mce-tinymce,.tox-tinymce),
body .profile-settings :is(.mce-tinymce,.tox-tinymce),
body .rbs384-signature-input+.mce-tinymce{width:100% !important;max-width:100% !important;}
@media(max-width:640px){
 body .mce-tinymce.mce-container .mce-toolbar-grp{padding:4px 2px !important;}
 body .mce-tinymce.mce-container .mce-btn button{padding:5px 6px !important;min-height:32px !important;}
 body :is(.mce-tinymce,.tox-tinymce,.cke_chrome){max-width:100% !important;}
}

/* Legacy/R38 scoped .cke_top rule must not darken the CKEditor sprite toolbar. */
body.rbs38-admin .rbs38-main .cke_chrome :is(.cke_top,.cke_bottom,.cke_toolgroup,.cke_combo_button,.cke_button){background:#f4f8fc !important;background-image:none !important;border-color:#b9cedd !important;color:#153449 !important;}

/* Native dropdowns and dialog fields on light editor surfaces. */
body :is(.mce-tinymce,.tox-tinymce,.cke_chrome,.mce-menu,.mce-window,.tox-dialog,.cke_dialog){color-scheme:light !important;}
