@keyframes focus-bounce {
  0%,
  75%,
  100% {
    outline-offset: var(--magma-outline-focus-offset, 2px);
  }

  50% {
    outline-offset: var(--magma-outline-blur-offset, 6px);
  }
}

:host(:not(:is([hydrated], .hydrated))) {
  @apply not-hydrated;
}


mds-button,
mds-icon,
mds-text {
  &:not(:is([hydrated], .hydrated)) {
    @apply not-hydrated;
  }
}


/**
 * @prop --mds-chip-background: Public. Sets the `background-color` of the component
 * @prop --mds-chip-background-selected: Sets the `background-color` of the component when it's selected
 * @prop --mds-chip-border: Sets the `border-color` of the component
 * @prop --mds-chip-border-selected: Sets the `border-color` of the component when it's selected
 * @prop --mds-chip-color: Public. Sets the `color` of the component
 * @prop --mds-chip-color-selected: Sets the `color` of the component when it's selected
 * @prop --mds-chip-icon-background: Public. Sets the `background-color` of the icon
 * @prop --mds-chip-icon-background-selected: Sets the `background-color` of the icon when the component is selected
 * @prop --mds-chip-icon-color: Sets the `fill` color of the icon of the component
 * @prop --mds-chip-icon-color-selected: Sets the `fill` color of the icon of the component when it's selected
 * @prop --mds-chip-opacity-disabled: Sets the `opacity` of the component when it's disabled
 * @prop --mds-chip-shadow: Public. Sets the `box-shadow` of the component
 * @prop --mds-chip-shadow-selected: Sets the `box-shadow` of the component when it's selected
 */

/* --mds-chip-shadow not supported by Houdini */

:host {
  --mds-chip-background: rgb(var(--magma-surface-overlay, var(--surface-neutral-overlay, 255 255 255)));
  --mds-chip-border: transparent;
  --mds-chip-color: rgb(var(--magma-text-muted, var(--text-neutral-muted, 73 73 73)));
  --mds-chip-icon-background: rgb(var(--magma-accent-fg, var(--variant-primary-03, 0 73 211)));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-opacity-disabled: 0.5;
  --mds-chip-shadow: var(--shadow-sm-sharp, 0 0 1px 1px rgb(0 0 0 / 0.06), 0 1px 3px 0 rgb(0 0 0 / 0.1));
  --mds-chip-transition-duration: var(--duration-150, 150ms);
  --mds-chip-label-transition-duration: var(--duration-200, 200ms);
  --private-chip-transition-duration: var(--mds-chip-transition-duration);
  --private-chip-label-transition-duration: var(--mds-chip-label-transition-duration);

  align-items: center;
  align-self: self-start;
  background-color: var(--mds-chip-background, rgb(var(--magma-surface-overlay, var(--surface-neutral-overlay, 255 255 255))));
  border: --spacing(50) solid var(--mds-chip-border, transparent);
  border-radius: var(--magma-radius-full, var(--radius-full, 1000px));
  box-shadow: var(--mds-chip-shadow);
  box-sizing: border-box;
  color: var(--mds-chip-color, rgb(var(--magma-text-muted, var(--text-neutral-muted, 73 73 73))));
  display: inline-flex;
  gap: --spacing(150);
  justify-content: center;
  justify-self: start;
  max-width: min-content;
  min-width: min-content;
  padding: 0 --spacing(50);
  transition-duration: var(--private-chip-transition-duration);
  transition-property: background-color, border-color, box-shadow, color, opacity;
  transition-timing-function: var(--ease-in-out-quad, cubic-bezier(0.455, 0.03, 0.515, 0.955));
}

.label-wrapper {
  align-items: center;
  display: inline-flex;
  height: --spacing(800);
  justify-content: start;

  &:first-child {
    padding-left: --spacing(200);
  }

  &:last-child {
    padding-right: --spacing(200);
  }
}

:host([disabled]:not([disabled='false'])) {
  opacity: var(--mds-chip-opacity-disabled, 0.5);
  pointer-events: none;
}

.label {
  border-radius: var(--magma-radius-full, var(--radius-full, 1000px));
  flex-grow: 1;
  text-decoration-color: transparent;
  transition-duration: var(--private-chip-label-transition-duration);
  transition-property: color, text-decoration-color, outline, outline-offset;
  transition-timing-function: var(--ease-out-quad, cubic-bezier(0.25, 0.46, 0.45, 0.94));
}

