:root { color-scheme: only light; }
@media screen {
  :root[data-theme="dark"] { color-scheme: dark; background-color: #111a22; }
}
.bar .links { align-items: center; }
.theme-toggle { display: none; }
html[data-theme] .theme-toggle {
  --glyph: 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' stroke-linejoin='round'%3E%3Cpath d='M20.1 14.1A8.4 8.4 0 0 1 9.9 3.9a8.4 8.4 0 1 0 10.2 10.2Z'/%3E%3C/svg%3E");
  position: relative;
  z-index: 6;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink, #182835);
  background: transparent;
  cursor: pointer;
}
html[data-theme="dark"] .theme-toggle {
  --glyph: 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 0h2M5 5l1.5 1.5m11 11L19 19M5 19l1.5-1.5m11-11L19 5'/%3E%3C/svg%3E");
}
.theme-toggle::before, .theme-toggle::after { content: ""; grid-area: 1 / 1; }
.theme-toggle::before {
  width: 27px;
  height: 27px;
  box-sizing: border-box;
  border: 1px solid var(--line, #cddbe4);
  border-radius: 50%;
  background: var(--paper, #fff);
  transition: border-color var(--control-transition), background-color var(--control-transition);
}
.theme-toggle::after {
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}
.theme-toggle:focus-visible { outline: 2px solid var(--blue, #075d96); outline-offset: 1px; }
.theme-hint {
  position: absolute;
  top: 100%;
  right: 0;
  width: max-content;
  padding: 5px 10px;
  border: 1px solid var(--line, #cddbe4);
  border-radius: 8px;
  background: var(--paper, #fff);
  color: var(--ink, #182835);
  font: 600 12px/1.45 system-ui, sans-serif;
  box-shadow: 0 4px 12px #102e481a;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity var(--control-transition), transform var(--control-transition);
}
.theme-hint.to-light, [data-theme="dark"] .theme-hint.to-dark { display: none; }
[data-theme="dark"] .theme-hint.to-light { display: block; }
.theme-toggle:focus-visible:not([data-dismissed]) .theme-hint { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: hover) {
  .theme-toggle:hover::before { border-color: var(--blue, #075d96); }
  .theme-toggle:hover:not([data-dismissed]) .theme-hint { opacity: 1; transform: none; pointer-events: auto; }
}
@media (pointer: coarse) {
  html[data-theme] .theme-toggle { width: 44px; height: 44px; }
}
@media (forced-colors: active) {
  .theme-toggle::after { background: ButtonText; forced-color-adjust: none; }
}
.catalog-error .theme-toggle { position: absolute; right: 4%; top: 12px; }
@media print { html[data-theme] .theme-toggle { display: none; } }
