.theme-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  font: inherit;
}

.theme-control__trigger,
.theme-control__option {
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  background: var(--bg-elevated);
  font: inherit;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-ui), border-color var(--dur-fast) var(--ease-ui), transform var(--dur-fast) var(--ease-ui);
}

.theme-control__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  padding: .45em .9em;
  white-space: nowrap;
}

.theme-control__trigger:hover,
.theme-control__option:hover { border-color: var(--accent-ink); background: var(--bg-surface); }
.theme-control__trigger:active { transform: scale(.98); }
.theme-control__icon { color: var(--accent-ink); }
.theme-control__chevron { color: var(--text-secondary); font-size: .82em; }

.theme-control__menu {
  position: absolute;
  z-index: 120;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 4px;
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--glow-soft);
}

.theme-control__menu[hidden] { display: none; }
.theme-control__option { width: 100%; border-radius: var(--radius-md); text-align: left; padding: .5em .75em; }
.theme-control__option[aria-checked="true"] { border-color: var(--accent-ink); color: var(--accent-ink); background: var(--bg-surface); }
.theme-control__trigger:focus-visible,
.theme-control__option:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

@media (max-width: 520px) {
  .theme-control__trigger { min-width: 44px; padding-inline: .65em; }
  .theme-control__label { display: none; }
  .theme-control__menu { min-width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-control__trigger,
  .theme-control__option { transition: none; }
}