:host([clickable]:not([clickable='false'])) .label {
  cursor: pointer;
  text-decoration: underline;
}

:host([clickable]:not([clickable='false'])) .label:hover {
  text-decoration-color: unset;
}

.label--interactive {
  @apply focus-bounce;
}

.label--interactive:focus-visible {
  @apply focus-bounce--focused;

  z-index: 10;
}

.icon-area {
  align-items: center;
  background-color: var(--mds-chip-icon-background, rgb(var(--magma-accent-fg, var(--variant-primary-03, 0 73 211))));
  border-radius: var(--magma-radius-full, var(--radius-full, 1000px));
  display: flex;
  flex-shrink: 0;
  height: --spacing(700);
  justify-content: center;
  transition-duration: inherit;
  transition-timing-function: inherit;
  width: --spacing(700);
}

.icon {
  fill: var(--mds-chip-icon-color, rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255))));
  height: --spacing(400);
  transition: fill;
  transition-duration: var(--private-chip-label-transition-duration);
  width: --spacing(400);
}

/* The swatch: the colour of the product (the swatch prop, set inline), at the size of the glyph
 * of the icon and where the glyph goes, centred in the width of the disc of the icon, so a row of
 * chips with swatches and with icons keeps its labels in line (the size chosen with vittorio on
 * the render of both, 2026-11-10: the glyph, lighter than a disc as wide as the icon's). The ring
 * is a functional outline (border-default, docs/agents/color.md): it keeps a swatch as light or as
 * dark as the chip visible, in both modes and selected, and the global palette flips and promotes
 * it (pref-contrast-more) without a rule of its own here. */

.swatch {
  border: --spacing(25) solid rgb(var(--magma-border-default, var(--border-neutral-default, 183 183 183)));
  border-radius: var(--magma-radius-full, var(--radius-full, 1000px));
  box-sizing: border-box;
  flex-shrink: 0;
  height: --spacing(400);
  margin-inline: --spacing(150);
  width: --spacing(400);
}

.button-delete {
  align-self: center;
  border-radius: var(--magma-radius-full, var(--radius-full, 1000px));
  corner-shape: round;
  height: auto;
  padding: 0;
}

.button-delete--hidden {
  display: none;
}

/* Variant tokens. Every block declares the resting value and its -selected twin;
   the swap between the two pairs is done once, by the remap rule below, so a new
   token only has to be added in one place.

   The ground is surface-overlay, not a wash: a chip casts a shadow, so it is lifted like
   the other elevated objects, not marked like a flat pill (spec 6.1b). */

:host {
  --mds-chip-background: rgb(var(--magma-surface-overlay, var(--surface-neutral-overlay, 255 255 255)));
  --mds-chip-background-selected: rgb(var(--magma-surface-overlay, var(--surface-neutral-overlay, 255 255 255)));
  --mds-chip-border: transparent;
  --mds-chip-border-selected: transparent;
  --mds-chip-color: rgb(var(--magma-text-subtle, var(--text-neutral-subtle, 99 99 99)));
  --mds-chip-color-selected: rgb(var(--magma-text-subtle, var(--text-neutral-subtle, 99 99 99)));
  --mds-chip-icon-background: rgb(var(--magma-accent-fg, var(--variant-primary-03, 0 73 211)));
  --mds-chip-icon-background-selected: rgb(var(--magma-accent-fg, var(--variant-primary-03, 0 73 211)));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-shadow: var(--shadow-sm-sharp, 0 0 1px 1px rgb(0 0 0 / 0.06), 0 1px 3px 0 rgb(0 0 0 / 0.1));
  --mds-chip-shadow-selected: var(--shadow-sm-sharp, 0 0 1px 1px rgb(0 0 0 / 0.06), 0 1px 3px 0 rgb(0 0 0 / 0.1));
}

/* Selected remap, written once for every variant. variant and tone are always
   reflected onto the host (they default to primary/strong), so this selector
   scores 0,4,0 and outranks every :host([variant='x'][tone='y']) block below,
   which scores 0,3,0 - no source order dependency, no per-variant repetition.
   Anything the preference layers want to change on a selected chip has to be
   said in the -selected vocabulary, because the resting token is overwritten
   here. */

