.header-controls { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.theme-picker { position: relative; }
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font-size: 11px;
}
.theme-toggle:hover, .theme-toggle[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
.theme-toggle > .icon { width: 13px; height: 13px; }
.theme-current-swatch { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); }
.theme-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(282px, calc(100vw - 40px));
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 12px 40px var(--shadow), 0 3px 10px var(--shadow);
  z-index: 60;
}
.theme-options { margin: 0; padding: 0; border: 0; min-width: 0; }
.theme-options legend { padding: 5px 7px 12px; font-size: 12px; font-weight: 600; color: var(--text); }
.theme-option { display: grid; grid-template-columns: 31px 1fr 16px; align-items: center; gap: 10px; padding: 10px 8px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; }
.theme-option + .theme-option { margin-top: 3px; }
.theme-option:hover { background: var(--surface); }
.theme-option:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-line); }
.theme-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme-option-swatch { width: 31px; height: 31px; border: 1px solid var(--line-strong); border-radius: 50%; background: conic-gradient(var(--swatch-accent) 0 34%, var(--swatch-text) 34% 50%, var(--swatch-bg) 50% 100%); }
.theme-option-copy { display: grid; gap: 2px; }
.theme-option-copy strong { color: var(--text); font-size: 12px; font-weight: 550; line-height: 1.5; }
.theme-option-copy small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.theme-option input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.theme-hint { color: var(--muted); margin: 10px 7px 3px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 960px) {
  .theme-panel { right: -50px; }
}
@media (max-width: 440px) {
  .site-header .brand-caption, .site-header .brand-divider { display: none; }
  .header-controls { gap: 8px; }
  .theme-toggle { min-height: 40px; padding-inline: 10px; }
  .theme-panel { right: -48px; }
}
