:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.theme-picker { position: relative; display: inline-flex; flex: 0 0 auto; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 1px solid var(--line, #dedbd3);
  border-radius: 50%; background: var(--paper, #fffdf8); color: var(--ink, #25241e);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover, .theme-toggle[aria-expanded="true"] { background: var(--soft, #f2eee6); }
.theme-toggle:focus-visible, .theme-option:focus-visible { outline: 2px solid var(--accent, #b54c28); outline-offset: 3px; }
.theme-toggle svg { width: 21px; height: 21px; }
.theme-menu {
  position: absolute; z-index: 100; right: 0; top: calc(100% + 9px);
  display: grid; gap: 3px; width: 168px; padding: 6px; margin: 0;
  border: 1px solid var(--line, #dedbd3); border-radius: 14px;
  background: var(--panel, #fffdf8); color: var(--ink, #25241e);
  box-shadow: 0 12px 36px rgb(0 0 0 / 14%);
}
.theme-menu[hidden] { display: none; }
.theme-option {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px;
  padding: 9px 10px; border: 0; border-radius: 9px; background: transparent;
  color: inherit; font: inherit; font-size: 14px; line-height: 1.3; text-align: left; cursor: pointer;
}
.theme-option:hover, .theme-option[aria-checked="true"] { background: var(--soft, #f2eee6); }
.theme-option svg { flex: 0 0 auto; width: 20px; height: 20px; }
.theme-option .theme-check { width: 16px; height: 16px; margin-left: auto; opacity: 0; }
.theme-option[aria-checked="true"] .theme-check { opacity: 1; }
