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


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


/**
 * @prop --mds-radial-progress-background: Public. Color of the ring track, behind the progress arc
 * @prop --mds-radial-progress-color: Public. Color of the progress arc and of the icon
 * @prop --mds-radial-progress-text-background: Background color of the inner circle that holds the value
 * @prop --mds-radial-progress-text-background-shadow: Box shadow of the inner circle that holds the value
 * @prop --mds-radial-progress-text-suffix: Public. Text written after the value, as a CSS string (`'%'` by default)
 */

:host {
  --mds-radial-progress-background: rgb(var(--magma-wash-base, var(--tone-neutral-09, 225 225 225)));
  --mds-radial-progress-color: rgb(var(--magma-accent-fg, var(--variant-primary-03, 0 73 211)));
  --mds-radial-progress-text-background-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-radial-progress-text-background: rgb(var(--magma-surface-overlay, var(--surface-neutral-overlay, 255 255 255)));
  --mds-radial-progress-text-suffix: '%';
  --mds-radial-progress: 0%;

  align-items: center;
  aspect-ratio: 1;
  background-color: var(--mds-radial-progress-background);
  background-image: conic-gradient(
    var(--mds-radial-progress-color) var(--mds-radial-progress),
    transparent 0%
  );
  border-radius: var(--magma-radius-full, var(--radius-full, 1000px));
  box-sizing: border-box;
  container-name: mds-radial-progress;
  container-type: inline-size;
  display: flex;
  height: auto;
  justify-content: center;
  padding: --spacing(200);
  transition-duration: var(--duration-500, 500ms);

  /* not --mds-radial-progress: the tween moves the ring, a transition on top would lag it (#1177) */
  transition-property: background-color, --mds-radial-progress-color;
  transition-timing-function: ease-out;
  width: --spacing(1200);
}

.value-container {
  align-items: center;
  aspect-ratio: 1;
  background-color: var(--mds-radial-progress-text-background);
  border-radius: inherit;
  box-shadow: var(--mds-radial-progress-text-background-shadow);
  display: flex;
  flex-direction: column;
  gap: --spacing(50);
  justify-content: center;
  padding: --spacing(50);
  width: 100%;
}

.value-container__text {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.value {
  color: currentcolor;
  display: inline-flex;
}

.value::after {
  content: var(--mds-radial-progress-text-suffix);
}

.icon {
  aspect-ratio: 1;
  fill: var(--mds-radial-progress-color);
  max-height: --spacing(600);
  max-width: --spacing(600);
  width: 100%;
}

@container mds-radial-progress (max-width: 47px) {
  :host([typography='label'][icon]) .value-container__text {
    display: none;
  }
}

@container mds-radial-progress (max-width: 47px) {
  :host([typography='option'][icon]) .value-container__text {
    display: none;
  }
}

@container mds-radial-progress (max-width: 35px) {
  :host([typography='label']) .value {
    --mds-radial-progress-text-suffix: '';
  }
}

@container mds-radial-progress (max-width: 31px) {
  :host([typography='option']) .value {
    --mds-radial-progress-text-suffix: '';
  }
}

@container mds-radial-progress (max-width: 23px) {
  :host([typography='label']) .value {
    display: none;
  }
}

@container mds-radial-progress (max-width: 19px) {
  :host([typography='option']) .value {
    display: none;
  }
}

:host([variant='primary']) {
  --mds-radial-progress-color: rgb(var(--magma-accent-emphasis-hover, var(--variant-primary-03, 0 73 211)));
  --mds-radial-progress-background: rgb(var(--magma-wash-base, var(--tone-neutral-09, 225 225 225)));
}

:host([variant='secondary']) {
  --mds-radial-progress-color: rgb(var(--magma-accent-emphasis-hover, var(--variant-primary-03, 0 73 211)));
  --mds-radial-progress-background: rgb(var(--magma-wash-base, var(--tone-neutral-09, 225 225 225)));
}

:host([variant='ai']) {
  --mds-radial-progress-color: rgb(var(--magma-accent-ai-emphasis, var(--variant-ai-04, 128 78 232)));
  --mds-radial-progress-background: rgb(var(--magma-accent-ai-surface, var(--variant-ai-09, 225 219 255)));
}

:host([variant='error']) {
  --mds-radial-progress-color: rgb(var(--magma-danger-text-default, var(--text-error-default, 89 0 0)));
  --mds-radial-progress-background: rgb(var(--magma-danger-wash-base, var(--status-error-09, 255 214 211)));
}

:host([variant='warning']) {
  --mds-radial-progress-color: rgb(var(--magma-warning-text-default, var(--text-warning-default, 58 44 0)));
  --mds-radial-progress-background: rgb(var(--magma-warning-wash-base, var(--status-warning-09, 255 220 117)));
}

:host([variant='success']) {
  --mds-radial-progress-color: rgb(var(--magma-success-text-default, var(--text-success-default, 0 53 0)));
  --mds-radial-progress-background: rgb(var(--magma-success-wash-base, var(--status-success-09, 191 233 205)));
}

:host([variant='info']) {
  --mds-radial-progress-color: rgb(var(--magma-info-text-default, var(--text-info-default, 0 45 86)));
  --mds-radial-progress-background: rgb(var(--magma-info-wash-base, var(--status-info-09, 193 230 246)));
}

:host([variant='light']) {
  --mds-radial-progress-color: rgb(var(--magma-text-muted, var(--text-neutral-muted, 73 73 73)));
  --mds-radial-progress-background: rgb(var(--magma-wash-base, var(--tone-neutral-09, 225 225 225)));
}

:host([variant='dark']) {
  --mds-radial-progress-color: rgb(var(--magma-on-inverse, var(--tone-neutral-seed, 255 255 255)));
  --mds-radial-progress-background: rgb(var(--magma-surface-inverse, var(--tone-neutral-02, 42 42 42)));
  --mds-radial-progress-text-background: rgb(var(--magma-on-inverse, var(--tone-neutral-seed, 255 255 255)) / 0.15);

  color: rgb(var(--magma-on-inverse, var(--tone-neutral-seed, 255 255 255)));
}

