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


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


:host {
  display: grid;
  gap: --spacing(200);
}

.item {
  --mds-tab-item-default-color: rgb(var(--magma-text-disabled, var(--text-neutral-disabled, 119 119 119)));

  flex-basis: 0;
  flex-grow: 1;
}

.item--high {
  --mds-tab-item-selected-color: rgb(var(--magma-danger-emphasis, var(--status-error-04, 196 64 65)));
}

.item--medium {
  --mds-tab-item-selected-color: rgb(var(--magma-warning-emphasis, var(--status-warning-04, 142 106 0)));
}

.item--low {
  --mds-tab-item-selected-color: rgb(var(--magma-success-emphasis, var(--status-success-04, 0 128 57)));
}

/* 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. */

:host([pref-contrast='more']) {
  .item {
    --mds-tab-item-default-color: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)));
  }

  .item--high {
    --mds-tab-item-default-color: rgb(var(--magma-danger-text-default, var(--text-error-default, 89 0 0)));
  }

  .item--medium {
    --mds-tab-item-default-color: rgb(var(--magma-warning-text-default, var(--text-warning-default, 58 44 0)));
  }

  .item--low {
    --mds-tab-item-default-color: rgb(var(--magma-success-text-default, var(--text-success-default, 0 53 0)));
  }
}

@media (prefers-contrast: more) {
  :host([pref-contrast='system']),
  :host(:not([pref-contrast])) {
    .item {
      --mds-tab-item-default-color: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)));
    }

    .item--high {
      --mds-tab-item-default-color: rgb(var(--magma-danger-text-default, var(--text-error-default, 89 0 0)));
    }

    .item--medium {
      --mds-tab-item-default-color: rgb(var(--magma-warning-text-default, var(--text-warning-default, 58 44 0)));
    }

    .item--low {
      --mds-tab-item-default-color: rgb(var(--magma-success-text-default, var(--text-success-default, 0 53 0)));
    }
  }
}