:host([variant][tone][selected]) {
  --mds-chip-background: var(--mds-chip-background-selected);
  --mds-chip-border: var(--mds-chip-border-selected);
  --mds-chip-color: var(--mds-chip-color-selected);
  --mds-chip-icon-background: var(--mds-chip-icon-background-selected);
  --mds-chip-icon-color: var(--mds-chip-icon-color-selected);
  --mds-chip-shadow: var(--mds-chip-shadow-selected);
}

/* variant */

:host([variant='primary'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--magma-accent-emphasis, var(--variant-primary-04, 11 96 255)));
  --mds-chip-icon-background: rgb(var(--magma-accent-fg, var(--variant-primary-03, 0 73 211)));
  --mds-chip-icon-background-selected: rgb(var(--magma-accent-fg, var(--variant-primary-03, 0 73 211)));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='primary'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--magma-accent-border, var(--variant-primary-06, 129 171 251)));
  --mds-chip-icon-background: rgb(var(--magma-accent-surface, var(--variant-primary-09, 213 224 245)));
  --mds-chip-icon-background-selected: rgb(var(--magma-accent-surface, var(--variant-primary-09, 213 224 245)));
  --mds-chip-icon-color: rgb(var(--magma-accent-emphasis, var(--variant-primary-04, 11 96 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-accent-emphasis, var(--variant-primary-04, 11 96 255)));
}

:host([variant='secondary'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--magma-accent-emphasis, var(--variant-primary-04, 11 96 255)));
  --mds-chip-icon-background: rgb(var(--magma-accent-fg, var(--variant-primary-03, 0 73 211)));
  --mds-chip-icon-background-selected: rgb(var(--magma-accent-fg, var(--variant-primary-03, 0 73 211)));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='secondary'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--magma-accent-border, var(--variant-primary-06, 129 171 251)));
  --mds-chip-icon-background: rgb(var(--magma-accent-surface, var(--variant-primary-09, 213 224 245)));
  --mds-chip-icon-background-selected: rgb(var(--magma-accent-surface, var(--variant-primary-09, 213 224 245)));
  --mds-chip-icon-color: rgb(var(--magma-accent-emphasis, var(--variant-primary-04, 11 96 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-accent-emphasis, var(--variant-primary-04, 11 96 255)));
}

:host([variant='ai'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--magma-accent-ai-emphasis, var(--variant-ai-04, 128 78 232)));
  --mds-chip-icon-background: rgb(var(--magma-accent-ai-fg, var(--variant-ai-03, 105 49 204)));
  --mds-chip-icon-background-selected: rgb(var(--magma-accent-ai-fg, var(--variant-ai-03, 105 49 204)));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='ai'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--magma-accent-ai-border, var(--variant-ai-06, 178 157 254)));
  --mds-chip-icon-background: rgb(var(--magma-accent-ai-surface, var(--variant-ai-09, 225 219 255)));
  --mds-chip-icon-background-selected: rgb(var(--magma-accent-ai-surface, var(--variant-ai-09, 225 219 255)));
  --mds-chip-icon-color: rgb(var(--magma-accent-ai-emphasis, var(--variant-ai-04, 128 78 232)));
  --mds-chip-icon-color-selected: rgb(var(--magma-accent-ai-emphasis, var(--variant-ai-04, 128 78 232)));
}

/* state */

:host([variant='success'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--magma-success-emphasis, var(--status-success-04, 0 128 57)));
  --mds-chip-icon-background: rgb(var(--magma-success-emphasis, var(--status-success-04, 0 128 57)));
  --mds-chip-icon-background-selected: rgb(var(--magma-success-emphasis, var(--status-success-04, 0 128 57)));
  --mds-chip-icon-color: rgb(var(--magma-success-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-success-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='success'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--magma-success-border-strong, var(--border-success-strong, 17 166 98)));
  --mds-chip-icon-background: rgb(var(--magma-success-wash-base, var(--status-success-09, 191 233 205)));
  --mds-chip-icon-background-selected: rgb(var(--magma-success-wash-base, var(--status-success-09, 191 233 205)));
  --mds-chip-icon-color: rgb(var(--magma-success-text-default, var(--text-success-default, 0 53 0)));
  --mds-chip-icon-color-selected: rgb(var(--magma-success-text-default, var(--text-success-default, 0 53 0)));
}

