:host-context(.item) {
  /**
   * @prop --color: Color of the label
   */
  --color: initial;
  display: block;
  color: var(--color);
  font-family: var(--ion-font-family, inherit);
  font-size: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}

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

:host(.ion-text-wrap),
:host([text-wrap]) {
  white-space: normal;
}

:host-context(.item-interactive-disabled:not(.item-multiple-inputs)) {
  cursor: default;
  opacity: 0.3;
  pointer-events: none;
}

:host-context(.item-input) {
  flex: initial;
  max-width: 200px;
  pointer-events: none;
}

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

:host(.label-fixed) {
  flex: 0 0 100px;
  width: 100px;
  min-width: 100px;
  max-width: 200px;
}

:host(.label-stacked),
:host(.label-floating) {
  margin-bottom: 0;
  align-self: stretch;
  width: auto;
  max-width: 100%;
}
:host(.label-no-animate.label-floating) {
  transition: none;
}

::slotted(*) h1,
::slotted(*) h2,
::slotted(*) h3,
::slotted(*) h4,
::slotted(*) h5,
::slotted(*) h6 {
  text-overflow: inherit;
  overflow: inherit;
}

:host(.ion-text-wrap),
:host([text-wrap]) {
  line-height: 1.5;
}

/**
 * When translating the label, we need to use translateY
 * instead of translate3d due to a WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=215731
 */
:host(.label-stacked) {
  transform-origin: left top;
  transform: translateY(50%) scale(0.75);
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
:host-context([dir=rtl]):host(.label-stacked), :host-context([dir=rtl]).label-stacked {
  transform-origin: right top;
}

:host(.label-floating) {
  transform: translateY(96%);
  transform-origin: left top;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
:host-context([dir=rtl]):host(.label-floating), :host-context([dir=rtl]).label-floating {
  transform-origin: right top;
}

:host-context(.item-textarea).label-floating {
  transform: translateY(185%);
}

:host(.label-stacked),
:host(.label-floating) {
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  margin-bottom: 0;
}

:host-context(.item-has-focus).label-floating,
:host-context(.item-has-placeholder:not(.item-input)).label-floating,
:host-context(.item-has-value).label-floating {
  transform: translateY(50%) scale(0.75);
}

:host-context(.item-has-focus).label-stacked:not(.ion-color),
:host-context(.item-has-focus).label-floating:not(.ion-color) {
  color: var(--ion-color-primary, #3880ff);
}

:host-context(.item-has-focus.ion-color).label-stacked:not(.ion-color),
:host-context(.item-has-focus.ion-color).label-floating:not(.ion-color) {
  color: var(--ion-color-contrast);
}

::slotted(*) h1 {
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  margin-bottom: 2px;
  font-size: 24px;
  font-weight: normal;
}

::slotted(*) h2 {
  margin-left: 0;
  margin-right: 0;
  margin-top: 2px;
  margin-bottom: 2px;
  font-size: 16px;
  font-weight: normal;
}

::slotted(*) h3,
::slotted(*) h4,
::slotted(*) h5,
::slotted(*) h6 {
  margin-left: 0;
  margin-right: 0;
  margin-top: 2px;
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: normal;
  line-height: normal;
}

::slotted(*) p {
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  margin-bottom: 2px;
  font-size: 14px;
  line-height: 20px;
  text-overflow: inherit;
  overflow: inherit;
}

::slotted(p) {
  color: var(--ion-color-step-600, #666666);
}

:host-context(.ion-color)::slotted(p) {
  color: inherit;
}