/* D511 — Toggle theme cream/dark MIDDLE-RIGHT anti-overlap absolu
   Yacine 29avr: "TOGGL NE DOIT PAS SE CHEVAUCHER avec Logout ou raccourcis"
   Position: right:18px milieu vertical (entre Logout top-right et footer bottom)
   Prend précédence sur D397 (bottom-left) + D78 (top-right)
*/

/* Override D397 et tout autre toggle theme */
.theme-toggle-d397,
[id*="theme-toggle"],
[class*="theme-toggle"],
[id*="cream-toggle"],
[class*="cream-toggle"],
#v80-toggle,
.d511-theme-toggle {
  position: fixed !important;
  right: 18px !important;
  top: 50% !important;
  bottom: auto !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  z-index: 99987 !important; /* sous Logout 99990 */
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
}

/* Mobile: bottom-left (loin Logout top-right) */
@media (max-width: 768px) {
  .theme-toggle-d397,
  [id*="theme-toggle"],
  [class*="theme-toggle"],
  #v80-toggle,
  .d511-theme-toggle {
    right: auto !important;
    left: 14px !important;
    top: auto !important;
    bottom: 14px !important;
    transform: none !important;
    width: 40px !important;
    height: 40px !important;
  }
}

/* Garantir Logout reste accessible top-right */
#weval-global-logout,
.opus-d78-logout,
[id*="logout-btn"] {
  z-index: 99990 !important; /* au-dessus toggle */
}

/* Cream theme par défaut (Yacine: UX BLAN FOND CREME PAR DEFAUT) */
:root:not([data-theme="dark"]):not(.theme-dark) body:not(.theme-dark) {
  /* respect existing cream defaults */
}