:host([variant='warning'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--magma-warning-emphasis, var(--status-warning-04, 142 106 0)));
  --mds-chip-icon-background: rgb(var(--magma-warning-emphasis, var(--status-warning-04, 142 106 0)));
  --mds-chip-icon-background-selected: rgb(var(--magma-warning-emphasis, var(--status-warning-04, 142 106 0)));
  --mds-chip-icon-color: rgb(var(--magma-warning-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-warning-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='warning'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--magma-warning-border-strong, var(--border-warning-strong, 184 130 0)));
  --mds-chip-icon-background: rgb(var(--magma-warning-wash-base, var(--status-warning-09, 255 220 117)));
  --mds-chip-icon-background-selected: rgb(var(--magma-warning-wash-base, var(--status-warning-09, 255 220 117)));
  --mds-chip-icon-color: rgb(var(--magma-warning-text-default, var(--text-warning-default, 58 44 0)));
  --mds-chip-icon-color-selected: rgb(var(--magma-warning-text-default, var(--text-warning-default, 58 44 0)));
}

:host([variant='error'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--magma-danger-emphasis, var(--status-error-04, 196 64 65)));
  --mds-chip-icon-background: rgb(var(--magma-danger-emphasis, var(--status-error-04, 196 64 65)));
  --mds-chip-icon-background-selected: rgb(var(--magma-danger-emphasis, var(--status-error-04, 196 64 65)));
  --mds-chip-icon-color: rgb(var(--magma-danger-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-danger-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='error'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--magma-danger-border-strong, var(--border-error-strong, 218 96 93)));
  --mds-chip-icon-background: rgb(var(--magma-danger-wash-base, var(--status-error-09, 255 214 211)));
  --mds-chip-icon-background-selected: rgb(var(--magma-danger-wash-base, var(--status-error-09, 255 214 211)));
  --mds-chip-icon-color: rgb(var(--magma-danger-text-default, var(--text-error-default, 89 0 0)));
  --mds-chip-icon-color-selected: rgb(var(--magma-danger-text-default, var(--text-error-default, 89 0 0)));
}

:host([variant='info'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--magma-info-emphasis, var(--status-info-04, 0 119 164)));
  --mds-chip-icon-background: rgb(var(--magma-info-emphasis, var(--status-info-04, 0 119 164)));
  --mds-chip-icon-background-selected: rgb(var(--magma-info-emphasis, var(--status-info-04, 0 119 164)));
  --mds-chip-icon-color: rgb(var(--magma-info-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-info-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='info'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--magma-info-border-strong, var(--border-info-strong, 18 154 196)));
  --mds-chip-icon-background: rgb(var(--magma-info-wash-base, var(--status-info-09, 193 230 246)));
  --mds-chip-icon-background-selected: rgb(var(--magma-info-wash-base, var(--status-info-09, 193 230 246)));
  --mds-chip-icon-color: rgb(var(--magma-info-text-default, var(--text-info-default, 0 45 86)));
  --mds-chip-icon-color-selected: rgb(var(--magma-info-text-default, var(--text-info-default, 0 45 86)));
}

/* label */

:host([variant='amaranth'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--label-amaranth-04, 202 51 77));
  --mds-chip-icon-background: rgb(var(--label-amaranth-05, 232 60 89));
  --mds-chip-icon-background-selected: rgb(var(--label-amaranth-05, 232 60 89));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='amaranth'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--label-amaranth-06, 255 135 144));
  --mds-chip-icon-background: rgb(var(--label-amaranth-09, 255 214 215));
  --mds-chip-icon-background-selected: rgb(var(--label-amaranth-09, 255 214 215));
  --mds-chip-icon-color: rgb(var(--label-amaranth-04, 202 51 77));
  --mds-chip-icon-color-selected: rgb(var(--label-amaranth-04, 202 51 77));
}

