.theme-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: .5rem .75rem;
  border: 1px solid #525252;
  border-radius: 3px;
  color: #f5f5f5;
  background: transparent;
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: #222; }
html[data-theme="light"] .theme-toggle { color: #222; border-color: #aaa; }
html[data-theme="light"] .theme-toggle:hover { background: #f3f3f3; }
.theme-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.theme-toggle-icon {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  background: currentColor;
  mask: var(--theme-icon) center / contain no-repeat;
  -webkit-mask: var(--theme-icon) center / contain no-repeat;
  --theme-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2m0 16v2M2 12h2m16 0h2M4.93 4.93l1.42 1.42m11.3 11.3 1.42 1.42m0-14.14-1.42 1.42m-11.3 11.3-1.42 1.42'/%3E%3C/svg%3E");
}
html[data-theme="light"] .theme-toggle-icon {
  --theme-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M20.7 14.13A8.8 8.8 0 0 1 9.87 3.3a8.8 8.8 0 1 0 10.83 10.83Z'/%3E%3C/svg%3E");
}
@media (max-width: 84rem) {
  .theme-toggle { padding-inline: .5rem; }
  .theme-toggle-label { display: none; }
}
@media (max-width: 40rem) {
  .nav .theme-toggle { margin-inline-start: auto; }
}
@media (max-width: 22rem) {
  .nav { gap: .35rem; }
}
@media (forced-colors: active) {
  .theme-toggle-icon { forced-color-adjust: none; background: ButtonText; }
}
