:host {
  /**
   * @prop --background: Background of the segment button
   * @prop --background-checked: Background of the checked segment button
   *
   * @prop --background-hover: Background of the segment button on hover
   * @prop --background-focused: Background of the segment button when focused with the tab key
   *
   * @prop --background-hover-opacity: Opacity of the segment button background on hover
   * @prop --background-focused-opacity: Opacity of the segment button background when focused with the tab key
   *
   * @prop --color: Color of the segment button
   * @prop --color-checked: Color of the checked segment button
   * @prop --color-hover: Color of the segment button on hover
   * @prop --color-focused: Color of the segment button when focused with the tab key
   *
   * @prop --border-radius: Radius of the segment button border
   * @prop --border-color: Color of the segment button border
   * @prop --border-style: Style of the segment button border
   * @prop --border-width: Width of the segment button border
   *
   * @prop --margin-top: Top margin of the segment button
   * @prop --margin-end: Right margin if direction is left-to-right, and left margin
   *                      if direction is right-to-left of the segment button
   * @prop --margin-bottom: Bottom margin of the segment button
   * @prop --margin-start: Left margin if direction is left-to-right, and right margin
   *                      if direction is right-to-left of the segment button
   *
   * @prop --padding-top: Top padding of the segment button
   * @prop --padding-end: Right padding if direction is left-to-right, and left padding
   *                      if direction is right-to-left of the segment button
   * @prop --padding-bottom: Bottom padding of the segment button
   * @prop --padding-start: Left padding if direction is left-to-right, and right padding
   *                        if direction is right-to-left of the segment button
   *
   * @prop --transition: Transition of the segment button
   *
   * @prop --indicator-height: Height of the indicator for the checked segment button
   * @prop --indicator-box-shadow: Box shadow on the indicator for the checked segment button
   * @prop --indicator-color: Color of the indicator for the checked segment button
   * @prop --indicator-transition: Transition of the indicator for the checked segment button
   * @prop --indicator-transform: Transform of the indicator for the checked segment button
   */
  --background: none;
  --background-checked: none;
  --background-hover: none;
  --background-hover-opacity: 0;
  --background-focused: none;
  --background-focused-opacity: 0;
  --separator-border-width: 1px;
  --separator-border-color: rgba(var(--bkkr-text-color-rgb, 0, 0, 0), 0.12);
  --separator-border-style: solid;
  --color: initial;
  --color-hover: var(--color);
  --color-checked: var(--color);
  --color-disabled: var(--color);
  --indicator-box-shadow: 0 1.5px 2.5px 0 rgba(var(--box-shadow-color, 0, 0, 0), 0.1), 0 6px 5px 0 rgba(var(--box-shadow-color, 0, 0, 0), 0.12), 0 0.6px 10px 0 rgba(var(--box-shadow-color, 0, 0, 0), 0.08);
  --indicator-color: var(--bkkr-card-background, var(--bkkr-background-color, #fff));
  --indicator-height: 100%;
  --indicator-transition: 0.26s transform cubic-bezier(0.32, 0.72, 0, 1), 0.2s box-shadow cubic-bezier(0.32, 0.72, 0, 1);
  --indicator-transform: none;
  --transition: 100ms all linear;
  --padding-top: 0px;
  --padding-end: 13px;
  --padding-bottom: 0px;
  --padding-start: 13px;
  --margin-top: 0px;
  --margin-end: 0px;
  --margin-bottom: 0px;
  --margin-start: 0px;
  --min-height: 36px;
  --min-width: 70px;
  margin-left: var(--margin-start);
  margin-right: var(--margin-end);
  margin-top: var(--margin-top);
  margin-bottom: var(--margin-bottom);
  display: flex;
  position: relative;
  flex: 1 1 auto;
  flex-basis: 0;
  flex-direction: row;
  min-width: var(--min-width);
  height: auto;
  min-height: var(--min-height);
  transform: translate3d(0, 0, 0);
  background: var(--background);
  color: var(--color);
  font-size: 0.8em;
  font-weight: 450;
  line-height: 35px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  font-kerning: none;
  touch-action: manipulation;
}
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
  :host {
    margin-left: unset;
    margin-right: unset;
    -webkit-margin-start: var(--margin-start);
    margin-inline-start: var(--margin-start);
    -webkit-margin-end: var(--margin-end);
    margin-inline-end: var(--margin-end);
  }
}

.button-native {
  border-radius: 0;
  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;
  white-space: inherit;
  padding-left: var(--padding-start);
  padding-right: var(--padding-end);
  padding-top: var(--padding-top);
  padding-bottom: var(--padding-bottom);
  transform: translate3d(0,  0,  0);
  display: flex;
  position: relative;
  flex-direction: inherit;
  flex-grow: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: inherit;
  max-width: inherit;
  height: auto;
  min-height: inherit;
  max-height: inherit;
  transform: translate3d(0, 0, 0);
  transition: var(--transition);
  border: none;
  outline: none;
  background: transparent;
  contain: content;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
  will-change: transform, box-shadow;
}
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
  .button-native {
    padding-left: unset;
    padding-right: unset;
    -webkit-padding-start: var(--padding-start);
    padding-inline-start: var(--padding-start);
    -webkit-padding-end: var(--padding-end);
    padding-inline-end: var(--padding-end);
  }
}

