.theme-toggle {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: var(--touch-target, 44px);
  height: var(--touch-target, 44px);
  padding: 0;
  place-items: center;
  border: var(--border-width, 1px) solid var(--border, currentColor);
  border-radius: 50%;
  background: var(--theme-control-bg, transparent);
  color: var(--text, currentColor);
  font: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.theme-toggle:hover {
  background: var(--theme-control-hover, var(--surface, transparent));
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--focus-ring-color, currentColor);
  outline-offset: 2px;
}

.theme-toggle__icon--sun,
.theme-toggle__icon--moon {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.theme-toggle__icon--sun {
  opacity: 1;
  transform: scale(1);
}

.theme-toggle__icon--moon {
  opacity: 0;
  transform: scale(0.7);
}

html[data-theme="dark"] .theme-toggle__icon--sun {
  opacity: 0;
  transform: scale(0.7);
}

html[data-theme="dark"] .theme-toggle__icon--moon {
  opacity: 1;
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle__icon--sun,
  .theme-toggle__icon--moon {
    transition: none !important;
  }
}

.theme-toggle__icons {
  position: relative;
  display: inline-flex;
  width: 18px;
  height: 18px;
}
