/**
 * A heuristic that applies CSS to tablet
 * viewports.
 *
 * Usage:
 * @include tablet-viewport() {
 *   :host {
 *     background-color: green;
 *   }
 * }
 */
/**
 * A heuristic that applies CSS to mobile
 * viewports (i.e. phones, not tablets).
 *
 * Usage:
 * @include mobile-viewport() {
 *   :host {
 *     background-color: blue;
 *   }
 * }
 */
/**
 * Convert a pixels given value into rem
 * 
 * @param pixels - Value in pixels to be converted (i.e. px)
 * @param context (optional) - Baseline value
 */
/**
 * Convert a font size to a dynamic font size.
 * Fonts that participate in Dynamic Type should use
 * dynamic font sizes.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param unit (optional) - The unit to convert to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * a maximum font size.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * a minimum font size.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * maximum and minimum font sizes.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
 * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * A heuristic that applies CSS to tablet
 * viewports.
 *
 * Usage:
 * @include tablet-viewport() {
 *   :host {
 *     background-color: green;
 *   }
 * }
 */
/**
 * A heuristic that applies CSS to mobile
 * viewports (i.e. phones, not tablets).
 *
 * Usage:
 * @include mobile-viewport() {
 *   :host {
 *     background-color: blue;
 *   }
 * }
 */
:host {
  /**
   * @prop --background: Background of the badge
   * @prop --color: Text color of the badge
   *
   * @prop --padding-top: Top padding of the badge
   * @prop --padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the badge
   * @prop --padding-bottom: Bottom padding of the badge
   * @prop --padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the badge
   */
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  -webkit-padding-start: var(--padding-start);
  padding-inline-start: var(--padding-start);
  -webkit-padding-end: var(--padding-end);
  padding-inline-end: var(--padding-end);
  padding-top: var(--padding-top);
  padding-bottom: var(--padding-bottom);
  display: inline-block;
  background: var(--background);
  color: var(--color);
  text-align: center;
  white-space: nowrap;
  contain: content;
  vertical-align: baseline;
}

:host([vertical]:not(.in-tab-button)) {
  position: absolute;
}
:host([vertical]:not(.in-tab-button)) {
  inset-inline-end: 0;
}

:host(:not(.in-tab-button)[vertical].badge-vertical-top) {
  top: 0;
}

:host(:not(.in-tab-button)[vertical].badge-vertical-bottom) {
  bottom: 0;
}

:host {
  --padding-start: var(--token-space-200, var(--token-scale-200, 8px));
  --padding-end: var(--token-space-200, var(--token-scale-200, 8px));
  --padding-top: var(--token-space-0, var(--token-scale-0, 0px));
  --padding-bottom: var(--token-space-0, var(--token-scale-0, 0px));
  font-size: var(--token-font-size-300, 12px);
  font-weight: var(--token-font-weight-medium, 500);
  letter-spacing: var(--token-font-letter-spacing-0, 0%);
  line-height: var(--token-font-line-height-500, var(--token-scale-500, 20px));
  text-decoration: none;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--token-scale-250, 10px);
}

