:root {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

button[data-theme-toggle] {
  align-items: center;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--on-dark, #fff);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  gap: .35rem;
  justify-content: center;
  min-height: 40px;
  min-width: 40px;
  padding: .35rem .65rem;
  transition: background-color .15s ease, border-color .15s ease;
}

button[data-theme-toggle]:hover {
  background: rgba(255, 255, 255, .1);
}

button[data-theme-toggle]:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.theme-toggle__icon {
  font-size: 1.05rem;
  line-height: 1;
}

.theme-toggle__label {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@media (max-width: 480px) {
  button[data-theme-toggle] {
    min-height: 38px;
    min-width: 38px;
    padding: .3rem .55rem;
  }
}

@media print {
  :root,
  html[data-theme="dark"] {
    color-scheme: light;
  }
}