.button-native::after {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: absolute;
  content: "";
  opacity: 0;
}

.button-inner {
  display: flex;
  position: relative;
  flex-flow: inherit;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 1;
}

:host::before {
  margin-left: 0;
  margin-right: 0;
  margin-top: 5px;
  margin-bottom: 5px;
  transition: 160ms opacity ease-in-out;
  transition-delay: 100ms;
  border-left: var(--separator-border-width) var(--separator-border-style) var(--separator-border-color);
  content: "";
  opacity: 1;
  will-change: opacity;
}

:host(:first-of-type)::before {
  border-left-color: transparent;
}

:host(.segment-button-checked) {
  background: var(--background-checked);
  color: var(--color-checked);
  z-index: -1;
}

:host(.segment-button-checked)::before,
:host(.segment-button-after-checked)::before {
  opacity: 0;
}

:host(.segment-button-disabled) {
  pointer-events: none;
  cursor: default;
  opacity: 0.3;
}

:host(.segment-button-activated) {
  --indicator-transform: scale(0.95);
  --indicator-box-shadow: none;
}

:host(.state-focused) .button-native {
  color: var(--color-focused);
  opacity: 0.7;
}
:host(.state-focused) .button-native::after {
  background: var(--background-focused);
  opacity: var(--background-focused-opacity);
}

:host(:focus) {
  outline: none;
}

@media (any-hover: hover) {
  :host(:hover) .button-native {
    color: var(--color-hover);
    opacity: 0.5;
  }
  :host(:hover) .button-native::after {
    background: var(--background-hover);
    opacity: var(--background-hover-opacity);
  }

  :host(.segment-button-checked:hover) .button-native {
    color: var(--color-checked);
    opacity: 1;
  }
}
::slotted(bkkr-label) {
  box-sizing: border-box;
  display: block;
  align-self: center;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.segment-button-indicator {
  padding-left: var(--indicator-padding-start);
  padding-right: var(--indicator-padding-end);
  padding-top: var(--indicator-padding-top);
  padding-bottom: var(--indicator-padding-bottom);
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  transform-origin: left;
  display: flex;
  position: absolute;
  align-items: flex-end;
  opacity: 0;
  box-sizing: border-box;
  pointer-events: none;
  will-change: transform, opacity;
}
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
  .segment-button-indicator {
    padding-left: unset;
    padding-right: unset;
    -webkit-padding-start: var(--indicator-padding-start);
    padding-inline-start: var(--indicator-padding-start);
    -webkit-padding-end: var(--indicator-padding-end);
    padding-inline-end: var(--indicator-padding-end);
  }
}

.segment-button-indicator-background {
  border-radius: calc(var(--border-radius, 12px) - 3px);
  width: 100%;
  height: var(--indicator-height);
  transform: var(--indicator-transform);
  transition: var(--indicator-transition);
  background: var(--indicator-color);
  box-shadow: var(--indicator-box-shadow);
  pointer-events: none;
}

.segment-button-indicator-animated {
  transition: var(--indicator-transition);
}

:host(.segment-button-checked) .segment-button-indicator {
  opacity: 1;
}

:host(.in-segment-color) {
  background: none;
  color: var(--bkkr-text-color, #000);
}

:host(.in-segment-color) .segment-button-indicator-background {
  background: var(--color-contrast);
}

@media (any-hover: hover) {
  :host(.in-segment-color:hover) .button-native,
:host(.in-segment-color.segment-button-checked:hover) .button-native {
    color: var(--bkkr-text-color, #000);
  }
}
@media (prefers-reduced-motion: reduce) {
  .segment-button-indicator-background {
    transform: none;
  }

  .segment-button-indicator-animated {
    transition: none;
  }
}
:host(.in-toolbar:not(.in-segment-color)) {
  --background-checked: var(--toolbar-segment-background-checked, none);
  --color: var(--toolbar-segment-color, var(--toolbar-color), initial);
  --color-checked: var(--toolbar-segment-color-checked, var(--toolbar-color), initial);
  --indicator-color: var(--toolbar-segment-indicator-color, var(--bkkr-card-background, var(--bkkr-background-color, #fff)));
}

:host(.in-toolbar-color) .segment-button-indicator-background {
  background: #fff;
}

:host(.in-toolbar-color:not(.in-segment-color)) .button-native {
  color: var(--color-contrast);
}

:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native {
  color: var(--color-base);
}

@media (any-hover: hover) {
  :host(.in-toolbar-color:not(.in-segment-color):hover) .button-native {
    color: var(--color-contrast);
  }

  :host(.in-toolbar-color.segment-button-checked:not(.in-segment-color):hover) .button-native {
    color: var(--color-base);
  }
}