:host([variant='aqua'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--label-aqua-04, 4 122 143));
  --mds-chip-icon-background: rgb(var(--label-aqua-05, 5 141 165));
  --mds-chip-icon-background-selected: rgb(var(--label-aqua-05, 5 141 165));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='aqua'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--label-aqua-06, 6 186 217));
  --mds-chip-icon-background: rgb(var(--label-aqua-09, 151 237 252));
  --mds-chip-icon-background-selected: rgb(var(--label-aqua-09, 151 237 252));
  --mds-chip-icon-color: rgb(var(--label-aqua-04, 4 122 143));
  --mds-chip-icon-color-selected: rgb(var(--label-aqua-04, 4 122 143));
}

:host([variant='blue'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--label-blue-04, 44 96 250));
  --mds-chip-icon-background: rgb(var(--label-blue-05, 69 120 254));
  --mds-chip-icon-background-selected: rgb(var(--label-blue-05, 69 120 254));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='blue'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--label-blue-06, 131 170 255));
  --mds-chip-icon-background: rgb(var(--label-blue-09, 209 224 254));
  --mds-chip-icon-background-selected: rgb(var(--label-blue-09, 209 224 254));
  --mds-chip-icon-color: rgb(var(--label-blue-04, 44 96 250));
  --mds-chip-icon-color-selected: rgb(var(--label-blue-04, 44 96 250));
}

:host([variant='green'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--label-green-04, 21 128 61));
  --mds-chip-icon-background: rgb(var(--label-green-05, 26 148 71));
  --mds-chip-icon-background-selected: rgb(var(--label-green-05, 26 148 71));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='green'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--label-green-06, 34 195 93));
  --mds-chip-icon-background: rgb(var(--label-green-09, 154 242 188));
  --mds-chip-icon-background-selected: rgb(var(--label-green-09, 154 242 188));
  --mds-chip-icon-color: rgb(var(--label-green-04, 21 128 61));
  --mds-chip-icon-color-selected: rgb(var(--label-green-04, 21 128 61));
}

:host([variant='lime'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--label-lime-04, 81 124 12));
  --mds-chip-icon-background: rgb(var(--label-lime-05, 93 143 15));
  --mds-chip-icon-background-selected: rgb(var(--label-lime-05, 93 143 15));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='lime'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--label-lime-06, 123 189 20));
  --mds-chip-icon-background: rgb(var(--label-lime-09, 186 240 97));
  --mds-chip-icon-background-selected: rgb(var(--label-lime-09, 186 240 97));
  --mds-chip-icon-color: rgb(var(--label-lime-04, 81 124 12));
  --mds-chip-icon-color-selected: rgb(var(--label-lime-04, 81 124 12));
}

:host([variant='orange'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--label-orange-04, 181 82 13));
  --mds-chip-icon-background: rgb(var(--label-orange-05, 208 95 16));
  --mds-chip-icon-background-selected: rgb(var(--label-orange-05, 208 95 16));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='orange'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--label-orange-06, 253 141 81));
  --mds-chip-icon-background: rgb(var(--label-orange-09, 255 215 194));
  --mds-chip-icon-background-selected: rgb(var(--label-orange-09, 255 215 194));
  --mds-chip-icon-color: rgb(var(--label-orange-04, 181 82 13));
  --mds-chip-icon-color-selected: rgb(var(--label-orange-04, 181 82 13));
}

:host([variant='orchid'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--label-orchid-04, 202 34 125));
  --mds-chip-icon-background: rgb(var(--label-orchid-05, 225 60 143));
  --mds-chip-icon-background-selected: rgb(var(--label-orchid-05, 225 60 143));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='orchid'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--label-orchid-06, 248 134 183));
  --mds-chip-icon-background: rgb(var(--label-orchid-09, 255 212 229));
  --mds-chip-icon-background-selected: rgb(var(--label-orchid-09, 255 212 229));
  --mds-chip-icon-color: rgb(var(--label-orchid-04, 202 34 125));
  --mds-chip-icon-color-selected: rgb(var(--label-orchid-04, 202 34 125));
}

:host([variant='purple'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--label-purple-04, 150 64 227));
  --mds-chip-icon-background: rgb(var(--label-purple-05, 168 86 247));
  --mds-chip-icon-background-selected: rgb(var(--label-purple-05, 168 86 247));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='purple'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--label-purple-06, 197 150 254));
  --mds-chip-icon-background: rgb(var(--label-purple-09, 233 217 255));
  --mds-chip-icon-background-selected: rgb(var(--label-purple-09, 233 217 255));
  --mds-chip-icon-color: rgb(var(--label-purple-04, 150 64 227));
  --mds-chip-icon-color-selected: rgb(var(--label-purple-04, 150 64 227));
}

