/**
 * 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 textarea
   *
   * @prop --border-radius: Border radius of the textarea
   * @prop --border-color: Color of the border below the textarea when using helper text, error text, or counter
   * @prop --border-radius: Radius of the textarea border. A large radius may display unevenly when using fill="outline"; if needed, use shape="round" instead or increase --padding-start.
   * @prop --border-style: Style of the border below the textarea when using helper text, error text, or counter
   * @prop --border-width: Width of the border below the textarea when using helper text, error text, or counter
   *
   * @prop --color: Color of the text
   *
   * @prop --placeholder-color: Color of the placeholder text
   * @prop --placeholder-font-style: Style of the placeholder text
   * @prop --placeholder-font-weight: Weight of the placeholder text
   * @prop --placeholder-opacity: Opacity of the placeholder text
   *
   * @prop --highlight-height: The height of the highlight on the textarea. Only applies to md mode.
   * @prop --highlight-color-focused: The color of the highlight on the textarea when focused
   * @prop --highlight-color-valid: The color of the highlight on the textarea when valid
   * @prop --highlight-color-invalid: The color of the highlight on the textarea when invalid
   *
   * @prop --padding-top: Top padding of the textarea
   * @prop --padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the textarea
   * @prop --padding-bottom: Bottom padding of the textarea
   * @prop --padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the textarea
   */
  --background: initial;
  --color: initial;
  --placeholder-color: initial;
  --placeholder-font-style: initial;
  --placeholder-font-weight: initial;
  --padding-top: 0;
  --padding-end: 0;
  --padding-start: 0;
  --border-radius: 0;
  --border-style: solid;
  /**
   * This is a private API that is used to switch
   * out the highlight color based on the state
   * of the component without having to write
   * different selectors for different fill variants.
   */
  --highlight-color: var(--highlight-color-focused);
  display: block;
  position: relative;
  width: 100%;
  color: var(--color);
  box-sizing: border-box;
}

/**
 * When the cols property is set we should
 * respect that width instead of defaulting
 * to taking up the entire line.
 * Requires both the cols and autoGrow
 * properties to be reflected as attributes
 * on the host.
 *
 * cols does not work with autoGrow because
 * autoGrow would prevent line breaks from naturally
 * occurring until the textarea takes up the entire line width.
 */
:host([cols]:not([auto-grow])) {
  width: fit-content;
}

:host(.ion-color) {
  background: initial;
}

:host-context(ion-item) {
  align-self: baseline;
}

:host-context(ion-item)[slot=start],
:host-context(ion-item)[slot=end] {
  width: auto;
}

.native-textarea {
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  padding-bottom: 0;
  display: block;
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  white-space: pre-wrap;
  /**
   * This ensures the textarea
   * remains on top of any decoration
   * that we render (particularly the
   * outline border when fill="outline").
   * If we did not do this then Axe would
   * be unable to determine the color
   * contrast of the textarea.
   */
  z-index: 1;
  box-sizing: border-box;
  resize: none;
  appearance: none;
}
.native-textarea::placeholder {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  padding-bottom: 0;
  color: var(--placeholder-color);
  font-family: inherit;
  font-style: var(--placeholder-font-style);
  font-weight: var(--placeholder-font-weight);
  opacity: var(--placeholder-opacity);
}

.native-textarea {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-decoration: inherit;
  text-indent: inherit;
  text-overflow: inherit;
  text-transform: inherit;
  grid-area: 1/1/2/2;
  word-break: break-word;
}

.cloned-input {
  top: 0;
  bottom: 0;
  position: absolute;
  pointer-events: none;
}
.cloned-input {
  inset-inline-start: 0;
}

/**
 * The cloned input needs to be disabled on
 * Android otherwise the viewport will still
 * shift when running scroll assist.
 */
.cloned-input:disabled {
  opacity: 1;
}

:host([auto-grow]) .cloned-input {
  height: 100%;
}

:host([auto-grow]) .native-textarea {
  overflow: hidden;
}

.textarea-wrapper {
  -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: 0px;
  padding-bottom: 0px;
  border-radius: var(--border-radius);
  display: flex;
  position: relative;
  flex-grow: 1;
  align-items: flex-start;
  height: inherit;
  min-height: inherit;
  transition: background-color 15ms linear;
  background: var(--background);
  line-height: normal;
}

.native-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

:host(.has-focus) textarea {
  caret-color: var(--highlight-color);
}

