.dialog-select-field {
  width: 100%;
  display: inline-grid;
  grid-template-rows: auto;
  grid-template-columns: 1fr 40px;
  column-gap: var(--spacing-xs);
  align-items: center;

  .open-button {
    grid-row: 1;
    grid-column: 2 / 3;
    background-color: var(--surface-icon-on-dark);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1;

    @include animate-field;
    transition-property: background-color, opacity;

    svg {
      path {
        @include animate-field;
        transition-property: fill;
        fill: var(--surface-icon-primary);
      }
    }

    &:disabled {
      opacity: var(--disabled-opacity);
    }

    &:not(:disabled) {
      &:hover {
        background-color: var(--surface-main-primary);

        svg {
          path {
            fill: var(--surface-icon-secondary);
          }
        }
      }
    }
  }

  & > .track {
    grid-row: 1;
    grid-column: 1 / 2;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px 8px 18px;
    border-radius: 10px;
    border: 1px solid var(--border-primary);
    min-height: 50px;
    background-color: var(--surface-frame-bg);
    position: relative;
    overflow: hidden;
    opacity: 1;

    @include animate-field;
    transition-property: border-color, opacity;

    &.overflows {
      &::after {
        position: absolute;
        top: 0;
        right: 0;
        width: 65px;
        height: 100%;
        content: ' ';
        background: linear-gradient(
          90deg,
          rgba(0, 0, 0, 0) 0%,
          var(--surface-default-modal) 100%
        );
      }
    }

    .options {
      display: flex;
      flex-flow: row nowrap;
      align-items: center;
      justify-content: flex-start;
      column-gap: 8px;
      z-index: 1;

      .dialog-select-tag {
        display: inline-flex;
        flex-flow: row;
        align-items: center;
        justify-content: flex-start;
        box-sizing: border-box;
        padding: 7px 10px;
        border: 1px solid var(--border-primary);
        column-gap: 10px;
        border-radius: 10px;
        background-color: var(--surface-default-modal);

        span,
        p {
          @include typography(app-input);
          user-select: none;
          text-wrap: nowrap;
        }
      }
    }

    & > svg {
      border-radius: 10px;
      user-select: none;
      z-index: 2;
      position: absolute;
      right: -1px;
      top: 0px;
    }
  }

  &.disabled {
    & > .track {
      cursor: not-allowed;
    }

    & > .open-button {
      cursor: not-allowed;
    }
  }

  &.invalid {
    & > .track {
      border-color: var(--border-alert);
    }
  }

  &.disabled {
    & > .open-button {
      opacity: var(--disabled-opacity);
    }

    & > .track {
      opacity: var(--disabled-opacity);
    }
  }
}

.dialog-select {
  & > .inner {
    position: relative;

    & > label {
      padding-bottom: var(--spacing-xs);
    }
  }
}

.dialog-select-track-floating-menu {
  min-width: 200px;
  max-width: 100dvh;

  ul {
    list-style: none;
    display: flex;
    flex-flow: column;
    row-gap: var(--spacing-xs);

    li {
      @include typography(app-modal-2);
      display: flex;
      flex-flow: row wrap;
      gap: var(--spacing-xs);
      align-items: center;
      justify-content: flex-start;
    }
  }
}
