[data-fui-comp="ui-theme-toggle"] {
  display: inline-flex;
}
/* The styled button is the data-fui-comp element itself for the icon/label
   variants (button[data-fui-comp]) and a descendant for the pill variant
   ([data-fui-comp] button) — target both. */
[data-fui-comp="ui-theme-toggle"] button,
button[data-fui-comp="ui-theme-toggle"] {
  cursor: pointer;
  border: 1px solid var(--color-border, #E4E4E7);
  border-radius: var(--radius-md, 0.375rem);
  background: var(--color-surface, #fff);
  color: var(--color-text, #18181B);
  padding: var(--spacing-xs, 0.25rem);
  min-block-size: var(--spacing-touch-target, 44px);
  min-inline-size: var(--spacing-touch-target, 44px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
[data-fui-comp="ui-theme-toggle"] button:hover,
button[data-fui-comp="ui-theme-toggle"]:hover {
  background: var(--color-surface-soft, #F4F4F5);
}
[data-fui-comp="ui-theme-toggle"] button:focus-visible,
button[data-fui-comp="ui-theme-toggle"]:focus-visible {
  outline: 2px solid var(--color-primary, #4F46E5);
  outline-offset: 1px;
}

/* Icon variant: a ghost button — transparent, borderless, just the sun/moon
   glyph in the current text color, with a subtle hover wash. Reads as a calm
   header affordance rather than a heavy bordered box. The variant class sits on
   the same element as data-fui-comp, so match it as a compound selector. */
[data-fui-comp="ui-theme-toggle"].ui-theme-toggle--icon {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-muted, #52525B);
}
[data-fui-comp="ui-theme-toggle"].ui-theme-toggle--icon:hover {
  background: color-mix(in oklab, var(--color-text, #18181B) 7%, transparent);
  color: var(--color-text, #18181B);
}
[data-fui-comp="ui-theme-toggle"] svg {
  width: 18px;
  height: 18px;
}
[data-fui-comp="ui-theme-toggle"] .ui-theme-toggle__moon { display: none; }
[data-fui-comp="ui-theme-toggle"] .ui-theme-toggle__sun  { display: block; }
html[data-color-scheme="light"] [data-fui-comp="ui-theme-toggle"] .ui-theme-toggle__moon { display: block; }
html[data-color-scheme="light"] [data-fui-comp="ui-theme-toggle"] .ui-theme-toggle__sun  { display: none; }

/* Label variant: show correct text */
[data-fui-comp="ui-theme-toggle"] .ui-theme-toggle__dark  { display: none; }
html[data-color-scheme="dark"] [data-fui-comp="ui-theme-toggle"] .ui-theme-toggle__light { display: none; }
html[data-color-scheme="dark"] [data-fui-comp="ui-theme-toggle"] .ui-theme-toggle__dark  { display: inline; }

/* Pill variant */
[data-fui-comp="ui-theme-toggle"] .ui-theme-toggle--pill {
  display: inline-flex;
  border: 1px solid var(--color-border, #E4E4E7);
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-surface, #fff);
}
[data-fui-comp="ui-theme-toggle"] .ui-theme-toggle__opt {
  border: none;
  border-radius: 999px;
  padding: var(--spacing-xs, 0.25rem) var(--spacing-sm, 0.5rem);
  font-size: var(--text-sm, 0.875rem);
  font-weight: 500;
  min-inline-size: auto;
  min-block-size: 36px;
  background: transparent;
}
[data-fui-comp="ui-theme-toggle"] .ui-theme-toggle__opt[aria-pressed="true"] {
  background: var(--color-primary, #4F46E5);
  color: var(--color-primary-foreground, #fff);
}