/* Light/dark mode for LDAP Account Manager, injected by config/lam/dark-mode.conf.
   LAM ships light-only styles, so dark mode inverts the page and re-inverts media to keep their colours.
   Theme: follows the OS by default; the toggle button (lam-theme.js) forces light or dark and remembers it. */
@media (prefers-color-scheme: dark) {
  html:not([data-lam-theme="light"]) {
    filter: invert(0.9) hue-rotate(180deg);
    background: #fff;
  }
  html:not([data-lam-theme="light"]) :is(img, video, picture, canvas, svg image, [style*="background-image"]) {
    filter: invert(1) hue-rotate(180deg);
  }
}
html[data-lam-theme="dark"] {
  filter: invert(0.9) hue-rotate(180deg);
  background: #fff;
}
html[data-lam-theme="dark"] :is(img, video, picture, canvas, svg image, [style*="background-image"]) {
  filter: invert(1) hue-rotate(180deg);
}

#lam-theme-toggle {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 99999;
  padding: 6px 10px;
  border: 1px solid #888;
  border-radius: 6px;
  background: #f4f4f4;
  color: #222;
  font: 13px/1.2 sans-serif;
  cursor: pointer;
}
