/* Self-contained styling for the site-wide theme toggle button.
 * Colors are hardcoded (not page CSS variables) so the button looks correct on
 * every page regardless of that page's own variable system.
 * Every declaration is !important: several pages style bare `button { ... }`
 * with !important (pill radius, padding, etc.), which would otherwise bleed
 * into this injected button and make it look different from page to page. */
.theme-toggle {
  position: fixed !important;
  top: 18px !important;
  right: 18px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 1000 !important;
  width: 44px !important;
  height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background: #ffffff !important;
  color: #1a2332 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14) !important;
  cursor: pointer !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  font: inherit !important;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease !important;
}

.theme-toggle:hover {
  transform: rotate(-18deg) scale(1.05) !important;
}

.theme-toggle:focus-visible {
  outline: none !important;
}

.theme-toggle svg {
  width: 22px !important;
  height: 22px !important;
  display: block !important;
}

.theme-toggle .icon-moon {
  display: none !important;
}

:root[data-theme="dark"] .theme-toggle {
  background: #161d26 !important;
  color: #e7edf3 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none !important;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block !important;
}

@media (max-width: 620px) {
  .theme-toggle {
    top: 12px !important;
    right: 12px !important;
    width: 40px !important;
    height: 40px !important;
  }
}
