/* Theme chooser — a System / Light / Dark segmented control that lives inside
   the account dropdown menu (rendered by shared/site-nav-account.js, built by
   shared/theme.js). Styled entirely from semantic tokens so it themes itself.
   Revealed by the collapsible "Theme" row in the account menu. */

.theme-control {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
}

.theme-control-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.4375rem 0.5625rem;
  border: 0;
  border-radius: 0.4375rem;
  background: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.1;
  text-align: left;
  cursor: pointer;
  transition:
    color 0.12s ease,
    background-color 0.12s ease;
}

.theme-control-option:hover {
  color: var(--ink);
  background: var(--hover-bg);
}

.theme-control-option:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: -1px;
}

@media (prefers-reduced-motion: reduce) {
  .theme-control-option {
    transition: none;
  }
}

.theme-control-option.is-active {
  color: var(--ink);
  background: var(--selected-bg);
}

.theme-control-icon {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  color: currentColor;
}

.theme-control-icon svg {
  width: 1rem;
  height: 1rem;
}

.theme-control-label {
  margin-right: auto;
}

.theme-control-option.is-active::after {
  content: "";
  width: 0.875rem;
  height: 0.875rem;
  margin-left: 0.5rem;
  background: currentColor;
  -webkit-mask: var(--theme-check) center / contain no-repeat;
  mask: var(--theme-check) center / contain no-repeat;
}

:root {
  --theme-check: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5l4.5 4.5L19 7"/></svg>');
}