.native-wrapper {
  display: grid;
  min-width: inherit;
  max-width: inherit;
  /**
   * This avoids a WebKit bug where
   * the height of the inner textarea
   * is incorrect and flows outside the
   * parent container: https://bugs.webkit.org/show_bug.cgi?id=256781
   * TODO FW-4734
   */
  grid-auto-rows: 100%;
}
.native-wrapper::after {
  white-space: pre-wrap;
  content: attr(data-replicated-value) " ";
  visibility: hidden;
}

.native-wrapper::after {
  padding-left: 0;
  padding-right: 0;
  padding-top: var(--padding-top);
  padding-bottom: var(--padding-bottom);
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-radius: var(--border-radius);
  /**
   * Note: Do not use @include text-inherit()
   * as that sets white-space: inherit
   * Instead, we use white-space: pre-wrap above.
   */
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-decoration: inherit;
  text-indent: inherit;
  text-overflow: inherit;
  text-transform: inherit;
  grid-area: 1/1/2/2;
  word-break: break-word;
}

.textarea-wrapper-inner {
  display: flex;
  width: 100%;
  min-height: inherit;
}

:host(.ion-touched.ion-invalid) {
  --highlight-color: var(--highlight-color-invalid);
}

/**
 * The component highlight is only shown
 * on focus, so we can safely set the valid
 * color state when touched/valid. If we
 * set it when .has-focus is present then
 * the highlight color would change
 * from the valid color to the component's
 * color during the transition after the
 * component loses focus.
 */
:host(.ion-valid) {
  --highlight-color: var(--highlight-color-valid);
}

.textarea-bottom {
  display: flex;
  justify-content: space-between;
  border-top: var(--border-width) var(--border-style) var(--border-color);
  white-space: normal;
}

/**
 * If the textarea has a validity state, the
 * border and label should reflect that as a color.
 */
:host(.has-focus.ion-valid),
:host(.ion-touched.ion-invalid) {
  --border-color: var(--highlight-color);
}

/**
 * Error text should only be shown when .ion-invalid is
 * present on the textarea. Otherwise the helper text should
 * be shown.
 */
.textarea-bottom .error-text {
  display: none;
  color: var(--highlight-color-invalid);
}

.textarea-bottom .helper-text {
  display: block;
}

:host(.ion-touched.ion-invalid) .textarea-bottom .error-text {
  display: block;
}

:host(.ion-touched.ion-invalid) .textarea-bottom .helper-text {
  display: none;
}

.textarea-bottom .counter {
  /**
   * Counter should always be at
   * the end of the container even
   * when no helper/error texts are used.
   */
  -webkit-margin-start: auto;
  margin-inline-start: auto;
  white-space: nowrap;
}

.label-text-wrapper {
  -webkit-padding-start: 0px;
  padding-inline-start: 0px;
  -webkit-padding-end: 0px;
  padding-inline-end: 0px;
  padding-top: var(--padding-top);
  padding-bottom: var(--padding-bottom);
  /**
   * This ensures that double tapping this text
   * clicks the <label> and focuses the textarea
   * when a screen reader is enabled.
   */
  pointer-events: none;
}

/**
 * We need to use two elements instead of
 * one. The .label-text-wrapper is responsible
 * for centering the label text vertically regardless
 * of the textarea height using flexbox.
 *
 * The .label-text element is responsible for controlling
 * overflow when label-placement="fixed".
 * We want the ellipses to show up when the
 * fixed label overflows, but text-overflow: ellipsis only
 * works on block-level elements. A flex item is
 * considered blockified (https://www.w3.org/TR/css-display-3/#blockify).
 */
