.site-preferences {
  display: inline-flex;
  flex: none;
  gap: 7px;
  align-items: center;
}

.site-preferences .site-theme-toggle {
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--gold, var(--brand-gold, #80601e));
  background: transparent;
  cursor: pointer;
}

.site-theme-toggle::before {
  display: block;
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("/interaction-kit/moon.svg") center / contain no-repeat;
}

.site-theme-toggle[data-next-theme="day"]::before {
  mask-image: url("/interaction-kit/sun.svg");
}

.site-preferences .site-theme-toggle:hover { background: var(--pale, var(--brand-wash, #faf7f0)); }

[data-site-languages] {
  position: relative;
  flex: none;
  color: var(--ink, var(--brand-ink, #262421));
  font-family: var(--body, var(--brand-body, inherit));
  font-size: 12px;
  line-height: 1.5;
}

[data-site-languages] > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 6px;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

[data-site-languages] > summary::-webkit-details-marker { display: none; }

[data-site-languages] > summary::after {
  content: "";
  width: 5px;
  height: 5px;
  border: solid var(--gold, var(--brand-gold, #80601e));
  border-width: 0 1px 1px 0;
  transform: translateY(-2px) rotate(45deg);
}

[data-site-languages][open] { z-index: 120; }
[data-site-languages][open] > summary::after { transform: rotate(225deg); }

[data-site-languages] > ul {
  position: absolute;
  inset-inline-end: 0;
  min-width: 126px;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--canvas-rule, var(--brand-line, #e0d9cb));
  background: var(--paper, var(--brand-paper, #fff));
  box-shadow: 0 8px 21px #2a24100d;
}

[data-site-languages] a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding-inline: 10px;
  color: inherit;
  text-decoration: none;
}

[data-site-languages] a:is(:hover, [aria-current]) {
  color: var(--gold, var(--brand-gold, #80601e));
  background: var(--pale, #faf7f0);
}

[data-site-languages] a[aria-current]::after { content: "✓"; }
[data-site-languages] :is(a, summary):focus-visible {
  outline: 1px solid var(--gold, var(--brand-gold, #80601e));
  outline-offset: -2px;
}

@media (max-width: 600px) {
  .site-preferences { margin-inline-start: auto; }
}