:host([variant='red'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--label-red-04, 212 28 28));
  --mds-chip-icon-background: rgb(var(--label-red-05, 230 66 66));
  --mds-chip-icon-background-selected: rgb(var(--label-red-05, 230 66 66));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='red'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--label-red-06, 241 144 144));
  --mds-chip-icon-background: rgb(var(--label-red-09, 250 215 215));
  --mds-chip-icon-background-selected: rgb(var(--label-red-09, 250 215 215));
  --mds-chip-icon-color: rgb(var(--label-red-04, 212 28 28));
  --mds-chip-icon-color-selected: rgb(var(--label-red-04, 212 28 28));
}

:host([variant='sky'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--label-sky-04, 7 118 169));
  --mds-chip-icon-background: rgb(var(--label-sky-05, 10 137 194));
  --mds-chip-icon-background-selected: rgb(var(--label-sky-05, 10 137 194));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='sky'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--label-sky-06, 82 180 238));
  --mds-chip-icon-background: rgb(var(--label-sky-09, 196 229 250));
  --mds-chip-icon-background-selected: rgb(var(--label-sky-09, 196 229 250));
  --mds-chip-icon-color: rgb(var(--label-sky-04, 7 118 169));
  --mds-chip-icon-color-selected: rgb(var(--label-sky-04, 7 118 169));
}

:host([variant='violet'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--label-violet-04, 128 78 232));
  --mds-chip-icon-background: rgb(var(--label-violet-05, 143 101 247));
  --mds-chip-icon-background-selected: rgb(var(--label-violet-05, 143 101 247));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='violet'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--label-violet-06, 178 157 254));
  --mds-chip-icon-background: rgb(var(--label-violet-09, 225 219 255));
  --mds-chip-icon-background-selected: rgb(var(--label-violet-09, 225 219 255));
  --mds-chip-icon-color: rgb(var(--label-violet-04, 128 78 232));
  --mds-chip-icon-color-selected: rgb(var(--label-violet-04, 128 78 232));
}

:host([variant='yellow'][tone='strong']) {
  --mds-chip-border-selected: rgb(var(--label-yellow-04, 140 107 22));
  --mds-chip-icon-background: rgb(var(--label-yellow-05, 161 124 22));
  --mds-chip-icon-background-selected: rgb(var(--label-yellow-05, 161 124 22));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='yellow'][tone='weak']) {
  --mds-chip-border-selected: rgb(var(--label-yellow-06, 214 163 15));
  --mds-chip-icon-background: rgb(var(--label-yellow-09, 254 219 157));
  --mds-chip-icon-background-selected: rgb(var(--label-yellow-09, 254 219 157));
  --mds-chip-icon-color: rgb(var(--label-yellow-04, 140 107 22));
  --mds-chip-icon-color-selected: rgb(var(--label-yellow-04, 140 107 22));
}

/* Motion, held back.
 *
 * Every component zeroes the private durations its own base CSS reads, which composes
 * with the public knobs - but that only reaches the declarations that read them. An audit
 * of the 52 sheets found 21 transitions in 15 components that did not: the host's own
 * transition in mds-button and mds-table, the focus ring of the input family, the tab
 * slider, the close button of mds-note. This reset reaches the whole shadow tree, which is
 * what the preference promises, and keeps reaching it when a declaration is added.
 *
 * Transitions only, on purpose. A keyframe animation is usually a loader, and a loader has
 * to keep saying "working": mds-spinner slows to 8s under reduced motion instead of
 * freezing, and a duration of nearly zero on an infinite animation would spin it out of
 * control instead of stopping it.
 *
 * 0.01ms rather than 0s, so a component that waits for its own transitionend still gets
 * one: mds-modal, mds-push-notification and mds-tree-item all listen for it, and a
 * transition of zero never fires it. */

/* stylelint-disable time-min-milliseconds -- the floor is there to keep a transition
   perceivable; the point of these two is that it is not. */

:host([pref-animation='reduce']),
:host([pref-animation='reduce']) *,
:host([pref-animation='reduce']) *::before,
:host([pref-animation='reduce']) *::after {
  transition-duration: 0.01ms !important;
}