.label-text,
::slotted([slot=label]) {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/**
 * If no label text is placed into the slot
 * then the element should be hidden otherwise
 * there will be additional margins added.
 */
.label-text-wrapper-hidden,
.textarea-outline-notch-hidden {
  display: none;
}

/**
 * Label is on the left of the textarea in LTR and
 * on the right in RTL.
 */
:host(.textarea-label-placement-start) .textarea-wrapper {
  flex-direction: row;
}

/**
 * Label is on the right of the textarea in LTR and
 * on the left in RTL.
 */
:host(.textarea-label-placement-end) .textarea-wrapper {
  flex-direction: row-reverse;
}

/**
 * Stacked: Label sits above the textarea and is scaled down.
 * Floating: Label sits over the textarea when the textarea has no
 * value and is blurred. Label sits above the textarea and is scaled
 * down when the textarea is focused or has a value.
 *
 */
:host(.textarea-label-placement-stacked) .textarea-wrapper,
:host(.textarea-label-placement-floating) .textarea-wrapper {
  flex-direction: column;
  align-items: start;
}

/**
 * Ensures that the label animates
 * up and to the left in LTR or
 * up and to the right in RTL.
 */
:host(.textarea-label-placement-stacked) .label-text-wrapper,
:host(.textarea-label-placement-floating) .label-text-wrapper {
  transform-origin: left top;
  -webkit-padding-start: 0px;
  padding-inline-start: 0px;
  -webkit-padding-end: 0px;
  padding-inline-end: 0px;
  padding-top: 0px;
  padding-bottom: 0px;
  max-width: 100%;
  /**
   * The 2 ensures the label
   * remains on top of any browser
   * autofill background too.
   */
  z-index: 2;
}
:host-context([dir=rtl]):host(.textarea-label-placement-stacked) .label-text-wrapper, :host-context([dir=rtl]).textarea-label-placement-stacked .label-text-wrapper, :host-context([dir=rtl]):host(.textarea-label-placement-floating) .label-text-wrapper, :host-context([dir=rtl]).textarea-label-placement-floating .label-text-wrapper {
  transform-origin: right top;
}

@supports selector(:dir(rtl)) {
  :host(.textarea-label-placement-stacked:dir(rtl)) .label-text-wrapper, :host(.textarea-label-placement-floating:dir(rtl)) .label-text-wrapper {
    transform-origin: right top;
  }
}

/**
 * Ensures the textarea does not
 * overlap the label.
 */
:host(.textarea-label-placement-stacked) textarea,
:host(.textarea-label-placement-floating) textarea,
:host(.textarea-label-placement-stacked[auto-grow]) .native-wrapper::after,
:host(.textarea-label-placement-floating[auto-grow]) .native-wrapper::after {
  -webkit-margin-start: 0px;
  margin-inline-start: 0px;
  -webkit-margin-end: 0px;
  margin-inline-end: 0px;
  margin-top: 8px;
  margin-bottom: 0px;
}

/**
 * This makes the label sit over the textarea
 * when the textarea is blurred and has no value.
 */
:host(.textarea-label-placement-floating) .label-text-wrapper {
  transform: translateY(100%) scale(1);
}

/**
 * The textarea should be hidden when the label
 * is on top of the textarea. This prevents the label
 * from overlapping any placeholder value.
 */
:host(.textarea-label-placement-floating) textarea {
  opacity: 0;
}

:host(.has-focus.textarea-label-placement-floating) textarea,
:host(.has-value.textarea-label-placement-floating) textarea {
  opacity: 1;
}

.start-slot-wrapper,
.end-slot-wrapper {
  display: flex;
  flex-shrink: 0;
  align-self: start;
}

:host(.textarea-fill-outline) {
  --border-width: var(--token-border-size-025, var(--token-scale-025, 1px));
  --border-color: var(--token-border-input-default, var(--token-primitives-neutral-600, #8c8c8c));
}

:host(.textarea-fill-outline) .textarea-wrapper {
  background: initial;
}

:host(.textarea-fill-outline) .textarea-wrapper-inner {
  /**
   * The border should be relative to the inner wrapper
   * so that it does not include the label.
   */
  position: relative;
}

:host(.textarea-fill-outline) .textarea-outline {
  right: 0;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: var(--border-radius);
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border: var(--border-width) var(--border-style) var(--border-color);
  background: var(--background);
}

/**
 * The bottom content should never have
 * a border with the outline style.
 */
:host(.textarea-fill-outline) .textarea-bottom {
  border-top: none;
}

:host(.textarea-fill-outline) textarea {
  margin-top: var(--token-space-100, var(--token-scale-100, 4px));
}

:host(.textarea-fill-outline.has-focus.ion-valid),
:host(.textarea-fill-outline.ion-touched.ion-invalid) {
  --border-color: var(--highlight-color);
}

:host(.textarea-fill-outline.textarea-readonly) {
  --border-color: var(--token-border-input-default, var(--token-primitives-neutral-600, #8c8c8c));
  --border-width: var(--token-border-size-025, var(--token-scale-025, 1px));
}

:host(.textarea-fill-solid) {
  --border-color: var(--token-bg-input-bold-default, var(--token-primitives-neutral-200, #eae9e9));
  --border-width: var(--token-border-size-050, var(--token-scale-050, 2px));
  --background: var(--token-bg-input-bold-default, var(--token-primitives-neutral-200, #eae9e9));
}

:host(.textarea-fill-solid) .textarea-wrapper {
  border-bottom: none;
  background: none;
}

:host(.textarea-fill-solid) .textarea-wrapper-inner {
  border-radius: var(--border-radius);
  position: relative;
  border: var(--border-width) var(--border-style) var(--border-color);
  background: var(--background);
}

:host(.textarea-fill-solid) .textarea-bottom {
  --border-width: var(--token-scale-0, 0px);
}

:host(.textarea-fill-solid.has-focus) {
  --border-color: var(--token-border-focus-default, var(--token-primitives-blue-400, #b5c0f7));
}

:host(.textarea-fill-solid.has-focus.ion-valid),
:host(.textarea-fill-solid.ion-touched.ion-invalid) {
  --border-width: var(--token-border-size-050, var(--token-scale-050, 2px));
  --border-color: var(--highlight-color);
}

:host(.textarea-fill-solid.textarea-readonly) {
  --background: var(--token-bg-input-bold-read-only, var(--token-primitives-neutral-300, #e0e0e0));
  --border-color: var(--token-bg-input-bold-read-only, var(--token-primitives-neutral-300, #e0e0e0));
}

:host(.textarea-fill-solid.textarea-readonly.ion-invalid) {
  --border-color: rgba(var(--token-semantics-danger-base-rgb, 229, 41, 41), 0.6);
}

:host(.textarea-fill-solid.textarea-disabled) {
  --background: var(--token-bg-input-bold-disabled, var(--token-primitives-neutral-300, #e0e0e0));
  --border-color: var(--token-bg-input-bold-disabled, var(--token-primitives-neutral-300, #e0e0e0));
}

:host {
  --border-color: var(--token-border-input-default, var(--token-primitives-neutral-600, #8c8c8c));
  --color: var(--token-text-default, var(--token-primitives-neutral-1200, #242424));
  --highlight-color-valid: var(--token-text-success, var(--token-semantics-success-900, var(--token-primitives-green-900, #126f23)));
  --highlight-color-invalid: var(--token-semantics-danger-800, var(--token-primitives-red-800, #bf2222));
  --highlight-color-focused: 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)))));
  --placeholder-color: var(--token-text-subtlest, var(--token-primitives-neutral-800, #626262));
  --placeholder-opacity: 1;
  --background: var(--token-bg-surface-default, var(--token-primitives-base-white, #ffffff));
  --padding-bottom: var(--token-space-200, var(--token-scale-200, 8px));
  font-size: var(--token-font-size-350, 14px);
  font-weight: var(--token-font-weight-regular, 400);
  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;
}

:host(.ion-color) {
  --highlight-color-focused: var(--ion-color-base);
}

.textarea-wrapper-inner {
  height: 0;
}

:host(.textarea-size-small) .textarea-wrapper-inner {
  --padding-top: var(--token-space-200, var(--token-scale-200, 8px));
  --padding-end: var(--token-space-300, var(--token-scale-300, 12px));
  --padding-bottom: var(--token-space-200, var(--token-scale-200, 8px));
  --padding-start: var(--token-space-300, var(--token-scale-300, 12px));
  min-height: var(--token-scale-2800, 112px);
}

:host(.textarea-size-medium) .textarea-wrapper-inner {
  --padding-top: var(--token-space-300, var(--token-scale-300, 12px));
  --padding-end: var(--token-space-400, var(--token-scale-400, 16px));
  --padding-bottom: var(--token-space-300, var(--token-scale-300, 12px));
  --padding-start: var(--token-space-400, var(--token-scale-400, 16px));
  min-height: var(--token-scale-3400, 136px);
}

:host(.textarea-size-large) .textarea-wrapper-inner {
  --padding-top: var(--token-space-400, var(--token-scale-400, 16px));
  --padding-end: var(--token-space-500, var(--token-scale-500, 20px));
  --padding-bottom: var(--token-space-400, var(--token-scale-400, 16px));
  --padding-start: var(--token-space-500, var(--token-scale-500, 20px));
  min-height: var(--token-scale-3600, 144px);
}

:host(.textarea-shape-soft) {
  --border-radius: var(--token-soft-xl, var(--token-border-radius-200, var(--token-scale-200, 8px)));
}

:host(.textarea-shape-round) {
  --border-radius: var(--token-round-xl, var(--token-border-radius-400, var(--token-scale-400, 16px)));
}

:host(.textarea-shape-rectangular) {
  --border-radius: var(--token-rectangular-xl, var(--token-border-radius-0, var(--token-scale-0, 0px)));
}

.textarea-wrapper {
  gap: var(--token-space-100, var(--token-scale-100, 4px));
}

.textarea-wrapper-inner {
  -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);
}

:host([auto-grow]) .textarea-wrapper-inner {
  height: auto;
}

:host([auto-grow]) .native-wrapper {
  min-height: inherit;
  max-height: inherit;
}

.label-text-wrapper {
  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;
  max-width: var(--token-scale-5000, 200px);
  transition: color var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1)), transform var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1));
  color: var(--token-text-subtle, var(--token-primitives-neutral-1000, #3b3b3b));
}

:host(.label-floating) .label-text-wrapper {
  transform: none;
}

ion-icon {
  --color: globals.$ion-icon-subtlest;
  font-size: var(--token-scale-400, 16px);
}

.start-slot-wrapper,
.end-slot-wrapper {
  margin-top: var(--token-space-050, var(--token-scale-050, 2px));
}

.textarea-bottom {
  -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(--token-space-100, var(--token-scale-100, 4px));
  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;
}

.textarea-bottom .helper-text,
.textarea-bottom .counter {
  color: var(--token-text-subtlest, var(--token-primitives-neutral-800, #626262));
}

:host(.has-focus.ion-valid) .helper-text {
  color: var(--highlight-color-valid);
}

:host(.has-focus.ion-valid),
:host(.ion-touched.ion-invalid) {
  --border-width: var(--token-border-size-025, var(--token-scale-025, 1px));
}

.textarea-highlight {
  bottom: -1px;
  position: absolute;
  width: 100%;
  height: var(--token-border-size-050, var(--token-scale-050, 2px));
  transform: scale(0);
  transition: transform var(--token-transition-time-200, 200ms);
  background: var(--border-color);
}
.textarea-highlight {
  inset-inline-start: 0;
}

:host(.has-focus) {
  --border-color: var(--token-border-focus-default, var(--token-primitives-blue-400, #b5c0f7));
  --border-width: var(--token-border-size-050, var(--token-scale-050, 2px));
}

:host(.has-focus) .textarea-highlight {
  transform: scale(1);
}

@media (any-hover: hover) {
  :host(:hover) {
    --border-color: var(--token-border-focus-default, var(--token-primitives-blue-400, #b5c0f7));
  }
}
:host(.textarea-disabled) {
  --color: var(--token-text-disabled, var(--token-primitives-neutral-500, #a2a2a2));
  --background: var(--token-bg-input-disabled, var(--token-primitives-neutral-100, #f3f3f3));
  --border-color: var(--token-border-disabled, var(--token-primitives-neutral-300, #e0e0e0));
  --placeholder-color: var(--token-text-disabled, var(--token-primitives-neutral-500, #a2a2a2));
}

:host(.textarea-disabled:not(.ion-valid)) .textarea-bottom .helper-text,
:host(.textarea-disabled) .textarea-bottom .counter,
:host(.textarea-disabled) .label-text-wrapper {
  color: var(--token-text-disabled, var(--token-primitives-neutral-500, #a2a2a2));
}

:host(.textarea-disabled.has-focus.ion-valid) {
  --border-color: rgba(var(--token-semantics-success-base-rgb, 27, 164, 51), 0.6);
}

:host(.textarea-disabled.ion-touched.ion-invalid) {
  --border-color: rgba(var(--token-semantics-danger-base-rgb, 229, 41, 41), 0.6);
}

:host(.textarea-disabled.ion-color) {
  --border-color: rgba(var(--ion-color-base-rgb), 0.6);
}

:host(.textarea-disabled.has-focus.ion-valid) .textarea-bottom .helper-text,
:host(.textarea-disabled.ion-touched.ion-invalid) .error-text {
  opacity: 0.6;
}

:host(.textarea-readonly) {
  --background: var(--token-bg-input-read-only, var(--token-primitives-neutral-100, #f3f3f3));
}

/**
 * This makes the label sit above the textarea.
 */
:host(.label-floating) .label-text-wrapper {
  /**
   * Label text should not extend
   * beyond the bounds of the textarea.
   */
  max-width: calc(100% / 0.75);
}

.textarea-wrapper textarea {
  /**
   * When the floating label appears on top of the
   * textarea, we need to fade the textarea out so that the
   * label does not overlap with the placeholder.
   */
  transition: opacity var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1));
}

/**
 * Label is on the left of the textarea in LTR and
 * on the right in RTL. Label also has a fixed width.
 */
:host(.textarea-label-placement-fixed) .label-text {
  flex: 0 0 calc(var(--token-scale-2400, 96px) + var(--token-space-100, var(--token-scale-100, 4px)));
  width: calc(var(--token-scale-2400, 96px) + var(--token-space-100, var(--token-scale-100, 4px)));
  min-width: calc(var(--token-scale-2400, 96px) + var(--token-space-100, var(--token-scale-100, 4px)));
  max-width: var(--token-scale-5000, 200px);
}