html[data-anthos-palette="cobalt"], [data-swatch="cobalt"] { --appearance-accent: #2925d8; }
html[data-anthos-palette="pacific"], [data-swatch="pacific"] { --appearance-accent: #165b95; }
html[data-anthos-palette="fjord"], [data-swatch="fjord"] { --appearance-accent: #11675f; }
html[data-anthos-palette="forest"], [data-swatch="forest"] { --appearance-accent: #265840; }
html[data-anthos-palette="iris"], [data-swatch="iris"] { --appearance-accent: #6244a4; }
html[data-anthos-palette="garnet"], [data-swatch="garnet"] { --appearance-accent: #8c3656; }
html[data-anthos-palette="copper"], [data-swatch="copper"] { --appearance-accent: #994731; }
html[data-anthos-palette="sand"], [data-swatch="sand"] { --appearance-accent: #785b21; }
html[data-anthos-palette="graphite"], [data-swatch="graphite"] { --appearance-accent: #414e64; }
html[data-anthos-palette] {
  --appearance-on-accent: #fff;
  --appearance-panel: #fff;
  --appearance-accent-strong: color-mix(in srgb, var(--appearance-accent) 84%, #090e20);
  --appearance-page: color-mix(in srgb, var(--appearance-accent) 4%, #f9fafc);
  --appearance-surface: color-mix(in srgb, var(--appearance-accent) 5%, #fff);
  --appearance-subtle: color-mix(in srgb, var(--appearance-accent) 11%, #fff);
  --appearance-border: color-mix(in srgb, var(--appearance-accent) 22%, #e2e5eb);
  --appearance-ink: color-mix(in srgb, var(--appearance-accent) 21%, #131828);
  --appearance-muted: color-mix(in srgb, var(--appearance-accent) 20%, #535b6b);
  --appearance-dark-page: color-mix(in srgb, var(--appearance-accent) 9%, #111625);
  --appearance-dark-panel: color-mix(in srgb, var(--appearance-accent) 14%, #1b2130);
  --appearance-dark-surface: color-mix(in srgb, var(--appearance-accent) 17%, #222938);
  --appearance-dark-subtle: color-mix(in srgb, var(--appearance-accent) 23%, #283142);
  --appearance-dark-border: color-mix(in srgb, var(--appearance-accent) 29%, #445064);
  --appearance-dark-ink: #f8f9fd;
  --appearance-dark-muted: color-mix(in srgb, var(--appearance-accent) 13%, #ced8ea);
  --appearance-dark-accent: color-mix(in srgb, var(--appearance-accent) 55%, #fff);
  --appearance-dark-accent-strong: color-mix(in srgb, var(--appearance-accent) 42%, #fff);
  --appearance-dark-on-accent: #111625;
}

anthos-appearance { display: block; min-width: 0; }
anthos-appearance fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
anthos-appearance legend { margin: 0 0 .55rem; padding: 0; color: inherit; font: inherit; font-weight: 650; }
.appearance-options { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.4rem), 1fr)); }
.appearance-choice { position: relative; min-width: 0; display: block; cursor: pointer; }
.appearance-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; }
.appearance-choice > span {
  display: flex; min-height: 40px; align-items: center; gap: .45rem; border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 24%, transparent); background: color-mix(in srgb, currentColor 3%, transparent);
  border-radius: 5px; padding: .4rem .48rem; color: inherit; font-size: .82rem; line-height: 1.1;
}
.appearance-choice > span::before { content: ''; flex: 0 0 .9rem; width: .9rem; height: .9rem; border-radius: 3px; background: var(--appearance-accent, linear-gradient(135deg,#2925d8 50%,#e2e6fa 50%)); }
.appearance-choice[data-swatch="default"] > span::before { background: linear-gradient(135deg,#2925d8 50%,#e2e6fa 50%); }
.appearance-choice input:checked + span { font-weight: 700; border-color: currentColor; background: color-mix(in srgb, currentColor 8%, transparent); box-shadow: inset 0 0 0 1px currentColor; }
.appearance-choice input:focus-visible + span { outline: 2px solid currentColor; outline-offset: 2px; }
@media (hover: hover) { .appearance-choice:hover > span { border-color: currentColor; } }