@media (prefers-reduced-motion: reduce) {
  :host([pref-animation='system']),
  :host([pref-animation='system']) *,
  :host([pref-animation='system']) *::before,
  :host([pref-animation='system']) *::after,
  :host(:not([pref-animation])),
  :host(:not([pref-animation])) *,
  :host(:not([pref-animation])) *::before,
  :host(:not([pref-animation])) *::after {
    transition-duration: 0.01ms !important;
  }
}

/* stylelint-enable time-min-milliseconds */


/* Animation preference. The component mirrors the resolved mode from <html>
 * onto its host as pref-animation (see subscribePreference in @common/preference);
 * these plain shadow selectors then zero the private duration(s) the base CSS
 * reads. `reduce` always stops; `system` and no controller follow the OS via
 * @media; `no-preference` keeps the base value. Customization composes (the base
 * sets --private from the public token, this only overrides it when reduced). */

:host([pref-animation='reduce']) {
  --private-chip-transition-duration: 0s;
  --private-chip-label-transition-duration: 0s;
}

@media (prefers-reduced-motion: reduce) {
  :host([pref-animation='system']),
  :host(:not([pref-animation])) {
    --private-chip-transition-duration: 0s;
    --private-chip-label-transition-duration: 0s;
  }
}

/* Theme preference. The component reflects the resolved theme mode and scheme
 * from <html> onto its host as pref-mode + pref-theme-scheme (see
 * subscribePreference in @common/preference); these plain shadow selectors refine
 * for dark. `dark` is the explicit choice; `system` and no controller follow the
 * OS via @media; the scheme axis gates it. Cross-browser, no :host-context. */

:host([pref-mode='dark']:not([pref-theme-scheme='light'])),
:host([pref-theme-scheme='dark']) {
  box-shadow: var(--shadow-ring, 0 0 0 1px rgb(var(--tone-neutral-01, 5 5 5) / 0.3));
}

@media (prefers-color-scheme: dark) {
  :host([pref-mode='system']:not([pref-theme-scheme='light'])),
  :host(:not([pref-mode]):not([pref-theme-scheme='light'])) {
    box-shadow: var(--shadow-ring, 0 0 0 1px rgb(var(--tone-neutral-01, 5 5 5) / 0.3));
  }
}

/* Contrast preference. The component reflects the resolved mode from <html> onto
 * its host as pref-contrast (see subscribePreference in @common/preference); these
 * plain shadow selectors refine for high contrast. `more` is the explicit choice;
 * `system` and no controller follow the OS via @media. Cross-browser, no :host-context.
 *
 * The paper ground is --magma-surface-default on purpose: under pref-contrast-more
 * the layer promotes it to the seed (spec 9.3), so this reads as the paper of the
 * mode in high contrast and as the page anywhere else. */

:host([pref-contrast='more']) {
  --mds-chip-background: rgb(var(--magma-surface-default, var(--surface-neutral-default, 242 242 242)));
  --mds-chip-color: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)));
  --mds-chip-color-selected: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)));
  --mds-chip-icon-background-selected: rgb(var(--magma-accent-emphasis-hover, var(--variant-primary-03, 0 73 211)));
  --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-chip-opacity-disabled: var(--opacity-disabled, 0.6);

  box-shadow: var(--shadow-ring-2, 0 0 0 2px rgb(var(--tone-neutral-01, 5 5 5) / 0.3));
}

@media (prefers-contrast: more) {
  :host([pref-contrast='system']),
  :host(:not([pref-contrast])) {
    --mds-chip-background: rgb(var(--magma-surface-default, var(--surface-neutral-default, 242 242 242)));
    --mds-chip-color: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)));
    --mds-chip-color-selected: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)));
    --mds-chip-icon-background-selected: rgb(var(--magma-accent-emphasis-hover, var(--variant-primary-03, 0 73 211)));
    --mds-chip-icon-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
    --mds-chip-icon-color-selected: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
    --mds-chip-opacity-disabled: var(--opacity-disabled, 0.6);

    box-shadow: var(--shadow-ring-2, 0 0 0 2px rgb(var(--tone-neutral-01, 5 5 5) / 0.3));
  }
}