:host(.badge-bold) {
  --background: var(--ion-color-primary, var(--token-bg-primary-base-default, var(--token-semantics-primary-base, var(--token-semantics-primary-700, var(--token-primitives-blue-700, #105cef)))));
  --color: var(--ion-color-primary-contrast, var(--token-text-inverse, var(--token-primitives-base-white, #ffffff)));
}

:host(.badge-bold.ion-color) {
  background: var(--ion-color-base);
  color: var(--ion-color-contrast);
}

:host(.badge-subtle) {
  --background: var(--ion-color-primary-subtle, var(--token-bg-primary-subtle-default, var(--token-semantics-primary-100, var(--token-primitives-blue-100, #e9ecfc))));
  --color: var(--ion-color-primary-subtle-contrast, var(--token-text-primary, var(--token-semantics-primary-900, var(--token-primitives-blue-900, #0d4bc3))));
}

:host(.badge-subtle.ion-color) {
  background: var(--ion-color-subtle-base);
  color: var(--ion-color-subtle-contrast);
}

/* Soft Badge */
:host(.badge-soft) {
  border-radius: var(--token-soft-xs, var(--token-border-radius-200, var(--token-scale-200, 8px)));
}

:host(.badge-small.badge-soft) {
  border-radius: var(--token-soft-2xs, var(--token-border-radius-100, var(--token-scale-100, 4px)));
}

/* Round Badge */
:host(.badge-round) {
  border-radius: var(--token-round-sm, var(--token-border-radius-full, 999px));
}

/* Rectangular Badge */
:host(.badge-rectangular) {
  border-radius: var(--token-rectangular-sm, var(--token-border-radius-0, var(--token-scale-0, 0px)));
}

/* Small Badge */
:host(.badge-small) {
  --padding-start: var(--token-space-050, var(--token-scale-050, 2px));
  --padding-end: var(--token-space-050, var(--token-scale-050, 2px));
  min-width: var(--token-scale-400, 16px);
  height: var(--token-scale-400, 16px);
}

:host(.badge-small) ::slotted(ion-icon) {
  width: var(--token-scale-300, 12px);
  height: var(--token-scale-300, 12px);
}

/* Medium Badge */
/* Large size defaults to the medium size to avoid styles breakage */
:host(.badge-medium),
:host(.badge-large) {
  --padding-start: var(--token-space-100, var(--token-scale-100, 4px));
  --padding-end: var(--token-space-100, var(--token-scale-100, 4px));
  font-size: var(--token-font-size-350, 14px);
  font-weight: var(--token-font-weight-medium, 500);
  letter-spacing: var(--token-font-letter-spacing-0, 0%);
  line-height: var(--token-font-line-height-600, var(--token-scale-600, 24px));
  text-decoration: none;
  text-transform: none;
  min-width: var(--token-scale-600, 24px);
  height: var(--token-scale-600, 24px);
}

:host(.badge-medium) ::slotted(ion-icon),
:host(.badge-large) ::slotted(ion-icon) {
  width: var(--token-scale-400, 16px);
  height: var(--token-scale-400, 16px);
}

:host(:empty) {
  --padding-start: 0;
  --padding-end: 0;
}

:host([vertical]:not(:empty)) {
  --padding-start: var(--token-scale-100, 4px);
  --padding-end: var(--token-scale-100, 4px);
  --padding-top: var(--token-scale-100, 4px);
  --padding-bottom: var(--token-scale-100, 4px);
}

/* sm */
:host(.badge-small:empty) {
  min-width: var(--token-scale-200, 8px);
  height: var(--token-scale-200, 8px);
}

/* md */
:host(.badge-medium:empty) {
  min-width: var(--token-scale-300, 12px);
  height: var(--token-scale-300, 12px);
}

/* lg */
:host(.badge-large:empty) {
  min-width: var(--token-scale-400, 16px);
  height: var(--token-scale-400, 16px);
}

:host([vertical].in-tab-button) {
  position: relative;
}

:host([vertical]) ::slotted(ion-icon) {
  top: 50%;
  position: absolute;
  transform: translate(-50%, -50%);
}
:host([vertical]) ::slotted(ion-icon) {
  inset-inline-start: 50%;
}

:host(:not(:empty).in-button) {
  --padding-start: var(--token-scale-050, 2px);
  --padding-end: var(--token-scale-050, 2px);
  font-size: var(--token-font-size-300, 12px);
  font-weight: var(--token-font-weight-medium, 500);
  letter-spacing: var(--token-font-letter-spacing-1, 1%);
  line-height: var(--token-font-line-height-500, var(--token-scale-500, 20px));
  text-decoration: none;
  text-transform: none;
  min-width: var(--token-scale-400, 16px);
  height: var(--token-scale-400, 16px);
}
:host(:not(:empty).in-button) ::slotted(ion-icon) {
  width: var(--token-scale-300, 12px);
  height: var(--token-scale-300, 12px);
}