/* The shared appearance script adds a label in ::after. Keep it in aria-label
   and title only: a fixed circle must never grow to fit a translated label. */
html body :is(button.theme-toggle, button.theme-switch, button#theme, button.console-theme-toggle) {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 44px !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  aspect-ratio: 1 / 1 !important;
  padding: 0 !important;
  gap: 0 !important;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent) !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: inherit;
  font-size: 0 !important;
  line-height: 1 !important;
  vertical-align: middle;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 120ms, border-color 120ms;
  --theme-toggle-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20.9 13A9 9 0 0 1 11 3.1 9 9 0 1 0 20.9 13Z'/%3E%3C/svg%3E");
}

html:is(.dark, [data-theme="dark"]) body :is(button.theme-toggle, button.theme-switch, button#theme, button.console-theme-toggle),
html body :is(button.theme-toggle, button.theme-switch, button#theme, button.console-theme-toggle)[data-ka-current="dark"] {
  --theme-toggle-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='black'/%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' d='M12 2v2m0 16v2M2 12h2m16 0h2M4.93 4.93l1.42 1.42m11.3 11.3 1.42 1.42M4.93 19.07l1.42-1.42m11.3-11.3 1.42-1.42'/%3E%3C/svg%3E");
}

html body :is(button.theme-toggle, button.theme-switch, button#theme, button.console-theme-toggle)::before {
  content: "" !important;
  position: static !important;
  display: block !important;
  flex: 0 0 20px !important;
  width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: currentColor !important;
  -webkit-mask: var(--theme-toggle-icon) center / contain no-repeat !important;
  mask: var(--theme-toggle-icon) center / contain no-repeat !important;
  box-shadow: none !important;
  transform: none !important;
}

html body :is(button.theme-toggle, button.theme-switch, button#theme, button.console-theme-toggle)::after,
html body :is(button.theme-toggle, button.theme-switch, button#theme, button.console-theme-toggle) > * {
  content: none !important;
  display: none !important;
}

html body :is(button.theme-toggle, button.theme-switch, button#theme, button.console-theme-toggle):hover {
  background: color-mix(in srgb, currentColor 10%, transparent) !important;
  border-color: currentColor !important;
}

html body :is(button.theme-toggle, button.theme-switch, button#theme, button.console-theme-toggle):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html body :is(button.theme-toggle, button.theme-switch, button#theme, button.console-theme-toggle) { transition: none; }
}
